Changeset 53466 in webkit


Ignore:
Timestamp:
Jan 19, 2010 6:04:21 AM (14 years ago)
Author:
hamaji@chromium.org
Message:

2010-01-19 MORITA Hajime <morrita@gmail.com>

Reviewed by Shinichiro Hamaji.

[Chromium] layout_test on linux fails on doubleclick-beside-cr-span.html

Place larger margins before clicking position to grab certain words
instead of clicking blank, whitespaces or tabs before that words.
Note that widths of rendered tab characters are hard to predict,
So such margins are particularly helpful with them.

https://bugs.webkit.org/show_bug.cgi?id=33769

  • editing/selection/doubleclick-beside-cr-span.html: Fix to compute click position using actual character width.
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r53463 r53466  
     12010-01-19  MORITA Hajime  <morrita@gmail.com>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        [Chromium] layout_test on linux fails on doubleclick-beside-cr-span.html
     6       
     7        Place larger margins before clicking position to grab certain words
     8        instead of clicking blank, whitespaces or tabs before that words.
     9        Note that widths of rendered tab characters are hard to predict,
     10        So such margins are particularly helpful with them.
     11       
     12        https://bugs.webkit.org/show_bug.cgi?id=33769
     13
     14        * editing/selection/doubleclick-beside-cr-span.html:
     15          Fix to compute click position using actual character width.
     16
    1172010-01-19  Csaba Osztrogonác  <ossy@webkit.org>
    218
  • trunk/LayoutTests/editing/selection/doubleclick-beside-cr-span.html

    r52235 r53466  
    2323function doubleClickPosition(pos)
    2424{
    25     eventSender.mouseMoveTo(pos.x + 2, pos.y + 2);
     25    // Our test cases will have at most a single leading tab or four spaces,
     26    // followed by a word which is wider than 4 "X"s.
     27    // So, pos.x + CHAR_WIDTH * 4 always hits the words.
     28    eventSender.mouseMoveTo(pos.x + CHAR_WIDTH * 4, pos.y + LINE_HEIGHT / 2);
    2629    eventSender.mouseDown();
    2730    eventSender.leapForward(1);
     
    134137}
    135138
    136 function getPositionForward(spanId, ncharacters)
    137 {
    138    var pos = getPositionOfNode(spanId)
    139    pos.x += CHAR_WIDTH*ncharacters;
    140    return pos;
    141 }
    142 
    143139function runTests()
    144140{
     
    161157        doTest("totest_word_before_here_in_line", "select10 ");
    162158        doTest("totest_span_first_half", "select11 ");
    163         doTest("totest_span_second_half", "select12 ");
     159        doTest("totest_span_second_half", "selectHere12 ");
    164160
    165161        doTest("totest_linebreak_out_pre", "select1");
     
    168164        doTest("totest_linebreak_in_pre", "select4", getPositionOfNextLineHeadOf("totest_linebreak_in_pre"));
    169165        doTest("totest_tab_in_pre", "select5\t");
    170         doTest("totest_multiple_whitespaces_in_pre", "select6    ", getPositionForward("totest_multiple_whitespaces_in_pre", "    ".length));
     166        doTest("totest_multiple_whitespaces_in_pre", "select6    ");
    171167
    172168        doTest("totest_linebreak_out_prewrap", "select1");
     
    187183        doTest("totest_tab_out_nowrap", "select2\t");
    188184        doTest("totest_multiple_whitespaces_out_nowrap", "select3 ");
    189         doTest("totest_linebreak_in_nowrap", "select4\n", getPositionForward("totest_linebreak_in_nowrap", 1));
    190         doTest("totest_tab_in_nowrap", "select5\t", getPositionForward("totest_tab_in_nowrap", 1));
    191         doTest("totest_multiple_whitespaces_in_nowrap", "select6 ", getPositionForward("totest_multiple_whitespaces_in_nowrap", 1));
     185        doTest("totest_linebreak_in_nowrap", "select4\n");
     186        doTest("totest_tab_in_nowrap", "select5\t");
     187        doTest("totest_multiple_whitespaces_in_nowrap", "select6 ");
    192188
    193189    }
     
    286282<div class="case">
    287283<h3>a second half of word is inside b element</h3>
    288 <div style="width:100pt">
    289 abcd efgh ijkl mnop qrst sel<b id="totest_span_second_half">ect12</b> notyet
     284<!-- We choose selectHere12 instead select12 here
     285     because <b>ect12</b> would be too short to be clicked by doubleClickPosition(). -->
     286<div style="width:150pt">
     287abcd efgh ijkl mnop qrst uvwx yz123 sel<b id="totest_span_second_half">ectHere12</b> notyet
    290288</div>
    291289</div>
Note: See TracChangeset for help on using the changeset viewer.