Bug 113275

Summary: [shadow] styleForText should consider the case where parent node has no style
Product: WebKit Reporter: Takashi Sakamoto <tasak>
Component: CSSAssignee: Takashi Sakamoto <tasak>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, esprehn+autocc, macpherson, menard, ojan.autocc, webcomponents-bugzilla, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 59827    
Attachments:
Description Flags
repro.html
none
Patch
none
Patch none

Description Takashi Sakamoto 2013-03-25 22:23:05 PDT
Created attachment 195004 [details]
repro.html

If some text node is distributed to an insertion point but the parent of the insertion point
is out of composition, the text node's parent for rendering and styling might has no style.

For example, firstly create the following DOM tree:

   div1 --- shadow1 ---- shadow2
               |            |
               +---text     +---div2 ---- shadow3
                            |
                            |
                            |
                            |
                            |
                            +---shadow

Now insert [div3 -- shadow] under div2:


   div1 --- shadow1 ---- shadow2
               |            |
               +---text     +---div2 ---- shadow3
                            |     |
                            |     +-----div3
                            |             |
                            |             +----shadow
                            |
                            +---shadow

c.f. https://cluster-fuzz.appspot.com/testcase?key=163551153
Comment 1 Takashi Sakamoto 2013-03-25 22:24:18 PDT
div3 is a parent for rendering and styling of text and is out of composition.
So div3->renderStyle() would return 0.
Comment 2 Takashi Sakamoto 2013-03-25 22:51:44 PDT
Created attachment 195007 [details]
Patch
Comment 3 Build Bot 2013-03-26 04:16:59 PDT
Comment on attachment 195007 [details]
Patch

Attachment 195007 [details] did not pass win-ews (win):
Output: http://webkit-commit-queue.appspot.com/results/17184780
Comment 4 Hajime Morrita 2013-03-26 17:29:15 PDT
Comment on attachment 195007 [details]
Patch

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

> LayoutTests/fast/dom/shadow/text-node-distributed-crash.html:31
> +function runTest() {

You could use Hayato-san's createDOM() helper to make it readable without comments.
Comment 5 Takashi Sakamoto 2013-03-26 21:52:54 PDT
Created attachment 195220 [details]
Patch
Comment 6 Takashi Sakamoto 2013-03-26 21:53:23 PDT
Comment on attachment 195007 [details]
Patch

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

Thank you for reviewing.

>> LayoutTests/fast/dom/shadow/text-node-distributed-crash.html:31
>> +function runTest() {
> 
> You could use Hayato-san's createDOM() helper to make it readable without comments.

Sure. Done.
Comment 7 Hajime Morrita 2013-03-26 22:08:54 PDT
Comment on attachment 195220 [details]
Patch

Let's land after seeing a green win.
Comment 8 WebKit Review Bot 2013-03-26 23:42:07 PDT
Comment on attachment 195220 [details]
Patch

Clearing flags on attachment: 195220

Committed r146967: <http://trac.webkit.org/changeset/146967>
Comment 9 WebKit Review Bot 2013-03-26 23:42:11 PDT
All reviewed patches have been landed.  Closing bug.