mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Updated fixes to some clippy warnings in components/script
This commit is contained in:
parent
e74a03724f
commit
2a37c3dec8
58 changed files with 156 additions and 265 deletions
|
@ -149,10 +149,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ServoLayoutElement<'dom, LayoutDataT
|
|||
fn is_root(&self) -> bool {
|
||||
match self.as_node().parent_node() {
|
||||
None => false,
|
||||
Some(node) => match node.script_type_id() {
|
||||
NodeTypeId::Document(_) => true,
|
||||
_ => false,
|
||||
},
|
||||
Some(node) => matches!(node.script_type_id(), NodeTypeId::Document(_)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -456,6 +453,21 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
|
|||
) -> euclid::default::Size2D<Option<app_units::Au>> {
|
||||
todo!();
|
||||
}
|
||||
|
||||
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool {
|
||||
self.element.get_selector_flags().contains(flags)
|
||||
}
|
||||
|
||||
fn relative_selector_search_direction(&self) -> Option<ElementSelectorFlags> {
|
||||
let flags = self.element.get_selector_flags().intersection(
|
||||
ElementSelectorFlags::RELATIVE_SELECTOR_SEARCH_DIRECTION_ANCESTOR_SIBLING,
|
||||
);
|
||||
if flags.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
|
||||
|
@ -587,15 +599,11 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
|
|||
|
||||
NonTSPseudoClass::Lang(ref lang) => self.match_element_lang(None, lang),
|
||||
|
||||
NonTSPseudoClass::ServoNonZeroBorder => {
|
||||
match self
|
||||
.element
|
||||
.get_attr_for_layout(&ns!(), &local_name!("border"))
|
||||
{
|
||||
None | Some(&AttrValue::UInt(_, 0)) => false,
|
||||
_ => true,
|
||||
}
|
||||
},
|
||||
NonTSPseudoClass::ServoNonZeroBorder => !matches!(
|
||||
self.element
|
||||
.get_attr_for_layout(&ns!(), &local_name!("border")),
|
||||
None | Some(&AttrValue::UInt(_, 0))
|
||||
),
|
||||
NonTSPseudoClass::ReadOnly => !self
|
||||
.element
|
||||
.get_state_for_layout()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue