Revert "Backport several style changes from Gecko (5) (#30099)" (#30104)

This reverts commit 8e15389cae.
This commit is contained in:
Oriol Brufau 2023-08-16 08:24:42 +02:00 committed by GitHub
parent 8e15389cae
commit d6ae8dc112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
152 changed files with 4622 additions and 5862 deletions

View file

@ -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>