Changeset 88883 in webkit


Ignore:
Timestamp:
Jun 14, 2011 5:19:39 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

2011-06-13 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by David Hyatt.

Trailing tabs in a textarea become unselectable under certain conditions
https://bugs.webkit.org/show_bug.cgi?id=54598

The bug was caused by WebKit's erroneously collapsing leading whitespace when white-space is
set to pre-wrap. Per CSS 2.1 spec section 16.1.1, leading whitespace should not be removed
in this case.

See also: http://www.w3.org/TR/CSS2/text.html#white-space-model

Fixed the bug by adding an extra argument to shouldCollapseWhiteSpace, indicating whether
whitespace is leading or trailing. It defaults to leading because 16.1.1 does not allow allow
collapsing of whitespace anywhere but at the end of each line.

Test: fast/text/pre-wrap-trailing-tab.html

  • rendering/RenderBlockLineLayout.cpp: (WebCore::shouldCollapseWhiteSpace): Added WhitespacePosition as an argument. Returns false when whitespacePosition is not TrailingWhitespace even if white-space is pre-wrap. (WebCore::requiresLineBox): Takes WhitespacePosition as an argument and passes it to shouldCollapseWhiteSpace. (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Calls requiresLineBox. (WebCore::RenderBlock::LineBreaker::skipTrailingWhitespace): Ditto. (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace): Ditto.

2011-06-13 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by David Hyatt.

Trailing tabs in a textarea become unselectable under certain conditions
https://bugs.webkit.org/show_bug.cgi?id=54598

Added a test to ensure Webkit renders leading whitespace when white-space is set to pre-wrap
and word-wrap is set to break-word.

Also rebaselined few tests because WebKit now renders leading whitespace in those tests.

  • fast/text/pre-wrap-trailing-tab-expected.txt: Added.
  • fast/text/pre-wrap-trailing-tab.html: Added.
  • http/tests/misc/acid3-expected.txt:
  • platform/mac/fast/forms/basic-textareas-expected.txt:
  • platform/mac/fast/forms/basic-textareas-quirks-expected.txt
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88879 r88883  
     12011-06-13  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by David Hyatt.
     4
     5        Trailing tabs in a textarea become unselectable under certain conditions
     6        https://bugs.webkit.org/show_bug.cgi?id=54598
     7
     8        Added a test to ensure Webkit renders leading whitespace when white-space is set to pre-wrap
     9        and word-wrap is set to break-word.
     10
     11        Also rebaselined few tests because WebKit now renders leading whitespace in those tests.
     12
     13        * fast/text/pre-wrap-trailing-tab-expected.txt: Added.
     14        * fast/text/pre-wrap-trailing-tab.html: Added.
     15        * http/tests/misc/acid3-expected.txt:
     16        * platform/mac/fast/forms/basic-textareas-expected.txt:
     17        * platform/mac/fast/forms/basic-textareas-quirks-expected.txt
     18
    1192011-06-14  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/LayoutTests/http/tests/misc/acid3-expected.txt

    r73402 r88883  
    3535                  RenderImage {IMG} at (0,0) size 1x1
    3636          RenderPartObject {IFRAME} at (0,0) size 0x0
    37             layer at (0,0) size 16x2151
     37            layer at (0,0) size 16x2166
    3838              RenderView at (0,0) size 0x0
    39             layer at (0,0) size 0x2151
    40               RenderBlock {HTML} at (0,0) size 0x2151
    41                 RenderBody {BODY} at (8,8) size 0x2130
    42                   RenderBlock {PRE} at (0,0) size 0x2130
    43                     RenderText {#text} at (0,0) size 8x2130
     39            layer at (0,0) size 0x2166
     40              RenderBlock {HTML} at (0,0) size 0x2166
     41                RenderBody {BODY} at (8,8) size 0x2145
     42                  RenderBlock {PRE} at (0,0) size 0x2145
     43                    RenderText {#text} at (0,0) size 8x2145
    4444                      text run at (0,0) width 8: "<"
    4545                      text run at (0,15) width 8: "!"
     
    5151                      text run at (0,105) width 8: "P"
    5252                      text run at (0,120) width 8: "E"
    53                       text run at (0,135) width 8: "h"
    54                       text run at (0,150) width 8: "t"
    55                       text run at (0,165) width 8: "m"
    56                       text run at (0,180) width 8: "l"
    57                       text run at (0,195) width 8: ">"
    58                       text run at (0,210) width 8: "<"
    59                       text run at (0,225) width 8: "h"
    60                       text run at (0,240) width 8: "t"
    61                       text run at (0,255) width 8: "m"
    62                       text run at (0,270) width 8: "l"
    63                       text run at (0,285) width 8: ">"
    64                       text run at (0,300) width 8: "<"
    65                       text run at (0,315) width 8: "h"
    66                       text run at (0,330) width 8: "e"
    67                       text run at (0,345) width 8: "a"
    68                       text run at (0,360) width 8: "d"
    69                       text run at (0,375) width 8: ">"
    70                       text run at (0,390) width 8: "<"
    71                       text run at (0,405) width 8: "t"
    72                       text run at (0,420) width 8: "i"
    73                       text run at (0,435) width 8: "t"
    74                       text run at (0,450) width 8: "l"
    75                       text run at (0,465) width 8: "e"
    76                       text run at (0,480) width 8: ">"
    77                       text run at (0,495) width 8: "F"
    78                       text run at (0,510) width 8: "A"
    79                       text run at (0,525) width 8: "I"
    80                       text run at (0,540) width 8: "L"
    81                       text run at (0,555) width 8: "<"
    82                       text run at (0,570) width 8: "/"
    83                       text run at (0,585) width 8: "t"
    84                       text run at (0,600) width 8: "i"
    85                       text run at (0,615) width 8: "t"
    86                       text run at (0,630) width 8: "l"
    87                       text run at (0,645) width 8: "e"
    88                       text run at (0,660) width 8: ">"
    89                       text run at (0,675) width 8: "<"
    90                       text run at (0,690) width 8: "/"
    91                       text run at (0,705) width 8: "h"
    92                       text run at (0,720) width 8: "e"
    93                       text run at (0,735) width 8: "a"
    94                       text run at (0,750) width 8: "d"
    95                       text run at (0,765) width 8: ">"
    96                       text run at (0,780) width 8: "<"
    97                       text run at (0,795) width 8: "b"
    98                       text run at (0,810) width 8: "o"
    99                       text run at (0,825) width 8: "d"
    100                       text run at (0,840) width 8: "y"
    101                       text run at (0,855) width 8: ">"
    102                       text run at (0,870) width 8: "<"
    103                       text run at (0,885) width 8: "p"
    104                       text run at (0,900) width 8: ">"
    105                       text run at (0,915) width 8: "F"
    106                       text run at (0,930) width 8: "A"
    107                       text run at (0,945) width 8: "I"
    108                       text run at (0,960) width 8: "L"
    109                       text run at (0,975) width 8: "<"
    110                       text run at (0,990) width 8: "/"
    111                       text run at (0,1005) width 8: "p"
    112                       text run at (0,1020) width 8: ">"
    113                       text run at (0,1035) width 8: "<"
    114                       text run at (0,1050) width 8: "s"
    115                       text run at (0,1065) width 8: "c"
    116                       text run at (0,1080) width 8: "r"
    117                       text run at (0,1095) width 8: "i"
    118                       text run at (0,1110) width 8: "p"
    119                       text run at (0,1125) width 8: "t"
    120                       text run at (0,1140) width 8: ">"
    121                       text run at (0,1155) width 8: "p"
    122                       text run at (0,1170) width 8: "a"
    123                       text run at (0,1185) width 8: "r"
    124                       text run at (0,1200) width 8: "e"
    125                       text run at (0,1215) width 8: "n"
    126                       text run at (0,1230) width 8: "t"
    127                       text run at (0,1245) width 8: "."
    128                       text run at (0,1260) width 8: "n"
    129                       text run at (0,1275) width 8: "o"
    130                       text run at (0,1290) width 8: "t"
    131                       text run at (0,1305) width 8: "i"
    132                       text run at (0,1320) width 8: "f"
    133                       text run at (0,1335) width 8: "y"
    134                       text run at (0,1350) width 8: "("
    135                       text run at (0,1365) width 8: "\""
    136                       text run at (0,1380) width 8: "r"
    137                       text run at (0,1395) width 8: "e"
    138                       text run at (0,1410) width 8: "s"
    139                       text run at (0,1425) width 8: "o"
    140                       text run at (0,1440) width 8: "u"
    141                       text run at (0,1455) width 8: "r"
    142                       text run at (0,1470) width 8: "c"
    143                       text run at (0,1485) width 8: "e"
    144                       text run at (0,1500) width 8: "s"
    145                       text run at (0,1515) width 8: "/"
    146                       text run at (0,1530) width 8: "a"
    147                       text run at (0,1545) width 8: "c"
    148                       text run at (0,1560) width 8: "i"
    149                       text run at (0,1575) width 8: "d"
    150                       text run at (0,1590) width 8: "3"
    151                       text run at (0,1605) width 8: "/"
    152                       text run at (0,1620) width 8: "e"
    153                       text run at (0,1635) width 8: "m"
    154                       text run at (0,1650) width 8: "p"
    155                       text run at (0,1665) width 8: "t"
    156                       text run at (0,1680) width 8: "y"
    157                       text run at (0,1695) width 8: "."
    158                       text run at (0,1710) width 8: "t"
    159                       text run at (0,1725) width 8: "x"
    160                       text run at (0,1740) width 8: "t"
    161                       text run at (0,1755) width 8: "\""
    162                       text run at (0,1770) width 8: ")"
    163                       text run at (0,1785) width 8: "<"
    164                       text run at (0,1800) width 8: "/"
    165                       text run at (0,1815) width 8: "s"
    166                       text run at (0,1830) width 8: "c"
    167                       text run at (0,1845) width 8: "r"
    168                       text run at (0,1860) width 8: "i"
    169                       text run at (0,1875) width 8: "p"
    170                       text run at (0,1890) width 8: "t"
    171                       text run at (0,1905) width 8: ">"
    172                       text run at (0,1920) width 8: "<"
    173                       text run at (0,1935) width 8: "/"
    174                       text run at (0,1950) width 8: "b"
    175                       text run at (0,1965) width 8: "o"
    176                       text run at (0,1980) width 8: "d"
    177                       text run at (0,1995) width 8: "y"
    178                       text run at (0,2010) width 8: ">"
    179                       text run at (0,2025) width 8: "<"
    180                       text run at (0,2040) width 8: "/"
    181                       text run at (0,2055) width 8: "h"
    182                       text run at (0,2070) width 8: "t"
    183                       text run at (0,2085) width 8: "m"
    184                       text run at (0,2100) width 8: "l"
    185                       text run at (0,2115) width 8: ">"
     53                      text run at (0,135) width 0: " "
     54                      text run at (0,150) width 8: "h"
     55                      text run at (0,165) width 8: "t"
     56                      text run at (0,180) width 8: "m"
     57                      text run at (0,195) width 8: "l"
     58                      text run at (0,210) width 8: ">"
     59                      text run at (0,225) width 8: "<"
     60                      text run at (0,240) width 8: "h"
     61                      text run at (0,255) width 8: "t"
     62                      text run at (0,270) width 8: "m"
     63                      text run at (0,285) width 8: "l"
     64                      text run at (0,300) width 8: ">"
     65                      text run at (0,315) width 8: "<"
     66                      text run at (0,330) width 8: "h"
     67                      text run at (0,345) width 8: "e"
     68                      text run at (0,360) width 8: "a"
     69                      text run at (0,375) width 8: "d"
     70                      text run at (0,390) width 8: ">"
     71                      text run at (0,405) width 8: "<"
     72                      text run at (0,420) width 8: "t"
     73                      text run at (0,435) width 8: "i"
     74                      text run at (0,450) width 8: "t"
     75                      text run at (0,465) width 8: "l"
     76                      text run at (0,480) width 8: "e"
     77                      text run at (0,495) width 8: ">"
     78                      text run at (0,510) width 8: "F"
     79                      text run at (0,525) width 8: "A"
     80                      text run at (0,540) width 8: "I"
     81                      text run at (0,555) width 8: "L"
     82                      text run at (0,570) width 8: "<"
     83                      text run at (0,585) width 8: "/"
     84                      text run at (0,600) width 8: "t"
     85                      text run at (0,615) width 8: "i"
     86                      text run at (0,630) width 8: "t"
     87                      text run at (0,645) width 8: "l"
     88                      text run at (0,660) width 8: "e"
     89                      text run at (0,675) width 8: ">"
     90                      text run at (0,690) width 8: "<"
     91                      text run at (0,705) width 8: "/"
     92                      text run at (0,720) width 8: "h"
     93                      text run at (0,735) width 8: "e"
     94                      text run at (0,750) width 8: "a"
     95                      text run at (0,765) width 8: "d"
     96                      text run at (0,780) width 8: ">"
     97                      text run at (0,795) width 8: "<"
     98                      text run at (0,810) width 8: "b"
     99                      text run at (0,825) width 8: "o"
     100                      text run at (0,840) width 8: "d"
     101                      text run at (0,855) width 8: "y"
     102                      text run at (0,870) width 8: ">"
     103                      text run at (0,885) width 8: "<"
     104                      text run at (0,900) width 8: "p"
     105                      text run at (0,915) width 8: ">"
     106                      text run at (0,930) width 8: "F"
     107                      text run at (0,945) width 8: "A"
     108                      text run at (0,960) width 8: "I"
     109                      text run at (0,975) width 8: "L"
     110                      text run at (0,990) width 8: "<"
     111                      text run at (0,1005) width 8: "/"
     112                      text run at (0,1020) width 8: "p"
     113                      text run at (0,1035) width 8: ">"
     114                      text run at (0,1050) width 8: "<"
     115                      text run at (0,1065) width 8: "s"
     116                      text run at (0,1080) width 8: "c"
     117                      text run at (0,1095) width 8: "r"
     118                      text run at (0,1110) width 8: "i"
     119                      text run at (0,1125) width 8: "p"
     120                      text run at (0,1140) width 8: "t"
     121                      text run at (0,1155) width 8: ">"
     122                      text run at (0,1170) width 8: "p"
     123                      text run at (0,1185) width 8: "a"
     124                      text run at (0,1200) width 8: "r"
     125                      text run at (0,1215) width 8: "e"
     126                      text run at (0,1230) width 8: "n"
     127                      text run at (0,1245) width 8: "t"
     128                      text run at (0,1260) width 8: "."
     129                      text run at (0,1275) width 8: "n"
     130                      text run at (0,1290) width 8: "o"
     131                      text run at (0,1305) width 8: "t"
     132                      text run at (0,1320) width 8: "i"
     133                      text run at (0,1335) width 8: "f"
     134                      text run at (0,1350) width 8: "y"
     135                      text run at (0,1365) width 8: "("
     136                      text run at (0,1380) width 8: "\""
     137                      text run at (0,1395) width 8: "r"
     138                      text run at (0,1410) width 8: "e"
     139                      text run at (0,1425) width 8: "s"
     140                      text run at (0,1440) width 8: "o"
     141                      text run at (0,1455) width 8: "u"
     142                      text run at (0,1470) width 8: "r"
     143                      text run at (0,1485) width 8: "c"
     144                      text run at (0,1500) width 8: "e"
     145                      text run at (0,1515) width 8: "s"
     146                      text run at (0,1530) width 8: "/"
     147                      text run at (0,1545) width 8: "a"
     148                      text run at (0,1560) width 8: "c"
     149                      text run at (0,1575) width 8: "i"
     150                      text run at (0,1590) width 8: "d"
     151                      text run at (0,1605) width 8: "3"
     152                      text run at (0,1620) width 8: "/"
     153                      text run at (0,1635) width 8: "e"
     154                      text run at (0,1650) width 8: "m"
     155                      text run at (0,1665) width 8: "p"
     156                      text run at (0,1680) width 8: "t"
     157                      text run at (0,1695) width 8: "y"
     158                      text run at (0,1710) width 8: "."
     159                      text run at (0,1725) width 8: "t"
     160                      text run at (0,1740) width 8: "x"
     161                      text run at (0,1755) width 8: "t"
     162                      text run at (0,1770) width 8: "\""
     163                      text run at (0,1785) width 8: ")"
     164                      text run at (0,1800) width 8: "<"
     165                      text run at (0,1815) width 8: "/"
     166                      text run at (0,1830) width 8: "s"
     167                      text run at (0,1845) width 8: "c"
     168                      text run at (0,1860) width 8: "r"
     169                      text run at (0,1875) width 8: "i"
     170                      text run at (0,1890) width 8: "p"
     171                      text run at (0,1905) width 8: "t"
     172                      text run at (0,1920) width 8: ">"
     173                      text run at (0,1935) width 8: "<"
     174                      text run at (0,1950) width 8: "/"
     175                      text run at (0,1965) width 8: "b"
     176                      text run at (0,1980) width 8: "o"
     177                      text run at (0,1995) width 8: "d"
     178                      text run at (0,2010) width 8: "y"
     179                      text run at (0,2025) width 8: ">"
     180                      text run at (0,2040) width 8: "<"
     181                      text run at (0,2055) width 8: "/"
     182                      text run at (0,2070) width 8: "h"
     183                      text run at (0,2085) width 8: "t"
     184                      text run at (0,2100) width 8: "m"
     185                      text run at (0,2115) width 8: "l"
     186                      text run at (0,2130) width 8: ">"
    186187          RenderPartObject {IFRAME} at (0,0) size 0x0
    187188            layer at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/forms/basic-textareas-expected.txt

    r78884 r88883  
    547547                text run at (29,26) width 5: " "
    548548                text run at (0,39) width 130: "abcdefghijklmnopqrstuv"
    549         layer at (583,422) size 56x58 clip at (584,423) size 39x56 scrollHeight 173
     549        layer at (583,422) size 56x58 clip at (584,423) size 39x56 scrollHeight 186
    550550          RenderTextControl {TEXTAREA} at (3,31) size 56x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    551             RenderBlock {DIV} at (3,3) size 35x169
    552               RenderText {#text} at (0,0) size 35x169
     551            RenderBlock {DIV} at (3,3) size 35x182
     552              RenderText {#text} at (0,0) size 35x182
    553553                text run at (0,0) width 34: "Lorem"
    554554                text run at (33,0) width 2: " "
    555555                text run at (0,13) width 33: "ipsum"
    556                 text run at (0,26) width 29: "dolor"
    557                 text run at (28,26) width 4: " "
    558                 text run at (0,39) width 30: "ABCD"
    559                 text run at (0,52) width 35: "EFGHIJ"
    560                 text run at (0,65) width 31: "KLMN"
    561                 text run at (0,78) width 31: "OPQR"
    562                 text run at (0,91) width 28: "STUV"
    563                 text run at (0,104) width 30: "WXYZ"
    564                 text run at (29,104) width 5: " "
    565                 text run at (0,117) width 32: "abcde"
    566                 text run at (0,130) width 34: "fghijkl"
    567                 text run at (0,143) width 31: "mnop"
    568                 text run at (0,156) width 34: "qrstuv"
     556                text run at (0,26) width 7: "  "
     557                text run at (0,39) width 29: "dolor"
     558                text run at (28,39) width 4: " "
     559                text run at (0,52) width 30: "ABCD"
     560                text run at (0,65) width 35: "EFGHIJ"
     561                text run at (0,78) width 31: "KLMN"
     562                text run at (0,91) width 31: "OPQR"
     563                text run at (0,104) width 28: "STUV"
     564                text run at (0,117) width 30: "WXYZ"
     565                text run at (29,117) width 5: " "
     566                text run at (0,130) width 32: "abcde"
     567                text run at (0,143) width 34: "fghijkl"
     568                text run at (0,156) width 31: "mnop"
     569                text run at (0,169) width 34: "qrstuv"
    569570        layer at (3,503) size 161x47 clip at (4,504) size 159x30 scrollWidth 427
    570571          RenderTextControl {TEXTAREA} at (3,17) size 161x47 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     
    641642                text run at (104,0) width 5: " "
    642643                text run at (0,13) width 183: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    643                 text run at (0,26) width 130: "abcdefghijklmnopqrstuv"
     644                text run at (0,26) width 134: " abcdefghijklmnopqrstuv"
    644645        layer at (170,670) size 161x47 clip at (171,671) size 144x30 scrollWidth 185 scrollHeight 43
    645646          RenderTextControl {TEXTAREA} at (3,45) size 161x47 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     
    649650                text run at (104,0) width 5: " "
    650651                text run at (0,13) width 183: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    651                 text run at (0,26) width 130: "abcdefghijklmnopqrstuv"
     652                text run at (0,26) width 134: " abcdefghijklmnopqrstuv"
    652653      RenderPartObject {IFRAME} at (0,748) size 785x690
    653654        layer at (0,0) size 785x690
     
    934935                text run at (0,130) width 38: "mnopq"
    935936                text run at (0,143) width 27: "rstuv"
    936         layer at (429,155) size 60x68 clip at (430,156) size 43x66 scrollHeight 859
     937        layer at (429,155) size 60x68 clip at (430,156) size 43x66 scrollHeight 924
    937938          RenderTextControl {TEXTAREA} at (1,45) size 60x68 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    938             RenderBlock {DIV} at (21,21) size 3x819
    939               RenderText {#text} at (0,0) size 11x819
     939            RenderBlock {DIV} at (21,21) size 3x884
     940              RenderText {#text} at (0,0) size 11x884
    940941                text run at (0,0) width 6: "L"
    941942                text run at (0,13) width 7: "o"
     
    943944                text run at (0,39) width 7: "e"
    944945                text run at (0,52) width 11: "m"
    945                 text run at (0,65) width 4: "i"
    946                 text run at (0,78) width 7: "p"
    947                 text run at (0,91) width 6: "s"
    948                 text run at (0,104) width 7: "u"
    949                 text run at (0,117) width 11: "m"
    950                 text run at (0,130) width 7: "d"
    951                 text run at (0,143) width 7: "o"
    952                 text run at (0,156) width 4: "l"
    953                 text run at (0,169) width 7: "o"
    954                 text run at (0,182) width 5: "r"
    955                 text run at (0,195) width 8: "A"
    956                 text run at (0,208) width 7: "B"
    957                 text run at (0,221) width 8: "C"
    958                 text run at (0,234) width 9: "D"
    959                 text run at (0,247) width 6: "E"
    960                 text run at (0,260) width 6: "F"
    961                 text run at (0,273) width 8: "G"
    962                 text run at (0,286) width 9: "H"
    963                 text run at (0,299) width 4: "I"
    964                 text run at (0,312) width 4: "J"
    965                 text run at (0,325) width 8: "K"
    966                 text run at (0,338) width 6: "L"
    967                 text run at (0,351) width 10: "M"
    968                 text run at (0,364) width 9: "N"
    969                 text run at (0,377) width 9: "O"
    970                 text run at (0,390) width 7: "P"
    971                 text run at (0,403) width 9: "Q"
    972                 text run at (0,416) width 7: "R"
    973                 text run at (0,429) width 6: "S"
    974                 text run at (0,442) width 7: "T"
    975                 text run at (0,455) width 8: "U"
    976                 text run at (0,468) width 8: "V"
    977                 text run at (0,481) width 10: "W"
    978                 text run at (0,494) width 7: "X"
    979                 text run at (0,507) width 7: "Y"
    980                 text run at (0,520) width 7: "Z"
    981                 text run at (0,533) width 7: "a"
    982                 text run at (0,546) width 7: "b"
    983                 text run at (0,559) width 6: "c"
    984                 text run at (0,572) width 7: "d"
    985                 text run at (0,585) width 7: "e"
    986                 text run at (0,598) width 5: "f"
    987                 text run at (0,611) width 7: "g"
    988                 text run at (0,624) width 7: "h"
    989                 text run at (0,637) width 4: "i"
    990                 text run at (0,650) width 4: "j"
    991                 text run at (0,663) width 7: "k"
    992                 text run at (0,676) width 4: "l"
    993                 text run at (0,689) width 11: "m"
    994                 text run at (0,702) width 7: "n"
    995                 text run at (0,715) width 7: "o"
    996                 text run at (0,728) width 7: "p"
    997                 text run at (0,741) width 7: "q"
    998                 text run at (0,754) width 5: "r"
    999                 text run at (0,767) width 6: "s"
    1000                 text run at (0,780) width 5: "t"
    1001                 text run at (0,793) width 7: "u"
    1002                 text run at (0,806) width 6: "v"
     946                text run at (0,65) width 3: " "
     947                text run at (0,78) width 4: "i"
     948                text run at (0,91) width 7: "p"
     949                text run at (0,104) width 6: "s"
     950                text run at (0,117) width 7: "u"
     951                text run at (0,130) width 11: "m"
     952                text run at (0,143) width 3: " "
     953                text run at (0,156) width 3: " "
     954                text run at (0,169) width 7: "d"
     955                text run at (0,182) width 7: "o"
     956                text run at (0,195) width 4: "l"
     957                text run at (0,208) width 7: "o"
     958                text run at (0,221) width 5: "r"
     959                text run at (0,234) width 3: " "
     960                text run at (0,247) width 8: "A"
     961                text run at (0,260) width 7: "B"
     962                text run at (0,273) width 8: "C"
     963                text run at (0,286) width 9: "D"
     964                text run at (0,299) width 6: "E"
     965                text run at (0,312) width 6: "F"
     966                text run at (0,325) width 8: "G"
     967                text run at (0,338) width 9: "H"
     968                text run at (0,351) width 4: "I"
     969                text run at (0,364) width 4: "J"
     970                text run at (0,377) width 8: "K"
     971                text run at (0,390) width 6: "L"
     972                text run at (0,403) width 10: "M"
     973                text run at (0,416) width 9: "N"
     974                text run at (0,429) width 9: "O"
     975                text run at (0,442) width 7: "P"
     976                text run at (0,455) width 9: "Q"
     977                text run at (0,468) width 7: "R"
     978                text run at (0,481) width 6: "S"
     979                text run at (0,494) width 7: "T"
     980                text run at (0,507) width 8: "U"
     981                text run at (0,520) width 8: "V"
     982                text run at (0,533) width 10: "W"
     983                text run at (0,546) width 7: "X"
     984                text run at (0,559) width 7: "Y"
     985                text run at (0,572) width 7: "Z"
     986                text run at (0,585) width 3: " "
     987                text run at (0,598) width 7: "a"
     988                text run at (0,611) width 7: "b"
     989                text run at (0,624) width 6: "c"
     990                text run at (0,637) width 7: "d"
     991                text run at (0,650) width 7: "e"
     992                text run at (0,663) width 5: "f"
     993                text run at (0,676) width 7: "g"
     994                text run at (0,689) width 7: "h"
     995                text run at (0,702) width 4: "i"
     996                text run at (0,715) width 4: "j"
     997                text run at (0,728) width 7: "k"
     998                text run at (0,741) width 4: "l"
     999                text run at (0,754) width 11: "m"
     1000                text run at (0,767) width 7: "n"
     1001                text run at (0,780) width 7: "o"
     1002                text run at (0,793) width 7: "p"
     1003                text run at (0,806) width 7: "q"
     1004                text run at (0,819) width 5: "r"
     1005                text run at (0,832) width 6: "s"
     1006                text run at (0,845) width 5: "t"
     1007                text run at (0,858) width 7: "u"
     1008                text run at (0,871) width 6: "v"
    10031009        layer at (511,195) size 60x28 clip at (512,196) size 43x26 scrollHeight 156
    10041010          RenderTextControl {TEXTAREA} at (1,45) size 60x28 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     
    12401246                text run at (29,26) width 5: " "
    12411247                text run at (0,39) width 130: "abcdefghijklmnopqrstuv"
    1242         layer at (583,401) size 56x58 clip at (584,402) size 39x56 scrollHeight 173
     1248        layer at (583,401) size 56x58 clip at (584,402) size 39x56 scrollHeight 186
    12431249          RenderTextControl {TEXTAREA} at (3,31) size 56x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    1244             RenderBlock {DIV} at (3,3) size 35x169
    1245               RenderText {#text} at (0,0) size 35x169
     1250            RenderBlock {DIV} at (3,3) size 35x182
     1251              RenderText {#text} at (0,0) size 35x182
    12461252                text run at (0,0) width 34: "Lorem"
    12471253                text run at (33,0) width 2: " "
    12481254                text run at (0,13) width 33: "ipsum"
    1249                 text run at (0,26) width 29: "dolor"
    1250                 text run at (28,26) width 4: " "
    1251                 text run at (0,39) width 30: "ABCD"
    1252                 text run at (0,52) width 35: "EFGHIJ"
    1253                 text run at (0,65) width 31: "KLMN"
    1254                 text run at (0,78) width 31: "OPQR"
    1255                 text run at (0,91) width 28: "STUV"
    1256                 text run at (0,104) width 30: "WXYZ"
    1257                 text run at (29,104) width 5: " "
    1258                 text run at (0,117) width 32: "abcde"
    1259                 text run at (0,130) width 34: "fghijkl"
    1260                 text run at (0,143) width 31: "mnop"
    1261                 text run at (0,156) width 34: "qrstuv"
     1255                text run at (0,26) width 7: "  "
     1256                text run at (0,39) width 29: "dolor"
     1257                text run at (28,39) width 4: " "
     1258                text run at (0,52) width 30: "ABCD"
     1259                text run at (0,65) width 35: "EFGHIJ"
     1260                text run at (0,78) width 31: "KLMN"
     1261                text run at (0,91) width 31: "OPQR"
     1262                text run at (0,104) width 28: "STUV"
     1263                text run at (0,117) width 30: "WXYZ"
     1264                text run at (29,117) width 5: " "
     1265                text run at (0,130) width 32: "abcde"
     1266                text run at (0,143) width 34: "fghijkl"
     1267                text run at (0,156) width 31: "mnop"
     1268                text run at (0,169) width 34: "qrstuv"
    12621269        layer at (3,479) size 161x47 clip at (4,480) size 159x30 scrollWidth 427
    12631270          RenderTextControl {TEXTAREA} at (3,17) size 161x47 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     
    13341341                text run at (104,0) width 5: " "
    13351342                text run at (0,13) width 183: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    1336                 text run at (0,26) width 130: "abcdefghijklmnopqrstuv"
     1343                text run at (0,26) width 134: " abcdefghijklmnopqrstuv"
    13371344        layer at (170,640) size 161x47 clip at (171,641) size 144x30 scrollWidth 185 scrollHeight 43
    13381345          RenderTextControl {TEXTAREA} at (3,45) size 161x47 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     
    13421349                text run at (104,0) width 5: " "
    13431350                text run at (0,13) width 183: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    1344                 text run at (0,26) width 130: "abcdefghijklmnopqrstuv"
     1351                text run at (0,26) width 134: " abcdefghijklmnopqrstuv"
    13451352      RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/forms/basic-textareas-quirks-expected.txt

    r85011 r88883  
    366366        text run at (0,39) width 130: "abcdefghijklmnopqrstuv"
    367367        text run at (129,39) width 5: " "
    368 layer at (26,761) size 56x58 clip at (27,762) size 39x56 scrollHeight 173
     368layer at (26,761) size 56x58 clip at (27,762) size 39x56 scrollHeight 186
    369369  RenderTextControl {TEXTAREA} at (17,3) size 56x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    370     RenderBlock {DIV} at (3,3) size 35x169
    371       RenderText {#text} at (0,0) size 35x169
     370    RenderBlock {DIV} at (3,3) size 35x182
     371      RenderText {#text} at (0,0) size 35x182
    372372        text run at (0,0) width 34: "Lorem"
    373373        text run at (33,0) width 2: " "
     
    387387        text run at (0,143) width 31: "mnop"
    388388        text run at (0,156) width 34: "qrstuv"
     389        text run at (0,169) width 4: " "
    389390layer at (376,26) size 60x32 clip at (377,27) size 43x30 scrollHeight 160
    390391  RenderTextControl {TEXTAREA} at (15,3) size 60x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     
    408409        text run at (0,143) width 27: "rstuv"
    409410        text run at (26,143) width 5: " "
    410 layer at (376,80) size 60x68 clip at (377,81) size 43x66 scrollHeight 859
     411layer at (376,80) size 60x68 clip at (377,81) size 43x66 scrollHeight 924
    411412  RenderTextControl {TEXTAREA} at (15,3) size 60x68 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    412     RenderBlock {DIV} at (21,21) size 3x819
    413       RenderText {#text} at (0,0) size 11x819
     413    RenderBlock {DIV} at (21,21) size 3x884
     414      RenderText {#text} at (0,0) size 11x884
    414415        text run at (0,0) width 6: "L"
    415416        text run at (0,13) width 7: "o"
     
    417418        text run at (0,39) width 7: "e"
    418419        text run at (0,52) width 11: "m"
    419         text run at (0,65) width 4: "i"
    420         text run at (0,78) width 7: "p"
    421         text run at (0,91) width 6: "s"
    422         text run at (0,104) width 7: "u"
    423         text run at (0,117) width 11: "m"
    424         text run at (0,130) width 7: "d"
    425         text run at (0,143) width 7: "o"
    426         text run at (0,156) width 4: "l"
     420        text run at (0,65) width 3: " "
     421        text run at (0,78) width 4: "i"
     422        text run at (0,91) width 7: "p"
     423        text run at (0,104) width 6: "s"
     424        text run at (0,117) width 7: "u"
     425        text run at (0,130) width 11: "m"
     426        text run at (0,143) width 3: " "
     427        text run at (0,156) width 7: "d"
    427428        text run at (0,169) width 7: "o"
    428         text run at (0,182) width 5: "r"
    429         text run at (0,195) width 8: "A"
    430         text run at (0,208) width 7: "B"
    431         text run at (0,221) width 8: "C"
    432         text run at (0,234) width 9: "D"
    433         text run at (0,247) width 6: "E"
    434         text run at (0,260) width 6: "F"
    435         text run at (0,273) width 8: "G"
    436         text run at (0,286) width 9: "H"
    437         text run at (0,299) width 4: "I"
    438         text run at (0,312) width 4: "J"
    439         text run at (0,325) width 8: "K"
    440         text run at (0,338) width 6: "L"
    441         text run at (0,351) width 10: "M"
    442         text run at (0,364) width 9: "N"
    443         text run at (0,377) width 9: "O"
    444         text run at (0,390) width 7: "P"
    445         text run at (0,403) width 9: "Q"
    446         text run at (0,416) width 7: "R"
    447         text run at (0,429) width 6: "S"
    448         text run at (0,442) width 7: "T"
    449         text run at (0,455) width 8: "U"
    450         text run at (0,468) width 8: "V"
    451         text run at (0,481) width 10: "W"
    452         text run at (0,494) width 7: "X"
    453         text run at (0,507) width 7: "Y"
    454         text run at (0,520) width 7: "Z"
    455         text run at (0,533) width 7: "a"
    456         text run at (0,546) width 7: "b"
    457         text run at (0,559) width 6: "c"
    458         text run at (0,572) width 7: "d"
    459         text run at (0,585) width 7: "e"
    460         text run at (0,598) width 5: "f"
    461         text run at (0,611) width 7: "g"
    462         text run at (0,624) width 7: "h"
    463         text run at (0,637) width 4: "i"
    464         text run at (0,650) width 4: "j"
    465         text run at (0,663) width 7: "k"
    466         text run at (0,676) width 4: "l"
    467         text run at (0,689) width 11: "m"
    468         text run at (0,702) width 7: "n"
    469         text run at (0,715) width 7: "o"
    470         text run at (0,728) width 7: "p"
    471         text run at (0,741) width 7: "q"
    472         text run at (0,754) width 5: "r"
    473         text run at (0,767) width 6: "s"
    474         text run at (0,780) width 5: "t"
    475         text run at (0,793) width 7: "u"
    476         text run at (0,806) width 6: "v"
     429        text run at (0,182) width 4: "l"
     430        text run at (0,195) width 7: "o"
     431        text run at (0,208) width 5: "r"
     432        text run at (0,221) width 3: " "
     433        text run at (0,234) width 8: "A"
     434        text run at (0,247) width 7: "B"
     435        text run at (0,260) width 8: "C"
     436        text run at (0,273) width 9: "D"
     437        text run at (0,286) width 6: "E"
     438        text run at (0,299) width 6: "F"
     439        text run at (0,312) width 8: "G"
     440        text run at (0,325) width 9: "H"
     441        text run at (0,338) width 4: "I"
     442        text run at (0,351) width 4: "J"
     443        text run at (0,364) width 8: "K"
     444        text run at (0,377) width 6: "L"
     445        text run at (0,390) width 10: "M"
     446        text run at (0,403) width 9: "N"
     447        text run at (0,416) width 9: "O"
     448        text run at (0,429) width 7: "P"
     449        text run at (0,442) width 9: "Q"
     450        text run at (0,455) width 7: "R"
     451        text run at (0,468) width 6: "S"
     452        text run at (0,481) width 7: "T"
     453        text run at (0,494) width 8: "U"
     454        text run at (0,507) width 8: "V"
     455        text run at (0,520) width 10: "W"
     456        text run at (0,533) width 7: "X"
     457        text run at (0,546) width 7: "Y"
     458        text run at (0,559) width 7: "Z"
     459        text run at (0,572) width 3: " "
     460        text run at (0,585) width 7: "a"
     461        text run at (0,598) width 7: "b"
     462        text run at (0,611) width 6: "c"
     463        text run at (0,624) width 7: "d"
     464        text run at (0,637) width 7: "e"
     465        text run at (0,650) width 5: "f"
     466        text run at (0,663) width 7: "g"
     467        text run at (0,676) width 7: "h"
     468        text run at (0,689) width 4: "i"
     469        text run at (0,702) width 4: "j"
     470        text run at (0,715) width 7: "k"
     471        text run at (0,728) width 4: "l"
     472        text run at (0,741) width 11: "m"
     473        text run at (0,754) width 7: "n"
     474        text run at (0,767) width 7: "o"
     475        text run at (0,780) width 7: "p"
     476        text run at (0,793) width 7: "q"
     477        text run at (0,806) width 5: "r"
     478        text run at (0,819) width 6: "s"
     479        text run at (0,832) width 5: "t"
     480        text run at (0,845) width 7: "u"
     481        text run at (0,858) width 6: "v"
     482        text run at (0,871) width 3: " "
    477483layer at (376,170) size 60x28 clip at (377,171) size 43x26 scrollHeight 156
    478484  RenderTextControl {TEXTAREA} at (15,3) size 60x28 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
  • trunk/Source/WebCore/ChangeLog

    r88877 r88883  
     12011-06-13  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by David Hyatt.
     4
     5        Trailing tabs in a textarea become unselectable under certain conditions
     6        https://bugs.webkit.org/show_bug.cgi?id=54598
     7
     8        The bug was caused by WebKit's erroneously collapsing leading whitespace when white-space is
     9        set to pre-wrap. Per CSS 2.1 spec section 16.1.1, leading whitespace should not be removed
     10        in this case.
     11
     12        See also: http://www.w3.org/TR/CSS2/text.html#white-space-model
     13
     14        Fixed the bug by adding an extra argument to shouldCollapseWhiteSpace, indicating whether
     15        whitespace is leading or trailing. It defaults to leading because 16.1.1 does not allow allow
     16        collapsing of whitespace anywhere but at the end of each line.
     17
     18        Test: fast/text/pre-wrap-trailing-tab.html
     19
     20        * rendering/RenderBlockLineLayout.cpp:
     21        (WebCore::shouldCollapseWhiteSpace): Added WhitespacePosition as an argument. Returns false
     22        when whitespacePosition is not TrailingWhitespace even if white-space is pre-wrap.
     23        (WebCore::requiresLineBox): Takes WhitespacePosition as an argument and passes it to
     24        shouldCollapseWhiteSpace.
     25        (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Calls requiresLineBox.
     26        (WebCore::RenderBlock::LineBreaker::skipTrailingWhitespace): Ditto.
     27        (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace): Ditto.
     28
    1292011-06-14  Beth Dakin  <bdakin@apple.com>
    230
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r88613 r88883  
    14821482}
    14831483
    1484 static inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const LineInfo& lineInfo)
    1485 {
    1486     return style->collapseWhiteSpace() || (style->whiteSpace() == PRE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
     1484enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
     1485static inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const LineInfo& lineInfo, WhitespacePosition whitespacePosition)
     1486{
     1487    // CSS2 16.6.1
     1488    // If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is removed.
     1489    // If a space (U+0020) at the end of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is also removed.
     1490    // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-space' set to 'pre-wrap', UAs may visually collapse them.
     1491    return style->collapseWhiteSpace()
     1492        || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == PRE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
    14871493}
    14881494
     
    14951501}
    14961502
    1497 static bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = LineInfo())
     1503static bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace)
    14981504{
    14991505    if (it.m_obj->isFloatingOrPositioned())
     
    15031509        return false;
    15041510
    1505     if (!shouldCollapseWhiteSpace(it.m_obj->style(), lineInfo) || it.m_obj->isBR())
     1511    if (!shouldCollapseWhiteSpace(it.m_obj->style(), lineInfo, whitespacePosition) || it.m_obj->isBR())
    15061512        return true;
    15071513
     
    15161522
    15171523    InlineIterator it(this, inlineObj, 0);
     1524    // FIXME: We should pass correct value for WhitespacePosition.
    15181525    while (!it.atEnd() && !requiresLineBox(it))
    15191526        it.increment();
     
    15301537void RenderBlock::LineBreaker::skipTrailingWhitespace(InlineIterator& iterator, const LineInfo& lineInfo)
    15311538{
    1532     while (!iterator.atEnd() && !requiresLineBox(iterator, lineInfo)) {
     1539    while (!iterator.atEnd() && !requiresLineBox(iterator, lineInfo, TrailingWhitespace)) {
    15331540        RenderObject* object = iterator.m_obj;
    15341541        if (object->isFloating()) {
     
    15431550                                                     FloatingObject* lastFloatFromPreviousLine, LineWidth& width)
    15441551{
    1545     while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), lineInfo)) {
     1552    while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
    15461553        RenderObject* object = resolver.position().m_obj;
    15471554        if (object->isFloating())
Note: See TracChangeset for help on using the changeset viewer.