Auto merge of #17959 - emilio:no-moar-parent, r=heycam

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17959)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-03 05:50:18 -05:00 committed by GitHub
commit 452268eca9
7 changed files with 48 additions and 5 deletions

View file

@ -362,7 +362,7 @@ impl PseudoElement {
/// Whether this pseudo-element is an anonymous box.
#[inline]
fn is_anon_box(&self) -> bool {
pub fn is_anon_box(&self) -> bool {
match *self {
PseudoElement::MozText => true,
PseudoElement::OofPlaceholder => true,

View file

@ -57,7 +57,7 @@ impl PseudoElement {
/// Whether this pseudo-element is an anonymous box.
#[inline]
fn is_anon_box(&self) -> bool {
pub fn is_anon_box(&self) -> bool {
match *self {
% for pseudo in PSEUDOS:
% if pseudo.is_anon_box():