style: Move nsStyleContext::mParent to GeckoStyleContext.

Unfortunately this means that we lose the NS_STYLE_INHERIT_BIT optimization to
avoid posting changes if we had not requested the struct. In practice, I'm not
sure this optimization matters much, though, and we already compare all the
structs anyway.

We _could_ keep a weak parent pointer from the text style if needed, given we're
going to keep alive the text style at least until the parent style context goes
away, so should be safe, but I don't think the extra churn is worth it, to be
honest. Happy to do so as part of bug 1368290 if you think it's worth it.

Bug: 1385896
Reviewed-by: heycam
MozReview-Commit-ID: ka6tNwf4Ke
This commit is contained in:
Emilio Cobos Álvarez 2017-07-31 16:21:40 +02:00
parent 3ef182ca36
commit 6c5cf5e2ec
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 48 additions and 5 deletions

View file

@ -145,6 +145,11 @@ impl PseudoElement {
self.cascade_type() == PseudoElementCascadeType::Lazy
}
/// Whether this pseudo-element is for an anonymous box.
pub fn is_anon_box(&self) -> bool {
self.is_precomputed()
}
/// Whether this pseudo-element is precomputed.
#[inline]
pub fn is_precomputed(&self) -> bool {