Bug 1829189 - Make BeforeSetAttr infallible. r=smaug
rg BeforeSetAttr -l | xargs sed -i 's/nsresult BeforeSetAttr/void BeforeSetAttr/g' rg ::BeforeSetAttr -l | xargs sed -i 's/nsresult \(.*\)::BeforeSetAttr/void \1::BeforeSetAttr/g' Plus trivial fixes, plus clang-format. The only meaningful changes are in nsXULElement::BeforeSetAttr. Two things could fail: chromemargin: I removed it because we don't use the parsed attribute any other place than here: https://searchfox.org/mozilla-central/rev/31f5847a4494b3646edabbdd7ea39cb88509afe2/dom/xul/ChromeObserver.cpp#136 And that deals just fine with it not being parsed. usercontextid: We have a debug assertion that we don't dynamically change it. I kept it but I don't think it's worth failing to set the attribute on release for that Differential Revision: https://phabricator.services.mozilla.com/D176069
This commit is contained in:
@@ -295,9 +295,9 @@ nsMapRuleToAttributesFunc HTMLImageElement::GetAttributeMappingFunction()
|
||||
return &MapAttributesIntoRule;
|
||||
}
|
||||
|
||||
nsresult HTMLImageElement::BeforeSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
const nsAttrValueOrString* aValue,
|
||||
bool aNotify) {
|
||||
void HTMLImageElement::BeforeSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
const nsAttrValueOrString* aValue,
|
||||
bool aNotify) {
|
||||
if (aNameSpaceID == kNameSpaceID_None && mForm &&
|
||||
(aName == nsGkAtoms::name || aName == nsGkAtoms::id)) {
|
||||
// remove the image from the hashtable as needed
|
||||
|
||||
Reference in New Issue
Block a user