Fix link and style elements to handle onload events.

Move LinkElement/StyleElement::SetAttr to AfterSetAttr.
This resolves #595.
This commit is contained in:
Pale Moon
2016-10-13 21:26:13 +02:00
committed by roytam1
parent eb5be090a8
commit d8bcd56051
4 changed files with 68 additions and 61 deletions
+7 -8
View File
@@ -172,23 +172,22 @@ HTMLStyleElement::UnbindFromTree(bool aDeep, bool aNullParent)
}
nsresult
HTMLStyleElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
bool aNotify)
HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
const nsAttrValue* aValue, bool aNotify)
{
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
if (NS_SUCCEEDED(rv) && aNameSpaceID == kNameSpaceID_None) {
if (aNameSpaceID == kNameSpaceID_None) {
if (aName == nsGkAtoms::title ||
aName == nsGkAtoms::media ||
aName == nsGkAtoms::type) {
UpdateStyleSheetInternal(nullptr, nullptr, true);
} else if (aName == nsGkAtoms::scoped) {
UpdateStyleSheetScopedness(true);
bool isScoped = aValue;
UpdateStyleSheetScopedness(isScoped);
}
}
return rv;
return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
aNotify);
}
nsresult