Changeset 109309 in webkit


Ignore:
Timestamp:
Feb 29, 2012 9:57:05 PM (12 years ago)
Author:
shinyak@chromium.org
Message:

createContentWithSelect in shadow-test-driver.js is not intuitive.
https://bugs.webkit.org/show_bug.cgi?id=80002

Reviewed by Hajime Morita.

createContentWithSelect takes an agument 'fallback', but it used to create a text node
if the argument is missing. This is not intuitive at all.

This patch changes the createContentWithSelect behavior to make it intuitive.

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

(createContentWithSelect):

  • fast/dom/shadow/content-element-move.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109306 r109309  
     12012-02-29  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        createContentWithSelect in shadow-test-driver.js is not intuitive.
     4        https://bugs.webkit.org/show_bug.cgi?id=80002
     5
     6        Reviewed by Hajime Morita.
     7
     8        createContentWithSelect takes an agument 'fallback', but it used to create a text node
     9        if the argument is missing. This is not intuitive at all.
     10
     11        This patch changes the createContentWithSelect behavior to make it intuitive.
     12
     13        * fast/dom/resources/shadow-test-driver.js:
     14        (createContentWithSelect):
     15        * fast/dom/shadow/content-element-move.html:
     16
    1172012-02-29  Erik Arvidsson  <arv@chromium.org>
    218
  • trunk/LayoutTests/fast/dom/resources/shadow-test-driver.js

    r109096 r109309  
    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

    r106619 r109309  
    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);
Note: See TracChangeset for help on using the changeset viewer.