mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
style: Fix tidy issues.
This commit is contained in:
parent
28719f2455
commit
273705d7fb
6 changed files with 17 additions and 32 deletions
|
@ -472,7 +472,7 @@ macro_rules! malloc_size_of_hash_set {
|
|||
n
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
malloc_size_of_hash_set!(std::collections::HashSet<T, S>);
|
||||
|
@ -513,7 +513,7 @@ macro_rules! malloc_size_of_hash_map {
|
|||
n
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
malloc_size_of_hash_map!(std::collections::HashMap<K, V, S>);
|
||||
|
|
|
@ -155,8 +155,7 @@ impl ParsedCaseSensitivity {
|
|||
ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument => {
|
||||
CaseSensitivity::CaseSensitive
|
||||
},
|
||||
ParsedCaseSensitivity::CaseSensitive |
|
||||
ParsedCaseSensitivity::ExplicitCaseSensitive => {
|
||||
ParsedCaseSensitivity::CaseSensitive | ParsedCaseSensitivity::ExplicitCaseSensitive => {
|
||||
CaseSensitivity::CaseSensitive
|
||||
},
|
||||
ParsedCaseSensitivity::AsciiCaseInsensitive => CaseSensitivity::AsciiCaseInsensitive,
|
||||
|
|
|
@ -521,12 +521,8 @@ where
|
|||
Combinator::PseudoElement => SelectorMatchingResult::NotMatchedGlobally,
|
||||
};
|
||||
|
||||
let mut next_element = next_element_for_combinator(
|
||||
element,
|
||||
combinator,
|
||||
&selector_iter,
|
||||
&context,
|
||||
);
|
||||
let mut next_element =
|
||||
next_element_for_combinator(element, combinator, &selector_iter, &context);
|
||||
|
||||
// Stop matching :visited as soon as we find a link, or a combinator for
|
||||
// something that isn't an ancestor.
|
||||
|
@ -590,12 +586,7 @@ where
|
|||
visited_handling = VisitedHandlingMode::AllLinksUnvisited;
|
||||
}
|
||||
|
||||
next_element = next_element_for_combinator(
|
||||
&element,
|
||||
combinator,
|
||||
&selector_iter,
|
||||
&context,
|
||||
);
|
||||
next_element = next_element_for_combinator(&element, combinator, &selector_iter, &context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1721,7 +1721,8 @@ where
|
|||
let case_sensitivity;
|
||||
{
|
||||
let local_name_lower_cow = to_ascii_lowercase(&local_name);
|
||||
case_sensitivity = attribute_flags.to_case_sensitivity(local_name_lower_cow.as_ref(), namespace.is_some());
|
||||
case_sensitivity =
|
||||
attribute_flags.to_case_sensitivity(local_name_lower_cow.as_ref(), namespace.is_some());
|
||||
local_name_lower = local_name_lower_cow.as_ref().into();
|
||||
local_name_is_ascii_lowercase = matches!(local_name_lower_cow, Cow::Borrowed(..));
|
||||
}
|
||||
|
@ -1758,32 +1759,26 @@ enum AttributeFlags {
|
|||
// Matching should be case-insensitive ('i' flag).
|
||||
AsciiCaseInsensitive,
|
||||
// No flags. Matching behavior depends on the name of the attribute.
|
||||
CaseSensitivityDependsOnName
|
||||
CaseSensitivityDependsOnName,
|
||||
}
|
||||
|
||||
impl AttributeFlags {
|
||||
fn to_case_sensitivity(
|
||||
self,
|
||||
local_name: &str,
|
||||
have_namespace: bool,
|
||||
) -> ParsedCaseSensitivity {
|
||||
fn to_case_sensitivity(self, local_name: &str, have_namespace: bool) -> ParsedCaseSensitivity {
|
||||
match self {
|
||||
AttributeFlags::CaseSensitive =>
|
||||
ParsedCaseSensitivity::ExplicitCaseSensitive,
|
||||
AttributeFlags::AsciiCaseInsensitive =>
|
||||
ParsedCaseSensitivity::AsciiCaseInsensitive,
|
||||
AttributeFlags::CaseSensitive => ParsedCaseSensitivity::ExplicitCaseSensitive,
|
||||
AttributeFlags::AsciiCaseInsensitive => ParsedCaseSensitivity::AsciiCaseInsensitive,
|
||||
AttributeFlags::CaseSensitivityDependsOnName => {
|
||||
if !have_namespace && include!(concat!(
|
||||
env!("OUT_DIR"),
|
||||
"/ascii_case_insensitive_html_attributes.rs"
|
||||
))
|
||||
.contains(local_name)
|
||||
.contains(local_name)
|
||||
{
|
||||
ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument
|
||||
} else {
|
||||
ParsedCaseSensitivity::CaseSensitive
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1798,7 +1793,7 @@ fn parse_attribute_flags<'i, 't>(
|
|||
// Selectors spec says language-defined; HTML says it depends on the
|
||||
// exact attribute name.
|
||||
return Ok(AttributeFlags::CaseSensitivityDependsOnName);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let ident = match *token {
|
||||
|
|
|
@ -12,7 +12,7 @@ use std::fmt::Debug;
|
|||
use std::ptr::NonNull;
|
||||
|
||||
/// Opaque representation of an Element, for identity comparisons.
|
||||
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
pub struct OpaqueElement(NonNull<()>);
|
||||
|
||||
unsafe impl Send for OpaqueElement {}
|
||||
|
|
|
@ -43,7 +43,7 @@ pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
|||
pub use self::border::{BorderImageSlice, BorderImageWidth};
|
||||
pub use self::box_::{AnimationIterationCount, AnimationName, Contain};
|
||||
pub use self::box_::{Appearance, BreakBetween, BreakWithin, Clear, Float};
|
||||
pub use self::box_::{Display, TransitionProperty, Overflow};
|
||||
pub use self::box_::{Display, Overflow, TransitionProperty};
|
||||
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
|
||||
pub use self::box_::{ScrollSnapType, TouchAction, VerticalAlign, WillChange};
|
||||
pub use self::color::{Color, ColorPropertyValue, RGBAColor};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue