зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #5802 - Fix some irregular indentation (from mmatyas:indentfix); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: 43d666f94b9b1b8313d430785946b8d3e020fecf
This commit is contained in:
Родитель
835b3be20c
Коммит
e3f5a0bd67
|
@ -6,13 +6,13 @@ use std::borrow::ToOwned;
|
|||
use std::cmp::max;
|
||||
|
||||
pub struct MIMEClassifier {
|
||||
image_classifier: GroupedClassifier,
|
||||
audio_video_classifer: GroupedClassifier,
|
||||
scriptable_classifier: GroupedClassifier,
|
||||
plaintext_classifier: GroupedClassifier,
|
||||
archive_classifer: GroupedClassifier,
|
||||
binary_or_plaintext: BinaryOrPlaintextClassifier,
|
||||
feeds_classifier: FeedsClassifier
|
||||
image_classifier: GroupedClassifier,
|
||||
audio_video_classifer: GroupedClassifier,
|
||||
scriptable_classifier: GroupedClassifier,
|
||||
plaintext_classifier: GroupedClassifier,
|
||||
archive_classifer: GroupedClassifier,
|
||||
binary_or_plaintext: BinaryOrPlaintextClassifier,
|
||||
feeds_classifier: FeedsClassifier
|
||||
}
|
||||
|
||||
impl MIMEClassifier {
|
||||
|
@ -313,7 +313,7 @@ impl MIMEChecker for BinaryOrPlaintextClassifier {
|
|||
}
|
||||
}
|
||||
struct GroupedClassifier {
|
||||
byte_matchers: Vec<Box<MIMEChecker + Send + Sync>>,
|
||||
byte_matchers: Vec<Box<MIMEChecker + Send + Sync>>,
|
||||
}
|
||||
impl GroupedClassifier {
|
||||
fn image_classifer() -> GroupedClassifier {
|
||||
|
@ -406,12 +406,12 @@ impl GroupedClassifier {
|
|||
}
|
||||
}
|
||||
impl MIMEChecker for GroupedClassifier {
|
||||
fn classify(&self,data: &Vec<u8>) -> Option<(String, String)> {
|
||||
fn classify(&self,data: &Vec<u8>) -> Option<(String, String)> {
|
||||
self.byte_matchers
|
||||
.iter()
|
||||
.filter_map(|matcher| matcher.classify(data))
|
||||
.next()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct FeedsClassifier;
|
||||
|
@ -840,12 +840,12 @@ impl ByteMatcher {
|
|||
|
||||
//The string "<?xml".
|
||||
fn text_xml()->ByteMatcher {
|
||||
ByteMatcher{
|
||||
ByteMatcher {
|
||||
pattern: b"<?xml",
|
||||
mask: b"\xFF\xFF\xFF\xFF\xFF",
|
||||
content_type: ("text", "xml"),
|
||||
leading_ignore: b"\t\n\x0C\r "
|
||||
}
|
||||
}
|
||||
}
|
||||
//The string "%PDF-", the PDF signature.
|
||||
fn application_pdf()->ByteMatcher {
|
||||
|
|
|
@ -540,18 +540,18 @@ impl<'a> TreeWalkerHelpers for JSRef<'a, TreeWalker> {
|
|||
impl<'a> Iterator for JSRef<'a, TreeWalker> {
|
||||
type Item = JSRef<'a, Node>;
|
||||
|
||||
fn next(&mut self) -> Option<JSRef<'a, Node>> {
|
||||
match self.next_node() {
|
||||
Ok(node) => node.map(|n| n.root().get_unsound_ref_forever()),
|
||||
Err(_) =>
|
||||
// The Err path happens only when a JavaScript
|
||||
// NodeFilter throws an exception. This iterator
|
||||
// is meant for internal use from Rust code, which
|
||||
// will probably be using a native Rust filter,
|
||||
// which cannot produce an Err result.
|
||||
unreachable!()
|
||||
fn next(&mut self) -> Option<JSRef<'a, Node>> {
|
||||
match self.next_node() {
|
||||
Ok(node) => node.map(|n| n.root().get_unsound_ref_forever()),
|
||||
Err(_) =>
|
||||
// The Err path happens only when a JavaScript
|
||||
// NodeFilter throws an exception. This iterator
|
||||
// is meant for internal use from Rust code, which
|
||||
// will probably be using a native Rust filter,
|
||||
// which cannot produce an Err result.
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[jstraceable]
|
||||
|
|
|
@ -799,11 +799,11 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
|
|||
// If we didn't have a clip rect, the previous display doesn't need rebuilding
|
||||
// because it was built for infinite clip (MAX_RECT).
|
||||
had_clip_rect
|
||||
}
|
||||
}
|
||||
|
||||
fn set_devtools_wants_updates(self, value: bool) {
|
||||
self.devtools_wants_updates.set(value);
|
||||
}
|
||||
fn set_devtools_wants_updates(self, value: bool) {
|
||||
self.devtools_wants_updates.set(value);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts
|
||||
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Temporary<Window>> {
|
||||
|
|
|
@ -818,7 +818,7 @@ impl ScriptTask {
|
|||
return;
|
||||
}
|
||||
panic!("Page rect message sent to nonexistent pipeline");
|
||||
}
|
||||
}
|
||||
|
||||
/// Handle a request to load a page in a new child frame of an existing page.
|
||||
fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) {
|
||||
|
|
|
@ -110,7 +110,7 @@ pub extern "C" fn cef_execute_process(_args: *const cef_main_args_t,
|
|||
_app: *mut cef_app_t,
|
||||
_windows_sandbox_info: *mut c_void)
|
||||
-> c_int {
|
||||
-1
|
||||
-1
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
Загрузка…
Ссылка в новой задаче