diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4 index 77c2e85b5e..c5cc8730a9 100644 --- a/build/autoconf/compiler-opts.m4 +++ b/build/autoconf/compiler-opts.m4 @@ -176,22 +176,24 @@ if test "$GNU_CC"; then CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections" fi - CFLAGS="$CFLAGS -fno-math-errno" - CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno" + CFLAGS="$CFLAGS -fno-math-errno -pipe" + CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe" - if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then - CFLAGS="$CFLAGS -msse2 -mfpmath=sse" - CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse" - fi + case "${host_cpu}" in + i*86) + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" + CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse" + ;; + esac if test -z "$CLANG_CC"; then case "$CC_VERSION" in 4.* | 5.*) ;; *) - # Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko. - # Instead of completely disabling this optimization on newer GCC's, - # we'll force them to use level 1 optimization with -flifetime-dse=1. + # Lifetime Dead Store Elimination level 2 (default in GCC) breaks Goanna. + # Instead of completely disabling this optimization, we force level 1 + # optimization instead with -flifetime-dse=1. # Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS. CFLAGS="-flifetime-dse=1 $CFLAGS" CXXFLAGS="-flifetime-dse=1 $CXXFLAGS" diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 30df27a012..21f19d5974 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -14,8 +14,7 @@ #include "mozilla/AnimationUtils.h" #include "mozilla/EffectSet.h" #include "mozilla/LayerAnimationInfo.h" -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetPresShellForContent #include "nsCSSPropertyIDSet.h" #include "nsCSSProps.h" @@ -202,10 +201,7 @@ EffectCompositor::RequestRestyle(dom::Element* aElement, if (aRestyleType == RestyleType::Layer) { // Prompt layers to re-sync their animations. - MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(), - "stylo: Servo-backed style system should not be using " - "EffectCompositor"); - mPresContext->RestyleManager()->AsGecko()->IncrementAnimationGeneration(); + mPresContext->RestyleManager()->IncrementAnimationGeneration(); EffectSet* effectSet = EffectSet::GetEffectSet(aElement, aPseudoType); if (effectSet) { @@ -317,10 +313,7 @@ EffectCompositor::GetAnimationRule(dom::Element* aElement, return nullptr; } - MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(), - "stylo: Servo-backed style system should not be using " - "EffectCompositor"); - if (mPresContext->RestyleManager()->AsGecko()->SkipAnimationRules()) { + if (mPresContext->RestyleManager()->SkipAnimationRules()) { // We don't need to worry about updating mElementsToRestyle in this case // since this is not the animation restyle we requested when we called // PostRestyleForAnimation (see comment at start of this method). diff --git a/dom/animation/EffectSet.cpp b/dom/animation/EffectSet.cpp index 55dbe353b2..b528bae16d 100644 --- a/dom/animation/EffectSet.cpp +++ b/dom/animation/EffectSet.cpp @@ -5,8 +5,7 @@ #include "EffectSet.h" #include "mozilla/dom/Element.h" // For Element -#include "mozilla/RestyleManagerHandle.h" -#include "mozilla/RestyleManagerHandleInlines.h" +#include "mozilla/RestyleManager.h" #include "nsCSSPseudoElements.h" // For CSSPseudoElementType #include "nsCycleCollectionNoteChild.h" // For CycleCollectionNoteChild #include "nsPresContext.h" @@ -110,11 +109,8 @@ EffectSet::DestroyEffectSet(dom::Element* aElement, void EffectSet::UpdateAnimationGeneration(nsPresContext* aPresContext) { - MOZ_ASSERT(aPresContext->RestyleManager()->IsGecko(), - "stylo: Servo-backed style system should not be using " - "EffectSet"); mAnimationGeneration = - aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration(); + aPresContext->RestyleManager()->GetAnimationGeneration(); } /* static */ nsIAtom** diff --git a/dom/animation/KeyframeEffectReadOnly.cpp b/dom/animation/KeyframeEffectReadOnly.cpp index 2efc747f09..d588c7b1da 100644 --- a/dom/animation/KeyframeEffectReadOnly.cpp +++ b/dom/animation/KeyframeEffectReadOnly.cpp @@ -15,7 +15,6 @@ #include "mozilla/FloatingPoint.h" // For IsFinite #include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt #include "mozilla/KeyframeUtils.h" -#include "mozilla/ServoBindings.h" #include "mozilla/StyleAnimationValue.h" #include "Layers.h" // For Layer #include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContextForElement @@ -32,17 +31,7 @@ namespace mozilla { bool PropertyValuePair::operator==(const PropertyValuePair& aOther) const { - if (mProperty != aOther.mProperty || mValue != aOther.mValue) { - return false; - } - if (mServoDeclarationBlock == aOther.mServoDeclarationBlock) { - return true; - } - if (!mServoDeclarationBlock || !aOther.mServoDeclarationBlock) { - return false; - } - return Servo_DeclarationBlock_Equals(mServoDeclarationBlock, - aOther.mServoDeclarationBlock); + return mProperty == aOther.mProperty && mValue == aOther.mValue; } namespace dom { @@ -296,10 +285,7 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext) runningOnCompositorProperties.HasProperty(property.mProperty); } - // FIXME (bug 1303235): Do this for Servo too - if (aStyleContext->PresContext()->StyleSet()->IsGecko()) { - CalculateCumulativeChangeHint(aStyleContext); - } + CalculateCumulativeChangeHint(aStyleContext); MarkCascadeNeedsUpdate(); @@ -936,13 +922,8 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx, : propertyValue.mProperty; nsAutoString stringValue; - if (propertyValue.mServoDeclarationBlock) { - Servo_DeclarationBlock_SerializeOneValue( - propertyValue.mServoDeclarationBlock, &stringValue); - } else { - propertyValue.mValue.AppendToString( - propertyForSerializing, stringValue, nsCSSValue::eNormalized); - } + propertyValue.mValue.AppendToString( + propertyForSerializing, stringValue, nsCSSValue::eNormalized); JS::Rooted value(aCx); if (!ToJSValue(aCx, stringValue, &value) || @@ -1286,10 +1267,8 @@ CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty, nsCOMArray rules; rules.AppendObject(styleRule); - MOZ_ASSERT(aBaseStyleContext->PresContext()->StyleSet()->IsGecko(), - "ServoStyleSet should not use StyleAnimationValue for animations"); nsStyleSet* styleSet = - aBaseStyleContext->PresContext()->StyleSet()->AsGecko(); + aBaseStyleContext->PresContext()->StyleSet(); RefPtr styleContext = styleSet->ResolveStyleByAddingRules(aBaseStyleContext, rules); @@ -1362,10 +1341,8 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const return false; } - // FIXME (bug 1303235): We don't calculate mCumulativeChangeHint for - // the Servo backend yet nsPresContext* presContext = GetPresContext(); - if (!presContext || presContext->StyleSet()->IsServo()) { + if (!presContext) { return false; } diff --git a/dom/animation/KeyframeEffectReadOnly.h b/dom/animation/KeyframeEffectReadOnly.h index 5d8d12d868..77e3074e2e 100644 --- a/dom/animation/KeyframeEffectReadOnly.h +++ b/dom/animation/KeyframeEffectReadOnly.h @@ -19,8 +19,6 @@ #include "mozilla/EffectCompositor.h" #include "mozilla/KeyframeEffectParams.h" #include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords -#include "mozilla/ServoBindingTypes.h" // RawServoDeclarationBlock and - // associated RefPtrTraits #include "mozilla/StyleAnimationValue.h" #include "mozilla/dom/AnimationEffectReadOnly.h" #include "mozilla/dom/Element.h" @@ -63,11 +61,6 @@ struct PropertyValuePair // (string). nsCSSValue mValue; - // The specified value when using the Servo backend. However, even when - // using the Servo backend, we still fill in |mValue| in the case where we - // fail to parse the value since we use it to store the original string. - RefPtr mServoDeclarationBlock; - bool operator==(const PropertyValuePair&) const; }; diff --git a/dom/animation/KeyframeUtils.cpp b/dom/animation/KeyframeUtils.cpp index 540f892d57..1285611e49 100644 --- a/dom/animation/KeyframeUtils.cpp +++ b/dom/animation/KeyframeUtils.cpp @@ -9,7 +9,6 @@ #include "mozilla/Move.h" #include "mozilla/Preferences.h" #include "mozilla/RangedArray.h" -#include "mozilla/ServoBindings.h" #include "mozilla/StyleAnimationValue.h" #include "mozilla/TimingParams.h" #include "mozilla/dom/BaseKeyframeTypesBinding.h" // For FastBaseKeyframe etc. @@ -319,12 +318,8 @@ public: // ------------------------------------------------------------------ inline bool -IsInvalidValuePair(const PropertyValuePair& aPair, StyleBackendType aBackend) +IsInvalidValuePair(const PropertyValuePair& aPair) { - if (aBackend == StyleBackendType::Servo) { - return !aPair.mServoDeclarationBlock; - } - // There are three types of values we store as token streams: // // * Shorthand values (where we manually extract the token stream's string @@ -600,8 +595,6 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray& aKeyframes, MOZ_ASSERT(aStyleContext); MOZ_ASSERT(aElement); - StyleBackendType styleBackend = aElement->OwnerDoc()->GetStyleBackendType(); - const size_t len = aKeyframes.Length(); nsTArray result(len); @@ -610,12 +603,7 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray& aKeyframes, ComputedKeyframeValues* computedValues = result.AppendElement(); for (const PropertyValuePair& pair : PropertyPriorityIterator(frame.mPropertyValues)) { - MOZ_ASSERT(!pair.mServoDeclarationBlock || - styleBackend == StyleBackendType::Servo, - "Animation values were parsed using Servo backend but target" - " element is not using Servo backend?"); - - if (IsInvalidValuePair(pair, styleBackend)) { + if (IsInvalidValuePair(pair)) { continue; } @@ -623,33 +611,25 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray& aKeyframes, // a KeyframeValueEntry for each value. nsTArray values; - if (styleBackend == StyleBackendType::Servo) { + // For shorthands, we store the string as a token stream so we need to + // extract that first. + if (nsCSSProps::IsShorthand(pair.mProperty)) { + nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue(); if (!StyleAnimationValue::ComputeValues(pair.mProperty, - CSSEnabledState::eForAllContent, aStyleContext, - *pair.mServoDeclarationBlock, values)) { + CSSEnabledState::eForAllContent, aElement, aStyleContext, + tokenStream->mTokenStream, /* aUseSVGMode */ false, values) || + IsComputeValuesFailureKey(pair)) { continue; } } else { - // For shorthands, we store the string as a token stream so we need to - // extract that first. - if (nsCSSProps::IsShorthand(pair.mProperty)) { - nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue(); - if (!StyleAnimationValue::ComputeValues(pair.mProperty, - CSSEnabledState::eForAllContent, aElement, aStyleContext, - tokenStream->mTokenStream, /* aUseSVGMode */ false, values) || - IsComputeValuesFailureKey(pair)) { - continue; - } - } else { - if (!StyleAnimationValue::ComputeValues(pair.mProperty, - CSSEnabledState::eForAllContent, aElement, aStyleContext, - pair.mValue, /* aUseSVGMode */ false, values)) { - continue; - } - MOZ_ASSERT(values.Length() == 1, - "Longhand properties should produce a single" - " StyleAnimationValue"); + if (!StyleAnimationValue::ComputeValues(pair.mProperty, + CSSEnabledState::eForAllContent, aElement, aStyleContext, + pair.mValue, /* aUseSVGMode */ false, values)) { + continue; } + MOZ_ASSERT(values.Length() == 1, + "Longhand properties should produce a single" + " StyleAnimationValue"); } for (auto& value : values) { @@ -999,30 +979,6 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue, result.mProperty = aProperty; - if (aDocument->GetStyleBackendType() == StyleBackendType::Servo) { - nsCString name = nsCSSProps::GetStringValue(aProperty); - - NS_ConvertUTF16toUTF8 value(aStringValue); - RefPtr base = - new ThreadSafeURIHolder(aDocument->GetDocumentURI()); - RefPtr referrer = - new ThreadSafeURIHolder(aDocument->GetDocumentURI()); - RefPtr principal = - new ThreadSafePrincipalHolder(aDocument->NodePrincipal()); - - nsCString baseString; - aDocument->GetDocumentURI()->GetSpec(baseString); - - RefPtr servoDeclarationBlock = - Servo_ParseProperty(&name, &value, &baseString, - base, referrer, principal).Consume(); - - if (servoDeclarationBlock) { - result.mServoDeclarationBlock = servoDeclarationBlock.forget(); - return result; - } - } - nsCSSValue value; if (!nsCSSProps::IsShorthand(aProperty)) { aParser.ParseLonghandProperty(aProperty, @@ -1054,13 +1010,6 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue, "The shorthand property of a token stream should be initialized" " to unknown"); value.SetTokenStreamValue(tokenStream); - } else { - // If we succeeded in parsing with Gecko, but not Servo the animation is - // not going to work since, for the purposes of animation, we're going to - // ignore |mValue| when the backend is Servo. - NS_WARNING_ASSERTION(aDocument->GetStyleBackendType() != - StyleBackendType::Servo, - "Gecko succeeded in parsing where Servo failed"); } result.mValue = value; @@ -1412,8 +1361,6 @@ HasImplicitKeyframeValues(const nsTArray& aKeyframes, } }; - StyleBackendType styleBackend = aDocument->GetStyleBackendType(); - for (size_t i = 0, len = aKeyframes.Length(); i < len; i++) { const Keyframe& frame = aKeyframes[i]; @@ -1429,25 +1376,18 @@ HasImplicitKeyframeValues(const nsTArray& aKeyframes, : computedOffset; for (const PropertyValuePair& pair : frame.mPropertyValues) { - if (IsInvalidValuePair(pair, styleBackend)) { + if (IsInvalidValuePair(pair)) { continue; } if (nsCSSProps::IsShorthand(pair.mProperty)) { - if (styleBackend == StyleBackendType::Gecko) { - nsCSSValueTokenStream* tokenStream = - pair.mValue.GetTokenStreamValue(); - nsCSSParser parser(aDocument->CSSLoader()); - if (!parser.IsValueValidForProperty(pair.mProperty, - tokenStream->mTokenStream)) { - continue; - } + nsCSSValueTokenStream* tokenStream = + pair.mValue.GetTokenStreamValue(); + nsCSSParser parser(aDocument->CSSLoader()); + if (!parser.IsValueValidForProperty(pair.mProperty, + tokenStream->mTokenStream)) { + continue; } - // For the Servo backend, invalid shorthand values are represented by - // a null mServoDeclarationBlock member which we skip above in - // IsInvalidValuePair. - MOZ_ASSERT(styleBackend != StyleBackendType::Servo || - pair.mServoDeclarationBlock); CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES( prop, pair.mProperty, CSSEnabledState::eForAllContent) { addToPropertySets(*prop, offsetToUse); diff --git a/dom/base/ChildIterator.cpp b/dom/base/ChildIterator.cpp index 3d24da3176..3507d4740d 100644 --- a/dom/base/ChildIterator.cpp +++ b/dom/base/ChildIterator.cpp @@ -474,10 +474,7 @@ IsNativeAnonymousImplementationOfPseudoElement(nsIContent* aContent) // Unlike regular nodes, native anonymous content (NAC) gets created during // frame construction, which happens after the main style traversal. This // means that we have to manually resolve style for those nodes shortly after - // they're created, either by (a) invoking ResolvePseudoElementStyle (for PE - // NAC), or (b) handing the subtree off to Servo for a mini-traversal (for - // non-PE NAC). We have assertions in nsCSSFrameConstructor that we don't do - // both. + // they're created by invoking ResolvePseudoElementStyle (for PE NAC). // // Once that happens, the NAC has a frame. So if we have no frame here, // we're either not NAC, or in the process of doing (b). Either way, this diff --git a/dom/base/DOMMatrix.cpp b/dom/base/DOMMatrix.cpp index f0358125f8..56cf6f1b17 100644 --- a/dom/base/DOMMatrix.cpp +++ b/dom/base/DOMMatrix.cpp @@ -117,6 +117,17 @@ ValidateAndFixupMatrixInit(DOMMatrixInit& aMatrixInit, ErrorResult& aRv) #undef Check3DField } +void +DOMMatrixReadOnly::SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit) { + MOZ_ASSERT(Is2D()); + mMatrix2D->_11 = aMatrixInit.mM11.Value(); + mMatrix2D->_12 = aMatrixInit.mM12.Value(); + mMatrix2D->_21 = aMatrixInit.mM21.Value(); + mMatrix2D->_22 = aMatrixInit.mM22.Value(); + mMatrix2D->_31 = aMatrixInit.mM41.Value(); + mMatrix2D->_32 = aMatrixInit.mM42.Value(); +} + void DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit) { @@ -149,6 +160,34 @@ DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit) } } +already_AddRefed DOMMatrixReadOnly::FromMatrix( + nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit, + ErrorResult& aRv) { + DOMMatrix2DInit matrixInit(aMatrixInit); + if (!ValidateAndFixupMatrix2DInit(matrixInit, aRv)) { + return nullptr; + }; + + RefPtr matrix = + new DOMMatrixReadOnly(aParent, /* is2D */ true); + matrix->SetDataFromMatrix2DInit(matrixInit); + return matrix.forget(); +} + +already_AddRefed DOMMatrixReadOnly::FromMatrix( + nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv) { + DOMMatrixInit matrixInit(aMatrixInit); + if (!ValidateAndFixupMatrixInit(matrixInit, aRv)) { + return nullptr; + }; + + RefPtr rval = + new DOMMatrixReadOnly(aParent, matrixInit.mIs2D.Value()); + rval->SetDataFromMatrixInit(matrixInit); + return rval.forget(); + +} + already_AddRefed DOMMatrixReadOnly::FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv) { diff --git a/dom/base/DOMMatrix.h b/dom/base/DOMMatrix.h index 99e7714add..423580e2c4 100644 --- a/dom/base/DOMMatrix.h +++ b/dom/base/DOMMatrix.h @@ -26,6 +26,7 @@ class DOMPoint; class StringOrUnrestrictedDoubleSequence; struct DOMPointInit; struct DOMMatrixInit; +struct DOMMatrix2DInit; class DOMMatrixReadOnly : public nsWrapperCache { @@ -57,6 +58,12 @@ public: nsISupports* GetParentObject() const { return mParent; } virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; + static already_AddRefed + FromMatrix(nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit, ErrorResult& aRv); + + static already_AddRefed + FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv); + static already_AddRefed FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv); @@ -207,6 +214,12 @@ public: ErrorResult& aRv) const; void Stringify(nsAString& aResult); bool WriteStructuredClone(JSStructuredCloneWriter* aWriter) const; + const gfx::Matrix* GetInternal2D() const { + if (Is2D()) { + return mMatrix2D; + } + return nullptr; + } protected: nsCOMPtr mParent; @@ -220,6 +233,7 @@ protected: * where all of its members are properly defined. * The init dictionary's dimension must match the matrix one. */ + void SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit); void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit); DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv); diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index b299d3849e..7522128d46 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -56,7 +56,6 @@ #include "mozilla/AnimationComparator.h" #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/ContentEvents.h" -#include "mozilla/DeclarationBlockInlines.h" #include "mozilla/EffectSet.h" #include "mozilla/EventDispatcher.h" #include "mozilla/EventListenerManager.h" @@ -108,6 +107,7 @@ #include "nsViewManager.h" #include "nsIScrollableFrame.h" #include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */ +#include "mozilla/css/Declaration.h" #include "nsCSSRuleProcessor.h" #include "nsRuleProcessorData.h" #include "nsTextNode.h" @@ -1485,6 +1485,27 @@ Element::GetElementsByClassName(const nsAString& aClassNames, return NS_OK; } +CSSPseudoElementType +Element::GetPseudoElementType() const { + if (!HasProperties()) { + return CSSPseudoElementType::NotPseudo; + } + nsresult rv = NS_OK; + auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv); + if (rv == NS_PROPTABLE_PROP_NOT_THERE) { + return CSSPseudoElementType::NotPseudo; + } + return CSSPseudoElementType(reinterpret_cast(raw)); +} + +void +Element::SetPseudoElementType(CSSPseudoElementType aPseudo) { + static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t), + "Need to be able to store this in a void*"); + MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo); + SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast(aPseudo)); +} + /** * Returns the count of descendants (inclusive of aContent) in * the uncomposed document that are explicitly set as editable. @@ -1615,7 +1636,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent, // And clear the lazy frame construction bits. NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES); // And the restyle bits - UnsetRestyleFlagsIfGecko(); + UnsetRestyleFlags(); } else if (IsInShadowTree()) { // We're not in a document, but we did get inserted into a shadow tree. // Since we won't have any restyle data in the document's restyle trackers, @@ -1625,7 +1646,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent, // inserted into a document. UnsetFlags(NODE_FORCE_XBL_BINDINGS | NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES); - UnsetRestyleFlagsIfGecko(); + UnsetRestyleFlags(); } else { // If we're not in the doc and not in a shadow tree, // update our subtree pointer. @@ -1766,18 +1787,6 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent, } } - // It would be cleanest to mark nodes as dirty when (a) they're created and - // (b) they're unbound from a tree. However, we can't easily do (a) right now, - // because IsStyledByServo() is not always easy to check at node creation time, - // and the bits have different meaning in the non-IsStyledByServo case. - // - // So for now, we just mark nodes as dirty when they're inserted into a - // document or shadow tree. - if (IsStyledByServo() && IsInComposedDoc()) { - MOZ_ASSERT(!HasServoData()); - SetIsDirtyForServo(); - } - // XXXbz script execution during binding can trigger some of these // postcondition asserts.... But we do want that, since things will // generally be quite broken when that happens. @@ -1904,16 +1913,6 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent) ClearInDocument(); - // Computed styled data isn't useful for detached nodes, and we'll need to - // 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 // are in the uncomposed document. ResetEditableDescendantCount(); @@ -2025,7 +2024,7 @@ Element::GetSMILOverrideStyle() return slots->mSMILOverrideStyle; } -DeclarationBlock* +css::Declaration* Element::GetSMILOverrideStyleDeclaration() { Element::nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots(); @@ -2033,7 +2032,7 @@ Element::GetSMILOverrideStyleDeclaration() } nsresult -Element::SetSMILOverrideStyleDeclaration(DeclarationBlock* aDeclaration, +Element::SetSMILOverrideStyleDeclaration(css::Declaration* aDeclaration, bool aNotify) { Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots(); @@ -2073,14 +2072,14 @@ Element::IsInteractiveHTMLContent(bool aIgnoreTabindex) const return false; } -DeclarationBlock* +css::Declaration* Element::GetInlineStyleDeclaration() { return nullptr; } nsresult -Element::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration, +Element::SetInlineStyleDeclaration(css::Declaration* aDeclaration, const nsAString* aSerialized, bool aNotify) { diff --git a/dom/base/Element.h b/dom/base/Element.h index 7dae897e77..4d4c9284d3 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -57,7 +57,9 @@ class nsDocument; class nsDOMStringMap; namespace mozilla { -class DeclarationBlock; +namespace css { + class Declaration; +} // namespace css namespace dom { struct AnimationFilter; struct ScrollIntoViewOptions; @@ -79,27 +81,27 @@ NS_GetContentList(nsINode* aRootNode, // Element-specific flags enum { // Set if the element has a pending style change. - ELEMENT_HAS_PENDING_RESTYLE = NODE_SHARED_RESTYLE_BIT_1, + ELEMENT_HAS_PENDING_RESTYLE = ELEMENT_FLAG_BIT(0), // Set if the element is a potential restyle root (that is, has a style // change pending _and_ that style change will attempt to restyle // descendants). - ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = NODE_SHARED_RESTYLE_BIT_2, + ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1), // Set if the element has a pending animation-only style change as // part of an animation-only style update (where we update styles from // animation to the current refresh tick, but leave everything else as // it was). - ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(0), + ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(2), // Set if the element is a potential animation-only restyle root (that // is, has an animation-only style change pending _and_ that style // change will attempt to restyle descendants). - ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1), + ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(3), // Set if this element has a pending restyle with an eRestyle_SomeDescendants // restyle hint. - ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(2), + ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(4), // Just the HAS_PENDING bits, for convenience ELEMENT_PENDING_RESTYLE_FLAGS = @@ -117,10 +119,10 @@ enum { ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR, // Set if this element is marked as 'scrollgrab' (see bug 912666) - ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(3), + ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(5), // Remaining bits are for subclasses - ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 4 + ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 6 }; #undef ELEMENT_FLAG_BIT @@ -274,13 +276,13 @@ public: /** * Get the inline style declaration, if any, for this element. */ - virtual DeclarationBlock* GetInlineStyleDeclaration(); + virtual css::Declaration* GetInlineStyleDeclaration(); /** * Set the inline style declaration for this element. This will send * an appropriate AttributeChanged notification if aNotify is true. */ - virtual nsresult SetInlineStyleDeclaration(DeclarationBlock* aDeclaration, + virtual nsresult SetInlineStyleDeclaration(css::Declaration* aDeclaration, const nsAString* aSerialized, bool aNotify); @@ -288,7 +290,7 @@ public: * Get the SMIL override style declaration for this element. If the * rule hasn't been created, this method simply returns null. */ - virtual DeclarationBlock* GetSMILOverrideStyleDeclaration(); + virtual css::Declaration* GetSMILOverrideStyleDeclaration(); /** * Set the SMIL override style declaration for this element. If @@ -296,7 +298,7 @@ public: * context, so that the style changes will be noticed. */ virtual nsresult SetSMILOverrideStyleDeclaration( - DeclarationBlock* aDeclaration, bool aNotify); + css::Declaration* aDeclaration, bool aNotify); /** * Returns a new nsISMILAttr that allows the caller to animate the given @@ -814,24 +816,9 @@ public: already_AddRefed GetElementsByClassName(const nsAString& aClassNames); - CSSPseudoElementType GetPseudoElementType() const { - if (!HasProperties()) { - return CSSPseudoElementType::NotPseudo; - } - nsresult rv = NS_OK; - auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv); - if (rv == NS_PROPTABLE_PROP_NOT_THERE) { - return CSSPseudoElementType::NotPseudo; - } - return CSSPseudoElementType(reinterpret_cast(raw)); - } + CSSPseudoElementType GetPseudoElementType() const; - void SetPseudoElementType(CSSPseudoElementType aPseudo) { - static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t), - "Need to be able to store this in a void*"); - MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo); - SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast(aPseudo)); - } + void SetPseudoElementType(CSSPseudoElementType aPseudo); private: /** @@ -1662,9 +1649,9 @@ inline const mozilla::dom::Element* nsINode::AsElement() const return static_cast(this); } -inline void nsINode::UnsetRestyleFlagsIfGecko() +inline void nsINode::UnsetRestyleFlags() { - if (IsElement() && !IsStyledByServo()) { + if (IsElement()) { UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS); } } diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 354e92193b..1c2fc05b09 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -17,7 +17,6 @@ #include "mozilla/dom/FragmentOrElement.h" #include "mozilla/AsyncEventDispatcher.h" -#include "mozilla/DeclarationBlockInlines.h" #include "mozilla/EffectSet.h" #include "mozilla/EventDispatcher.h" #include "mozilla/EventListenerManager.h" @@ -99,6 +98,7 @@ #include "nsIScrollableFrame.h" #include "ChildIterator.h" #include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */ +#include "mozilla/css/Declaration.h" #include "nsRuleProcessorData.h" #include "nsTextNode.h" #include "mozilla/dom/NodeListBinding.h" @@ -2531,51 +2531,3 @@ FragmentOrElement::SetIsElementInStyleScopeFlagOnShadowTree(bool aInStyleScope) shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope); } } - -#ifdef DEBUG -static void -AssertDirtyDescendantsBitPropagated(nsINode* aNode) -{ - MOZ_ASSERT(aNode->HasDirtyDescendantsForServo()); - nsINode* parent = aNode->GetFlattenedTreeParentNode(); - if (!parent->IsContent()) { - MOZ_ASSERT(parent == aNode->OwnerDoc()); - MOZ_ASSERT(parent->HasDirtyDescendantsForServo()); - } else { - AssertDirtyDescendantsBitPropagated(parent); - } -} -#else -static void AssertDirtyDescendantsBitPropagated(nsINode* aNode) {} -#endif - -void -nsIContent::MarkAncestorsAsHavingDirtyDescendantsForServo() -{ - MOZ_ASSERT(IsInComposedDoc()); - - // Get the parent in the flattened tree. - nsINode* parent = GetFlattenedTreeParentNode(); - - // Loop until we hit a base case. - while (true) { - - // Base case: the document. - if (!parent->IsContent()) { - MOZ_ASSERT(parent == OwnerDoc()); - parent->SetHasDirtyDescendantsForServo(); - return; - } - - // Base case: the parent is already marked, and therefore - // so are all its ancestors. - if (parent->HasDirtyDescendantsForServo()) { - AssertDirtyDescendantsBitPropagated(parent); - return; - } - - // Mark the parent and iterate. - parent->SetHasDirtyDescendantsForServo(); - parent = parent->GetFlattenedTreeParentNode(); - } -} diff --git a/dom/base/FragmentOrElement.h b/dom/base/FragmentOrElement.h index 2f65fe5174..50c10536a9 100644 --- a/dom/base/FragmentOrElement.h +++ b/dom/base/FragmentOrElement.h @@ -35,7 +35,9 @@ class nsDOMStringMap; class nsIURI; namespace mozilla { -class DeclarationBlock; +namespace css { +class Declaration; +} namespace dom { struct CustomElementData; class DOMIntersectionObserver; @@ -265,7 +267,7 @@ public: /** * Holds any SMIL override style declaration for this element. */ - RefPtr mSMILOverrideStyleDeclaration; + RefPtr mSMILOverrideStyleDeclaration; /** * The nearest enclosing content node with a binding that created us. diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index abf6301123..2f24c2856f 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -109,9 +109,8 @@ ShadowRoot::CloneInternalDataFrom(ShadowRoot* aOther) for (size_t i = 0; i < sheetCount; ++i) { StyleSheet* sheet = aOther->SheetAt(i); if (sheet && sheet->IsApplicable()) { - // TODO: Remove AsGecko() call once Stylo is removed. RefPtr clonedSheet = - sheet->AsGecko()->Clone(nullptr, nullptr, nullptr, nullptr); + sheet->AsConcrete()->Clone(nullptr, nullptr, nullptr, nullptr); if (clonedSheet) { AppendStyleSheet(*clonedSheet); } diff --git a/dom/base/WindowNamedPropertiesHandler.cpp b/dom/base/WindowNamedPropertiesHandler.cpp index 97ea3f8daf..67da208278 100644 --- a/dom/base/WindowNamedPropertiesHandler.cpp +++ b/dom/base/WindowNamedPropertiesHandler.cpp @@ -43,9 +43,7 @@ ShouldExposeChildWindow(nsString& aNameBeingResolved, nsPIDOMWindowOuter* aChild // // This is problematic because it allows possibly-malicious and unrelated // cross-origin subframes to pollute the global namespace of their parent in - // unpredictable ways (see bug 860494). This is also problematic for browser - // engines like Servo that want to run cross-origin script on different - // threads. + // unpredictable ways (see bug 860494). // // The naive solution here would be to filter out any cross-origin subframes // obtained when doing named lookup in global scope. But that is unlikely to diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp index 711a695b78..9c4dcc9236 100644 --- a/dom/base/nsAttrValue.cpp +++ b/dom/base/nsAttrValue.cpp @@ -16,8 +16,7 @@ #include "nsIAtom.h" #include "nsUnicharUtils.h" #include "mozilla/MemoryReporting.h" -#include "mozilla/ServoBindingTypes.h" -#include "mozilla/DeclarationBlockInlines.h" +#include "mozilla/css/Declaration.h" #include "nsContentUtils.h" #include "nsReadableUtils.h" #include "prprf.h" @@ -150,7 +149,7 @@ nsAttrValue::nsAttrValue(nsIAtom* aValue) SetTo(aValue); } -nsAttrValue::nsAttrValue(already_AddRefed aValue, +nsAttrValue::nsAttrValue(already_AddRefed aValue, const nsAString* aSerialized) : mBits(0) { @@ -420,7 +419,7 @@ nsAttrValue::SetTo(double aValue, const nsAString* aSerialized) } void -nsAttrValue::SetTo(already_AddRefed aValue, +nsAttrValue::SetTo(already_AddRefed aValue, const nsAString* aSerialized) { MiscContainer* cont = EnsureEmptyMiscContainer(); @@ -643,7 +642,7 @@ nsAttrValue::ToString(nsAString& aResult) const { aResult.Truncate(); MiscContainer *container = GetMiscContainer(); - if (DeclarationBlock* decl = container->mValue.mCSSDeclaration) { + if (css::Declaration* decl = container->mValue.mCSSDeclaration) { decl->ToString(aResult); } const_cast(this)->SetMiscAtomOrString(&aResult); @@ -1748,15 +1747,11 @@ nsAttrValue::ParseStyleAttribute(const nsAString& aString, } } - RefPtr decl; - if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) { - decl = ServoDeclarationBlock::FromCssText(aString); - } else { - css::Loader* cssLoader = ownerDoc->CSSLoader(); - nsCSSParser cssParser(cssLoader); - decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI, - aElement->NodePrincipal()); - } + RefPtr decl; + css::Loader* cssLoader = ownerDoc->CSSLoader(); + nsCSSParser cssParser(cssLoader); + decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI, + aElement->NodePrincipal()); if (!decl) { return false; } @@ -1988,8 +1983,6 @@ nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const if (Type() == eCSSDeclaration && container->mValue.mCSSDeclaration) { // TODO: mCSSDeclaration might be owned by another object which // would make us count them twice, bug 677493. - // Bug 1281964: For ServoDeclarationBlock if we do measure we'll - // need a way to call the Servo heap_size_of function. //n += container->mCSSDeclaration->SizeOfIncludingThis(aMallocSizeOf); } else if (Type() == eAtomArray && container->mValue.mAtomArray) { // Don't measure each nsIAtom, they are measured separatly. diff --git a/dom/base/nsAttrValue.h b/dom/base/nsAttrValue.h index f2cb17aebf..831633afa2 100644 --- a/dom/base/nsAttrValue.h +++ b/dom/base/nsAttrValue.h @@ -36,8 +36,8 @@ class nsStyledElement; struct MiscContainer; namespace mozilla { -class DeclarationBlock; namespace css { +class Declaration; struct URLValue; struct ImageValue; } // namespace css @@ -122,7 +122,7 @@ public: nsAttrValue(const nsAttrValue& aOther); explicit nsAttrValue(const nsAString& aValue); explicit nsAttrValue(nsIAtom* aValue); - nsAttrValue(already_AddRefed aValue, + nsAttrValue(already_AddRefed aValue, const nsAString* aSerialized); explicit nsAttrValue(const nsIntMargin& aValue); ~nsAttrValue(); @@ -148,7 +148,7 @@ public: void SetTo(int16_t aInt); void SetTo(int32_t aInt, const nsAString* aSerialized); void SetTo(double aValue, const nsAString* aSerialized); - void SetTo(already_AddRefed aValue, + void SetTo(already_AddRefed aValue, const nsAString* aSerialized); void SetTo(mozilla::css::URLValue* aValue, const nsAString* aSerialized); void SetTo(const nsIntMargin& aValue); @@ -200,7 +200,7 @@ public: inline int16_t GetEnumValue() const; inline float GetPercentValue() const; inline AtomArray* GetAtomArrayValue() const; - inline mozilla::DeclarationBlock* GetCSSDeclarationValue() const; + inline mozilla::css::Declaration* GetCSSDeclarationValue() const; inline mozilla::css::URLValue* GetURLValue() const; inline mozilla::css::ImageValue* GetImageValue() const; inline double GetDoubleValue() const; diff --git a/dom/base/nsAttrValueInlines.h b/dom/base/nsAttrValueInlines.h index 382270f157..8909111137 100644 --- a/dom/base/nsAttrValueInlines.h +++ b/dom/base/nsAttrValueInlines.h @@ -30,7 +30,7 @@ struct MiscContainer final nscolor mColor; uint32_t mEnumValue; int32_t mPercent; - mozilla::DeclarationBlock* mCSSDeclaration; + mozilla::css::Declaration* mCSSDeclaration; mozilla::css::URLValue* mURL; mozilla::css::ImageValue* mImage; nsAttrValue::AtomArray* mAtomArray; @@ -145,7 +145,7 @@ nsAttrValue::GetAtomArrayValue() const return GetMiscContainer()->mValue.mAtomArray; } -inline mozilla::DeclarationBlock* +inline mozilla::css::Declaration* nsAttrValue::GetCSSDeclarationValue() const { NS_PRECONDITION(Type() == eCSSDeclaration, "wrong type"); diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index ab9f2419a1..5f1d3a30c0 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -245,8 +245,6 @@ #include "mozilla/dom/BoxObject.h" #include "gfxPrefs.h" #include "nsISupportsPrimitives.h" -#include "mozilla/StyleSetHandle.h" -#include "mozilla/StyleSetHandleInlines.h" #include "mozilla/StyleSheet.h" #include "mozilla/StyleSheetInlines.h" #include "mozilla/dom/SVGSVGElement.h" @@ -1152,12 +1150,7 @@ nsDOMStyleSheetSetList::EnsureFresh() for (size_t index = 0; index < count; index++) { StyleSheet* sheet = mDocument->SheetAt(index); NS_ASSERTION(sheet, "Null sheet in sheet list!"); - // XXXheycam ServoStyleSheets don't expose their title yet. - if (sheet->IsServo()) { - NS_ERROR("stylo: ServoStyleSets don't expose their title yet"); - continue; - } - sheet->AsGecko()->GetTitle(title); + sheet->AsConcrete()->GetTitle(title); if (!title.IsEmpty() && !mNames.Contains(title) && !Add(title)) { return; } @@ -2078,7 +2071,7 @@ nsDocument::RemoveDocStyleSheetsFromStyleSets() if (sheet->IsApplicable()) { nsCOMPtr shell = GetShell(); if (shell) { - shell->StyleSet()->RemoveDocStyleSheet(sheet); + shell->StyleSet()->RemoveDocStyleSheet(sheet->AsConcrete()); } } // XXX Tell observers? @@ -2097,7 +2090,7 @@ nsDocument::RemoveStyleSheetsFromStyleSets( if (sheet->IsApplicable()) { nsCOMPtr shell = GetShell(); if (shell) { - shell->StyleSet()->RemoveStyleSheet(aType, sheet); + shell->StyleSet()->RemoveStyleSheet(aType, sheet->AsConcrete()); } } // XXX Tell observers? @@ -2112,21 +2105,16 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI) mozAutoDocUpdate upd(this, UPDATE_STYLE, true); if (mStyleSetFilled) { // Skip removing style sheets from the style set if we know we haven't - // filled the style set. (This allows us to avoid calling - // GetStyleBackendType() too early.) + // filled the style set. RemoveDocStyleSheetsFromStyleSets(); RemoveStyleSheetsFromStyleSets(mOnDemandBuiltInUASheets, SheetType::Agent); RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eAgentSheet], SheetType::Agent); RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eUserSheet], SheetType::User); RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eAuthorSheet], SheetType::Doc); - if (GetStyleBackendType() == StyleBackendType::Gecko) { - nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance(); - if (sheetService) { - RemoveStyleSheetsFromStyleSets(*sheetService->AuthorStyleSheets(), SheetType::Doc); - } - } else { - NS_ERROR("stylo: nsStyleSheetService doesn't handle ServoStyleSheets yet"); + nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance(); + if (sheetService) { + RemoveStyleSheetsFromStyleSets(*sheetService->AuthorStyleSheets(), SheetType::Doc); } mStyleSetFilled = false; @@ -2168,18 +2156,18 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI) } static void -AppendSheetsToStyleSet(StyleSetHandle aStyleSet, +AppendSheetsToStyleSet(nsStyleSet* aStyleSet, const nsTArray>& aSheets, SheetType aType) { for (StyleSheet* sheet : Reversed(aSheets)) { - aStyleSet->AppendStyleSheet(aType, sheet); + aStyleSet->AppendStyleSheet(aType, sheet->AsConcrete()); } } void -nsDocument::FillStyleSet(StyleSetHandle aStyleSet) +nsDocument::FillStyleSet(nsStyleSet* aStyleSet) { NS_PRECONDITION(aStyleSet, "Must have a style set"); NS_PRECONDITION(aStyleSet->SheetCount(SheetType::Doc) == 0, @@ -2189,27 +2177,22 @@ nsDocument::FillStyleSet(StyleSetHandle aStyleSet) for (StyleSheet* sheet : Reversed(mStyleSheets)) { if (sheet->IsApplicable()) { - aStyleSet->AddDocStyleSheet(sheet, this); + aStyleSet->AddDocStyleSheet(sheet->AsConcrete(), this); } } - if (aStyleSet->IsGecko()) { - nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance(); - if (sheetService) { - for (StyleSheet* sheet : *sheetService->AuthorStyleSheets()) { - aStyleSet->AppendStyleSheet(SheetType::Doc, sheet); - } + nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance(); + if (sheetService) { + for (StyleSheet* sheet : *sheetService->AuthorStyleSheets()) { + aStyleSet->AppendStyleSheet(SheetType::Doc, sheet->AsConcrete()); } + } - // Iterate backwards to maintain order - for (StyleSheet* sheet : Reversed(mOnDemandBuiltInUASheets)) { - if (sheet->IsApplicable()) { - aStyleSet->PrependStyleSheet(SheetType::Agent, sheet); - } + // Iterate backwards to maintain order + for (StyleSheet* sheet : Reversed(mOnDemandBuiltInUASheets)) { + if (sheet->IsApplicable()) { + aStyleSet->PrependStyleSheet(SheetType::Agent, sheet->AsConcrete()); } - } else { - NS_WARNING("stylo: Not yet checking nsStyleSheetService for Servo-backed " - "documents. See bug 1290224"); } AppendSheetsToStyleSet(aStyleSet, mAdditionalSheets[eAgentSheet], @@ -2286,11 +2269,6 @@ nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject) do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global)); nsIDocument* doc = window ? window->GetExtantDoc() : nullptr; - if (doc && doc->IsStyledByServo()) { - NS_WARNING("stylo: Web Components not supported yet"); - return false; - } - return true; } @@ -3451,7 +3429,7 @@ nsDocument::TryChannelCharset(nsIChannel *aChannel, already_AddRefed nsDocument::CreateShell(nsPresContext* aContext, nsViewManager* aViewManager, - StyleSetHandle aStyleSet) + nsStyleSet* aStyleSet) { // Don't add anything here. Add it to |doCreateShell| instead. // This exists so that subclasses can pass other values for the 4th @@ -3461,7 +3439,7 @@ nsDocument::CreateShell(nsPresContext* aContext, nsViewManager* aViewManager, already_AddRefed nsDocument::doCreateShell(nsPresContext* aContext, - nsViewManager* aViewManager, StyleSetHandle aStyleSet) + nsViewManager* aViewManager, nsStyleSet* aStyleSet) { NS_ASSERTION(!mPresShell, "We have a presshell already!"); @@ -3829,7 +3807,7 @@ nsDocument::AddOnDemandBuiltInUASheet(StyleSheet* aSheet) // do not override Firefox OS/Mobile's content.css sheet. Maybe we should // have an insertion point to match the order of // nsDocumentViewer::CreateStyleSet though? - shell->StyleSet()->PrependStyleSheet(SheetType::Agent, aSheet); + shell->StyleSet()->PrependStyleSheet(SheetType::Agent, aSheet->AsConcrete()); } } @@ -3841,7 +3819,7 @@ nsDocument::AddStyleSheetToStyleSets(StyleSheet* aSheet) { nsCOMPtr shell = GetShell(); if (shell) { - shell->StyleSet()->AddDocStyleSheet(aSheet, this); + shell->StyleSet()->AddDocStyleSheet(aSheet->AsConcrete(), this); } } @@ -3850,11 +3828,7 @@ nsDocument::AddStyleSheetToStyleSets(StyleSheet* aSheet) className##Init init; \ init.mBubbles = true; \ init.mCancelable = true; \ - /* XXXheycam ServoStyleSheet doesn't implement DOM interfaces yet */ \ - if (aSheet->IsServo()) { \ - NS_ERROR("stylo: can't dispatch events for ServoStyleSheets yet"); \ - } \ - init.mStylesheet = aSheet->IsGecko() ? aSheet->AsGecko() : nullptr; \ + init.mStylesheet = aSheet->AsConcrete(); \ init.memberName = argName; \ \ RefPtr event = \ @@ -3912,7 +3886,7 @@ nsDocument::RemoveStyleSheetFromStyleSets(StyleSheet* aSheet) { nsCOMPtr shell = GetShell(); if (shell) { - shell->StyleSet()->RemoveDocStyleSheet(aSheet); + shell->StyleSet()->RemoveDocStyleSheet(aSheet->AsConcrete()); } } @@ -4083,7 +4057,7 @@ nsDocument::LoadAdditionalStyleSheet(additionalSheetType aType, return NS_ERROR_INVALID_ARG; // Loading the sheet sync. - RefPtr loader = new css::Loader(GetStyleBackendType()); + RefPtr loader = new css::Loader(); css::SheetParsingMode parsingMode; switch (aType) { @@ -4128,7 +4102,7 @@ nsDocument::AddAdditionalStyleSheet(additionalSheetType aType, StyleSheet* aShee nsCOMPtr shell = GetShell(); if (shell) { SheetType type = ConvertAdditionalSheetType(aType); - shell->StyleSet()->AppendStyleSheet(type, aSheet); + shell->StyleSet()->AppendStyleSheet(type, aSheet->AsConcrete()); } // Passing false, so documet.styleSheets.length will not be affected by @@ -4156,7 +4130,7 @@ nsDocument::RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheet nsCOMPtr shell = GetShell(); if (shell) { SheetType type = ConvertAdditionalSheetType(aType); - shell->StyleSet()->RemoveStyleSheet(type, sheetRef); + shell->StyleSet()->RemoveStyleSheet(type, sheetRef->AsConcrete()); } } @@ -5623,20 +5597,14 @@ nsIDocument::GetSelectedStyleSheetSet(nsAString& aSheetSet) StyleSheet* sheet = SheetAt(index); NS_ASSERTION(sheet, "Null sheet in sheet list!"); - // XXXheycam Make this work with ServoStyleSheets. - if (sheet->IsServo()) { - NS_ERROR("stylo: can't handle alternate ServoStyleSheets yet"); - continue; - } - bool disabled; - sheet->AsGecko()->GetDisabled(&disabled); + sheet->AsConcrete()->GetDisabled(&disabled); if (disabled) { // Disabled sheets don't affect the currently selected set continue; } - sheet->AsGecko()->GetTitle(title); + sheet->AsConcrete()->GetTitle(title); if (aSheetSet.IsEmpty()) { aSheetSet = title; @@ -5743,15 +5711,9 @@ nsDocument::EnableStyleSheetsForSetInternal(const nsAString& aSheetSet, StyleSheet* sheet = SheetAt(index); NS_ASSERTION(sheet, "Null sheet in sheet list!"); - // XXXheycam Make this work with ServoStyleSheets. - if (sheet->IsServo()) { - NS_ERROR("stylo: can't handle alternate ServoStyleSheets yet"); - continue; - } - - sheet->AsGecko()->GetTitle(title); + sheet->AsConcrete()->GetTitle(title); if (!title.IsEmpty()) { - sheet->AsGecko()->SetEnabled(title.Equals(aSheetSet)); + sheet->AsConcrete()->SetEnabled(title.Equals(aSheetSet)); } } if (aUpdateCSSLoader) { @@ -9471,17 +9433,12 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer) RefPtr sheet = SheetAt(i); if (sheet) { if (sheet->IsApplicable()) { - // XXXheycam Need to make ServoStyleSheet cloning work. - if (sheet->IsGecko()) { - RefPtr clonedSheet = - sheet->AsGecko()->Clone(nullptr, nullptr, clonedDoc, nullptr); - NS_WARNING_ASSERTION(clonedSheet, - "Cloning a stylesheet didn't work!"); - if (clonedSheet) { - clonedDoc->AddStyleSheet(clonedSheet); - } - } else { - NS_ERROR("stylo: ServoStyleSheet doesn't support cloning"); + RefPtr clonedSheet = + sheet->AsConcrete()->Clone(nullptr, nullptr, clonedDoc, nullptr); + NS_WARNING_ASSERTION(clonedSheet, + "Cloning a stylesheet didn't work!"); + if (clonedSheet) { + clonedDoc->AddStyleSheet(clonedSheet); } } } @@ -9491,17 +9448,12 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer) for (StyleSheet* sheet : Reversed(thisAsDoc->mOnDemandBuiltInUASheets)) { if (sheet) { if (sheet->IsApplicable()) { - // XXXheycam Need to make ServoStyleSheet cloning work. - if (sheet->IsGecko()) { - RefPtr clonedSheet = - sheet->AsGecko()->Clone(nullptr, nullptr, clonedDoc, nullptr); - NS_WARNING_ASSERTION(clonedSheet, - "Cloning a stylesheet didn't work!"); - if (clonedSheet) { - clonedDoc->AddOnDemandBuiltInUASheet(clonedSheet); - } - } else { - NS_ERROR("stylo: ServoStyleSheet doesn't support cloning"); + RefPtr clonedSheet = + sheet->AsConcrete()->Clone(nullptr, nullptr, clonedDoc, nullptr); + NS_WARNING_ASSERTION(clonedSheet, + "Cloning a stylesheet didn't work!"); + if (clonedSheet) { + clonedDoc->AddOnDemandBuiltInUASheet(clonedSheet); } } } @@ -12203,14 +12155,8 @@ nsIDocument::FlushUserFontSet() nsTArray rules; nsIPresShell* shell = GetShell(); if (shell) { - // XXXheycam ServoStyleSets don't support exposing @font-face rules yet. - if (shell->StyleSet()->IsGecko()) { - if (!shell->StyleSet()->AsGecko()->AppendFontFaceRules(rules)) { - return; - } - } else { - NS_WARNING("stylo: ServoStyleSets cannot handle @font-face rules yet. " - "See bug 1290237."); + if (!shell->StyleSet()->AppendFontFaceRules(rules)) { + return; } } @@ -12294,31 +12240,6 @@ nsIDocument::ReportHasScrollLinkedEffect() "ScrollLinkedEffectFound2"); } -void -nsIDocument::UpdateStyleBackendType() -{ - MOZ_ASSERT(mStyleBackendType == StyleBackendType(0), - "no need to call UpdateStyleBackendType now"); - - // 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* nsIDocument::GetSelection(ErrorResult& aRv) { diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index 923fb49ae9..22157500a0 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -43,7 +43,7 @@ #include "nsGkAtoms.h" #include "nsIApplicationCache.h" #include "nsIApplicationCacheContainer.h" -#include "mozilla/StyleSetHandle.h" +#include "nsStyleSet.h" #include "PLDHashTable.h" #include "nsAttrAndChildArray.h" #include "nsDOMAttributeMap.h" @@ -426,7 +426,7 @@ public: virtual already_AddRefed CreateShell( nsPresContext* aContext, nsViewManager* aViewManager, - mozilla::StyleSetHandle aStyleSet) override; + nsStyleSet* aStyleSet) override; virtual void DeleteShell() override; virtual nsresult GetAllowPlugins(bool* aAllowPlugins) override; @@ -1113,14 +1113,14 @@ public: protected: already_AddRefed doCreateShell(nsPresContext* aContext, nsViewManager* aViewManager, - mozilla::StyleSetHandle aStyleSet); + nsStyleSet* aStyleSet); void RemoveDocStyleSheetsFromStyleSets(); void RemoveStyleSheetsFromStyleSets( const nsTArray>& aSheets, mozilla::SheetType aType); void ResetStylesheetsToURI(nsIURI* aURI); - void FillStyleSet(mozilla::StyleSetHandle aStyleSet); + void FillStyleSet(nsStyleSet* aStyleSet); // Return whether all the presshells for this document are safe to flush bool IsSafeToFlush() const; diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp index 6aedebcc18..ebb135d88b 100644 --- a/dom/base/nsGenericDOMDataNode.cpp +++ b/dom/base/nsGenericDOMDataNode.cpp @@ -555,18 +555,6 @@ nsGenericDOMDataNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent, UpdateEditableState(false); - // It would be cleanest to mark nodes as dirty when (a) they're created and - // (b) they're unbound from a tree. However, we can't easily do (a) right now, - // because IsStyledByServo() is not always easy to check at node creation time, - // and the bits have different meaning in the non-IsStyledByServo case. - // - // So for now, we just mark nodes as dirty when they're inserted into a - // document or shadow tree. - if (IsStyledByServo() && IsInComposedDoc()) { - MOZ_ASSERT(!HasServoData()); - SetIsDirtyForServo(); - } - NS_POSTCONDITION(aDocument == GetUncomposedDoc(), "Bound to wrong document"); NS_POSTCONDITION(aParent == GetParent(), "Bound to wrong parent"); NS_POSTCONDITION(aBindingParent == GetBindingParent(), @@ -598,16 +586,6 @@ nsGenericDOMDataNode::UnbindFromTree(bool aDeep, bool aNullParent) } ClearInDocument(); - // Computed styled data isn't useful for detached nodes, and we'll need to - // 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()) { UnsetFlags(NODE_IS_IN_SHADOW_TREE); diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index 4d7d76e251..4e2f1e09fb 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -933,13 +933,6 @@ public: mozilla::dom::Element* GetEditingHost(); - /** - * Set NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO all the way up the flattened - * parent chain to the document. If an ancestor is found with the bit already - * set, this method asserts that all of its ancestors also have the bit set. - */ - void MarkAncestorsAsHavingDirtyDescendantsForServo(); - /** * Determining language. Look at the nearest ancestor element that has a lang * attribute in the XML namespace or is an HTML/SVG element and has a lang in diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 6ae4eb4f55..90c0668e2e 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -34,7 +34,6 @@ #include "mozilla/CORSMode.h" #include "mozilla/dom/DocumentOrShadowRoot.h" #include "mozilla/LinkedList.h" -#include "mozilla/StyleBackendType.h" #include "mozilla/StyleSheet.h" #include "mozilla/TimeStamp.h" #include // for member @@ -97,6 +96,7 @@ class nsWindowSizes; class nsDOMCaretPosition; class nsViewportInfo; class nsIGlobalObject; +class nsStyleSet; struct nsCSSSelectorList; namespace mozilla { @@ -104,7 +104,6 @@ class CSSStyleSheet; class ErrorResult; class EventStates; class PendingAnimationTracker; -class StyleSetHandle; class SVGAttrAnimationRuleProcessor; template class OwningNonNull; @@ -782,7 +781,7 @@ public: virtual already_AddRefed CreateShell( nsPresContext* aContext, nsViewManager* aViewManager, - mozilla::StyleSetHandle aStyleSet) = 0; + nsStyleSet* aStyleSet) = 0; virtual void DeleteShell() = 0; nsIPresShell* GetShell() const @@ -1148,20 +1147,6 @@ public: return mCSSLoader; } - mozilla::StyleBackendType GetStyleBackendType() const { - if (mStyleBackendType == mozilla::StyleBackendType(0)) { - const_cast(this)->UpdateStyleBackendType(); - } - MOZ_ASSERT(mStyleBackendType != mozilla::StyleBackendType(0)); - return mStyleBackendType; - } - - void UpdateStyleBackendType(); - - bool IsStyledByServo() const { - return GetStyleBackendType() == mozilla::StyleBackendType::Servo; - } - /** * Get this document's StyleImageLoader. This is guaranteed to not return null. */ @@ -2978,10 +2963,6 @@ protected: uint32_t mDummy; #endif - // Whether this document has (or will have, once we have a pres shell) a - // Gecko- or Servo-backed style system. - mozilla::StyleBackendType mStyleBackendType; - // True if BIDI is enabled. bool mBidiEnabled : 1; // True if a MathML element has ever been owned by this document. diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index d4129171cb..04e299daeb 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -19,7 +19,6 @@ #include "mozilla/InternalMutationEvent.h" #include "mozilla/Likely.h" #include "mozilla/MemoryReporting.h" -#include "mozilla/ServoBindings.h" #include "mozilla/TimeStamp.h" #include "mozilla/css/StyleRule.h" #include "mozilla/dom/Element.h" @@ -152,9 +151,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* @@ -1443,15 +1439,6 @@ nsINode::UnoptimizableCCNode() const AsElement()->IsInNamespace(kNameSpaceID_XBL)); } -void -nsINode::ClearServoData() { -#ifdef MOZ_STYLO - Servo_Node_ClearNodeData(this); -#else - MOZ_CRASH("Accessing servo node data in non-stylo build"); -#endif -} - /* static */ bool nsINode::Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb) @@ -3193,14 +3180,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..eeab6b1507 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -7,7 +7,6 @@ #define nsINode_h___ #include "mozilla/Likely.h" -#include "mozilla/ServoTypes.h" #include "mozilla/UniquePtr.h" #include "nsCOMPtr.h" // for member, local #include "nsGkAtoms.h" // for nsGkAtoms::baseURIProperty @@ -203,20 +202,8 @@ enum { NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS = NODE_FLAG_BIT(20), - // These two bits are shared by Gecko's and Servo's restyle systems for - // different purposes. They should not be accessed directly, and access to - // them should be properly guarded by asserts. - NODE_SHARED_RESTYLE_BIT_1 = NODE_FLAG_BIT(21), - NODE_SHARED_RESTYLE_BIT_2 = NODE_FLAG_BIT(22), - - // Whether this node is dirty for Servo's style system. - NODE_IS_DIRTY_FOR_SERVO = NODE_SHARED_RESTYLE_BIT_1, - - // Whether this node has dirty descendants for Servo's style system. - NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO = NODE_SHARED_RESTYLE_BIT_2, - // Remaining bits are node type specific. - NODE_TYPE_SPECIFIC_BITS_OFFSET = 23 + NODE_TYPE_SPECIFIC_BITS_OFFSET = 21 }; // Make sure we have space for our bits @@ -1018,59 +1005,7 @@ public: virtual nsPIDOMWindowOuter* GetOwnerGlobalForBindings() override; virtual nsIGlobalObject* GetOwnerGlobal() const override; - /** - * 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 - { - MOZ_ASSERT(IsStyledByServo()); - return HasFlag(NODE_IS_DIRTY_FOR_SERVO); - } - - bool HasDirtyDescendantsForServo() const - { - MOZ_ASSERT(IsStyledByServo()); - return HasFlag(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO); - } - - void SetIsDirtyForServo() { - MOZ_ASSERT(IsStyledByServo()); - SetFlags(NODE_IS_DIRTY_FOR_SERVO); - } - - void SetHasDirtyDescendantsForServo() { - MOZ_ASSERT(IsStyledByServo()); - SetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO); - } - - void SetIsDirtyAndHasDirtyDescendantsForServo() { - MOZ_ASSERT(IsStyledByServo()); - SetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO | NODE_IS_DIRTY_FOR_SERVO); - } - - void UnsetIsDirtyForServo() { - MOZ_ASSERT(IsStyledByServo()); - UnsetFlags(NODE_IS_DIRTY_FOR_SERVO); - } - - void UnsetHasDirtyDescendantsForServo() { - MOZ_ASSERT(IsStyledByServo()); - UnsetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO); - } - - void UnsetIsDirtyAndHasDirtyDescendantsForServo() { - MOZ_ASSERT(IsStyledByServo()); - UnsetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO | NODE_IS_DIRTY_FOR_SERVO); - } - - inline void UnsetRestyleFlagsIfGecko(); + inline void UnsetRestyleFlags(); /** * Adds a mutation observer to be notified when this node, or any of its @@ -2138,16 +2073,6 @@ public: #undef TOUCH_EVENT #undef EVENT - bool HasServoData() { -#ifdef MOZ_STYLO - return !!mServoData.Get(); -#else - MOZ_CRASH("Accessing servo node data in non-stylo build"); -#endif - } - - void ClearServoData(); - protected: static bool Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb); static void Unlink(nsINode *tmp); @@ -2185,11 +2110,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/dom/base/nsNameSpaceManager.h b/dom/base/nsNameSpaceManager.h index 8c7eb4d1dd..ecaaae4765 100644 --- a/dom/base/nsNameSpaceManager.h +++ b/dom/base/nsNameSpaceManager.h @@ -41,21 +41,6 @@ public: virtual nsresult GetNameSpaceURI(int32_t aNameSpaceID, nsAString& aURI); - // Returns the atom for the namespace URI associated with the given ID. The - // ID must be within range and not be kNameSpaceID_None (i.e. zero); - nsIAtom* NameSpaceURIAtom(int32_t aNameSpaceID) { - MOZ_ASSERT(aNameSpaceID > 0); - return NameSpaceURIAtomForServo(aNameSpaceID); - } - - // NB: This function should only be called by Servo code (and the above - // accessor), which uses the empty atom to represent kNameSpaceID_None. - nsIAtom* NameSpaceURIAtomForServo(int32_t aNameSpaceID) { - MOZ_ASSERT(aNameSpaceID >= 0); - MOZ_ASSERT((int64_t) aNameSpaceID < (int64_t) mURIArray.Length()); - return mURIArray.ElementAt(aNameSpaceID); - } - int32_t GetNameSpaceID(const nsAString& aURI, bool aInChromeDoc); int32_t GetNameSpaceID(nsIAtom* aURI, diff --git a/dom/base/nsStyleLinkElement.cpp b/dom/base/nsStyleLinkElement.cpp index cfc074ba28..7a0a563350 100644 --- a/dom/base/nsStyleLinkElement.cpp +++ b/dom/base/nsStyleLinkElement.cpp @@ -319,14 +319,9 @@ nsStyleLinkElement::DoUpdateStyleSheet(nsIDocument* aOldDocument, return NS_OK; } - // XXXheycam ServoStyleSheets do not support