Bug 78596 - <shadow> should be rendered correctly
Summary: <shadow> should be rendered correctly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shinya Kawanaka
URL:
Keywords:
Depends on: 78771 78778 79901 79902 80373 80501
Blocks: 77503 79197
  Show dependency treegraph
 
Reported: 2012-02-14 03:09 PST by Shinya Kawanaka
Modified: 2012-03-08 03:25 PST (History)
10 users (show)

See Also:


Attachments
WIP (87.36 KB, patch)
2012-02-22 03:50 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
WIP (70.32 KB, patch)
2012-02-23 22:57 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (67.77 KB, patch)
2012-02-28 22:56 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
WIP (58.42 KB, patch)
2012-03-01 00:43 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
WIP (57.97 KB, patch)
2012-03-01 01:02 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (57.97 KB, patch)
2012-03-01 01:15 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
WIP (46.31 KB, patch)
2012-03-05 00:44 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (49.39 KB, patch)
2012-03-06 23:11 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (49.22 KB, patch)
2012-03-06 23:23 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (49.33 KB, patch)
2012-03-07 00:55 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (49.09 KB, patch)
2012-03-08 00:53 PST, Shinya Kawanaka
morrita: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2012-02-14 03:09:21 PST
<shadow> should render an older shadow subtree.
Comment 1 Shinya Kawanaka 2012-02-17 00:16:54 PST
This will be easily done if my InsertionPoint refactoring.
In that case, <shadow> should be derived from InsertionPoint.
Comment 2 Shinya Kawanaka 2012-02-22 03:50:40 PST
Created attachment 128173 [details]
WIP
Comment 3 Shinya Kawanaka 2012-02-23 22:57:03 PST
Created attachment 128657 [details]
WIP
Comment 4 WebKit Review Bot 2012-02-23 23:34:16 PST
Comment on attachment 128657 [details]
WIP

Attachment 128657 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11603713
Comment 5 Early Warning System Bot 2012-02-23 23:42:51 PST
Comment on attachment 128657 [details]
WIP

Attachment 128657 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11576739
Comment 6 Philippe Normand 2012-02-23 23:49:07 PST
Comment on attachment 128657 [details]
WIP

Attachment 128657 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11608723
Comment 7 WebKit Review Bot 2012-02-24 00:16:53 PST
Comment on attachment 128657 [details]
WIP

Attachment 128657 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11574752
Comment 8 Gyuyoung Kim 2012-02-24 00:40:31 PST
Comment on attachment 128657 [details]
WIP

Attachment 128657 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/11599720
Comment 9 Shinya Kawanaka 2012-02-28 22:56:17 PST
Created attachment 129394 [details]
Patch
Comment 10 Hajime Morrita 2012-02-28 23:14:01 PST
Comment on attachment 129394 [details]
Patch

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

> Source/WebCore/ChangeLog:19
> +

Please split this up to these three changes if possible.
This patch is simply to big.
You can use this bug as a metabug.

> Source/WebCore/html/shadow/HTMLShadowElement.h:56
> +    ShadowRoot* distributedShadowRoot;

Please follow the naming guideline.
Comment 11 Shinya Kawanaka 2012-02-29 01:12:28 PST
Let me try to split the patch.
Comment 12 Shinya Kawanaka 2012-03-01 00:43:57 PST
Created attachment 129654 [details]
WIP
Comment 13 Shinya Kawanaka 2012-03-01 01:02:54 PST
Created attachment 129658 [details]
WIP
Comment 14 Shinya Kawanaka 2012-03-01 01:15:51 PST
Created attachment 129661 [details]
Patch
Comment 15 Hajime Morrita 2012-03-01 01:25:46 PST
Comment on attachment 129661 [details]
Patch

- I don't think we need to hide HTMLShadowElement behind the flag it can be like as HTMLContentElement.
- Pelase split  firstRendererOf() and lastRendererOf() refactoring in separate patch.
   Having it in the same change makes it really hard to see  the actual change.
Comment 16 Dimitri Glazkov (Google) 2012-03-01 09:26:10 PST
(In reply to comment #15)
> (From update of attachment 129661 [details])
> - I don't think we need to hide HTMLShadowElement behind the flag it can be like as HTMLContentElement.

I think we do need this behind flag. Otherwise, there are visible effects of the Shadow DOM implementation even when the flag is enabled. See bug 79935 for details.

> - Pelase split  firstRendererOf() and lastRendererOf() refactoring in separate patch.
>    Having it in the same change makes it really hard to see  the actual change.
Comment 17 Hajime Morrita 2012-03-01 22:56:59 PST
(In reply to comment #16)
> (In reply to comment #15)
> > (From update of attachment 129661 [details] [details])
> > - I don't think we need to hide HTMLShadowElement behind the flag it can be like as HTMLContentElement.
> 
> I think we do need this behind flag. Otherwise, there are visible effects of the Shadow DOM implementation even when the flag is enabled. See bug 79935 for details.
> 
> > - Pelase split  firstRendererOf() and lastRendererOf() refactoring in separate patch.
> >    Having it in the same change makes it really hard to see  the actual change.

Let me clarify, I think:
- It's OK to have HTMLShadowElement.cpp/h files for  regardless of ENABLE(SHADOW_DOM).
- It's NOT ok to have HTMLShadowElement.idl compiled in unless we ENABLE(SHADOW_DOM).
- For tag name, I think we need to fix Bug 79935 WITHOUT hiding HTMLContentElement.h/cpp behind ENABLE(SHADOW_DOM).
   It should be hidden by runtime flag, not compilation flag. I guess we need parser support here. Let me investigate this.

If we can pull up most of the code from HTMLContentElement to InsertionPoint, and can implement built-in shadows 
using only InsertionPoint without using HTMLContentElement. That would be best.
Comment 18 Shinya Kawanaka 2012-03-05 00:44:41 PST
Created attachment 130067 [details]
WIP
Comment 19 Build Bot 2012-03-05 01:00:33 PST
Comment on attachment 130067 [details]
WIP

Attachment 130067 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/11803879
Comment 20 Build Bot 2012-03-05 01:02:17 PST
Comment on attachment 130067 [details]
WIP

Attachment 130067 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/11801839
Comment 21 Early Warning System Bot 2012-03-05 01:08:52 PST
Comment on attachment 130067 [details]
WIP

Attachment 130067 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11802866
Comment 22 WebKit Review Bot 2012-03-05 01:17:21 PST
Comment on attachment 130067 [details]
WIP

Attachment 130067 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11801847
Comment 23 Gyuyoung Kim 2012-03-05 01:34:21 PST
Comment on attachment 130067 [details]
WIP

Attachment 130067 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/11802879
Comment 24 Gustavo Noronha (kov) 2012-03-05 02:33:13 PST
Comment on attachment 130067 [details]
WIP

Attachment 130067 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11809291
Comment 25 Shinya Kawanaka 2012-03-06 23:11:54 PST
Created attachment 130550 [details]
Patch
Comment 26 Shinya Kawanaka 2012-03-06 23:23:14 PST
Created attachment 130553 [details]
Patch
Comment 27 Hajime Morrita 2012-03-06 23:58:36 PST
Comment on attachment 130553 [details]
Patch

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

> Source/WebCore/html/shadow/HTMLShadowElement.cpp:64
> +    if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode()))

Why not treeScope()? shadowTreeRootNode() traverses down the tree and better be avoided if possible.

> Source/WebCore/html/shadow/InsertionPoint.cpp:52
>      if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode())) {

Ditto.

> Source/WebCore/html/shadow/InsertionPoint.h:71
> +    ShadowRoot* shadowRootAssignedFrom;

I don't think we need this.

> Source/WebCore/html/shadow/InsertionPoint.h:76
>      if (!node || node->isContentElement())

It looks Node::isContentElement() is no longer need and can be morphed to isInsertionPoint().
It also even don't need to stay in Node. can be pulled down to HTMLElement.
Comment 28 Shinya Kawanaka 2012-03-07 00:46:27 PST
> > Source/WebCore/html/shadow/InsertionPoint.h:76
> >      if (!node || node->isContentElement())
> 
> It looks Node::isContentElement() is no longer need and can be morphed to isInsertionPoint().
> It also even don't need to stay in Node. can be pulled down to HTMLElement.

Let's do this in another bug?
I don't think it's good idea to merge this refactoring into this patch...
Comment 29 Shinya Kawanaka 2012-03-07 00:52:11 PST
(In reply to comment #28)
> > > Source/WebCore/html/shadow/InsertionPoint.h:76
> > >      if (!node || node->isContentElement())
> > 
> > It looks Node::isContentElement() is no longer need and can be morphed to isInsertionPoint().
> > It also even don't need to stay in Node. can be pulled down to HTMLElement.
> 
> Let's do this in another bug?
> I don't think it's good idea to merge this refactoring into this patch...

And I want to remove isShadowElement from Node.
Comment 30 Shinya Kawanaka 2012-03-07 00:55:53 PST
Created attachment 130561 [details]
Patch
Comment 31 Shinya Kawanaka 2012-03-08 00:53:15 PST
Created attachment 130791 [details]
Patch
Comment 32 Shinya Kawanaka 2012-03-08 00:55:16 PST
(In reply to comment #27)
> (From update of attachment 130553 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=130553&action=review
> 
> > Source/WebCore/html/shadow/HTMLShadowElement.cpp:64
> > +    if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode()))
> 
> Why not treeScope()? shadowTreeRootNode() traverses down the tree and better be avoided if possible.

Done.

> 
> > Source/WebCore/html/shadow/InsertionPoint.cpp:52
> >      if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode())) {
> 
> Ditto.

Done.

> 
> > Source/WebCore/html/shadow/InsertionPoint.h:71
> > +    ShadowRoot* shadowRootAssignedFrom;
> 
> I don't think we need this.

Done.

> 
> > Source/WebCore/html/shadow/InsertionPoint.h:76
> >      if (!node || node->isContentElement())
> 
> It looks Node::isContentElement() is no longer need and can be morphed to isInsertionPoint().
> It also even don't need to stay in Node. can be pulled down to HTMLElement.

Already fixed in another patch
Comment 33 Hajime Morrita 2012-03-08 02:02:31 PST
Comment on attachment 130791 [details]
Patch

Looks good. Let's land this once bots become green.
Comment 34 Shinya Kawanaka 2012-03-08 03:25:54 PST
Committed r110161: <http://trac.webkit.org/changeset/110161>