Bug 86999

Summary: When a text node is clicked, event's target should be adjusted by using composed shadow tree.
Product: WebKit Reporter: Hayato Ito <hayato>
Component: DOMAssignee: Hayato Ito <hayato>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, dominicc, morrita, shinyak, tasak, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 87072    
Bug Blocks: 59805    
Attachments:
Description Flags
use composed shadow tree none

Description Hayato Ito 2012-05-21 02:19:35 PDT
Suppose the following tree:

<div id='host'>
  - <shadow root>
      - <content>
  - <text node A> 


When <text node A> is clicked,  click event's target becomes #host. But that should be 'shadow root'. 
The reason is that the text node is distributed and the nearest parentNode of the text node is 'shadow root' in composed shadow DOM tree.
Comment 1 Hayato Ito 2012-05-23 00:27:54 PDT
Created attachment 143485 [details]
use composed shadow tree
Comment 2 Dimitri Glazkov (Google) 2012-05-23 09:00:52 PDT
Comment on attachment 143485 [details]
use composed shadow tree

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

> LayoutTests/fast/dom/shadow/shadow-dom-event-dispatching.html:193
> +function prepareDOMTree6(parent)

you really should consider naming these methods to describe the nature of the test.
Comment 3 Hayato Ito 2012-05-23 18:24:36 PDT
Thank you for the review.

(In reply to comment #2)
> (From update of attachment 143485 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143485&action=review
> 
> > LayoutTests/fast/dom/shadow/shadow-dom-event-dispatching.html:193
> > +function prepareDOMTree6(parent)
> 
> you really should consider naming these methods to describe the nature of the test.

Yeah, let me name these functions to good ones in another patch.
Comment 4 WebKit Review Bot 2012-05-23 18:47:08 PDT
Comment on attachment 143485 [details]
use composed shadow tree

Clearing flags on attachment: 143485

Committed r118299: <http://trac.webkit.org/changeset/118299>
Comment 5 WebKit Review Bot 2012-05-23 18:47:20 PDT
All reviewed patches have been landed.  Closing bug.