Source/WebCore/ChangeLog

 12012-02-26 MORITA Hajime <morrita@google.com>
 2
 3 Removing <ul>, <li> inside shadow DOM triggers assertion in updateListMarkerNumbers
 4 https://bugs.webkit.org/show_bug.cgi?id=72440
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This problem was caused by the inconsistent detach order of DOM tree where
 9 Element::detach() called ContainerNode::detach() before shadow tree is detached.
 10 This resulted the renderer of the element being destroyed even if its children,
 11 each of which came from an element in the shadow tree, are alive.
 12 In principle, child renderers should be destroyed before its parent.
 13
 14 This change aligns the detach order with the attach order. The shadow tree is
 15 now deatched before parent's ContainerNode::detach() is called.
 16
 17 Test: fast/dom/shadow/shadow-ul-li.html
 18
 19 * dom/Element.cpp:
 20 (WebCore::Element::detach):
 21
1222012-02-26 Adam Barth <abarth@webkit.org>
223
324 ContextDestructionObserver should live in its own file

Source/WebCore/dom/Element.cpp

@@void Element::detach()
964964 cancelFocusAppearanceUpdate();
965965 if (hasRareData())
966966 rareData()->resetComputedStyle();
967  ContainerNode::detach();
968  if (ShadowRootList* shadowRoots = shadowRootList())
969  shadowRoots->detach();
 967 if (hasShadowRoot()) {
 968 for (Node* child = firstChild(); child; child = child->nextSibling()) {
 969 if (child->attached())
 970 child->detach();
 971 }
 972
 973 shadowRootList()->detach();
 974 Node::detach();
 975 } else
 976 ContainerNode::detach();
970977
971978 RenderWidget::resumeWidgetHierarchyUpdates();
972979}

LayoutTests/ChangeLog

 12012-02-26 MORITA Hajime <morrita@google.com>
 2
 3 Removing <ul>, <li> inside shadow DOM triggers assertion in updateListMarkerNumbers
 4 https://bugs.webkit.org/show_bug.cgi?id=72440
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/dom/shadow/shadow-ul-li-expected.txt: Added.
 9 * fast/dom/shadow/shadow-ul-li.html: Added.
 10
1112012-02-26 Yoshifumi Inoue <yosin@chromium.org>
212
313 LayoutTests/fast/forms/number/input-number-events.html is failing since r108228

LayoutTests/fast/dom/shadow/shadow-ul-li-expected.txt

 1PASS unless crash.

LayoutTests/fast/dom/shadow/shadow-ul-li.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<script>
 5function test()
 6{
 7 if (!window.layoutTestController)
 8 return; // needs ShadowRoot
 9 layoutTestController.dumpAsText();
 10
 11 var host = document.createElement('div');
 12 document.body.appendChild(host);
 13 var shadow = internals.ensureShadowRoot(host);
 14
 15 var ul = document.createElement('ul');
 16 var li = document.createElement('li');
 17 ul.appendChild(li);
 18 shadow.appendChild(ul);
 19 document.body.offsetLeft;
 20
 21 document.body.innerHTML = 'PASS unless crash.';
 22}
 23</script>
 24</head>
 25<body onload="test()">
 26</body>
 27</html>