diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index b299d3849e..37878eaa20 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1908,10 +1908,6 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent) // recomputed it anyway if we ever insert the nodes back into a document. if (IsStyledByServo()) { ClearServoData(); - } else { -#ifdef MOZ_STYLO - MOZ_ASSERT(!HasServoData()); -#endif } // Editable descendant count only counts descendants that diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index ab9f2419a1..19e23cb6eb 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -12302,21 +12302,6 @@ nsIDocument::UpdateStyleBackendType() // Assume Gecko by default. mStyleBackendType = StyleBackendType::Gecko; - -#ifdef MOZ_STYLO - // XXX For now we use a Servo-backed style set only for (X)HTML documents - // in content docshells. This should let us avoid implementing XUL-specific - // CSS features. And apart from not supporting SVG properties in Servo - // yet, the root SVG element likes to create a style sheet for an SVG - // document before we have a pres shell (i.e. before we make the decision - // here about whether to use a Gecko- or Servo-backed style system), so - // we avoid Servo-backed style sets for SVG documents. - if (!mDocumentContainer) { - NS_WARNING("stylo: No docshell yet, assuming Gecko style system"); - } else if (nsLayoutUtils::SupportsServoStyleBackend(this)) { - mStyleBackendType = StyleBackendType::Servo; - } -#endif } Selection* diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp index 6aedebcc18..d045c0424e 100644 --- a/dom/base/nsGenericDOMDataNode.cpp +++ b/dom/base/nsGenericDOMDataNode.cpp @@ -602,10 +602,6 @@ nsGenericDOMDataNode::UnbindFromTree(bool aDeep, bool aNullParent) // recomputed it anyway if we ever insert the nodes back into a document. if (IsStyledByServo()) { ClearServoData(); - } else { -#ifdef MOZ_STYLO - MOZ_ASSERT(!HasServoData()); -#endif } if (aNullParent || !mParent->IsInShadowTree()) { diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index d4129171cb..03ea679880 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -152,9 +152,6 @@ nsINode::~nsINode() { MOZ_ASSERT(!HasSlots(), "nsNodeUtils::LastRelease was not called?"); MOZ_ASSERT(mSubtreeRoot == this, "Didn't restore state properly?"); -#ifdef MOZ_STYLO - ClearServoData(); -#endif } void* @@ -1445,11 +1442,7 @@ nsINode::UnoptimizableCCNode() const void nsINode::ClearServoData() { -#ifdef MOZ_STYLO - Servo_Node_ClearNodeData(this); -#else MOZ_CRASH("Accessing servo node data in non-stylo build"); -#endif } /* static */ @@ -3193,14 +3186,6 @@ nsINode::IsNodeApzAwareInternal() const return EventTarget::IsApzAware(); } -#ifdef MOZ_STYLO -bool -nsINode::IsStyledByServo() const -{ - return OwnerDoc()->IsStyledByServo(); -} -#endif - DocGroup* nsINode::GetDocGroup() const { diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 5268767a3e..a33c088928 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -1022,11 +1022,7 @@ public: * Returns true if this is a node belonging to a document that uses the Servo * style system. */ -#ifdef MOZ_STYLO - bool IsStyledByServo() const; -#else bool IsStyledByServo() const { return false; } -#endif bool IsDirtyForServo() const { @@ -2139,11 +2135,7 @@ public: #undef EVENT bool HasServoData() { -#ifdef MOZ_STYLO - return !!mServoData.Get(); -#else MOZ_CRASH("Accessing servo node data in non-stylo build"); -#endif } void ClearServoData(); @@ -2185,11 +2177,6 @@ protected: // Storage for more members that are usually not needed; allocated lazily. nsSlots* mSlots; - -#ifdef MOZ_STYLO - // Per-node data managed by Servo. - mozilla::ServoCell mServoData; -#endif }; inline nsIDOMNode* GetAsDOMNode(nsINode* aNode) diff --git a/layout/base/RestyleManagerBase.h b/layout/base/RestyleManagerBase.h index 8b8bf4170e..c3fc2f8a5a 100644 --- a/layout/base/RestyleManagerBase.h +++ b/layout/base/RestyleManagerBase.h @@ -120,11 +120,7 @@ protected: } inline bool IsServo() const { -#ifdef MOZ_STYLO - return PresContext()->StyleSet()->IsServo(); -#else return false; -#endif } private: diff --git a/layout/base/RestyleManagerHandle.h b/layout/base/RestyleManagerHandle.h index 5cc26e41e1..30702c5a5e 100644 --- a/layout/base/RestyleManagerHandle.h +++ b/layout/base/RestyleManagerHandle.h @@ -52,11 +52,7 @@ public: bool IsServo() const { MOZ_ASSERT(mValue, "RestyleManagerHandle null pointer dereference"); -#ifdef MOZ_STYLO - return mValue & SERVO_BIT; -#else return false; -#endif } StyleBackendType BackendType() const @@ -186,16 +182,8 @@ public: RestyleManagerHandle& operator=(ServoRestyleManager* aManager) { -#ifdef MOZ_STYLO - MOZ_ASSERT(!(reinterpret_cast(aManager) & SERVO_BIT), - "least significant bit shouldn't be set; we use it for state"); - mPtr.mValue = - aManager ? (reinterpret_cast(aManager) | SERVO_BIT) : 0; - return *this; -#else MOZ_CRASH("should not have a ServoRestyleManager object when MOZ_STYLO is " "disabled"); -#endif } // Make RestyleManagerHandle usable in boolean contexts. diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 613dd0b304..79ab52aaa6 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -181,9 +181,6 @@ typedef nsStyleTransformMatrix::TransformReferenceBox TransformReferenceBox; /* static */ bool nsLayoutUtils::sInterruptibleReflowEnabled; /* static */ bool nsLayoutUtils::sSVGTransformBoxEnabled; /* static */ bool nsLayoutUtils::sTextCombineUprightDigitsEnabled; -#ifdef MOZ_STYLO -/* static */ bool nsLayoutUtils::sStyloEnabled; -#endif /* static */ uint32_t nsLayoutUtils::sIdlePeriodDeadlineLimit; /* static */ uint32_t nsLayoutUtils::sQuiescentFramesBeforeIdlePeriod; @@ -7632,10 +7629,6 @@ nsLayoutUtils::Initialize() "svg.transform-box.enabled"); Preferences::AddBoolVarCache(&sTextCombineUprightDigitsEnabled, "layout.css.text-combine-upright-digits.enabled"); -#ifdef MOZ_STYLO - Preferences::AddBoolVarCache(&sStyloEnabled, - "layout.css.servo.enabled"); -#endif Preferences::AddUintVarCache(&sIdlePeriodDeadlineLimit, "layout.idle_period.time_limit", DEFAULT_IDLE_PERIOD_TIME_LIMIT); diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index f8724d69d3..29cd655660 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -2383,11 +2383,7 @@ public: // or disabled at compile-time. However, we provide the additional capability // to disable it dynamically in stylo-enabled builds via a pref. static bool StyloEnabled() { -#ifdef MOZ_STYLO - return sStyloEnabled; -#else return false; -#endif } static uint32_t IdlePeriodDeadlineLimit() { @@ -2910,9 +2906,6 @@ private: static bool sInterruptibleReflowEnabled; static bool sSVGTransformBoxEnabled; static bool sTextCombineUprightDigitsEnabled; -#ifdef MOZ_STYLO - static bool sStyloEnabled; -#endif static uint32_t sIdlePeriodDeadlineLimit; static uint32_t sQuiescentFramesBeforeIdlePeriod; diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index 0433cab914..ed21093ba3 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -695,23 +695,9 @@ Gecko_Destroy_nsStyle##name(nsStyle##name* ptr) \ #undef STYLE_STRUCT -#ifndef MOZ_STYLO #define SERVO_BINDING_FUNC(name_, return_, ...) \ return_ name_(__VA_ARGS__) { \ MOZ_CRASH("stylo: shouldn't be calling " #name_ "in a non-stylo build"); \ } #include "ServoBindingList.h" #undef SERVO_BINDING_FUNC -#endif - -#ifdef MOZ_STYLO -const nsStyleVariables* -Servo_GetStyleVariables(ServoComputedValuesBorrowed aComputedValues) -{ - // Servo can't provide us with Variables structs yet, so instead of linking - // to a Servo_GetStyleVariables defined in Servo we define one here that - // always returns the same, empty struct. - static nsStyleVariables variables(StyleStructContext::ServoContext()); - return &variables; -} -#endif diff --git a/layout/style/ServoUtils.h b/layout/style/ServoUtils.h index 047cbb7a05..8c8dbebcc1 100644 --- a/layout/style/ServoUtils.h +++ b/layout/style/ServoUtils.h @@ -10,15 +10,9 @@ #include "mozilla/TypeTraits.h" -#ifdef MOZ_STYLO -# define MOZ_DECL_STYLO_CHECK_METHODS \ - bool IsGecko() const { return !IsServo(); } \ - bool IsServo() const { return mType == StyleBackendType::Servo; } -#else # define MOZ_DECL_STYLO_CHECK_METHODS \ bool IsGecko() const { return true; } \ bool IsServo() const { return false; } -#endif /** * Macro used in a base class of |geckotype_| and |servotype_|. diff --git a/layout/style/StyleContextSource.h b/layout/style/StyleContextSource.h index 7c6a007304..9911dd8aa2 100644 --- a/layout/style/StyleContextSource.h +++ b/layout/style/StyleContextSource.h @@ -53,11 +53,7 @@ struct NonOwningStyleContextSource bool IsNull() const { return !mBits; } bool IsGeckoRuleNodeOrNull() const { return !IsServoComputedValues(); } bool IsServoComputedValues() const { -#ifdef MOZ_STYLO - return mBits & 1; -#else return false; -#endif } nsRuleNode* AsGeckoRuleNode() const { diff --git a/layout/style/StyleSetHandle.h b/layout/style/StyleSetHandle.h index 6c67a058df..e5e4af800a 100644 --- a/layout/style/StyleSetHandle.h +++ b/layout/style/StyleSetHandle.h @@ -54,11 +54,7 @@ public: bool IsServo() const { MOZ_ASSERT(mValue, "StyleSetHandle null pointer dereference"); -#ifdef MOZ_STYLO - return mValue & SERVO_BIT; -#else return false; -#endif } StyleBackendType BackendType() const @@ -187,16 +183,8 @@ public: StyleSetHandle& operator=(ServoStyleSet* aStyleSet) { -#ifdef MOZ_STYLO - MOZ_ASSERT(!(reinterpret_cast(aStyleSet) & SERVO_BIT), - "least significant bit shouldn't be set; we use it for state"); - mPtr.mValue = - aStyleSet ? (reinterpret_cast(aStyleSet) | SERVO_BIT) : 0; - return *this; -#else MOZ_CRASH("should not have a ServoStyleSet object when MOZ_STYLO is " "disabled"); -#endif } // Make StyleSetHandle usable in boolean contexts. diff --git a/layout/style/StyleStructContext.h b/layout/style/StyleStructContext.h index f4b59972ec..d8273049ab 100644 --- a/layout/style/StyleStructContext.h +++ b/layout/style/StyleStructContext.h @@ -35,11 +35,7 @@ class nsDeviceContext; * We don't put the type in namespace mozilla, since we expect it to be * temporary, and the namespacing would clutter up nsStyleStruct.h. */ -#ifdef MOZ_STYLO -#define SERVO_DEFAULT(default_val) { if (!mPresContext) { return default_val; } } -#else #define SERVO_DEFAULT(default_val) { MOZ_ASSERT(mPresContext); } -#endif class StyleStructContext { public: MOZ_IMPLICIT StyleStructContext(nsPresContext* aPresContext) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index e57b552ebb..1fa6166f27 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -10507,13 +10507,6 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext, uint32_t ruleTypeMask, bool aAuthorColorsAllowed) { -#ifdef MOZ_STYLO - if (aStyleContext->StyleSource().IsServoComputedValues()) { - NS_WARNING("stylo: nsRuleNode::HasAuthorSpecifiedRules not implemented"); - return true; - } -#endif - uint32_t inheritBits = 0; if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) { inheritBits |= NS_STYLE_INHERIT_BIT(Background); diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 38b422bd73..1c40245425 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -88,18 +88,9 @@ nsStyleContext::nsStyleContext(nsStyleContext* aParent, , mEmptyChild(nullptr) , mPseudoTag(aPseudoTag) , mSource(Move(aSource)) -#ifdef MOZ_STYLO - , mPresContext(nullptr) -#endif , mCachedResetData(nullptr) , mBits(((uint64_t)aPseudoType) << NS_STYLE_CONTEXT_TYPE_SHIFT) , mRefCnt(0) -#ifdef MOZ_STYLO - , mStoredChangeHint(nsChangeHint(0)) -#ifdef DEBUG - , mConsumedChangeHint(false) -#endif -#endif #ifdef DEBUG , mFrameRefCnt(0) , mComputingStruct(nsStyleStructID_None) @@ -116,10 +107,6 @@ nsStyleContext::nsStyleContext(nsStyleContext* aParent, : nsStyleContext(aParent, OwningStyleContextSource(Move(aRuleNode)), aPseudoTag, aPseudoType) { -#ifdef MOZ_STYLO - mPresContext = mSource.AsGeckoRuleNode()->PresContext(); -#endif - if (aParent) { #ifdef DEBUG nsRuleNode *r1 = mParent->RuleNode(), *r2 = mSource.AsGeckoRuleNode(); @@ -146,10 +133,6 @@ nsStyleContext::nsStyleContext(nsStyleContext* aParent, : nsStyleContext(aParent, OwningStyleContextSource(Move(aComputedValues)), aPseudoTag, aPseudoType) { -#ifdef MOZ_STYLO - mPresContext = aPresContext; -#endif - FinishConstruction(aSkipParentDisplayBasedStyleFixup); } diff --git a/layout/style/nsStyleContext.h b/layout/style/nsStyleContext.h index b0b4896a3d..404240b16e 100644 --- a/layout/style/nsStyleContext.h +++ b/layout/style/nsStyleContext.h @@ -154,11 +154,7 @@ public: } nsPresContext* PresContext() const { -#ifdef MOZ_STYLO - return mPresContext; -#else return mSource.AsGeckoRuleNode()->PresContext(); -#endif } nsStyleContext* GetParent() const { return mParent; } @@ -512,45 +508,6 @@ public: mozilla::NonOwningStyleContextSource StyleSource() const { return mSource.AsRaw(); } -#ifdef MOZ_STYLO - // NOTE: It'd be great to assert here that the previous change hint is always - // consumed. - // - // This is not the case right now, since the changes of childs of frames that - // go through frame construction are not consumed. - void StoreChangeHint(nsChangeHint aHint) - { - MOZ_ASSERT(!IsShared()); - mStoredChangeHint = aHint; -#ifdef DEBUG - mConsumedChangeHint = false; -#endif - } - - nsChangeHint ConsumeStoredChangeHint() - { - MOZ_ASSERT(!mConsumedChangeHint, "Re-consuming the same change hint!"); - nsChangeHint result = mStoredChangeHint; - mStoredChangeHint = nsChangeHint(0); -#ifdef DEBUG - mConsumedChangeHint = true; -#endif - return result; - } -#else - void StoreChangeHint(nsChangeHint aHint) - { - MOZ_CRASH("stylo: Called nsStyleContext::StoreChangeHint in a non MOZ_STYLO " - "build."); - } - - nsChangeHint ConsumeStoredChangeHint() - { - MOZ_CRASH("stylo: Called nsStyleContext::ComsumeStoredChangeHint in a non " - "MOZ_STYLO build."); - } -#endif - private: // Private destructor, to discourage deletion outside of Release(): ~nsStyleContext(); @@ -781,12 +738,6 @@ private: // when it's released and nulled out during teardown. const mozilla::OwningStyleContextSource mSource; -#ifdef MOZ_STYLO - // In Gecko, we can get this off the rule node. We make this conditional - // on stylo builds to avoid the memory bloat on release. - nsPresContext* mPresContext; -#endif - // mCachedInheritedData and mCachedResetData point to both structs that // are owned by this style context and structs that are owned by one of // this style context's ancestors (which are indirectly owned since this @@ -809,15 +760,6 @@ private: uint32_t mRefCnt; - // For now we store change hints on the style context during parallel traversal. - // We should improve this - see bug 1289861. -#ifdef MOZ_STYLO - nsChangeHint mStoredChangeHint; -#ifdef DEBUG - bool mConsumedChangeHint; -#endif -#endif - #ifdef DEBUG uint32_t mFrameRefCnt; // number of frames that use this // as their style context diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index dfa0fd0caa..17c6021044 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5258,11 +5258,6 @@ pref("dom.webkitBlink.filesystem.enabled", true); pref("media.block-autoplay-until-in-foreground", true); -#ifdef MOZ_STYLO -// Is the Servo-backed style system enabled? -pref("layout.css.servo.enabled", true); -#endif - // Block toplevel data: URI navigations // If true, all toplevel data: URI navigations will be blocked. // Please note that manually entering a data: URI in the diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index 69b207d77a..49ff260b47 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -185,12 +185,6 @@ if CONFIG['OS_ARCH'] == 'Linux': OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS'] OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] -if CONFIG['SERVO_TARGET_DIR']: - if CONFIG['_MSC_VER']: - OS_LIBS += ['%s/geckoservo' % CONFIG['SERVO_TARGET_DIR']] - else: - OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo'] - if CONFIG['MOZ_SYSTEM_JPEG']: OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] diff --git a/toolkit/moz.configure b/toolkit/moz.configure index fbd728fdc8..edf2a78fb8 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -387,31 +387,6 @@ id_and_secret_keyfile('Bing API') simple_keyfile('Adjust SDK') -# Servo integration -# ============================================================== -option('--enable-stylo', env='STYLO_ENABLED', nargs=0, - help='Enables experimental integration with the servo style system. ' - 'This requires either building servo within Gecko\'s cargo phase ' - 'or passing --with-servo') - -@depends('--enable-stylo') -def stylo(value): - if value: - return True - -set_define('MOZ_STYLO', stylo) -imply_option('--enable-jemalloc', depends_if('--enable-stylo')(lambda _: 'moz')) - -option('--with-servo', env='SERVO_TARGET_DIR', nargs=1, - help='Absolute path of the target directory where libgeckoservo can ' - 'be found. This is generally servo_src_dir/target/release.') - -@depends_if('--with-servo') -def servo_target_dir(value): - return value[0] - -set_config('SERVO_TARGET_DIR', servo_target_dir) - # Gecko integrated IPC fuzzer # ============================================================== option('--enable-ipc-fuzzer', env='MOZ_FAULTY', diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 74850e17e2..54922ae894 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -3767,15 +3767,6 @@ XREMain::XRE_mainRun() rv = appStartup->CreateHiddenWindow(); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); -#ifdef MOZ_STYLO - // We initialize Servo here so that the hidden DOM window is available, - // since initializing Servo calls style struct constructors, and the - // HackilyFindDeviceContext stuff we have right now depends on the hidden - // DOM window. When we fix that, this should move back to - // nsLayoutStatics.cpp - Servo_Initialize(); -#endif - #if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK) nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit(); if (toolkit && !mDesktopStartupID.IsEmpty()) { @@ -3848,12 +3839,6 @@ XREMain::XRE_mainRun() } } -#ifdef MOZ_STYLO - // This, along with the call to Servo_Initialize, should eventually move back - // to nsLayoutStatics.cpp. - Servo_Shutdown(); -#endif - return rv; }