author | Nazım Can Altınova <canaltinova@gmail.com> |
Sat, 10 Jun 2017 17:22:23 +0300 | |
changeset 411479 | 958eeb68e32ec9cb55bcb8f746f5591381266ae2 |
parent 411478 | d8871fb0af7d50668441c15650ce0e37cb1b05d5 |
child 411480 | 145daf186ca7790ffbeb88b8dea1f8e22e8bf4db |
push id | 7391 |
push user | mtabara@mozilla.com |
push date | Mon, 12 Jun 2017 13:08:53 +0000 |
treeherder | mozilla-beta@2191d7f87e2e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | emilio |
bugs | 1355724 |
milestone | 55.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1182,27 +1182,31 @@ nsPresContext::CompatibilityModeChanged( return; } nsIDocument* doc = mShell->GetDocument(); if (!doc) { return; } + StyleSetHandle styleSet = mShell->StyleSet(); + if (styleSet->IsServo()) { + styleSet->AsServo()->CompatibilityModeChanged(); + } + if (doc->IsSVGDocument()) { // SVG documents never load quirk.css. return; } bool needsQuirkSheet = CompatibilityMode() == eCompatibility_NavQuirks; if (mQuirkSheetAdded == needsQuirkSheet) { return; } - StyleSetHandle styleSet = mShell->StyleSet(); auto cache = nsLayoutStylesheetCache::For(styleSet->BackendType()); StyleSheet* sheet = cache->QuirkSheet(); if (needsQuirkSheet) { // quirk.css needs to come after html.css; we just keep it at the end. DebugOnly<nsresult> rv = styleSet->AppendStyleSheet(SheetType::Agent, sheet); NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "failed to insert quirk.css");
--- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -53,16 +53,18 @@ SERVO_BINDING_FUNC(Servo_StyleSheet_Size SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSetOwned, RawGeckoPresContextOwned pres_context) SERVO_BINDING_FUNC(Servo_StyleSet_Clear, void, RawServoStyleSetBorrowed set) SERVO_BINDING_FUNC(Servo_StyleSet_RebuildData, void, RawServoStyleSetBorrowed set) SERVO_BINDING_FUNC(Servo_StyleSet_MediumFeaturesChanged, bool, RawServoStyleSetBorrowed set) SERVO_BINDING_FUNC(Servo_StyleSet_Drop, void, RawServoStyleSetOwned set) +SERVO_BINDING_FUNC(Servo_StyleSet_CompatModeChanged, void, + RawServoStyleSetBorrowed raw_data) SERVO_BINDING_FUNC(Servo_StyleSet_AppendStyleSheet, void, RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet, uint64_t unique_id) SERVO_BINDING_FUNC(Servo_StyleSet_PrependStyleSheet, void, RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet, uint64_t unique_id)
--- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -1118,16 +1118,22 @@ ServoStyleSet::RebuildData() void ServoStyleSet::ClearDataAndMarkDeviceDirty() { ClearNonInheritingStyleContexts(); Servo_StyleSet_Clear(mRawSet.get()); mStylistState |= StylistState::FullyDirty; } +void +ServoStyleSet::CompatibilityModeChanged() +{ + Servo_StyleSet_CompatModeChanged(mRawSet.get()); +} + already_AddRefed<ServoComputedValues> ServoStyleSet::ResolveServoStyle(Element* aElement) { UpdateStylistIfNeeded(); return Servo_ResolveStyle(aElement, mRawSet.get(), mAllowResolveStaleStyles).Consume(); }
--- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -342,16 +342,21 @@ public: /** * Clears the style data, both style sheet data and cached non-inheriting * style contexts, and marks the stylist as needing an unconditional full * rebuild, including a device reset. */ void ClearDataAndMarkDeviceDirty(); /** + * Notifies the Servo stylesheet that the document's compatibility mode has changed. + */ + void CompatibilityModeChanged(); + + /** * Resolve style for the given element, and return it as a * ServoComputedValues, not an nsStyleContext. */ already_AddRefed<ServoComputedValues> ResolveServoStyle(dom::Element* aElement); bool GetKeyframesForName(const nsString& aName, const nsTimingFunction& aTimingFunction, const ServoComputedValues* aComputedValues,