Changeset 15418 in webkit


Ignore:
Timestamp:
Jul 13, 2006 9:42:01 PM (18 years ago)
Author:
ddkilzer
Message:

LayoutTests:

Reviewed by Hyatt. Patch by Mitz.

  • editing/deleting/delete-to-select-table-expected.txt:
  • editing/execCommand/boldSelection-expected.txt:
  • editing/execCommand/italicizeByCharacter-expected.txt:
  • editing/execCommand/modifyForeColorByCharacter-expected.txt:
  • editing/execCommand/print-expected.txt:
  • editing/execCommand/selectAll-expected.txt:
  • editing/execCommand/strikethroughSelection-expected.txt:
  • editing/inserting/insert-div-027-expected.txt:
  • editing/selection/after-line-wrap-expected.txt:
  • editing/selection/mixed-editability-1-expected.txt:
  • editing/selection/select-all-001-expected.txt:
  • editing/selection/select-all-002-expected.txt:
  • editing/selection/select-all-003-expected.txt:
  • fast/clip/outline-overflowClip-expected.txt:
  • fast/text/international/rtl-white-space-pre-wrap-expected.checksum: Added.
  • fast/text/international/rtl-white-space-pre-wrap-expected.png: Added.
  • fast/text/international/rtl-white-space-pre-wrap-expected.txt: Added.
  • fast/text/international/rtl-white-space-pre-wrap.html: Added.
  • fast/text/whitespace/pre-wrap-overflow-selection-expected.txt:
  • fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt:

WebCore:

Reviewed by Hyatt. Patch by Mitz.

Test: fast/text/international/rtl-white-space-pre-wrap.html

  • rendering/RenderText.cpp: (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case of clipping the caret position to the text box when the caret is after the trailing space of an autowrapped line.
  • rendering/bidi.cpp: (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate- to-fit the logically last text box if it contains the trailing spaces of an autowrapped line. (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run. In the case of autowrapped text with white space that overflows beyond the line, the last text run is the one containing the overflowing white space. (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a line that autowraps only after white space into a separate text run.
Location:
trunk
Files:
4 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r15417 r15418  
     12006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
     2
     3        Reviewed by Hyatt.
     4
     5        - test and updated results for http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
     6          REGRESSION: RTL white-space:pre-wrap text is offset to the right
     7
     8        * editing/deleting/delete-to-select-table-expected.txt:
     9        * editing/execCommand/boldSelection-expected.txt:
     10        * editing/execCommand/italicizeByCharacter-expected.txt:
     11        * editing/execCommand/modifyForeColorByCharacter-expected.txt:
     12        * editing/execCommand/print-expected.txt:
     13        * editing/execCommand/selectAll-expected.txt:
     14        * editing/execCommand/strikethroughSelection-expected.txt:
     15        * editing/inserting/insert-div-027-expected.txt:
     16        * editing/selection/after-line-wrap-expected.txt:
     17        * editing/selection/mixed-editability-1-expected.txt:
     18        * editing/selection/select-all-001-expected.txt:
     19        * editing/selection/select-all-002-expected.txt:
     20        * editing/selection/select-all-003-expected.txt:
     21        * fast/clip/outline-overflowClip-expected.txt:
     22        * fast/text/international/rtl-white-space-pre-wrap-expected.checksum: Added.
     23        * fast/text/international/rtl-white-space-pre-wrap-expected.png: Added.
     24        * fast/text/international/rtl-white-space-pre-wrap-expected.txt: Added.
     25        * fast/text/international/rtl-white-space-pre-wrap.html: Added.
     26        * fast/text/whitespace/pre-wrap-overflow-selection-expected.txt:
     27        * fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt:
     28
    1292006-07-13  Mark Rowe  <opendarwin.org@bdash.net.nz>
    230
  • trunk/LayoutTests/editing/deleting/delete-to-select-table-expected.txt

    r15206 r15418  
    5050              RenderTableCell {TD} at (2,24) size 27x20 [r=1 c=0 rs=1 cs=1]
    5151                RenderText {#text} at (1,1) size 25x18
    52                   text run at (1,1) width 25: "bar      "
     52                  text run at (1,1) width 24: "bar "
     53                  text run at (25,1) width 1: "     "
    5354              RenderTableCell {TD} at (31,24) size 47x20 [r=1 c=1 rs=1 cs=1]
    5455                RenderText {#text} at (1,1) size 45x18
  • trunk/LayoutTests/editing/execCommand/boldSelection-expected.txt

    r14684 r15418  
    153153              text run at (0,84) width 197: "disagree with them, "
    154154              text run at (197,84) width 218: "glorify or vilify them, "
    155               text run at (415,84) width 341: "about the only thing you can't do is "
     155              text run at (415,84) width 340: "about the only thing you can't do is"
     156              text run at (755,84) width 1: " "
    156157              text run at (0,112) width 129: "ignore them. "
    157158              text run at (129,112) width 281: "Because they change things. "
    158               text run at (410,112) width 346: "They push the human race forward.  "
     159              text run at (410,112) width 344: "They push the human race forward."
     160              text run at (754,112) width 2: "  "
    159161              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
    160162              text run at (481,140) width 146: "we see genius. "
  • trunk/LayoutTests/editing/execCommand/italicizeByCharacter-expected.txt

    r14684 r15418  
    3333              text run at (0,84) width 197: "disagree with them, "
    3434              text run at (197,84) width 218: "glorify or vilify them, "
    35               text run at (415,84) width 341: "about the only thing you can't do is "
     35              text run at (415,84) width 340: "about the only thing you can't do is"
     36              text run at (755,84) width 1: " "
    3637              text run at (0,112) width 129: "ignore them. "
    3738              text run at (129,112) width 281: "Because they change things. "
    38               text run at (410,112) width 346: "They push the human race forward.  "
     39              text run at (410,112) width 344: "They push the human race forward."
     40              text run at (754,112) width 2: "  "
    3941              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
    4042              text run at (481,140) width 146: "we see genius. "
  • trunk/LayoutTests/editing/execCommand/modifyForeColorByCharacter-expected.txt

    r14684 r15418  
    3333              text run at (0,84) width 197: "disagree with them, "
    3434              text run at (197,84) width 218: "glorify or vilify them, "
    35               text run at (415,84) width 341: "about the only thing you can't do is "
     35              text run at (415,84) width 340: "about the only thing you can't do is"
     36              text run at (755,84) width 1: " "
    3637              text run at (0,112) width 129: "ignore them. "
    3738              text run at (129,112) width 281: "Because they change things. "
    38               text run at (410,112) width 346: "They push the human race forward.  "
     39              text run at (410,112) width 344: "They push the human race forward."
     40              text run at (754,112) width 2: "  "
    3941              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
    4042              text run at (481,140) width 146: "we see genius. "
  • trunk/LayoutTests/editing/execCommand/print-expected.txt

    r14684 r15418  
    2626              text run at (0,84) width 197: "disagree with them, "
    2727              text run at (197,84) width 218: "glorify or vilify them, "
    28               text run at (415,84) width 341: "about the only thing you can't do is "
     28              text run at (415,84) width 340: "about the only thing you can't do is"
     29              text run at (755,84) width 1: " "
    2930              text run at (0,112) width 129: "ignore them. "
    3031              text run at (129,112) width 281: "Because they change things. "
    31               text run at (410,112) width 346: "They push the human race forward.  "
     32              text run at (410,112) width 344: "They push the human race forward."
     33              text run at (754,112) width 2: "  "
    3234              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
    3335              text run at (481,140) width 146: "we see genius. "
  • trunk/LayoutTests/editing/execCommand/selectAll-expected.txt

    r14684 r15418  
    2828              text run at (0,84) width 197: "disagree with them, "
    2929              text run at (197,84) width 218: "glorify or vilify them, "
    30               text run at (415,84) width 341: "about the only thing you can't do is "
     30              text run at (415,84) width 340: "about the only thing you can't do is"
     31              text run at (755,84) width 1: " "
    3132              text run at (0,112) width 129: "ignore them. "
    3233              text run at (129,112) width 281: "Because they change things. "
    33               text run at (410,112) width 346: "They push the human race forward.  "
     34              text run at (410,112) width 344: "They push the human race forward."
     35              text run at (754,112) width 2: "  "
    3436              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
    3537              text run at (481,140) width 146: "we see genius. "
  • trunk/LayoutTests/editing/execCommand/strikethroughSelection-expected.txt

    r14684 r15418  
    153153              text run at (0,84) width 197: "disagree with them, "
    154154              text run at (197,84) width 218: "glorify or vilify them, "
    155               text run at (415,84) width 341: "about the only thing you can't do is "
     155              text run at (415,84) width 340: "about the only thing you can't do is"
     156              text run at (755,84) width 1: " "
    156157              text run at (0,112) width 129: "ignore them. "
    157158              text run at (129,112) width 281: "Because they change things. "
    158               text run at (410,112) width 346: "They push the human race forward.  "
     159              text run at (410,112) width 344: "They push the human race forward."
     160              text run at (754,112) width 2: "  "
    159161              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
    160162              text run at (481,140) width 146: "we see genius. "
  • trunk/LayoutTests/editing/inserting/insert-div-027-expected.txt

    r14684 r15418  
    1919      RenderBlock (anonymous) at (0,0) size 784x56
    2020        RenderText {#text} at (0,0) size 784x56
    21           text run at (0,0) width 784: "Test inserting paragraphs: should see two blue boxes, where the second blue box "
     21          text run at (0,0) width 781: "Test inserting paragraphs: should see two blue boxes, where the second blue box"
     22          text run at (781,0) width 3: " "
    2223          text run at (0,28) width 245: "starts with an empty line."
    2324      RenderBlock {DIV} at (0,56) size 784x36
  • trunk/LayoutTests/editing/selection/after-line-wrap-expected.txt

    r14684 r15418  
    3131      RenderBlock {DIV} at (16,104) size 752x38 [border: (1px solid #000000)]
    3232        RenderText {#text} at (1,1) size 750x18
    33           text run at (1,1) width 750: "don't select me                                                                                                                                                                                                                                                                                                                                                             "
     33          text run at (1,1) width 749: "don't select me                                                                                                                                                                    "
     34          text run at (750,1) width 1: "                                                                                                                                                                                         "
    3435        RenderInline {I} at (0,0) size 150x18
    3536          RenderText {#text} at (1,19) size 150x18
  • trunk/LayoutTests/editing/selection/mixed-editability-1-expected.txt

    r15195 r15418  
    1515      RenderText {#text} at (20,0) size 784x36
    1616        text run at (20,0) width 464: "ly the first two letters of the first word in this sentence should be selected. "
    17         text run at (484,0) width 300: "To run this test manually, double click between "
     17        text run at (484,0) width 298: "To run this test manually, double click between"
     18        text run at (782,0) width 2: " "
    1819        text run at (0,18) width 351: "the first two letters of the first word of the first sentence."
    1920      RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/editing/selection/select-all-001-expected.txt

    r14684 r15418  
    1515            text run at (0,58) width 589: "upon this continent, a new nation, conceived in Liberty, and "
    1616            text run at (0,106) width 577: "dedicated to the proposition that all men are created equal. "
    17             text run at (0,154) width 600: "Now we are engaged in a great civil war, testing whether that "
     17            text run at (0,154) width 596: "Now we are engaged in a great civil war, testing whether that"
     18            text run at (596,154) width 4: " "
    1819            text run at (0,202) width 565: "nation, or any nation, so conceived, and so dedicated, can "
    1920            text run at (0,250) width 571: "long endure. We are met here on a great battlefield of that "
     
    2223            text run at (0,394) width 579: "nation might live. It is altogether fitting and proper that we "
    2324            text run at (0,442) width 565: "should do this. Four score and seven years ago our fathers "
    24             text run at (0,490) width 600: "brought forth, upon this continent, a new nation, conceived in "
     25            text run at (0,490) width 598: "brought forth, upon this continent, a new nation, conceived in"
     26            text run at (598,490) width 2: " "
    2527            text run at (0,538) width 560: "Liberty, and dedicated to the proposition that all men are "
    2628            text run at (0,586) width 136: "created equal."
  • trunk/LayoutTests/editing/selection/select-all-002-expected.txt

    r14684 r15418  
    2222          RenderBR {BR} at (569,272) size 0x0
    2323          RenderText {#text} at (0,298) size 600x172
    24             text run at (0,298) width 600: "battlefield of that war. We have come to dedicate a portion of "
     24            text run at (0,298) width 600: "battlefield of that war. We have come to dedicate a portion of"
     25            text run at (600,298) width 0: " "
    2526            text run at (0,346) width 585: "it as a final resting place for those who here gave their lives "
    2627            text run at (0,394) width 588: "that that nation might live. It is altogether fitting and proper "
  • trunk/LayoutTests/editing/selection/select-all-003-expected.txt

    r14684 r15418  
    1616          text run at (0,154) width 589: "upon this continent, a new nation, conceived in Liberty, and "
    1717          text run at (0,202) width 577: "dedicated to the proposition that all men are created equal. "
    18           text run at (0,250) width 600: "Now we are engaged in a great civil war, testing whether that "
     18          text run at (0,250) width 596: "Now we are engaged in a great civil war, testing whether that"
     19          text run at (596,250) width 4: " "
    1920          text run at (0,298) width 565: "nation, or any nation, so conceived, and so dedicated, can "
    2021          text run at (0,346) width 571: "long endure. We are met here on a great battlefield of that "
     
    2324          text run at (0,490) width 579: "nation might live. It is altogether fitting and proper that we "
    2425          text run at (0,538) width 565: "should do this. Four score and seven years ago our fathers "
    25           text run at (0,586) width 600: "brought forth, upon this continent, a new nation, conceived in "
     26          text run at (0,586) width 598: "brought forth, upon this continent, a new nation, conceived in"
     27          text run at (598,586) width 2: " "
    2628          text run at (0,634) width 560: "Liberty, and dedicated to the proposition that all men are "
    2729          text run at (0,682) width 142: "created equal. "
  • trunk/LayoutTests/fast/clip/outline-overflowClip-expected.txt

    r14684 r15418  
    1919  RenderBlock (positioned) {DIV} at (52,20) size 105x24 [bgcolor=#EEEEEE] [border: (3px solid #FF0000)]
    2020    RenderText {#text} at (3,3) size 99x18
    21       text run at (3,3) width 99: "text in inner div "
     21      text run at (3,3) width 99: "text in inner div"
     22      text run at (102,3) width 0: " "
  • trunk/LayoutTests/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt

    r14684 r15418  
    2424      RenderBlock {PRE} at (0,212) size 108x83 [border: (4px solid #0000FF)]
    2525        RenderText {#text} at (4,4) size 100x75
    26           text run at (4,4) width 100: "This   text     "
     26          text run at (4,4) width 96: "This   text "
     27          text run at (100,4) width 4: "    "
    2728          text run at (4,19) width 72: "will wrap"
    2829          text run at (76,19) width 0: " "
     
    3536  RenderBlock {PRE} at (0,101) size 108x83 [border: (4px solid #A52A2A)]
    3637    RenderText {#text} at (4,4) size 100x75
    37       text run at (4,4) width 100: "This   text     "
     38      text run at (4,4) width 96: "This   text "
     39      text run at (100,4) width 4: "    "
    3840      text run at (4,19) width 72: "will wrap"
    3941      text run at (76,19) width 0: " "
  • trunk/LayoutTests/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt

    r14684 r15418  
    3333      RenderBlock {PRE} at (0,104) size 51x30 [bgcolor=#C0C0C0]
    3434        RenderText {#text} at (0,0) size 51x30
    35           text run at (0,0) width 51: "foo      "
     35          text run at (0,0) width 48: "foo   "
     36          text run at (48,0) width 3: "   "
    3637          text run at (0,15) width 24: "bar"
    3738      RenderBlock {P} at (0,150) size 769x18
     
    5051          text run at (0,15) width 48: "   bar"
    5152      RenderBlock {PRE} at (0,227) size 51x30 [bgcolor=#C0C0C0]
    52         RenderText {#text} at (0,0) size 51x15
     53        RenderText {#text} at (0,0) size 56x15
    5354          text run at (0,0) width 48: "foo   "
    54           text run at (48,0) width 3: " "
    55         RenderBR {BR} at (51,12) size 0x0
     55          text run at (48,0) width 8: " "
     56        RenderBR {BR} at (56,12) size 0x0
    5657        RenderText {#text} at (0,15) size 48x15
    5758          text run at (0,15) width 48: "   bar"
  • trunk/WebCore/ChangeLog

    r15415 r15418  
     12006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
     2
     3        Reviewed by Hyatt.
     4
     5        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
     6          REGRESSION: RTL white-space:pre-wrap text is offset to the right
     7
     8        Test: fast/text/international/rtl-white-space-pre-wrap.html
     9
     10        * rendering/RenderText.cpp:
     11        (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
     12        of clipping the caret position to the text box when the caret is after
     13        the trailing space of an autowrapped line.
     14        * rendering/bidi.cpp:
     15        (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
     16        to-fit the logically last text box if it contains the trailing spaces of an
     17        autowrapped line.
     18        (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
     19        In the case of autowrapped text with white space that overflows beyond the line,
     20        the last text run is the one containing the overflowing white space.
     21        (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
     22        line that autowraps only after white space into a separate text run.
     23
    1242006-07-13  David Harrison  <harrison@apple.com>
    225
  • trunk/WebCore/rendering/RenderText.cpp

    r15286 r15418  
    416416
    417417    RenderBlock *cb = containingBlock();
    418     int availableWidth = cb->lineWidth(top);
    419     if (style()->autoWrap())
    420         left = min(left, absx + box->m_x + availableWidth - 1);
    421    
     418    if (style()->autoWrap()) {
     419        int availableWidth = cb->lineWidth(top);
     420        if (!box->m_reversed)
     421            left = min(left, absx + availableWidth - 1);
     422        else
     423            left = max(left, absx + box->m_x);
     424    }
     425     
    422426    return IntRect(left, top, 1, height);
    423427}
  • trunk/WebCore/rendering/bidi.cpp

    r15319 r15418  
    8585static BidiRun* sFirstBidiRun;
    8686static BidiRun* sLastBidiRun;
     87static BidiRun* sLogicallyLastBidiRun;
    8788static int sBidiRunCount;
    8889static BidiRun* sCompactFirstBidiRun;
     
    868869                      // Similarly, line break boxes have no effect on the width.
    869870        if (r->obj->isText()) {
    870             RenderText *rt = static_cast<RenderText *>(r->obj);
     871            RenderText* rt = static_cast<RenderText*>(r->obj);
    871872            int textWidth = rt->width(r->start, r->stop-r->start, totWidth, m_firstLine);
    872873            int effectiveWidth = textWidth;
     
    877878                needsWordSpacing = !DeprecatedChar(rt->text()[r->stop-1]).isSpace() && r->stop == rtLength;         
    878879            }
    879             if (!r->compact) {
    880                 RenderStyle *style = r->obj->style();
    881                 if (style->autoWrap() && style->breakOnlyAfterWhiteSpace()) {
    882                     // shrink the box as needed to keep the line from overflowing the available width
    883                     textWidth = min(effectiveWidth, availableWidth - totWidth);
    884                 }
    885             }
    886880            r->box->setWidth(textWidth);
    887881        } else if (!r->obj->isInlineFlow()) {
     
    895889        if (!r->compact)
    896890            totWidth += r->box->width();
     891    }
     892
     893    if (totWidth > availableWidth && sLogicallyLastBidiRun->obj->style(m_firstLine)->autoWrap() &&
     894        sLogicallyLastBidiRun->obj->style(m_firstLine)->breakOnlyAfterWhiteSpace() &&
     895        !sLogicallyLastBidiRun->compact) {
     896        sLogicallyLastBidiRun->box->setWidth(sLogicallyLastBidiRun->box->width() - totWidth + availableWidth);
     897        totWidth = availableWidth;
    897898    }
    898899
     
    13891390    }
    13901391
     1392    sLogicallyLastBidiRun = sLastBidiRun;
     1393
    13911394    // reorder line according to run structure...
    13921395    // do not reverse for visually ordered web sites
     
    22712274                                    lBreak.obj = o;
    22722275                                    lBreak.pos = pos;
     2276                                    if (pos > 0) {
     2277                                        // Separate the trailing space into its own box, which we will
     2278                                        // resize to fit on the line in computeHorizontalPositionsForLine().
     2279                                        BidiIterator midpoint(0, o, pos);
     2280                                        addMidpoint(BidiIterator(0, o, pos-1)); // Stop
     2281                                        addMidpoint(BidiIterator(0, o, pos)); // Start
     2282                                    }
    22732283                                    skipWhitespace(lBreak, bidi);
    22742284                                }
Note: See TracChangeset for help on using the changeset viewer.