[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
sullivan at apple.com
sullivan at apple.com
Thu Apr 8 01:55:40 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit c9f9bb390c415ceca8879065cae3b99e87f8c550
Author: sullivan at apple.com <sullivan at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Feb 22 20:59:48 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=35256
HTMLSelectElement::setSelectedIndexByUser() can trigger unnecessary JS when there is no change to the selected index
Reviewed by Tim Hatcher.
No new tests because this code path is not used for JS-initiated changes.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setSelectedIndexByUser):
Bail out if the to-be-selected index matches the already-selected index.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9d3dcbf..443df4f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-22 John Sullivan <sullivan at apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35256
+ HTMLSelectElement::setSelectedIndexByUser() can trigger unnecessary JS when there is no change to the selected index
+
+ No new tests because this code path is not used for JS-initiated changes.
+
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::setSelectedIndexByUser):
+ Bail out if the to-be-selected index matches the already-selected index.
+
2010-02-22 Enrica Casucci <enrica at apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebCore/html/HTMLSelectElement.cpp b/WebCore/html/HTMLSelectElement.cpp
index 5f5c855..50639e9 100644
--- a/WebCore/html/HTMLSelectElement.cpp
+++ b/WebCore/html/HTMLSelectElement.cpp
@@ -87,6 +87,13 @@ void HTMLSelectElement::setSelectedIndex(int optionIndex, bool deselect)
void HTMLSelectElement::setSelectedIndexByUser(int optionIndex, bool deselect, bool fireOnChangeNow)
{
+ // Bail out if this index is already the selected one, to avoid running unnecessary JavaScript that can mess up
+ // autofill, when there is no actual change (see https://bugs.webkit.org/show_bug.cgi?id=35256 and rdar://7467917 ).
+ // Perhaps this logic could be moved into SelectElement, but some callers of SelectElement::setSelectedIndex()
+ // seem to expect it to fire its change event even when the index was already selected.
+ if (optionIndex == selectedIndex())
+ return;
+
SelectElement::setSelectedIndex(m_data, this, optionIndex, deselect, fireOnChangeNow, true);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list