From 4c1b7d306763092af5b6ab0473e1a968c855724f Mon Sep 17 00:00:00 2001 From: Iris Hsiao Date: Tue, 28 Mar 2017 15:23:59 +0800 Subject: [PATCH] Backed out changeset 6e4ccddb5c4b (bug 1350671) for build bustage --- layout/base/PresShell.cpp | 4 ---- layout/style/ServoBindingList.h | 3 +-- layout/style/ServoStyleSet.cpp | 4 +--- layout/style/ServoStyleSet.h | 24 ------------------- .../style/gecko_bindings/bindings.rs | 3 +-- servo/ports/geckolib/glue.rs | 13 +++------- 6 files changed, 6 insertions(+), 45 deletions(-) diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 50af6f55c8710..f283e91c35033 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -2953,10 +2953,6 @@ PresShell::RecreateFramesFor(nsIContent* aContent) nsStyleChangeList changeList(mPresContext->StyleSet()->BackendType()); changeList.AppendChange(nullptr, aContent, nsChangeHint_ReconstructFrame); - // We might have restyles pending when we're asked to recreate frames. - // Record that we're OK with stale styles being returned, to avoid assertions. - ServoStyleSet::AutoAllowStaleStyles guard(mStyleSet->GetAsServo()); - // Mark ourselves as not safe to flush while we're doing frame construction. ++mChangeNestCount; RestyleManager* restyleManager = mPresContext->RestyleManager(); diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h index 07e8fc5e4a59e..ac98de4a267da 100644 --- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -291,8 +291,7 @@ SERVO_BINDING_FUNC(Servo_NoteExplicitHints, void, RawGeckoElementBorrowed elemen SERVO_BINDING_FUNC(Servo_TakeChangeHint, nsChangeHint, RawGeckoElementBorrowed element) SERVO_BINDING_FUNC(Servo_ResolveStyle, ServoComputedValuesStrong, RawGeckoElementBorrowed element, - RawServoStyleSetBorrowed set, - bool allow_stale) + RawServoStyleSetBorrowed set) SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ServoComputedValuesStrong, RawGeckoElementBorrowed element, nsIAtom* pseudo_tag, bool is_probe, RawServoStyleSetBorrowed set) diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 481ddac34a3f7..229a652717321 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -27,7 +27,6 @@ using namespace mozilla::dom; ServoStyleSet::ServoStyleSet() : mPresContext(nullptr) , mBatching(0) - , mAllowResolveStaleStyles(false) { } @@ -784,8 +783,7 @@ ServoStyleSet::RebuildData() already_AddRefed ServoStyleSet::ResolveServoStyle(Element* aElement) { - return Servo_ResolveStyle(aElement, mRawSet.get(), - mAllowResolveStaleStyles).Consume(); + return Servo_ResolveStyle(aElement, mRawSet.get()).Consume(); } void diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h index 422530a382723..85b5ab1124e64 100644 --- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -46,29 +46,6 @@ class ServoStyleSet { friend class ServoRestyleManager; public: - class AutoAllowStaleStyles - { - public: - AutoAllowStaleStyles(ServoStyleSet* aStyleSet) - : mStyleSet(aStyleSet) - { - if (mStyleSet) { - MOZ_ASSERT(!mStyleSet->mAllowResolveStaleStyles); - mStyleSet->mAllowResolveStaleStyles = true; - } - } - - ~AutoAllowStaleStyles() - { - if (mStyleSet) { - mStyleSet->mAllowResolveStaleStyles = false; - } - } - - private: - ServoStyleSet* mStyleSet; - }; - static bool IsInServoTraversal() { // The callers of this function are generally main-thread-only _except_ @@ -319,7 +296,6 @@ class ServoStyleSet EnumeratedArray>> mSheets; int32_t mBatching; - bool mAllowResolveStaleStyles; // Stores pointers to our cached style contexts for non-inheriting anonymous // boxes. diff --git a/servo/components/style/gecko_bindings/bindings.rs b/servo/components/style/gecko_bindings/bindings.rs index cc79d32bcf482..dd5196defa645 100644 --- a/servo/components/style/gecko_bindings/bindings.rs +++ b/servo/components/style/gecko_bindings/bindings.rs @@ -1812,8 +1812,7 @@ extern "C" { } extern "C" { pub fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, - set: RawServoStyleSetBorrowed, - allow_stale: bool) + set: RawServoStyleSetBorrowed) -> ServoComputedValuesStrong; } extern "C" { diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs index 6b9c72884816d..3ac1fdb869025 100644 --- a/servo/ports/geckolib/glue.rs +++ b/servo/ports/geckolib/glue.rs @@ -1473,22 +1473,15 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed) -> nsCh #[no_mangle] pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, - raw_data: RawServoStyleSetBorrowed, - allow_stale: bool) + raw_data: RawServoStyleSetBorrowed) -> ServoComputedValuesStrong { let element = GeckoElement(element); debug!("Servo_ResolveStyle: {:?}", element); let data = unsafe { element.ensure_data() }.borrow_mut(); - let valid_styles = if allow_stale { - data.has_styles() - } else { - data.has_current_styles() - }; - - if !valid_styles { - warn!("Resolving style on element without current styles with lazy computation forbidden."); + if !data.has_current_styles() { + warn!("Resolving style on unstyled element with lazy computation forbidden."); let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow(); return per_doc_data.default_computed_values().clone().into_strong(); }