[webkit-changes] cvs commit: WebCore/khtml/rendering bidi.cpp render_block.h

David hyatt at opensource.apple.com
Thu Nov 3 13:06:00 PST 2005


hyatt       05/11/03 13:05:59

  Modified:    .        ChangeLog
               khtml/rendering bidi.cpp render_block.h
  Log:
  	Make pre-wrap collapse away spaces at the start of a line.  There are
  	still several bugs, namely with overflow and with selection.  This is bugzilla
  	bug 5593.
  
          Reviewed by adele
  
  	fast/text/whitespace/pre-wrap.html
  
          * khtml/rendering/bidi.cpp:
          (khtml::skipNonBreakingSpace):
          (khtml::shouldCollapseWhiteSpace):
          (khtml::RenderBlock::skipWhitespace):
          * khtml/rendering/render_block.h:
  
  Revision  Changes    Path
  1.332     +16 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.331
  retrieving revision 1.332
  diff -u -r1.331 -r1.332
  --- ChangeLog	3 Nov 2005 20:00:51 -0000	1.331
  +++ ChangeLog	3 Nov 2005 21:05:55 -0000	1.332
  @@ -1,3 +1,19 @@
  +2005-11-03  David Hyatt  <hyatt at apple.com>
  +
  +	Make pre-wrap collapse away spaces at the start of a line.  There are
  +	still several bugs, namely with overflow and with selection.  This is bugzilla
  +	bug 5593.
  +	
  +        Reviewed by adele
  +
  +	fast/text/whitespace/pre-wrap.html
  +
  +        * khtml/rendering/bidi.cpp:
  +        (khtml::skipNonBreakingSpace):
  +        (khtml::shouldCollapseWhiteSpace):
  +        (khtml::RenderBlock::skipWhitespace):
  +        * khtml/rendering/render_block.h:
  +
   2005-11-03  Adele Peterson  <adele at apple.com>
   
           Reviewed by Darin.
  
  
  
  1.155     +7 -2      WebCore/khtml/rendering/bidi.cpp
  
  Index: bidi.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/bidi.cpp,v
  retrieving revision 1.154
  retrieving revision 1.155
  diff -u -r1.154 -r1.155
  --- bidi.cpp	2 Nov 2005 08:52:44 -0000	1.154
  +++ bidi.cpp	3 Nov 2005 21:05:59 -0000	1.155
  @@ -1872,7 +1872,7 @@
   
   static const ushort nonBreakingSpace = 0xa0;
   
  -inline bool RenderBlock::skipNonBreakingSpace(BidiIterator &it)
  +static inline bool skipNonBreakingSpace(BidiIterator &it)
   {
       if (it.obj->style()->nbspMode() != SPACE || it.current().unicode() != nonBreakingSpace)
           return false;
  @@ -1888,6 +1888,11 @@
       return true;
   }
   
  +static inline bool shouldCollapseWhiteSpace(const RenderStyle* style)
  +{
  +    return style->collapseWhiteSpace() || (style->whiteSpace() == PRE_WRAP && (!isLineEmpty || !previousLineBrokeCleanly));
  +}
  +
   int RenderBlock::skipWhitespace(BidiIterator &it, BidiState &bidi)
   {
       // FIXME: The entire concept of the skipWhitespace function is flawed, since we really need to be building
  @@ -1895,7 +1900,7 @@
       // elements quite right.  In other words, we need to build this function's work into the normal line
       // object iteration process.
       int w = lineWidth(m_height);
  -    while (!it.atEnd() && (it.obj->isInlineFlow() || (it.obj->style()->collapseWhiteSpace() && !it.obj->isBR() &&
  +    while (!it.atEnd() && (it.obj->isInlineFlow() || (shouldCollapseWhiteSpace(it.obj->style()) && !it.obj->isBR() &&
             (it.current() == ' ' || it.current() == '\t' || (!it.obj->style()->preserveNewline() && it.current() == '\n') ||
             it.current().unicode() == SOFT_HYPHEN || skipNonBreakingSpace(it) || it.obj->isFloatingOrPositioned())))) {
           if (it.obj->isFloatingOrPositioned()) {
  
  
  
  1.72      +0 -1      WebCore/khtml/rendering/render_block.h
  
  Index: render_block.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_block.h,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- render_block.h	2 Nov 2005 08:52:45 -0000	1.71
  +++ render_block.h	3 Nov 2005 21:05:59 -0000	1.72
  @@ -270,7 +270,6 @@
   private:
       DOM::Position positionForBox(InlineBox *box, bool start=true) const;
       DOM::Position positionForRenderer(RenderObject *renderer, bool start=true) const;
  -    bool skipNonBreakingSpace(BidiIterator &it);
       
   protected:
       struct FloatingObject {
  
  
  



More information about the webkit-changes mailing list