Bug 99815 - [Shadow] ASSERT triggered when we try reprojecting fallback elements
Summary: [Shadow] ASSERT triggered when we try reprojecting fallback elements
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:
Blocks: 99750
  Show dependency treegraph
 
Reported: 2012-10-18 23:31 PDT by Shinya Kawanaka
Modified: 2012-10-22 02:05 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.79 KB, patch)
2012-10-18 23:46 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (7.55 KB, patch)
2012-10-21 21:26 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (6.64 KB, patch)
2012-10-22 00:48 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch for landing (7.95 KB, patch)
2012-10-22 01:27 PDT, Shinya Kawanaka
no flags 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-10-18 23:31:12 PDT
Attaching fallback contents twice!
Comment 1 Shinya Kawanaka 2012-10-18 23:46:34 PDT
Created attachment 169561 [details]
Patch
Comment 2 Dimitri Glazkov (Google) 2012-10-19 09:21:50 PDT
Comment on attachment 169561 [details]
Patch

I see what you're doing here, but as Dominic would say, the solution looks a bit "skeezy" :)

1) Why is fallback content attached in the first place?
2) If it is, wouldn't it be more civil to detach and reattach it?
Comment 3 Shinya Kawanaka 2012-10-19 22:11:31 PDT
+morrita

We were attaching elements twice before, but it made NodeRenderingContext complex.
I and morrita removed such complexity before, so I'm afraid that I bring it again...
Comment 4 Hajime Morrita 2012-10-21 18:35:14 PDT
Comment on attachment 169561 [details]
Patch

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

> Source/WebCore/dom/Element.cpp:1013
> +        if (childrenMightBeAlreadyAttached()) {

Adding a virtual call here will hurt the speed. We need to figure out some better way.
Comment 5 Shinya Kawanaka 2012-10-21 21:26:15 PDT
Created attachment 169827 [details]
Patch
Comment 6 Hajime Morrita 2012-10-21 21:49:51 PDT
Comment on attachment 169827 [details]
Patch

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

Can you take some performance measurement? I think checking dom-modify and html5-full-render will be sufficient.

> Source/WebCore/dom/ContainerNode.h:166
> +    virtual bool childAttachedAllowedWhenAttachingChildren() { return false; }

This doesn't need to be polymorphic. We can just make it a standalone function. 
Then we can get rid of this #ifdef and just call it inside the ASSERT-ed expression.

> Source/WebCore/dom/ContainerNode.h:218
> +#ifndef NDEBUG

You don't need this. Asssertions are on only on debug build.
Comment 7 Shinya Kawanaka 2012-10-22 00:48:19 PDT
Created attachment 169840 [details]
Patch
Comment 8 Hajime Morrita 2012-10-22 01:07:18 PDT
Comment on attachment 169840 [details]
Patch

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

> Source/WebCore/ChangeLog:12
> +        We have confirmed that this patch does not regress the performance so much. The summary of the

Don't need "so much". This obviously has no perf impact. Be confident :-)

> Source/WebCore/dom/ContainerNode.h:NaN
>  inline void ContainerNode::attachChildren()

Do we have attachChildren() anywhere else? I believe we can replace attachChildren() with the "IfNeeed" version.
Comment 9 Shinya Kawanaka 2012-10-22 01:12:03 PDT
(In reply to comment #8)
> (From update of attachment 169840 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169840&action=review
> 
> > Source/WebCore/ChangeLog:12
> > +        We have confirmed that this patch does not regress the performance so much. The summary of the
> 
> Don't need "so much". This obviously has no perf impact. Be confident :-)
> 
> > Source/WebCore/dom/ContainerNode.h:NaN
> >  inline void ContainerNode::attachChildren()
> 
> Do we have attachChildren() anywhere else? I believe we can replace attachChildren() with the "IfNeeed" version.

I'll replace attachChildren() with the current version.

I'll also do a few refactoring after landing this.
Comment 10 Shinya Kawanaka 2012-10-22 01:27:38 PDT
Created attachment 169848 [details]
Patch for landing
Comment 11 WebKit Review Bot 2012-10-22 02:05:00 PDT
Comment on attachment 169848 [details]
Patch for landing

Clearing flags on attachment: 169848

Committed r132047: <http://trac.webkit.org/changeset/132047>
Comment 12 WebKit Review Bot 2012-10-22 02:05:04 PDT
All reviewed patches have been landed.  Closing bug.