mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Bug 1363481 - Add the old attribute value as a parameter to Element::AfterSetAttr
Tag #1375
This commit is contained in:
parent
658bd351a0
commit
1f233fa14b
65 changed files with 352 additions and 161 deletions
|
|
@ -57,6 +57,7 @@ nsStyledElement::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
|||
SetMayHaveStyle();
|
||||
bool modification = false;
|
||||
nsAttrValue oldValue;
|
||||
bool oldValueSet = false;
|
||||
|
||||
bool hasListeners = aNotify &&
|
||||
nsContentUtils::HasMutationListeners(this,
|
||||
|
|
@ -76,6 +77,7 @@ nsStyledElement::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
|||
oldValueStr);
|
||||
if (modification) {
|
||||
oldValue.SetTo(oldValueStr);
|
||||
oldValueSet = true;
|
||||
}
|
||||
}
|
||||
else if (aNotify && IsInUncomposedDoc()) {
|
||||
|
|
@ -92,9 +94,9 @@ nsStyledElement::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
|||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nullptr,
|
||||
oldValue, attrValue, modType, hasListeners,
|
||||
aNotify, kDontCallAfterSetAttr, document,
|
||||
updateBatch);
|
||||
oldValueSet ? &oldValue : nullptr, attrValue, modType,
|
||||
hasListeners, aNotify, kDontCallAfterSetAttr,
|
||||
document, updateBatch);
|
||||
}
|
||||
|
||||
DeclarationBlock*
|
||||
|
|
@ -145,7 +147,9 @@ nsStyledElement::ReparseStyleAttribute(bool aForceInDataDoc)
|
|||
ParseStyleAttribute(stringValue, attrValue, aForceInDataDoc);
|
||||
// Don't bother going through SetInlineStyleDeclaration; we don't
|
||||
// want to fire off mutation events or document notifications anyway
|
||||
nsresult rv = mAttrsAndChildren.SetAndSwapAttr(nsGkAtoms::style, attrValue);
|
||||
bool oldValueSet;
|
||||
nsresult rv = mAttrsAndChildren.SetAndSwapAttr(nsGkAtoms::style, attrValue,
|
||||
&oldValueSet);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue