зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1577743 - Remove dead argument from nsStyledElement::ReparseStyleAttribute. r=heycam
And remove the NodeInfoChanged override that used to call it. This is dead since we removed the old style system. Was used to force a reparse on cross-style-back-end adoption. Differential Revision: https://phabricator.services.mozilla.com/D44134 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
65633fd59e
Коммит
6d31222f7c
|
@ -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<nsStyledElement*>(this)->ReparseStyleAttribute(false, false);
|
||||
static_cast<nsStyledElement*>(this)->ReparseStyleAttribute(
|
||||
/* aForceInDataDoc = */ false);
|
||||
}
|
||||
|
||||
// FIXME(emilio): Why is this needed? The element shouldn't even be styled in
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче