Bug 145774 - Mouse release on AutoFill button activates it; should only activate on click
Summary: Mouse release on AutoFill button activates it; should only activate on click
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks: 145780
  Show dependency treegraph
 
Reported: 2015-06-08 15:50 PDT by Daniel Bates
Modified: 2015-06-08 18:18 PDT (History)
4 users (show)

See Also:


Attachments
Patch and layout test (8.87 KB, patch)
2015-06-08 15:56 PDT, Daniel Bates
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2015-06-08 15:50:55 PDT
Releasing the mouse on the AutoFill button activates it regardless of whether the button was pressed. Moreover, we always dispatch a DOM click event at the node n where the cursor was released regardless of whether n was pressed so long as n is a shadow tree node.
Comment 1 Daniel Bates 2015-06-08 15:51:08 PDT
<rdar://problem/21069245>
Comment 2 Daniel Bates 2015-06-08 15:56:06 PDT
Created attachment 254517 [details]
Patch and layout test
Comment 3 Ryosuke Niwa 2015-06-08 16:32:18 PDT
Comment on attachment 254517 [details]
Patch and layout test

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

> Source/WebCore/page/EventHandler.cpp:2053
> +    Element* mouseReleaseShadowHost = mouseReleaseNode->shadowHost();
> +    if (mouseReleaseShadowHost && mouseReleaseShadowHost == mousePressNode->shadowHost()) {
> +        // We want to dispatch the click to the shadow tree host element to give listeners the illusion that the
> +        // shadom tree is a single element. For example, we want to give the illusion that <input type="range">
> +        // is a single element even though it is a composition of multiple shadom tree elements.
> +        return mouseReleaseShadowHost;

We do use shadow DOM in summary element implementation so I think this needs to be changed to only do this for ShadowRoot::UserAgentShadowRoot
The check you just removed above was quite relevant.
Comment 4 Ryosuke Niwa 2015-06-08 17:09:35 PDT
(In reply to comment #3)
> Comment on attachment 254517 [details]
> Patch and layout test
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=254517&action=review
> 
> > Source/WebCore/page/EventHandler.cpp:2053
> > +    Element* mouseReleaseShadowHost = mouseReleaseNode->shadowHost();
> > +    if (mouseReleaseShadowHost && mouseReleaseShadowHost == mousePressNode->shadowHost()) {
> > +        // We want to dispatch the click to the shadow tree host element to give listeners the illusion that the
> > +        // shadom tree is a single element. For example, we want to give the illusion that <input type="range">
> > +        // is a single element even though it is a composition of multiple shadom tree elements.
> > +        return mouseReleaseShadowHost;
> 
> We do use shadow DOM in summary element implementation so I think this needs
> to be changed to only do this for ShadowRoot::UserAgentShadowRoot
> The check you just removed above was quite relevant.

On my second thought, this is irreleavnt.
Comment 5 Daniel Bates 2015-06-08 17:24:16 PDT
Committed r185341: <http://trac.webkit.org/changeset/185341>