Bug 145774

Summary: Mouse release on AutoFill button activates it; should only activate on click
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, jberlin, rniwa, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 145780    
Attachments:
Description Flags
Patch and layout test rniwa: review+

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>