Skip to content

Commit

Permalink
style: Remove NODE_IS_ANONYMOUS_ROOT.
Browse files Browse the repository at this point in the history
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 30, 2019
1 parent 425025c commit 246433a
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions components/style/gecko/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 246433a

Please sign in to comment.