Bug 1364274 part 1 - Propagate style bits from Servo ComputedValues to ServoStyleContext. r=heycam draft
authorXidorn Quan <me@upsuper.org>
Tue, 04 Jul 2017 16:49:50 +1000
changeset 608727 7e38904b7c5f229e5527b02008cac6459a8bcdc8
parent 608726 1c2e3b6136d2e2c1ac0cb7bab30b3fd312c1fcda
child 608728 37923ac7ab91c75245d14dafa7bef623ce92603b
push id68393
push userxquan@mozilla.com
push dateFri, 14 Jul 2017 03:52:32 +0000
reviewersheycam
bugs1364274
milestone56.0a1
Bug 1364274 part 1 - Propagate style bits from Servo ComputedValues to ServoStyleContext. r=heycam MozReview-Commit-ID: KewMPDdX8iy
layout/style/ServoBindingList.h
layout/style/ServoStyleContext.cpp
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -465,16 +465,18 @@ SERVO_BINDING_FUNC(Servo_ComputedValues_
                    RawServoStyleSetBorrowed set)
 SERVO_BINDING_FUNC(Servo_ComputedValues_Inherit, ServoComputedValuesStrong,
                    RawServoStyleSetBorrowed set,
                    ServoComputedValuesBorrowedOrNull parent_style,
                    mozilla::InheritTarget target)
 SERVO_BINDING_FUNC(Servo_ComputedValues_GetVisitedStyle,
                    ServoComputedValuesStrong,
                    ServoComputedValuesBorrowed values)
+SERVO_BINDING_FUNC(Servo_ComputedValues_GetStyleBits, uint64_t,
+                   ServoComputedValuesBorrowed values)
 // Gets the source style rules for the computed values. This returns
 // the result via rules, which would include a list of unowned pointers
 // to RawServoStyleRule.
 SERVO_BINDING_FUNC(Servo_ComputedValues_GetStyleRuleList, void,
                    ServoComputedValuesBorrowed values,
                    RawGeckoServoStyleRuleListBorrowedMut rules)
 
 // Initialize Servo components. Should be called exactly once at startup.
--- a/layout/style/ServoStyleContext.cpp
+++ b/layout/style/ServoStyleContext.cpp
@@ -17,14 +17,15 @@ ServoStyleContext::ServoStyleContext(nsS
                                nsPresContext* aPresContext,
                                nsIAtom* aPseudoTag,
                                CSSPseudoElementType aPseudoType,
                                already_AddRefed<ServoComputedValues> aComputedValues)
   : nsStyleContext(aParent, aPseudoTag, aPseudoType),
   mSource(Move(aComputedValues))
 {
   mPresContext = aPresContext;
+  AddStyleBit(Servo_ComputedValues_GetStyleBits(mSource));
 
   FinishConstruction();
 
   // No need to call ApplyStyleFixups here, since fixups are handled by Servo when
   // producing the ServoComputedValues.
 }