Bug 656197 part 3. Remove UpdateState calls in BeforeSetAttr. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 16 Mar 2017 14:50:42 -0400
changeset 348179 8adbe06476ae83f1c87bb35b2c06ad413ffa82e0
parent 348178 2a15b3d3bf8e1494f9104c469bbca9ce2d0695fd
child 348180 2a0e59a450209b4c0ed7679961cd9b45648a5d3d
push id39092
push userkwierso@gmail.com
push dateFri, 17 Mar 2017 18:14:05 +0000
treeherderautoland@88576fd417e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs656197
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 656197 part 3. Remove UpdateState calls in BeforeSetAttr. r=smaug The UpdateState calls in BeforeSetAttr were there in case an AttributeWillChange observer examined the element state and expected it to be updated to whatever changes BeforeSetAttr made. But at this point, AttributeWillChange runs before BeforeSetAttr, and there is no code that runs between BeforeSetAttr and the subsequent UpdateState in SetAttrAndNotify/UnsetAttr that cares or could care about the state of the element. So it's safe to do no state updates in BeforeSetAttr and just do the single UpdateState we already do. MozReview-Commit-ID: BQOPVgHyC0H
dom/html/nsGenericHTMLElement.cpp
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1954,23 +1954,16 @@ nsGenericHTMLFormElement::BeforeSetAttr(
 
       GetAttr(kNameSpaceID_None, nsGkAtoms::id, tmp);
 
       if (!tmp.IsEmpty()) {
         mForm->RemoveElementFromTable(this, tmp);
       }
 
       mForm->RemoveElement(this, false);
-
-      // Removing the element from the form can make it not be the default
-      // control anymore.  Go ahead and notify on that change, though we might
-      // end up readding and becoming the default control again in
-      // AfterSetAttr.
-      // FIXME: Bug 656197
-      UpdateState(aNotify);
     }
 
     if (aName == nsGkAtoms::form) {
       // If @form isn't set or set to the empty string, there were no observer
       // so we don't have to remove it.
       if (nsContentUtils::HasNonEmptyAttr(this, kNameSpaceID_None,
                                           nsGkAtoms::form)) {
         // The current form id observer is no longer needed.