WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
72440
Removing <ul>, <li> inside shadow DOM triggers assertion in updateListMarkerNumbers
https://bugs.webkit.org/show_bug.cgi?id=72440
Summary
Removing <ul>, <li> inside shadow DOM triggers assertion in updateListMarkerN...
Dominic Cooney
Reported
2011-11-15 16:23:10 PST
ASSERTION FAILED: listNode && listNode->renderer() /Volumes/HD2/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../rendering/RenderListItem.cpp(431) : void WebCore::RenderListItem::updateListMarkerNumbers()
Attachments
Repro layout test
(1.65 KB, text/plain)
2011-12-07 17:29 PST
,
Dominic Cooney
no flags
Details
Patch
(3.80 KB, patch)
2011-12-21 03:35 PST
,
Shinya Kawanaka
no flags
Details
Formatted Diff
Diff
Patch
(4.07 KB, patch)
2012-02-26 21:53 PST
,
Hajime Morrita
rniwa
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Hajime Morrita
Comment 1
2011-12-05 00:08:23 PST
Tree reforming pushing down this to 59802
Hajime Morrita
Comment 2
2011-12-05 03:34:01 PST
Hi Dominic, Could you provide any repro for this? I'm trying to reproduce this, but I have had none. Thanks in advance,
Dominic Cooney
Comment 3
2011-12-06 01:51:07 PST
I will work on a repro.
Dominic Cooney
Comment 4
2011-12-07 17:29:59 PST
Created
attachment 118291
[details]
Repro layout test
Shinya Kawanaka
Comment 5
2011-12-20 21:48:38 PST
I was investigating this. UL seems destroyed twice...?
Shinya Kawanaka
Comment 6
2011-12-21 02:36:15 PST
(In reply to
comment #5
)
> I was investigating this. > UL seems destroyed twice...?
RenderObjectChildList::destroyLeftoverChildren() destroys shadow objects, and it removes a renderer. The renderer of UL is deleted here, then LI is being deleted after that. I'm not sure setting renderer 0 in the function is necessary.
Shinya Kawanaka
Comment 7
2011-12-21 03:35:58 PST
Created
attachment 120166
[details]
Patch
Shinya Kawanaka
Comment 8
2011-12-21 03:36:39 PST
(In reply to
comment #7
)
> Created an attachment (id=120166) [details] > Patch
I'm not sure this is the right way, but this patch fixes the issue.
Ryosuke Niwa
Comment 9
2012-01-30 12:03:15 PST
Comment on
attachment 120166
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=120166&action=review
> Source/WebCore/rendering/RenderObjectChildList.cpp:62 > - if (firstChild()->node()) > - firstChild()->node()->setRenderer(0); > + Node* node = firstChild()->node(); > firstChild()->destroy(); > + if (node) > + node->setRenderer(0);
This doesn't look like a right fix.
Ryosuke Niwa
Comment 10
2012-01-30 12:04:05 PST
This is renderer related so should belong "Layout and Rendering".
Dimitri Glazkov (Google)
Comment 11
2012-02-08 09:22:39 PST
Comment on
attachment 120166
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=120166&action=review
> Source/WebCore/ChangeLog:9 > + This patch postpones removing renderers just after children are destroyed.
Can you explain a bit more as to why this is the right solution? Why does this behave differently in a shadow DOM subtree?
Shinya Kawanaka
Comment 12
2012-02-14 04:00:00 PST
(In reply to
comment #11
)
> (From update of
attachment 120166
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=120166&action=review
> > > Source/WebCore/ChangeLog:9 > > + This patch postpones removing renderers just after children are destroyed. > > Can you explain a bit more as to why this is the right solution? Why does this behave differently in a shadow DOM subtree?
Actually that code was written when I was a (very) newbie of rendering tree... Let me consider more right solution (or confirm this is the right solution) later.
Hajime Morrita
Comment 13
2012-02-26 21:53:53 PST
Created
attachment 128949
[details]
Patch
Hajime Morrita
Comment 14
2012-02-26 21:56:30 PST
Dimitri, could you take a look? It looks making code consistent just fixes the problem.
Ryosuke Niwa
Comment 15
2012-02-26 22:30:50 PST
Comment on
attachment 128949
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=128949&action=review
> Source/WebCore/dom/Element.cpp:971 > + for (Node* child = firstChild(); child; child = child->nextSibling()) { > + if (child->attached()) > + child->detach(); > + }
Can we call ContainerNode::detach() here instead?
Shinya Kawanaka
Comment 16
2012-02-26 23:25:50 PST
Comment on
attachment 128949
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=128949&action=review
>> Source/WebCore/dom/Element.cpp:971 >> + } > > Can we call ContainerNode::detach() here instead?
I don't think so, because ContainerNode::detach() will call Node::detach(). Having ContainerNode::detachChildren() might be useful, because we have a lot of similar code.
> Source/WebCore/dom/Element.cpp:973 > + shadowRootList()->detach();
Now that shadowRootList() has been renamed to shadowTree().
Ryosuke Niwa
Comment 17
2012-02-26 23:33:46 PST
Comment on
attachment 128949
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=128949&action=review
Okay, I think I understand what's happening on my second look.
>>> Source/WebCore/dom/Element.cpp:971 >>> + } >> >> Can we call ContainerNode::detach() here instead? > > I don't think so, because ContainerNode::detach() will call Node::detach(). > Having ContainerNode::detachChildren() might be useful, because we have a lot of similar code.
Oh I see what you're saying. Yeah, adding ContainerNode::detachChildren seems like a valuable refactoring of its own. I wonder it should be inlined or not.
> LayoutTests/fast/dom/shadow/shadow-ul-li.html:8 > + return; // needs ShadowRoot
Can we output some message about needing shadowRoot? Presumably, we should be able to modify test to be able to run without DRT once shadow DOM API becomes available to DOM?
Hajime Morrita
Comment 18
2012-02-27 01:34:26 PST
(In reply to
comment #17
)
> > LayoutTests/fast/dom/shadow/shadow-ul-li.html:8 > > + return; // needs ShadowRoot > > Can we output some message about needing shadowRoot? Presumably, we should be able to modify test to be able to run without DRT once shadow DOM API becomes available to DOM?
Oops. This has been there when it was an attached repro. I'll remove it and add Skipped lines. (In reply to
comment #16
)
> (From update of
attachment 128949
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=128949&action=review
> > Source/WebCore/dom/Element.cpp:973 > > + shadowRootList()->detach(); > > Now that shadowRootList() has been renamed to shadowTree().
God catch! I'll followup shortly.
Julien Chaffraix
Comment 19
2012-02-27 07:38:02 PST
It looks like the change was landed in
http://trac.webkit.org/changeset/108980
. Because the ChangeLog contained the wrong bug number, the final patch ended up in
bug 79630
. Morrita, could you update the ChangeLog bug URL and close this bug if I haven't missed anything?
Hajime Morrita
Comment 20
2012-02-27 16:18:35 PST
Good catch! Fixed
http://trac.webkit.org/changeset/109037
. Thank you for pointing it out.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug