[webkit-reviews] review requested: [Bug 64504] Focus and selection events are not fired when a <select>'s selection changes : [Attachment 101150] Patch v3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 18 05:24:03 PDT 2011


Jon Honeycutt <jhoneycutt at apple.com> has asked	for review:
Bug 64504: Focus and selection events are not fired when a <select>'s selection
changes
https://bugs.webkit.org/show_bug.cgi?id=64504

Attachment 101150: Patch v3
https://bugs.webkit.org/attachment.cgi?id=101150&action=review

------- Additional Comments from Jon Honeycutt <jhoneycutt at apple.com>
This should fix the logic error that was causing the assertion failures on the
bots - the error being that an option index was used where a list index
should've been used. Also note that an incorrect > was replaced with a >=. Here
is the relevant diff:


--- a/Source/WebCore/rendering/RenderMenuList.cpp
+++ b/Source/WebCore/rendering/RenderMenuList.cpp
@@ -356,10 +356,11 @@ void RenderMenuList::didUpdateActiveOption(int
optionIndex)
     m_lastActiveIndex = optionIndex;

     SelectElement* select = toSelectElement(static_cast<Element*>(node()));
-    if (optionIndex < 0 || optionIndex >
static_cast<int>(select->listItems().size()))
+    int listIndex = select->optionToListIndex(optionIndex);
+    if (listIndex < 0 || listIndex >= select->listItems().size())
	 return;

-    ASSERT(toOptionElement(select->listItems()[optionIndex]));
+    ASSERT(toOptionElement(select->listItems()[listIndex]));

     if (AccessibilityMenuList* menuList =
static_cast<AccessibilityMenuList*>(document()->axObjectCache()->get(this)))
	 menuList->didUpdateActiveOption(optionIndex);


More information about the webkit-reviews mailing list