Changeset 106336 in webkit


Ignore:
Timestamp:
Jan 30, 2012 10:36:02 PM (12 years ago)
Author:
hayato@chromium.org
Message:

Attach light children after removing a shadow root.
https://bugs.webkit.org/show_bug.cgi?id=74267

Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: fast/dom/shadow/dynamically-created-shadow-root-expected.html

fast/dom/shadow/dynamically-created-shadow-root.html:

  • dom/Element.cpp:

(WebCore::Element::removeShadowRoot):

LayoutTests:

  • fast/dom/shadow/dynamically-created-shadow-root-expected.html:
  • fast/dom/shadow/dynamically-created-shadow-root.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106332 r106336  
     12011-01-30  Hayato Ito  <hayato@chromium.org>
     2
     3        Attach light children after removing a shadow root.
     4        https://bugs.webkit.org/show_bug.cgi?id=74267
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/dom/shadow/dynamically-created-shadow-root-expected.html:
     9        * fast/dom/shadow/dynamically-created-shadow-root.html:
     10
    1112012-01-30  Raymond Liu  <raymond.liu@intel.com>
    212
  • trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root-expected.html

    r102423 r106336  
    66</div>
    77<div>Shadow should be rendered.</div>
     8<div>Light children should be rendered after a shadow root is removed.</div>
    89</body>
    910</html>
  • trunk/LayoutTests/fast/dom/shadow/dynamically-created-shadow-root.html

    r102423 r106336  
    55Can only run within DRT.
    66</div>
    7 <div id="host">Light children should not be rendered.</div>
     7<div id="host1">Light children should not be rendered.</div>
     8<div id="host2">Light children should be rendered after a shadow root is removed.</div>
    89<script>
    910if (window.internals) {
    10     var host = document.querySelector('#host');
    11     var shadowRoot = window.internals.ensureShadowRoot(host);
     11    var host1 = document.querySelector('#host1');
     12    var shadowRoot = window.internals.ensureShadowRoot(host1);
    1213    shadowRoot.appendChild(document.createTextNode('Shadow should be rendered.'));
     14
     15    var host2 = document.querySelector('#host2');
     16    var shadowRoot = window.internals.ensureShadowRoot(host2);
     17    shadowRoot.appendChild(document.createTextNode('Shadow should not be rendered.'));
     18    window.internals.removeShadowRoot(host2);
    1319}
    1420</script>
  • trunk/Source/WebCore/ChangeLog

    r106335 r106336  
     12011-01-30  Hayato Ito  <hayato@chromium.org>
     2
     3        Attach light children after removing a shadow root.
     4        https://bugs.webkit.org/show_bug.cgi?id=74267
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Tests: fast/dom/shadow/dynamically-created-shadow-root-expected.html
     9               fast/dom/shadow/dynamically-created-shadow-root.html:
     10
     11        * dom/Element.cpp:
     12        (WebCore::Element::removeShadowRoot):
     13
    1142012-01-30  Sheriff Bot  <webkit.review.bot@gmail.com>
    215
  • trunk/Source/WebCore/dom/Element.cpp

    r106323 r106336  
    12211221        else
    12221222            oldRoot->removedFromTree(true);
     1223        if (attached()) {
     1224            for (Node* child = firstChild(); child; child = child->nextSibling())
     1225                if (!child->attached())
     1226                    child->lazyAttach();
     1227        }
    12231228    }
    12241229}
Note: See TracChangeset for help on using the changeset viewer.