aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_dom/element.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/layout_dom/element.rs')
-rw-r--r--components/script/layout_dom/element.rs36
1 files changed, 20 insertions, 16 deletions
diff --git a/components/script/layout_dom/element.rs b/components/script/layout_dom/element.rs
index 91be4baa6ed..b85e72443c3 100644
--- a/components/script/layout_dom/element.rs
+++ b/components/script/layout_dom/element.rs
@@ -358,6 +358,14 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
false
}
+ unsafe fn set_selector_flags(&self, flags: ElementSelectorFlags) {
+ self.element.insert_selector_flags(flags);
+ }
+
+ fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool {
+ self.element.has_selector_flags(flags)
+ }
+
fn has_animations(&self, context: &SharedStyleContext) -> bool {
// This is not used for pseudo elements currently so we can pass None.
return self.has_css_animations(context, /* pseudo_element = */ None) ||
@@ -452,10 +460,6 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
fn namespace(&self) -> &Namespace {
self.element.namespace()
}
-
- fn primary_box_size(&self) -> euclid::default::Size2D<app_units::Au> {
- todo!();
- }
}
impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
@@ -569,11 +573,15 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
false
}
- fn match_non_ts_pseudo_class(
+ fn match_non_ts_pseudo_class<F>(
&self,
pseudo_class: &NonTSPseudoClass,
_: &mut MatchingContext<Self::Impl>,
- ) -> bool {
+ _: &mut F,
+ ) -> bool
+ where
+ F: FnMut(&Self, ElementSelectorFlags),
+ {
match *pseudo_class {
// https://github.com/servo/servo/issues/8718
NonTSPseudoClass::Link | NonTSPseudoClass::AnyLink => self.is_link(),
@@ -662,10 +670,6 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
fn is_html_element_in_html_document(&self) -> bool {
self.element.is_html_element() && self.as_node().owner_doc().is_html_document()
}
-
- fn set_selector_flags(&self, flags: ElementSelectorFlags) {
- self.element.insert_selector_flags(flags);
- }
}
/// A wrapper around elements that ensures layout can only
@@ -854,11 +858,15 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
}
}
- fn match_non_ts_pseudo_class(
+ fn match_non_ts_pseudo_class<F>(
&self,
_: &NonTSPseudoClass,
_: &mut MatchingContext<Self::Impl>,
- ) -> bool {
+ _: &mut F,
+ ) -> bool
+ where
+ F: FnMut(&Self, ElementSelectorFlags),
+ {
// NB: This could maybe be implemented
warn!("ServoThreadSafeLayoutElement::match_non_ts_pseudo_class called");
false
@@ -899,10 +907,6 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
warn!("ServoThreadSafeLayoutElement::is_root called");
false
}
-
- fn set_selector_flags(&self, flags: ElementSelectorFlags) {
- self.element.element.insert_selector_flags(flags);
- }
}
impl<'dom, LayoutDataType: LayoutDataTrait> GetStyleAndOpaqueLayoutData<'dom>