Title: [97565] trunk/Source/WebCore
Revision
97565
Author
[email protected]
Date
2011-10-15 15:47:42 -0700 (Sat, 15 Oct 2011)

Log Message

REGRESSION(r97533): fast/forms/select-script-onchange.html failed after
https://bugs.webkit.org/show_bug.cgi?id=70173

Reviewed by Ryosuke Niwa.

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setValue): Removed unneeded boolean argument
[true for deselect].
(WebCore::HTMLSelectElement::menuListDefaultEventHandler): Added explicit
boolean arguments for all calls to setSelectedIndex to restore pre-r97533
behavior.
(WebCore::HTMLSelectElement::typeAheadFind): Ditto.
(WebCore::HTMLSelectElement::accessKeySetSelectedIndex): Ditto.

* html/HTMLSelectElement.h:
Removed default of true for userDrivenChange. Each caller should pass it
explicitly. Longer term we should use an enum instead of a boolean or find
some other way of avoiding the argument.
(WebCore::HTMLSelectElement::setSelectedIndex):
Pass false for userDrivenChange as the old code did pre-r97533.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97564 => 97565)


--- trunk/Source/WebCore/ChangeLog	2011-10-15 21:44:50 UTC (rev 97564)
+++ trunk/Source/WebCore/ChangeLog	2011-10-15 22:47:42 UTC (rev 97565)
@@ -1,3 +1,26 @@
+2011-10-15  Darin Adler  <[email protected]>
+
+        REGRESSION(r97533): fast/forms/select-script-onchange.html failed after
+        https://bugs.webkit.org/show_bug.cgi?id=70173
+
+        Reviewed by Ryosuke Niwa.
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::setValue): Removed unneeded boolean argument
+        [true for deselect].
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Added explicit
+        boolean arguments for all calls to setSelectedIndex to restore pre-r97533
+        behavior.
+        (WebCore::HTMLSelectElement::typeAheadFind): Ditto.
+        (WebCore::HTMLSelectElement::accessKeySetSelectedIndex): Ditto.
+
+        * html/HTMLSelectElement.h:
+        Removed default of true for userDrivenChange. Each caller should pass it
+        explicitly. Longer term we should use an enum instead of a boolean or find
+        some other way of avoiding the argument.
+        (WebCore::HTMLSelectElement::setSelectedIndex):
+        Pass false for userDrivenChange as the old code did pre-r97533.
+
 2011-10-15  Laszlo Gombos  <[email protected]>
 
         [Qt] [Symbian] Remove support for the Symbian platform for the QtWebKit port

Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (97564 => 97565)


--- trunk/Source/WebCore/html/HTMLSelectElement.cpp	2011-10-15 21:44:50 UTC (rev 97564)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp	2011-10-15 22:47:42 UTC (rev 97565)
@@ -233,7 +233,7 @@
     for (unsigned i = 0; i < items.size(); i++) {
         if (items[i]->hasLocalName(optionTag)) {
             if (static_cast<HTMLOptionElement*>(items[i])->value() == value) {
-                setSelectedIndex(optionIndex, true);
+                setSelectedIndex(optionIndex);
                 return;
             }
             optionIndex++;
@@ -1006,7 +1006,7 @@
             handled = false;
 
         if (handled && static_cast<size_t>(listIndex) < listItems.size())
-            setSelectedIndex(listToOptionIndex(listIndex));
+            setSelectedIndex(listToOptionIndex(listIndex), true, false, true);
 
         if (handled)
             event->setDefaultHandled();
@@ -1073,7 +1073,7 @@
         int listIndex = optionToListIndex(selectedIndex());
         if (keyCode == '\r') {
             // listIndex should already be selected, but this will fire the onchange handler.
-            setSelectedIndex(listToOptionIndex(listIndex), true, true);
+            setSelectedIndex(listToOptionIndex(listIndex), true, true, true);
             handled = true;
         }
 #endif
@@ -1385,7 +1385,7 @@
         // Fold the option string and check if its prefix is equal to the folded prefix.
         String text = optionElement->textIndentedToRespectGroupLabel();
         if (stripLeadingWhiteSpace(text).foldCase().startsWith(prefixWithCaseFolded)) {
-            setSelectedIndex(listToOptionIndex(index));
+            setSelectedIndex(listToOptionIndex(index), true, false, true);
             if (!usesMenuList())
                 listBoxOnChange();
 
@@ -1418,7 +1418,7 @@
         if (optionElement->selected())
             optionElement->setSelectedState(false);
         else
-            setSelectedIndex(index, false, true);
+            setSelectedIndex(index, false, true, true);
     }
 
     if (usesMenuList())

Modified: trunk/Source/WebCore/html/HTMLSelectElement.h (97564 => 97565)


--- trunk/Source/WebCore/html/HTMLSelectElement.h	2011-10-15 21:44:50 UTC (rev 97564)
+++ trunk/Source/WebCore/html/HTMLSelectElement.h	2011-10-15 22:47:42 UTC (rev 97565)
@@ -139,7 +139,7 @@
 
     bool hasPlaceholderLabelOption() const;
 
-    void setSelectedIndex(int optionIndex, bool deselect, bool fireOnChangeNow, bool userDrivenChange = true);
+    void setSelectedIndex(int optionIndex, bool deselect, bool fireOnChangeNow, bool userDrivenChange);
     void deselectItemsWithoutValidation(Element* excludeElement = 0);
     void parseMultipleAttribute(const Attribute*);
     int lastSelectedListIndex() const;
@@ -183,7 +183,7 @@
 
 inline void HTMLSelectElement::setSelectedIndex(int index, bool deselect)
 {
-    setSelectedIndex(index, deselect, false);
+    setSelectedIndex(index, deselect, false, false);
 }
 
 inline bool HTMLSelectElement::usesMenuList() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to