Skip to content
Permalink
Browse files

style: Remove NODE_IS_ANONYMOUS_ROOT.

We no longer have multiple kinds of anonymous subtrees, so we can get back one
node bit.

Differential Revision: https://phabricator.services.mozilla.com/D53344
  • Loading branch information
emilio committed Nov 18, 2019
1 parent 425025c commit 246433acfa8caae242145326752b3d0d71c1f3d5
Showing with 2 additions and 14 deletions.
  1. +2 −14 components/style/gecko/wrapper.rs
@@ -761,25 +761,13 @@ impl<'le> GeckoElement<'le> {
data.damage |= damage;
}

/// This logic is duplicated in Gecko's nsIContent::IsRootOfAnonymousSubtree.
#[inline]
fn is_root_of_anonymous_subtree(&self) -> bool {
use crate::gecko_bindings::structs::NODE_IS_ANONYMOUS_ROOT;
self.flags() & (NODE_IS_ANONYMOUS_ROOT as u32) != 0
}

/// This logic is duplicated in Gecko's nsIContent::IsRootOfNativeAnonymousSubtree.
#[inline]
fn is_root_of_native_anonymous_subtree(&self) -> bool {
use crate::gecko_bindings::structs::NODE_IS_NATIVE_ANONYMOUS_ROOT;
return self.flags() & (NODE_IS_NATIVE_ANONYMOUS_ROOT as u32) != 0;
}

#[inline]
fn is_in_anonymous_subtree(&self) -> bool {
unsafe { bindings::Gecko_IsInAnonymousSubtree(self.0) }
}

/// Returns true if this node is the shadow root of an use-element shadow tree.
#[inline]
fn is_root_of_use_element_shadow_tree(&self) -> bool {
@@ -1028,7 +1016,7 @@ impl<'le> TElement for GeckoElement<'le> {
// StyleChildrenIterator::IsNeeded does, except that it might return
// true if we used to (but no longer) have anonymous content from
// ::before/::after, or nsIAnonymousContentCreators.
if self.is_in_anonymous_subtree() ||
if self.is_in_native_anonymous_subtree() ||
self.is_html_slot_element() ||
self.shadow_root().is_some() ||
self.may_have_anonymous_children()
@@ -2243,7 +2231,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {

#[inline]
fn ignores_nth_child_selectors(&self) -> bool {
self.is_root_of_anonymous_subtree()
self.is_root_of_native_anonymous_subtree()
}
}

0 comments on commit 246433a

Please sign in to comment.
You can’t perform that action at this time.