Changeset 86093 in webkit


Ignore:
Timestamp:
May 9, 2011 3:27:27 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-05-09 Eric Seidel <eric@webkit.org>

Reviewed by Ryosuke Niwa.

Abstract line deletion code into a function
https://bugs.webkit.org/show_bug.cgi?id=60501

No change in behavior, thus no testing.

  • rendering/RenderBlockLineLayout.cpp: (WebCore::deleteLineRange): (WebCore::RenderBlock::layoutRunsAndFloats): (WebCore::RenderBlock::determineStartPosition): (WebCore::RenderBlock::matchedEndLine):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86092 r86093  
     12011-05-09  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Abstract line deletion code into a function
     6        https://bugs.webkit.org/show_bug.cgi?id=60501
     7
     8        No change in behavior, thus no testing.
     9
     10        * rendering/RenderBlockLineLayout.cpp:
     11        (WebCore::deleteLineRange):
     12        (WebCore::RenderBlock::layoutRunsAndFloats):
     13        (WebCore::RenderBlock::determineStartPosition):
     14        (WebCore::RenderBlock::matchedEndLine):
     15
    1162011-05-09  Darin Adler  <darin@apple.com>
    217
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r86028 r86093  
    817817}
    818818
     819static void deleteLineRange(RenderArena* arena, RootInlineBox* startLine, int& repaintLogicalTop, int& repaintLogicalBottom, RootInlineBox* stopLine = 0)
     820{
     821    RootInlineBox* boxToDelete = startLine;
     822    while (boxToDelete && boxToDelete != stopLine) {
     823        repaintLogicalTop = min(repaintLogicalTop, boxToDelete->logicalTopVisualOverflow());
     824        repaintLogicalBottom = max(repaintLogicalBottom, boxToDelete->logicalBottomVisualOverflow());
     825        RootInlineBox* next = boxToDelete->nextRootBox();
     826        boxToDelete->deleteLine(arena);
     827        boxToDelete = next;
     828    }
     829}
     830
    819831void RenderBlock::layoutRunsAndFloats(bool fullLayout, bool hasInlineChild, Vector<FloatWithRect>& floats, int& repaintLogicalTop, int& repaintLogicalBottom)
    820832{
     
    862874            repaintLogicalBottom = logicalHeight();
    863875        }
    864         RenderArena* arena = renderArena();
    865         RootInlineBox* box = startLine;
    866         while (box) {
    867             repaintLogicalTop = min(repaintLogicalTop, box->logicalTopVisualOverflow());
    868             repaintLogicalBottom = max(repaintLogicalBottom, box->logicalBottomVisualOverflow());
    869             RootInlineBox* next = box->nextRootBox();
    870             box->deleteLine(arena);
    871             box = next;
    872         }
     876        deleteLineRange(renderArena(), startLine, repaintLogicalTop, repaintLogicalBottom);
    873877    }
    874878
     
    10431047        } else {
    10441048            // Delete all the remaining lines.
    1045             RootInlineBox* line = endLine;
    1046             RenderArena* arena = renderArena();
    1047             while (line) {
    1048                 repaintLogicalTop = min(repaintLogicalTop, line->logicalTopVisualOverflow());
    1049                 repaintLogicalBottom = max(repaintLogicalBottom, line->logicalBottomVisualOverflow());
    1050                 RootInlineBox* next = line->nextRootBox();
    1051                 line->deleteLine(arena);
    1052                 line = next;
    1053             }
     1049            deleteLineRange(renderArena(), endLine, repaintLogicalTop, repaintLogicalBottom);
    10541050        }
    10551051    }
     
    14311427
    14321428            // Now delete the lines that we failed to sync.
    1433             RootInlineBox* boxToDelete = endLine;
    1434             RenderArena* arena = renderArena();
    1435             while (boxToDelete && boxToDelete != result) {
    1436                 repaintLogicalTop = min(repaintLogicalTop, boxToDelete->logicalTopVisualOverflow());
    1437                 repaintLogicalBottom = max(repaintLogicalBottom, boxToDelete->logicalBottomVisualOverflow());
    1438                 RootInlineBox* next = boxToDelete->nextRootBox();
    1439                 boxToDelete->deleteLine(arena);
    1440                 boxToDelete = next;
    1441             }
    1442 
     1429            deleteLineRange(renderArena(), endLine, repaintLogicalTop, repaintLogicalBottom, result);
    14431430            endLine = result;
    14441431            return result;
Note: See TracChangeset for help on using the changeset viewer.