Bug 73189 - [Chromium] Assertion fails when opening two popup menus
Summary: [Chromium] Assertion fails when opening two popup menus
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jing Zhao
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-27 23:15 PST by Jing Zhao
Modified: 2011-12-02 14:22 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.18 KB, patch)
2011-11-27 23:20 PST, Jing Zhao
no flags Details | Formatted Diff | Diff
Patch (11.68 KB, patch)
2011-11-28 19:51 PST, Jing Zhao
no flags Details | Formatted Diff | Diff
Patch (5.52 KB, patch)
2011-11-28 21:52 PST, Jing Zhao
no flags Details | Formatted Diff | Diff
Patch (5.01 KB, patch)
2011-11-28 23:16 PST, Jing Zhao
no flags Details | Formatted Diff | Diff
Patch (4.96 KB, patch)
2011-11-28 23:31 PST, Jing Zhao
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jing Zhao 2011-11-27 23:15:18 PST
The assertion in WebViewImpl::popupOpened() fails when opening two popup menus.

See the test in the patch.
Comment 1 Jing Zhao 2011-11-27 23:20:45 PST
Created attachment 116703 [details]
Patch
Comment 2 Kent Tamura 2011-11-27 23:45:38 PST
Comment on attachment 116703 [details]
Patch

If a user clicks a point outside of opening popup-menu, platform-specific code should close the popup-menu and dispatch mouse events.
Comment 3 Alexey Proskuryakov 2011-11-28 10:41:25 PST
> If a user clicks a point outside of opening popup-menu, platform-specific code should close the popup-menu and dispatch mouse events.

It would be nice to an ASSERT for this, which should be easy to do by modifying this patch.
Comment 4 Jing Zhao 2011-11-28 19:51:35 PST
Created attachment 116875 [details]
Patch
Comment 5 Jing Zhao 2011-11-28 20:01:30 PST
To clarify, the assertion failure only happens when script simulates the clicks, but not by user generated clicks. The difference is that script can directly dispatch the mousedown event to the select element, but user generated clicks can't do that.

This happens on multiple platforms. We can open the test page to verify:

Chrome Mac: Tab crash
Chrome Windows: Two popups appear
Chrome Linux: Two popups appear
Safari 5.1 Mac: The second popup didn't appear.

When two popups appear, the assertion would fail.

With the last patch, the second popup won't appear in any platform.
Comment 6 Kent Tamura 2011-11-28 20:04:40 PST
Comment on attachment 116875 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116875&action=review

> Source/WebKit/chromium/ChangeLog:7
> +        Assertion fails when opening two popup menus
> +        https://bugs.webkit.org/show_bug.cgi?id=73189
> +
> +        Reviewed by NOBODY (OOPS!).
> +

You should mention the detail of the problem and how to fix it in ChangeLog.

> Source/WebKit/chromium/src/WebViewImpl.cpp:965
> +    if (popupContainer->popupType() == WebCore::PopupContainer::Select)

This 'if' needs {} because the content has two physical lines.

> LayoutTests/fast/forms/select-popup-crash.html:9
> +<script src="script-tests/listbox-selection-2.js"></script>

Please do not have a separated .js file.  select-popup-crash.js should be folded into select-popup-crash.html.
Comment 7 Kent Tamura 2011-11-28 20:15:36 PST
Comment on attachment 116875 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116875&action=review

> LayoutTests/fast/forms/script-tests/select-popup-crash.js:1
> +description('&lt;select> selection test for opening two popup menus.');

The test is very redundant. Dispatching two mousedown events on two <select>s is enough, right?
Comment 8 Jing Zhao 2011-11-28 21:52:18 PST
Created attachment 116889 [details]
Patch
Comment 9 Jing Zhao 2011-11-28 21:55:20 PST
All done. Please take another look.
Comment 10 Kent Tamura 2011-11-28 22:16:03 PST
Comment on attachment 116889 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116889&action=review

> LayoutTests/fast/forms/select-popup-crash.html:13
> +    parent.innerHTML = '<select id="sl1" size=5>'

This <select> doesn't open a popup menu.
Please confirm that this test crashes without your WebViewImpl.cpp change.
Comment 11 Jing Zhao 2011-11-28 22:36:58 PST
(In reply to comment #10)
> (From update of attachment 116889 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=116889&action=review
> 
> > LayoutTests/fast/forms/select-popup-crash.html:13
> > +    parent.innerHTML = '<select id="sl1" size=5>'
> 
> This <select> doesn't open a popup menu.
On what platform did you try it? I tested it in Chrome 17.0.942.0 dev on Linux and it opens two popup menus.

> Please confirm that this test crashes without your WebViewImpl.cpp change.
Yes I confirmed the crash (only in debug mode).
Comment 12 Kent Tamura 2011-11-28 22:44:40 PST
Comment on attachment 116889 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116889&action=review

>>> LayoutTests/fast/forms/select-popup-crash.html:13
>>> +    parent.innerHTML = '<select id="sl1" size=5>'
>> 
>> This <select> doesn't open a popup menu.
>> Please confirm that this test crashes without your WebViewImpl.cpp change.
> 
> On what platform did you try it? I tested it in Chrome 17.0.942.0 dev on Linux and it opens two popup menus.

Really? <select> with size >= 2 never show popup menus unless ENABLE_NO_LISTBOX_RENDERING is enabled.
Comment 13 Jing Zhao 2011-11-28 23:16:44 PST
Created attachment 116903 [details]
Patch
Comment 14 Kent Tamura 2011-11-28 23:21:22 PST
Comment on attachment 116903 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116903&action=review

> LayoutTests/fast/forms/select-popup-crash.html:42
> +    // Determine the item height.
> +    var sl1 = document.getElementById('sl1');
> +    var sl2 = document.getElementById('sl2');
> +

These lines are not needed.

> LayoutTests/fast/forms/select-popup-crash.html:54
> +    mouseDownOnSelect("sl2");
> +

We had better show a 'PASS' message; debug("PASS if the test didn't crash.");
Comment 15 Jing Zhao 2011-11-28 23:31:08 PST
Created attachment 116905 [details]
Patch
Comment 16 Kent Tamura 2011-11-28 23:36:55 PST
Comment on attachment 116905 [details]
Patch

ok
Comment 17 Jing Zhao 2011-11-28 23:48:45 PST
Kent, thank you for your review!
Comment 18 WebKit Review Bot 2011-11-29 00:13:17 PST
Comment on attachment 116905 [details]
Patch

Clearing flags on attachment: 116905

Committed r101337: <http://trac.webkit.org/changeset/101337>
Comment 19 WebKit Review Bot 2011-11-29 00:13:23 PST
All reviewed patches have been landed.  Closing bug.
Comment 20 Kent Tamura 2011-12-02 14:17:49 PST
Reverted r101337 for reason:

It's a wrong way to fix the problem

Committed r101852: <http://trac.webkit.org/changeset/101852>
Comment 21 Kent Tamura 2011-12-02 14:22:21 PST
We are discussing a correct fix in Bug 73304. This bug was obsoleted.