diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 77f774ad12a3..9ddd4307904c 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1728,7 +1728,8 @@ nsresult Element::BindToTree(BindContext& aContext, nsINode& aParent) { // XXXbz if we already have a style attr parsed, this won't do // anything... need to fix that. // If MayHaveStyle() is true, we must be an nsStyledElement - static_cast(this)->ReparseStyleAttribute(false, false); + static_cast(this)->ReparseStyleAttribute( + /* aForceInDataDoc = */ false); } // FIXME(emilio): Why is this needed? The element shouldn't even be styled in diff --git a/dom/base/nsStyledElement.cpp b/dom/base/nsStyledElement.cpp index 5cacab266ed7..e385d894622f 100644 --- a/dom/base/nsStyledElement.cpp +++ b/dom/base/nsStyledElement.cpp @@ -133,7 +133,7 @@ nsICSSDeclaration* nsStyledElement::Style() { if (!slots->mStyle) { // Just in case... - ReparseStyleAttribute(true, false); + ReparseStyleAttribute(/* aForceInDataDoc */ true); slots->mStyle = new nsDOMCSSAttributeDeclaration(this, false); SetMayHaveStyle(); @@ -142,14 +142,12 @@ nsICSSDeclaration* nsStyledElement::Style() { return slots->mStyle; } -nsresult nsStyledElement::ReparseStyleAttribute(bool aForceInDataDoc, - bool aForceIfAlreadyParsed) { +nsresult nsStyledElement::ReparseStyleAttribute(bool aForceInDataDoc) { if (!MayHaveStyle()) { return NS_OK; } const nsAttrValue* oldVal = mAttrs.GetAttr(nsGkAtoms::style); - if (oldVal && (aForceIfAlreadyParsed || - oldVal->Type() != nsAttrValue::eCSSDeclaration)) { + if (oldVal && oldVal->Type() != nsAttrValue::eCSSDeclaration) { nsAttrValue attrValue; nsAutoString stringValue; oldVal->ToString(stringValue); @@ -165,10 +163,6 @@ nsresult nsStyledElement::ReparseStyleAttribute(bool aForceInDataDoc, return NS_OK; } -void nsStyledElement::NodeInfoChanged(Document* aOldDoc) { - nsStyledElementBase::NodeInfoChanged(aOldDoc); -} - nsICSSDeclaration* nsStyledElement::GetExistingStyle() { Element::nsDOMSlots* slots = GetExistingDOMSlots(); if (!slots) { diff --git a/dom/base/nsStyledElement.h b/dom/base/nsStyledElement.h index 43ebc141b5c7..5318dbd76508 100644 --- a/dom/base/nsStyledElement.h +++ b/dom/base/nsStyledElement.h @@ -82,13 +82,9 @@ class nsStyledElement : public nsStyledElementBase { * Create the style struct from the style attr. Used when an element is * first put into a document. Only has an effect if the old value is a * string. If aForceInDataDoc is true, will reparse even if we're in a data - * document. If aForceIfAlreadyParsed is set, this will always reparse even - * if the value has already been parsed. + * document. */ - nsresult ReparseStyleAttribute(bool aForceInDataDoc, - bool aForceIfAlreadyParsed); - - virtual void NodeInfoChanged(mozilla::dom::Document* aOldDoc) override; + nsresult ReparseStyleAttribute(bool aForceInDataDoc); virtual nsresult BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName, const nsAttrValueOrString* aValue,