[webkit-changes] cvs commit: WebCore/layout-tests/fast/text/whitespace pre-break-word-expected.txt pre-break-word.html

David hyatt at opensource.apple.com
Mon Aug 8 17:13:50 PDT 2005


hyatt       05/08/08 17:13:49

  Modified:    .        ChangeLog
               khtml/rendering bidi.cpp
  Added:       layout-tests/fast/text/whitespace
                        pre-break-word-expected.txt pre-break-word.html
  Log:
  	Fix for radar bug #4202641, make sure line breaks happen inside
  	white-space:pre if word-wrap:break-word is set.
  
          Reviewed by darin
  
          Test cases added: fast/text/whitespace/pre-break-word.html
  
          * khtml/rendering/bidi.cpp:
          (khtml::RenderBlock::findNextLineBreak):
  
  Revision  Changes    Path
  1.4544    +12 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4543
  retrieving revision 1.4544
  diff -u -r1.4543 -r1.4544
  --- ChangeLog	8 Aug 2005 22:29:35 -0000	1.4543
  +++ ChangeLog	9 Aug 2005 00:13:45 -0000	1.4544
  @@ -1,3 +1,15 @@
  +2005-08-08  David Hyatt  <hyatt at apple.com>
  +
  +	Fix for radar bug #4202641, make sure line breaks happen inside
  +	white-space:pre if word-wrap:break-word is set.
  +	
  +        Reviewed by darin
  +
  +        Test cases added: fast/text/whitespace/pre-break-word.html
  +
  +        * khtml/rendering/bidi.cpp:
  +        (khtml::RenderBlock::findNextLineBreak):
  +
   2005-08-08  Darin Adler  <darin at apple.com>
   
           Reviewed by John.
  
  
  
  1.138     +2 -2      WebCore/khtml/rendering/bidi.cpp
  
  Index: bidi.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/bidi.cpp,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -r1.137 -r1.138
  --- bidi.cpp	1 Aug 2005 03:20:49 -0000	1.137
  +++ bidi.cpp	9 Aug 2005 00:13:49 -0000	1.138
  @@ -2096,7 +2096,7 @@
                   bool applyWordSpacing = false;
                   bool isNormal = o->style()->whiteSpace() == NORMAL;
                   bool breakNBSP = isNormal && o->style()->nbspMode() == SPACE;
  -                bool breakWords = w == 0 && isNormal && o->style()->wordWrap() == BREAK_WORD;
  +                bool breakWords = w == 0 && o->style()->wordWrap() == BREAK_WORD && (isNormal || o->style()->whiteSpace() == PRE);
   
                   currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c.unicode() == nonBreakingSpace);
   
  @@ -2152,7 +2152,7 @@
                           }
                       }
           
  -                    if (o->style()->whiteSpace() == NORMAL) {
  +                    if (o->style()->whiteSpace() == NORMAL || breakWords) {
                           // In AFTER_WHITE_SPACE mode, consider the current character
                           // as candidate width for this line.
                           int charWidth = o->style()->khtmlLineBreak() == AFTER_WHITE_SPACE ? t->width(pos, 1, f, w+tmpW) : 0;
  
  
  
  1.1                  WebCore/layout-tests/fast/text/whitespace/pre-break-word-expected.txt
  
  Index: pre-break-word-expected.txt
  ===================================================================
  layer at (0,0) size 800x600
    RenderCanvas at (0,0) size 800x600
  layer at (0,0) size 800x600
    RenderBlock {HTML} at (0,0) size 800x600
      RenderBody {BODY} at (8,8) size 784x584
        RenderBlock {DIV} at (0,0) size 154x130 [border: (2px solid #FF0000)]
          RenderText {TEXT} at (2,2) size 149x126
            text run at (2,2) width 149: "Even though this div is "
            text run at (2,20) width 149: "white-space pre, the tex"
            text run at (2,38) width 145: "t inside should still wra"
            text run at (2,56) width 145: "p to multiple lines beca"
            text run at (2,74) width 147: "use of the word-wrap:b"
            text run at (2,92) width 147: "reak-word CSS propert"
            text run at (2,110) width 12: "y."
  
  
  
  1.1                  WebCore/layout-tests/fast/text/whitespace/pre-break-word.html
  
  Index: pre-break-word.html
  ===================================================================
  <div style="border:2px solid red;width:150px;word-wrap:break-word;white-space:pre">Even though this div is white-space pre, the text inside should still wrap to multiple lines because of the word-wrap:break-word CSS property.</div>
  
  



More information about the webkit-changes mailing list