Changeset 64507 in webkit


Ignore:
Timestamp:
Aug 2, 2010 5:00:42 PM (14 years ago)
Author:
rniwa@webkit.org
Message:

2010-07-30 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Ojan Vafai.

Remove setNodeToDump from dump-as-markup.js
https://bugs.webkit.org/show_bug.cgi?id=43286

Removed Removed Markup.setNodeToDump, replaced all calls to this method by calls to dump.
Because we want need to avoid printing "Dump of markup 1:" when dump is called only once,
Markup.dump no longer adds the text on the first call. Instead, it'll insert the text
on the second call when the first call didn't have the description.

  • editing/execCommand/create-list-from-range-selection.html: Replaced setNodeToDump by dump
  • editing/execCommand/hilitecolor.html: Replaced setNodeToDump by dump
  • editing/execCommand/insert-list-empty-div.html: Replaced setNodeToDump by dump
  • editing/execCommand/switch-list-type-with-inner-list.html: Replaced setNodeToDump by dump
  • editing/execCommand/switch-list-type-with-orphaned-li.html: Replaced setNodeToDump by dump
  • editing/selection/home-inside-noneditable-table.html: Replaced setNodeToDump by dump
  • editing/style/remove-underline-from-stylesheet.html: Replaced setNodeToDump by dump
  • resources/dump-as-markup.js: Removed Markup.setNodeToDump. (Markup.dump): (Markup.notifyDone):
Location:
trunk/LayoutTests
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64506 r64507  
     12010-07-30  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        Remove setNodeToDump from dump-as-markup.js
     6        https://bugs.webkit.org/show_bug.cgi?id=43286
     7
     8        Removed Removed Markup.setNodeToDump, replaced all calls to this method by calls to dump.
     9        Because we want need to avoid printing "Dump of markup 1:" when dump is called only once,
     10        Markup.dump no longer adds the text on the first call. Instead, it'll insert the text
     11        on the second call when the first call didn't have the description.
     12
     13        * editing/execCommand/create-list-from-range-selection.html: Replaced setNodeToDump by dump
     14        * editing/execCommand/hilitecolor.html: Replaced setNodeToDump by dump
     15        * editing/execCommand/insert-list-empty-div.html: Replaced setNodeToDump by dump
     16        * editing/execCommand/switch-list-type-with-inner-list.html: Replaced setNodeToDump by dump
     17        * editing/execCommand/switch-list-type-with-orphaned-li.html: Replaced setNodeToDump by dump
     18        * editing/selection/home-inside-noneditable-table.html: Replaced setNodeToDump by dump
     19        * editing/style/remove-underline-from-stylesheet.html: Replaced setNodeToDump by dump
     20        * resources/dump-as-markup.js: Removed Markup.setNodeToDump.
     21        (Markup.dump):
     22        (Markup.notifyDone):
     23
    1242010-08-02  Martin Robinson  <mrobinson@igalia.com>
    225
  • trunk/LayoutTests/editing/execCommand/create-list-from-range-selection.html

    r63873 r64507  
    88s.setBaseAndExtent(start, 2, end, 2);
    99document.execCommand("InsertOrderedList", false, "");
    10 Markup.setNodeToDump("test");
     10Markup.dump("test");
    1111</script>
  • trunk/LayoutTests/editing/execCommand/hilitecolor.html

    r64013 r64507  
    1515sel.modify("move", "backward", "line");
    1616
    17 Markup.setNodeToDump('test')
     17Markup.dump('test')
    1818</script>
  • trunk/LayoutTests/editing/execCommand/insert-list-empty-div.html

    r63873 r64507  
    99
    1010document.execCommand("InsertUnorderedList");
    11 Markup.setNodeToDump("div");
     11Markup.dump("div");
    1212</script>
  • trunk/LayoutTests/editing/execCommand/switch-list-type-with-inner-list.html

    r64337 r64507  
    1212<script>
    1313Markup.description('This tests switching an unordered list with a nested list to an ordered list.');
    14 Markup.setNodeToDump('test');
    1514
    1615var test = document.getElementById('test');
    1716window.getSelection().selectAllChildren(test);
    1817document.execCommand('InsertOrderedList', false, null);
     18
     19Markup.dump('test');
    1920</script>
    2021</body>
  • trunk/LayoutTests/editing/execCommand/switch-list-type-with-orphaned-li.html

    r64337 r64507  
    1515<script>
    1616Markup.description('This tests switching multiple lists with an orphaned list child to an ordered list.');
    17 Markup.setNodeToDump('test');
    1817
    1918var test = document.getElementById('test');
    2019window.getSelection().selectAllChildren(test);
    2120document.execCommand('InsertOrderedList', false, null);
     21
     22Markup.dump('test');
    2223</script>
    2324</body>
  • trunk/LayoutTests/editing/selection/focus-contenteditable-iframe-expected.txt

    r64495 r64507  
    11This tests focusing the body element in a contentEditable iframe. The whole body contents should be selected. Focus should only place the cursor at the beginning of the body if there isn't an existing selection.
    2 
    3 Dump of markup 1:
    42| <html>
    53|   <head>
  • trunk/LayoutTests/editing/selection/home-inside-noneditable-table.html

    r63918 r64507  
    1313
    1414Markup.description("Tests whether home moves the caret to the beginning of line inside a content-editable in an uneditable table.")
    15 Markup.setNodeToDump('test');
    1615
    1716var s = window.getSelection();
    1817s.setPosition(document.getElementById('l1').firstChild, 23);
    19 Markup.dump();
     18Markup.dump('test');
    2019s.modify("move", "backward", "lineboundary");
    21 Markup.dump();
     20Markup.dump('test');
    2221
    2322</script>
  • trunk/LayoutTests/editing/style/remove-underline-from-stylesheet.html

    r64013 r64507  
    4040<script>
    4141Markup.description('This tests removing underline from stylesheet (.editing has underline). Because text-decoration that comes from a style rule cannot be pushed down, the underline should stay. (see bug 27809).');
    42 Markup.setNodeToDump('root');
    4342runEditingTest();
     43Markup.dump('root');
    4444</script>
    4545</body>
  • trunk/LayoutTests/resources/dump-as-markup.js

    r64303 r64507  
    3636        opt_node = document.getElementById(opt_node);
    3737
    38     var node = opt_node || Markup._node || document
     38    var node = opt_node || document
    3939    var markup = "";
    4040
    41     if (Markup._test_description && !Markup._dumpCalls)
    42         markup += Markup._test_description + '\n';
    43 
    4441    Markup._dumpCalls++;
    4542
    46     // If dump is not called by notifyDone, then print out optional description
    47     // because this test is manually calling dump.
    48     if (!Markup._done || opt_description) {
     43    if (Markup._dumpCalls > 1 || opt_description) {
    4944        if (!opt_description)
    5045            opt_description = "Dump of markup " + Markup._dumpCalls
     
    5247            markup += '\n';
    5348        markup += '\n' + opt_description + ':\n';
    54     }
     49    } else
     50        Markup._firstCallDidNotHaveDescription = true;
    5551
    5652    markup += Markup.get(node);
     
    5955        Markup._container = document.createElement('pre');
    6056        Markup._container.style.width = '100%';
     57    }
     58
     59    if (Markup._dumpCalls == 2 && Markup._firstCallDidNotHaveDescription) {
     60        var wrapper = Markup._container.getElementsByClassName('dump-as-markup-span')[0];
     61        wrapper.insertBefore(document.createTextNode('\nDump of markup 1:\n'), wrapper.firstChild);
    6162    }
    6263
     
    7374    }
    7475
    75     Markup._container.appendChild(document.createTextNode(markup));
     76    if (Markup._test_description && Markup._dumpCalls == 1)
     77        Markup._container.appendChild(document.createTextNode(Markup._test_description + '\n'))
     78
     79    var wrapper = document.createElement('span');
     80    wrapper.className = 'dump-as-markup-span';
     81    wrapper.appendChild(document.createTextNode(markup));
     82    Markup._container.appendChild(wrapper);
    7683}
    7784
     
    9097{
    9198    // Need to waitUntilDone or some tests won't finish appending the markup before the text is dumped.
    92     layoutTestController.waitUntilDone();
    93     Markup._done = true;
     99    if (window.layoutTestController)
     100        layoutTestController.waitUntilDone();
    94101
    95102    // If dump has already been called, don't bother to dump again
     
    107114    if (window.layoutTestController)
    108115        layoutTestController.notifyDone();
    109 }
    110 
    111 Markup.setNodeToDump = function(node)
    112 {
    113     if (typeof node == "string")
    114         node = document.getElementById(node);
    115     Markup._node = node
    116116}
    117117
Note: See TracChangeset for help on using the changeset viewer.