Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-08-12 01:27:26 +02:00 committed by Martin Robinson
parent 4878422c93
commit b05552369f
3 changed files with 35 additions and 25 deletions

View file

@ -358,10 +358,6 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
false
}
fn set_selector_flags(&self, flags: ElementSelectorFlags) {
self.element.insert_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) ||
@ -569,15 +565,11 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
false
}
fn match_non_ts_pseudo_class<F>(
fn match_non_ts_pseudo_class(
&self,
pseudo_class: &NonTSPseudoClass,
_: &mut MatchingContext<Self::Impl>,
_: &mut F,
) -> bool
where
F: FnMut(&Self, ElementSelectorFlags),
{
) -> bool {
match *pseudo_class {
// https://github.com/servo/servo/issues/8718
NonTSPseudoClass::Link | NonTSPseudoClass::AnyLink => self.is_link(),
@ -666,6 +658,10 @@ 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,15 +850,11 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
}
}
fn match_non_ts_pseudo_class<F>(
fn match_non_ts_pseudo_class(
&self,
_: &NonTSPseudoClass,
_: &mut MatchingContext<Self::Impl>,
_: &mut F,
) -> bool
where
F: FnMut(&Self, ElementSelectorFlags),
{
) -> bool {
// NB: This could maybe be implemented
warn!("ServoThreadSafeLayoutElement::match_non_ts_pseudo_class called");
false
@ -903,6 +895,10 @@ 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>