Bug 104218

Summary: [Shadow DOM] Implement HTMLShadowElement::olderShadowRoot
Product: WebKit Reporter: Hajime Morrita <morrita>
Component: DOMAssignee: Shinya Kawanaka <shinyak>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ojan.autocc, sgrekhov, shinyak, webcomponents-bugzilla, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 104346    
Bug Blocks: 63606    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Comment 1 Hajime Morrita 2012-12-06 01:46:57 PST
Created attachment 177972 [details]
Patch
Comment 2 Shinya Kawanaka 2012-12-06 18:06:39 PST
Comment on attachment 177972 [details]
Patch

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

> Source/WebCore/html/shadow/HTMLShadowElement.cpp:98
> +    TreeScope* scope = treeScope();

We have to check distribution is finished here.
Comment 3 Shinya Kawanaka 2012-12-06 20:27:46 PST
Created attachment 178145 [details]
Patch
Comment 4 Dimitri Glazkov (Google) 2012-12-06 20:55:55 PST
Comment on attachment 178145 [details]
Patch

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

> Source/WebCore/html/shadow/HTMLShadowElement.cpp:101
> +    document()->updateLayout();

Whoa. I am curious why have to do something so drastic here.
Comment 5 Shinya Kawanaka 2012-12-06 22:25:20 PST
(In reply to comment #4)
> (From update of attachment 178145 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=178145&action=review
> 
> > Source/WebCore/html/shadow/HTMLShadowElement.cpp:101
> > +    document()->updateLayout();
> 
> Whoa. I am curious why have to do something so drastic here.

When <shadow> is in a nested ShadowRoot, we have to ensure distribution of the parent TreeScope recursively...

Actually I've just followed HTMLContentElement::getDistributedNodes() though, because I know the above condition. assignedTo() might be calculated by a partial distribution, but I'm not sure yet.
Comment 6 Shinya Kawanaka 2012-12-06 22:37:22 PST
Ah, if <shadow> is not in document tree, distribution won't happen by this code...
I think getDistributedNodes() has the same bug. I'll confirm and fix it.
Comment 7 Shinya Kawanaka 2012-12-07 00:13:16 PST
Anyway, we have to fix https://bugs.webkit.org/show_bug.cgi?id=104346 first. This prevents us from fixing this issue.
Comment 8 Shinya Kawanaka 2012-12-11 21:29:58 PST
Created attachment 178959 [details]
Patch
Comment 9 Shinya Kawanaka 2012-12-11 21:30:46 PST
This patch can be applied after Bug 104346 is resolved.
Comment 10 Shinya Kawanaka 2012-12-11 23:30:20 PST
Created attachment 178977 [details]
Patch
Comment 11 WebKit Review Bot 2012-12-12 00:14:10 PST
Comment on attachment 178977 [details]
Patch

Clearing flags on attachment: 178977

Committed r137429: <http://trac.webkit.org/changeset/137429>
Comment 12 WebKit Review Bot 2012-12-12 00:14:14 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Shinya Kawanaka 2012-12-18 18:19:54 PST
*** Bug 105269 has been marked as a duplicate of this bug. ***