Changeset 109321 in webkit


Ignore:
Timestamp:
Feb 29, 2012 11:58:26 PM (12 years ago)
Author:
shinyak@chromium.org
Message:

Fallback elements in non-youngest shadow tree should not be rendered.
https://bugs.webkit.org/show_bug.cgi?id=80002

Reviewed by Hajime Morita.

Source/WebCore:

Fallback elements in non-youngest shadow tree should not be rendered, so its phase should be
AttachingNotDistributed instead of AttachingFallbacked.

Tests: multiple-shadowroot-rendering.html covers this patch.

  • dom/NodeRenderingContext.cpp:

(WebCore::NodeRenderingContext::NodeRenderingContext):

LayoutTests:

Since createContentWithSelect shadw-test-driver.js is not intuitive, fallback element
is not added in existing tests.
This change makes sure the existence of fallback elements.

  • fast/dom/resources/shadow-test-driver.js:

(createContentWithSelect):

  • fast/dom/shadow/content-element-move.html:
  • fast/dom/shadow/multiple-shadowroot-rendering.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109316 r109321  
     12012-02-29  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Fallback elements in non-youngest shadow tree should not be rendered.
     4        https://bugs.webkit.org/show_bug.cgi?id=80002
     5
     6        Reviewed by Hajime Morita.
     7
     8        Since createContentWithSelect shadw-test-driver.js is not intuitive, fallback element
     9        is not added in existing tests.
     10        This change makes sure the existence of fallback elements.
     11
     12        * fast/dom/resources/shadow-test-driver.js:
     13        (createContentWithSelect):
     14        * fast/dom/shadow/content-element-move.html:
     15        * fast/dom/shadow/multiple-shadowroot-rendering.html:
     16
    1172012-02-29  Kentaro Hara  <haraken@chromium.org>
    218
  • trunk/LayoutTests/fast/dom/resources/shadow-test-driver.js

    r109315 r109321  
    6262}
    6363
    64 function createContentWithSelect(select, fallback) {
     64function createContentWithSelect(select, fallbackText) {
    6565    var content = internals.createContentElement(document);
    6666    content.setAttribute('select', select);
    67     if (!fallback)
    68         content.appendChild(createSpanWithText("FALLBACK"));
     67    if (fallbackText)
     68        content.appendChild(createSpanWithText(fallbackText));
    6969
    7070    return content;
  • trunk/LayoutTests/fast/dom/shadow/content-element-move.html

    r109315 r109321  
    2323
    2424    // Create shadow tree.
    25     var content = createContentWithSelect('span');
     25    var content = createContentWithSelect('span', 'FALLBACK');
    2626    var sr = internals.ensureShadowRoot(root);
    2727    sr.appendChild(createSpanWithText("BEFORE"));
     
    4949
    5050    // Create shadow tree.
    51     var content1 = createContentWithSelect('.c1');
    52     var content2 = createContentWithSelect('span');
     51    var content1 = createContentWithSelect('.c1', 'FALLBACK');
     52    var content2 = createContentWithSelect('span', 'FALLBACK');
    5353    var sr = internals.ensureShadowRoot(root);
    5454    sr.appendChild(createSpanWithText("BEFORE"));
     
    7878
    7979    // Create shadow tree.
    80     var content1 = createContentWithSelect('.c1');
    81     var content2 = createContentWithSelect('span');
     80    var content1 = createContentWithSelect('.c1', 'FALLBACK');
     81    var content2 = createContentWithSelect('span', 'FALLBACK');
    8282    var sr = internals.ensureShadowRoot(root);
    8383    sr.appendChild(createSpanWithText("BEFORE"));
     
    134134
    135135    // Create shadow tree.
    136     var content = createContentWithSelect('span');
     136    var content = createContentWithSelect('span', 'FALLBACK');
    137137    var sr = internals.ensureShadowRoot(root);
    138138    sr.appendChild(createSpanWithText("BEFORE"));
     
    160160
    161161    // Create shadow tree.
    162     var content = createContentWithSelect('span');
     162    var content = createContentWithSelect('span', 'FALLBACK');
    163163    var sr = internals.ensureShadowRoot(root);
    164164    sr.appendChild(createSpanWithText("BEFORE"));
     
    187187
    188188    // Create shadow tree.
    189     var content = createContentWithSelect('.c1');
     189    var content = createContentWithSelect('.c1', 'FALLBACK');
    190190    var sr = internals.ensureShadowRoot(root);
    191191    sr.appendChild(createSpanWithText("BEFORE"));
     
    222222    var f = (function(root, callIfDone) {
    223223        return function() {
    224             var content = createContentWithSelect('span');
     224            var content = createContentWithSelect('span', 'FALLBACK');
    225225            var sr = internals.ensureShadowRoot(root);
    226226            sr.insertBefore(content, sr.lastChild);
     
    248248    var f = (function(root, callIfDone) {
    249249        return function() {
    250             var content1 = createContentWithSelect('.c2');
    251             var content2 = createContentWithSelect('span');
     250            var content1 = createContentWithSelect('.c2', 'FALLBACK');
     251            var content2 = createContentWithSelect('span', 'FALLBACK');
    252252            var sr = internals.ensureShadowRoot(root);
    253253            sr.insertBefore(content1, sr.lastChild);
     
    272272    sr.appendChild(createSpanWithText("BEFORE"));
    273273    sr.appendChild(mid);
    274     sr.appendChild(createContentWithSelect('.c2'));
     274    sr.appendChild(createContentWithSelect('.c2', 'FALLBACK'));
    275275    sr.appendChild(createSpanWithText("AFTER"));
    276276
     
    279279    var f = (function(root, mid, callIfDone) {
    280280        return function() {
    281             var content = createContentWithSelect('span');
     281            var content = createContentWithSelect('span', 'FALLBACK');
    282282            var sr = internals.ensureShadowRoot(root);
    283283            sr.insertBefore(content, mid);
     
    299299    // Create shadow tree.
    300300    var sr = internals.ensureShadowRoot(root);
    301     var content1 = createContentWithSelect('.c1');
    302     var content2 = createContentWithSelect('span');
     301    var content1 = createContentWithSelect('.c1', 'FALLBACK');
     302    var content2 = createContentWithSelect('span', 'FALLBACK');
    303303    sr.appendChild(createSpanWithText("BEFORE"));
    304304    sr.appendChild(content1);
     
    337337    // Create shadow tree in 'n1'
    338338    var sr = internals.ensureShadowRoot(n1);
    339     var content = createContentWithSelect('span');
     339    var content = createContentWithSelect('span', 'FALLBACK');
    340340    sr.appendChild(createSpanWithText("BEFORE"));
    341341    sr.appendChild(content);
  • trunk/LayoutTests/fast/dom/shadow/multiple-shadowroot-rendering.html

    r109096 r109321  
    125125    var sr1 = new WebKitShadowRoot(root);
    126126    sr1.appendChild(createSpanWithText('BEFORE: SHOULD NOT BE RENDERED'));
    127     sr1.appendChild(createContentWithSelect('span', 'FALLBACK'));
     127    sr1.appendChild(createContentWithSelect('span', 'FALLBACK 1'));
    128128    sr1.appendChild(createSpanWithText('AFTER: SHOULD NOT BE RENDERED'));
    129129
     
    133133        var sr2 = new WebKitShadowRoot(root);
    134134        sr2.appendChild(createSpanWithText('BEFORE'));
    135         sr2.appendChild(createContentWithSelect('span', 'FALLBACK'));
     135        sr2.appendChild(createContentWithSelect('span', 'FALLBACK 2'));
    136136        sr2.appendChild(createSpanWithText('AFTER'));
    137137
     
    149149    var sr1 = new WebKitShadowRoot(root);
    150150    sr1.appendChild(createSpanWithText('BEFORE: SHOULD NOT BE RENDERED'));
    151     sr1.appendChild(createContentWithSelect('span', 'FALLBACK'));
     151    sr1.appendChild(createContentWithSelect('span', 'FALLBACK 1'));
    152152    sr1.appendChild(createSpanWithText('AFTER: SHOULD NOT BE RENDERED'));
    153153
     
    155155        var sr2 = new WebKitShadowRoot(root);
    156156        sr2.appendChild(createSpanWithText('BEFORE'));
    157         sr2.appendChild(createContentWithSelect('span', 'FALLBACK'));
     157        sr2.appendChild(createContentWithSelect('span', 'FALLBACK 2'));
    158158        sr2.appendChild(createSpanWithText('AFTER'));
    159159
  • trunk/Source/WebCore/ChangeLog

    r109319 r109321  
     12012-02-29  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Fallback elements in non-youngest shadow tree should not be rendered.
     4        https://bugs.webkit.org/show_bug.cgi?id=80002
     5
     6        Reviewed by Hajime Morita.
     7
     8        Fallback elements in non-youngest shadow tree should not be rendered, so its phase should be
     9        AttachingNotDistributed instead of AttachingFallbacked.
     10
     11        Tests: multiple-shadowroot-rendering.html covers this patch.
     12
     13        * dom/NodeRenderingContext.cpp:
     14        (WebCore::NodeRenderingContext::NodeRenderingContext):
     15
    1162012-02-29  Adam Barth  <abarth@webkit.org>
    217
  • trunk/Source/WebCore/dom/NodeRenderingContext.cpp

    r109179 r109321  
    8989
    9090        if (isShadowBoundary(parent)) {
     91            // FIXME: We don't support <shadow> yet, so the non-youngest shadow won't be rendered.
     92            // https://bugs.webkit.org/show_bugs.cgi?id=78596
     93            if (!toShadowRoot(parent->shadowTreeRootNode())->isYoungest()) {
     94                m_phase = AttachingNotDistributed;
     95                m_parentNodeForRenderingAndStyle = parent;
     96                return;
     97            }
     98
    9199            if (toInsertionPoint(parent)->hasSelection())
    92100                m_phase = AttachingNotFallbacked;
Note: See TracChangeset for help on using the changeset viewer.