Bug 63607 - Crash if ShadowRoot has a text node.
Summary: Crash if ShadowRoot has a text node.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hajime Morrita
URL:
Keywords:
Depends on:
Blocks: 63504
  Show dependency treegraph
 
Reported: 2011-06-28 22:11 PDT by Hajime Morrita
Modified: 2011-06-30 00:43 PDT (History)
2 users (show)

See Also:


Attachments
Patch (11.84 KB, patch)
2011-06-29 00:59 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff
patch for landing (11.85 KB, patch)
2011-06-29 23:47 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff
patch for landing (11.80 KB, patch)
2011-06-29 23:50 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 2011-06-28 22:11:07 PDT
Reproduction is coming.

Note that this happens only if you use internals testing API.
There is no shadow tree which has text node as its immediate child.
Comment 1 Hajime Morrita 2011-06-29 00:59:11 PDT
Created attachment 99052 [details]
Patch
Comment 2 Dimitri Glazkov (Google) 2011-06-29 07:23:36 PDT
Comment on attachment 99052 [details]
Patch

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

> Source/WebCore/dom/Element.cpp:1109
> +        RefPtr<RenderStyle> newStyle = styleForRenderer(NodeRenderingContext(this, 0));

Using NodeRenderingContext(this, 0) constructor as a way to avoid running initialization code in NodeRenderingContext(Node*) seems inelegant. It seems we are having an abstraction problem here. It's not obvious what (this, 0) means in the context of this call.
Comment 3 Dimitri Glazkov (Google) 2011-06-29 09:18:38 PDT
Comment on attachment 99052 [details]
Patch

It seems like styleForRenderer is begging to be devirtualized and folded into NodeRenderingContext ... or something...
Comment 4 Hajime Morrita 2011-06-29 22:12:27 PDT
(In reply to comment #2)
> (From update of attachment 99052 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=99052&action=review
> 
> > Source/WebCore/dom/Element.cpp:1109
> > +        RefPtr<RenderStyle> newStyle = styleForRenderer(NodeRenderingContext(this, 0));
> 
> Using NodeRenderingContext(this, 0) constructor as a way to avoid running initialization code in NodeRenderingContext(Node*) seems inelegant. It seems we are having an abstraction problem here. It's not obvious what (this, 0) means in the context of this call.
Well, I'll introduce tag-type for making it clear.

(In reply to comment #3)
> (From update of attachment 99052 [details])
> It seems like styleForRenderer is begging to be devirtualized and folded into NodeRenderingContext ... or something...
Yes. That's what I tried to do at first...
or it might be a part of CSSSelector because it knows the parent node.
Comment 5 WebKit Review Bot 2011-06-29 22:54:55 PDT
Comment on attachment 99052 [details]
Patch

Rejecting attachment 99052 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=ec2-cq-02', '--port..." exit_code: 2

Last 500 characters of output:
57086529701d950b16c617d4401733e5f55b8e22
r90088 = 03758942d934755c9c03bc963fb16a1d5258ea7d
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.
Updating chromium port dependencies using gclient...

________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
Updating webkit projects from gyp files...

Full output: http://queues.webkit.org/results/8966336
Comment 6 Hajime Morrita 2011-06-29 23:47:00 PDT
Created attachment 99243 [details]
patch for landing
Comment 7 Hajime Morrita 2011-06-29 23:50:14 PDT
Created attachment 99244 [details]
patch for landing
Comment 8 WebKit Review Bot 2011-06-30 00:43:53 PDT
Comment on attachment 99244 [details]
patch for landing

Clearing flags on attachment: 99244

Committed r90094: <http://trac.webkit.org/changeset/90094>
Comment 9 WebKit Review Bot 2011-06-30 00:43:57 PDT
All reviewed patches have been landed.  Closing bug.