Run rustfmt on selectors, servo_arc, and style.

This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
This commit is contained in:
Bobby Holley 2018-04-10 17:35:15 -07:00
parent f7ae1a37e3
commit c99bcdd4b8
181 changed files with 9981 additions and 7933 deletions

View file

@ -9,7 +9,7 @@ use WeakAtom;
use dom::TElement;
use element_state::ElementState;
use gecko::snapshot_helpers;
use gecko::wrapper::{NamespaceConstraintHelpers, GeckoElement};
use gecko::wrapper::{GeckoElement, NamespaceConstraintHelpers};
use gecko_bindings::bindings;
use gecko_bindings::structs::ServoElementSnapshot;
use gecko_bindings::structs::ServoElementSnapshotFlags as Flags;
@ -91,13 +91,13 @@ impl GeckoElementSnapshot {
unsafe {
match *operation {
AttrSelectorOperation::Exists => {
bindings:: Gecko_SnapshotHasAttr(
self,
ns.atom_or_null(),
local_name.as_ptr(),
)
}
AttrSelectorOperation::WithValue { operator, case_sensitivity, expected_value } => {
bindings::Gecko_SnapshotHasAttr(self, ns.atom_or_null(), local_name.as_ptr())
},
AttrSelectorOperation::WithValue {
operator,
case_sensitivity,
expected_value,
} => {
let ignore_case = match case_sensitivity {
CaseSensitivity::CaseSensitive => false,
CaseSensitivity::AsciiCaseInsensitive => true,
@ -109,7 +109,7 @@ impl GeckoElementSnapshot {
ns.atom_or_null(),
local_name.as_ptr(),
expected_value.as_ptr(),
ignore_case
ignore_case,
),
AttrSelectorOperator::Includes => bindings::Gecko_SnapshotAttrIncludes(
self,
@ -139,15 +139,17 @@ impl GeckoElementSnapshot {
expected_value.as_ptr(),
ignore_case,
),
AttrSelectorOperator::Substring => bindings::Gecko_SnapshotAttrHasSubstring(
self,
ns.atom_or_null(),
local_name.as_ptr(),
expected_value.as_ptr(),
ignore_case,
),
AttrSelectorOperator::Substring => {
bindings::Gecko_SnapshotAttrHasSubstring(
self,
ns.atom_or_null(),
local_name.as_ptr(),
expected_value.as_ptr(),
ignore_case,
)
},
}
}
},
}
}
}
@ -170,12 +172,10 @@ impl ElementSnapshot for GeckoElementSnapshot {
#[inline]
fn id_attr(&self) -> Option<&WeakAtom> {
if !self.has_any(Flags::Id) {
return None
return None;
}
let ptr = unsafe {
bindings::Gecko_SnapshotAtomAttrValue(self, atom!("id").as_ptr())
};
let ptr = unsafe { bindings::Gecko_SnapshotAtomAttrValue(self, atom!("id").as_ptr()) };
// FIXME(emilio): This should assert, since this flag is exact.
if ptr.is_null() {
@ -202,7 +202,7 @@ impl ElementSnapshot for GeckoElementSnapshot {
#[inline]
fn each_class<F>(&self, callback: F)
where
F: FnMut(&Atom)
F: FnMut(&Atom),
{
if !self.has_any(Flags::MaybeClass) {
return;