Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Side by Side Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 16896019: Replace RenderArena with PartitionAlloc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // Adding a pair of midpoints before a character will split it out into a new li ne box. 391 // Adding a pair of midpoints before a character will split it out into a new li ne box.
392 static inline void ensureCharacterGetsLineBox(LineMidpointState& lineMidpointSta te, InlineIterator& textParagraphSeparator) 392 static inline void ensureCharacterGetsLineBox(LineMidpointState& lineMidpointSta te, InlineIterator& textParagraphSeparator)
393 { 393 {
394 InlineIterator midpoint(0, textParagraphSeparator.m_obj, textParagraphSepara tor.m_pos); 394 InlineIterator midpoint(0, textParagraphSeparator.m_obj, textParagraphSepara tor.m_pos);
395 startIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSepara tor.m_obj, textParagraphSeparator.m_pos - 1)); 395 startIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSepara tor.m_obj, textParagraphSeparator.m_pos - 1));
396 stopIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSeparat or.m_obj, textParagraphSeparator.m_pos)); 396 stopIgnoringSpaces(lineMidpointState, InlineIterator(0, textParagraphSeparat or.m_obj, textParagraphSeparator.m_pos));
397 } 397 }
398 398
399 static inline BidiRun* createRun(int start, int end, RenderObject* obj, InlineBi diResolver& resolver) 399 static inline BidiRun* createRun(int start, int end, RenderObject* obj, InlineBi diResolver& resolver)
400 { 400 {
401 return new (obj->renderArena()) BidiRun(start, end, obj, resolver.context(), resolver.dir()); 401 return new BidiRun(start, end, obj, resolver.context(), resolver.dir());
402 } 402 }
403 403
404 void RenderBlock::appendRunsForObject(BidiRunList<BidiRun>& runs, int start, int end, RenderObject* obj, InlineBidiResolver& resolver) 404 void RenderBlock::appendRunsForObject(BidiRunList<BidiRun>& runs, int start, int end, RenderObject* obj, InlineBidiResolver& resolver)
405 { 405 {
406 if (start > end || shouldSkipCreatingRunsForObject(obj)) 406 if (start > end || shouldSkipCreatingRunsForObject(obj))
407 return; 407 return;
408 408
409 LineMidpointState& lineMidpointState = resolver.midpointState(); 409 LineMidpointState& lineMidpointState = resolver.midpointState();
410 bool haveNextMidpoint = (lineMidpointState.currentMidpoint < lineMidpointSta te.numMidpoints); 410 bool haveNextMidpoint = (lineMidpointState.currentMidpoint < lineMidpointSta te.numMidpoints);
411 InlineIterator nextMidpoint; 411 InlineIterator nextMidpoint;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 if (firstSpace == trailingSpaceRun->stop()) 1167 if (firstSpace == trailingSpaceRun->stop())
1168 return 0; 1168 return 0;
1169 1169
1170 TextDirection direction = style()->direction(); 1170 TextDirection direction = style()->direction();
1171 bool shouldReorder = trailingSpaceRun != (direction == LTR ? bidiRuns.lastRu n() : bidiRuns.firstRun()); 1171 bool shouldReorder = trailingSpaceRun != (direction == LTR ? bidiRuns.lastRu n() : bidiRuns.firstRun());
1172 if (firstSpace != trailingSpaceRun->start()) { 1172 if (firstSpace != trailingSpaceRun->start()) {
1173 BidiContext* baseContext = currentContext; 1173 BidiContext* baseContext = currentContext;
1174 while (BidiContext* parent = baseContext->parent()) 1174 while (BidiContext* parent = baseContext->parent())
1175 baseContext = parent; 1175 baseContext = parent;
1176 1176
1177 BidiRun* newTrailingRun = new (renderArena()) BidiRun(firstSpace, traili ngSpaceRun->m_stop, trailingSpaceRun->m_object, baseContext, OtherNeutral); 1177 BidiRun* newTrailingRun = new BidiRun(firstSpace, trailingSpaceRun->m_st op, trailingSpaceRun->m_object, baseContext, OtherNeutral);
1178 trailingSpaceRun->m_stop = firstSpace; 1178 trailingSpaceRun->m_stop = firstSpace;
1179 if (direction == LTR) 1179 if (direction == LTR)
1180 bidiRuns.addRun(newTrailingRun); 1180 bidiRuns.addRun(newTrailingRun);
1181 else 1181 else
1182 bidiRuns.prependRun(newTrailingRun); 1182 bidiRuns.prependRun(newTrailingRun);
1183 trailingSpaceRun = newTrailingRun; 1183 trailingSpaceRun = newTrailingRun;
1184 return trailingSpaceRun; 1184 return trailingSpaceRun;
1185 } 1185 }
1186 if (!shouldReorder) 1186 if (!shouldReorder)
1187 return trailingSpaceRun; 1187 return trailingSpaceRun;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 1439
1440 // FIXME: Should this be a range object instead of two ints? 1440 // FIXME: Should this be a range object instead of two ints?
1441 LayoutUnit& m_repaintLogicalTop; 1441 LayoutUnit& m_repaintLogicalTop;
1442 LayoutUnit& m_repaintLogicalBottom; 1442 LayoutUnit& m_repaintLogicalBottom;
1443 1443
1444 bool m_usesRepaintBounds; 1444 bool m_usesRepaintBounds;
1445 1445
1446 RenderFlowThread* m_flowThread; 1446 RenderFlowThread* m_flowThread;
1447 }; 1447 };
1448 1448
1449 static void deleteLineRange(LineLayoutState& layoutState, RenderArena* arena, Ro otInlineBox* startLine, RootInlineBox* stopLine = 0) 1449 static void deleteLineRange(LineLayoutState& layoutState, RootInlineBox* startLi ne, RootInlineBox* stopLine = 0)
1450 { 1450 {
1451 RootInlineBox* boxToDelete = startLine; 1451 RootInlineBox* boxToDelete = startLine;
1452 while (boxToDelete && boxToDelete != stopLine) { 1452 while (boxToDelete && boxToDelete != stopLine) {
1453 layoutState.updateRepaintRangeFromBox(boxToDelete); 1453 layoutState.updateRepaintRangeFromBox(boxToDelete);
1454 // Note: deleteLineRange(renderArena(), firstRootBox()) is not identical to deleteLineBoxTree(). 1454 // Note: deleteLineRange(firstRootBox()) is not identical to deleteLineB oxTree().
1455 // deleteLineBoxTree uses nextLineBox() instead of nextRootBox() when tr aversing. 1455 // deleteLineBoxTree uses nextLineBox() instead of nextRootBox() when tr aversing.
1456 RootInlineBox* next = boxToDelete->nextRootBox(); 1456 RootInlineBox* next = boxToDelete->nextRootBox();
1457 boxToDelete->deleteLine(arena); 1457 boxToDelete->deleteLine();
1458 boxToDelete = next; 1458 boxToDelete = next;
1459 } 1459 }
1460 } 1460 }
1461 1461
1462 void RenderBlock::layoutRunsAndFloats(LineLayoutState& layoutState, bool hasInli neChild) 1462 void RenderBlock::layoutRunsAndFloats(LineLayoutState& layoutState, bool hasInli neChild)
1463 { 1463 {
1464 // We want to skip ahead to the first dirty line 1464 // We want to skip ahead to the first dirty line
1465 InlineBidiResolver resolver; 1465 InlineBidiResolver resolver;
1466 RootInlineBox* startLine = determineStartPosition(layoutState, resolver); 1466 RootInlineBox* startLine = determineStartPosition(layoutState, resolver);
1467 1467
(...skipping 24 matching lines...) Expand all
1492 // We also find the first clean line and extract these lines. We will add t hem back 1492 // We also find the first clean line and extract these lines. We will add t hem back
1493 // if we determine that we're able to synchronize after handling all our dir ty lines. 1493 // if we determine that we're able to synchronize after handling all our dir ty lines.
1494 InlineIterator cleanLineStart; 1494 InlineIterator cleanLineStart;
1495 BidiStatus cleanLineBidiStatus; 1495 BidiStatus cleanLineBidiStatus;
1496 if (!layoutState.isFullLayout() && startLine) 1496 if (!layoutState.isFullLayout() && startLine)
1497 determineEndPosition(layoutState, startLine, cleanLineStart, cleanLineBi diStatus); 1497 determineEndPosition(layoutState, startLine, cleanLineStart, cleanLineBi diStatus);
1498 1498
1499 if (startLine) { 1499 if (startLine) {
1500 if (!layoutState.usesRepaintBounds()) 1500 if (!layoutState.usesRepaintBounds())
1501 layoutState.setRepaintRange(logicalHeight()); 1501 layoutState.setRepaintRange(logicalHeight());
1502 deleteLineRange(layoutState, renderArena(), startLine); 1502 deleteLineRange(layoutState, startLine);
1503 } 1503 }
1504 1504
1505 if (!layoutState.isFullLayout() && lastRootBox() && lastRootBox()->endsWithB reak()) { 1505 if (!layoutState.isFullLayout() && lastRootBox() && lastRootBox()->endsWithB reak()) {
1506 // If the last line before the start line ends with a line break that cl ear floats, 1506 // If the last line before the start line ends with a line break that cl ear floats,
1507 // adjust the height accordingly. 1507 // adjust the height accordingly.
1508 // A line break can be either the first or the last object on a line, de pending on its direction. 1508 // A line break can be either the first or the last object on a line, de pending on its direction.
1509 if (InlineBox* lastLeafChild = lastRootBox()->lastLeafChild()) { 1509 if (InlineBox* lastLeafChild = lastRootBox()->lastLeafChild()) {
1510 RenderObject* lastObject = lastLeafChild->renderer(); 1510 RenderObject* lastObject = lastLeafChild->renderer();
1511 if (!lastObject->isBR()) 1511 if (!lastObject->isBR())
1512 lastObject = lastRootBox()->firstLeafChild()->renderer(); 1512 lastObject = lastRootBox()->firstLeafChild()->renderer();
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 LayoutUnit adjustment = 0; 1686 LayoutUnit adjustment = 0;
1687 adjustLinePositionForPagination(lineBox, adjustment, layoutS tate.flowThread()); 1687 adjustLinePositionForPagination(lineBox, adjustment, layoutS tate.flowThread());
1688 if (adjustment) { 1688 if (adjustment) {
1689 LayoutUnit oldLineWidth = availableLogicalWidthForLine(o ldLogicalHeight, layoutState.lineInfo().isFirstLine()); 1689 LayoutUnit oldLineWidth = availableLogicalWidthForLine(o ldLogicalHeight, layoutState.lineInfo().isFirstLine());
1690 lineBox->adjustBlockDirectionPosition(adjustment); 1690 lineBox->adjustBlockDirectionPosition(adjustment);
1691 if (layoutState.usesRepaintBounds()) 1691 if (layoutState.usesRepaintBounds())
1692 layoutState.updateRepaintRangeFromBox(lineBox); 1692 layoutState.updateRepaintRangeFromBox(lineBox);
1693 1693
1694 if (availableLogicalWidthForLine(oldLogicalHeight + adju stment, layoutState.lineInfo().isFirstLine()) != oldLineWidth) { 1694 if (availableLogicalWidthForLine(oldLogicalHeight + adju stment, layoutState.lineInfo().isFirstLine()) != oldLineWidth) {
1695 // We have to delete this line, remove all floats th at got added, and let line layout re-run. 1695 // We have to delete this line, remove all floats th at got added, and let line layout re-run.
1696 lineBox->deleteLine(renderArena()); 1696 lineBox->deleteLine();
1697 end = restartLayoutRunsAndFloatsInRange(oldLogicalHe ight, oldLogicalHeight + adjustment, lastFloatFromPreviousLine, resolver, oldEnd ); 1697 end = restartLayoutRunsAndFloatsInRange(oldLogicalHe ight, oldLogicalHeight + adjustment, lastFloatFromPreviousLine, resolver, oldEnd );
1698 continue; 1698 continue;
1699 } 1699 }
1700 1700
1701 setLogicalHeight(lineBox->lineBottomWithLeading()); 1701 setLogicalHeight(lineBox->lineBottomWithLeading());
1702 } 1702 }
1703 1703
1704 if (layoutState.flowThread()) 1704 if (layoutState.flowThread())
1705 lineBox->setContainingRegion(regionAtBlockOffset(lineBox ->lineTopWithLeading())); 1705 lineBox->setContainingRegion(regionAtBlockOffset(lineBox ->lineTopWithLeading()));
1706 } 1706 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 ASSERT(!floatingObject->m_originatingLine); 1825 ASSERT(!floatingObject->m_originatingLine);
1826 floatingObject->m_originatingLine = line; 1826 floatingObject->m_originatingLine = line;
1827 setLogicalHeight(logicalTopForChild(*f) - marginBeforeFo rChild(*f) + delta); 1827 setLogicalHeight(logicalTopForChild(*f) - marginBeforeFo rChild(*f) + delta);
1828 positionNewFloats(); 1828 positionNewFloats();
1829 } 1829 }
1830 } 1830 }
1831 } 1831 }
1832 setLogicalHeight(lastRootBox()->lineBottomWithLeading()); 1832 setLogicalHeight(lastRootBox()->lineBottomWithLeading());
1833 } else { 1833 } else {
1834 // Delete all the remaining lines. 1834 // Delete all the remaining lines.
1835 deleteLineRange(layoutState, renderArena(), layoutState.endLine()); 1835 deleteLineRange(layoutState, layoutState.endLine());
1836 } 1836 }
1837 } 1837 }
1838 1838
1839 if (m_floatingObjects && (layoutState.checkForFloatsFromLastLine() || positi onNewFloats()) && lastRootBox()) { 1839 if (m_floatingObjects && (layoutState.checkForFloatsFromLastLine() || positi onNewFloats()) && lastRootBox()) {
1840 // In case we have a float on the last line, it might not be positioned up to now. 1840 // In case we have a float on the last line, it might not be positioned up to now.
1841 // This has to be done before adding in the bottom border/padding, or th e float will 1841 // This has to be done before adding in the bottom border/padding, or th e float will
1842 // include the padding incorrectly. -dwh 1842 // include the padding incorrectly. -dwh
1843 if (layoutState.checkForFloatsFromLastLine()) { 1843 if (layoutState.checkForFloatsFromLastLine()) {
1844 LayoutUnit bottomVisualOverflow = lastRootBox()->logicalBottomVisual Overflow(); 1844 LayoutUnit bottomVisualOverflow = lastRootBox()->logicalBottomVisual Overflow();
1845 LayoutUnit bottomLayoutOverflow = lastRootBox()->logicalBottomLayout Overflow(); 1845 LayoutUnit bottomLayoutOverflow = lastRootBox()->logicalBottomLayout Overflow();
1846 TrailingFloatsRootInlineBox* trailingFloatsLineBox = new (renderAren a()) TrailingFloatsRootInlineBox(this); 1846 TrailingFloatsRootInlineBox* trailingFloatsLineBox = new TrailingFlo atsRootInlineBox(this);
1847 m_lineBoxes.appendLineBox(trailingFloatsLineBox); 1847 m_lineBoxes.appendLineBox(trailingFloatsLineBox);
1848 trailingFloatsLineBox->setConstructed(); 1848 trailingFloatsLineBox->setConstructed();
1849 GlyphOverflowAndFallbackFontsMap textBoxDataMap; 1849 GlyphOverflowAndFallbackFontsMap textBoxDataMap;
1850 VerticalPositionCache verticalPositionCache; 1850 VerticalPositionCache verticalPositionCache;
1851 LayoutUnit blockLogicalHeight = logicalHeight(); 1851 LayoutUnit blockLogicalHeight = logicalHeight();
1852 trailingFloatsLineBox->alignBoxesInBlockDirection(blockLogicalHeight , textBoxDataMap, verticalPositionCache); 1852 trailingFloatsLineBox->alignBoxesInBlockDirection(blockLogicalHeight , textBoxDataMap, verticalPositionCache);
1853 trailingFloatsLineBox->setLineTopBottomPositions(blockLogicalHeight, blockLogicalHeight, blockLogicalHeight, blockLogicalHeight); 1853 trailingFloatsLineBox->setLineTopBottomPositions(blockLogicalHeight, blockLogicalHeight, blockLogicalHeight, blockLogicalHeight);
1854 trailingFloatsLineBox->setPaginatedLineWidth(availableLogicalWidthFo rContent(blockLogicalHeight)); 1854 trailingFloatsLineBox->setPaginatedLineWidth(availableLogicalWidthFo rContent(blockLogicalHeight));
1855 LayoutRect logicalLayoutOverflow(0, blockLogicalHeight, 1, bottomLay outOverflow - blockLogicalHeight); 1855 LayoutRect logicalLayoutOverflow(0, blockLogicalHeight, 1, bottomLay outOverflow - blockLogicalHeight);
1856 LayoutRect logicalVisualOverflow(0, blockLogicalHeight, 1, bottomVis ualOverflow - blockLogicalHeight); 1856 LayoutRect logicalVisualOverflow(0, blockLogicalHeight, 1, bottomVis ualOverflow - blockLogicalHeight);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 1899
1900 RenderFlowThread* flowThread = flowThreadContainingBlock(); 1900 RenderFlowThread* flowThread = flowThreadContainingBlock();
1901 bool clearLinesForPagination = firstLineBox() && flowThread && !flowThread-> hasRegions(); 1901 bool clearLinesForPagination = firstLineBox() && flowThread && !flowThread-> hasRegions();
1902 1902
1903 // Figure out if we should clear out our line boxes. 1903 // Figure out if we should clear out our line boxes.
1904 // FIXME: Handle resize eventually! 1904 // FIXME: Handle resize eventually!
1905 bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren || clearLinesForPagination; 1905 bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren || clearLinesForPagination;
1906 LineLayoutState layoutState(isFullLayout, repaintLogicalTop, repaintLogicalB ottom, flowThread); 1906 LineLayoutState layoutState(isFullLayout, repaintLogicalTop, repaintLogicalB ottom, flowThread);
1907 1907
1908 if (isFullLayout) 1908 if (isFullLayout)
1909 lineBoxes()->deleteLineBoxes(renderArena()); 1909 lineBoxes()->deleteLineBoxes();
1910 1910
1911 // Text truncation kicks in in two cases: 1911 // Text truncation kicks in in two cases:
1912 // 1) If your overflow isn't visible and your text-overflow-mode isn't c lip. 1912 // 1) If your overflow isn't visible and your text-overflow-mode isn't c lip.
1913 // 2) If you're an anonymous block with a block parent that satisfies #1 . 1913 // 2) If you're an anonymous block with a block parent that satisfies #1 .
1914 // FIXME: CSS3 says that descendants that are clipped must also know how to truncate. This is insanely 1914 // FIXME: CSS3 says that descendants that are clipped must also know how to truncate. This is insanely
1915 // difficult to figure out in general (especially in the middle of doing lay out), so we only handle the 1915 // difficult to figure out in general (especially in the middle of doing lay out), so we only handle the
1916 // simple case of an anonymous block truncating when it's parent is clipped. 1916 // simple case of an anonymous block truncating when it's parent is clipped.
1917 bool hasTextOverflow = (style()->textOverflow() && hasOverflowClip()) 1917 bool hasTextOverflow = (style()->textOverflow() && hasOverflowClip())
1918 || (isAnonymousBlock() && parent() && parent()->isRenderBlock() && paren t()->style()->textOverflow() && parent()->hasOverflowClip()); 1918 || (isAnonymousBlock() && parent() && parent()->isRenderBlock() && paren t()->style()->textOverflow() && parent()->hasOverflowClip());
1919 1919
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 break; 2067 break;
2068 } 2068 }
2069 // Check if a new float has been inserted after the last known float. 2069 // Check if a new float has been inserted after the last known float.
2070 if (!curr && floatIndex < layoutState.floats().size()) 2070 if (!curr && floatIndex < layoutState.floats().size())
2071 layoutState.markForFullLayout(); 2071 layoutState.markForFullLayout();
2072 } 2072 }
2073 2073
2074 if (layoutState.isFullLayout()) { 2074 if (layoutState.isFullLayout()) {
2075 // FIXME: This should just call deleteLineBoxTree, but that causes 2075 // FIXME: This should just call deleteLineBoxTree, but that causes
2076 // crashes for fast/repaint tests. 2076 // crashes for fast/repaint tests.
2077 RenderArena* arena = renderArena();
2078 curr = firstRootBox(); 2077 curr = firstRootBox();
2079 while (curr) { 2078 while (curr) {
2080 // Note: This uses nextRootBox() insted of nextLineBox() like delete LineBoxTree does. 2079 // Note: This uses nextRootBox() insted of nextLineBox() like delete LineBoxTree does.
2081 RootInlineBox* next = curr->nextRootBox(); 2080 RootInlineBox* next = curr->nextRootBox();
2082 curr->deleteLine(arena); 2081 curr->deleteLine();
2083 curr = next; 2082 curr = next;
2084 } 2083 }
2085 ASSERT(!firstLineBox() && !lastLineBox()); 2084 ASSERT(!firstLineBox() && !lastLineBox());
2086 } else { 2085 } else {
2087 if (curr) { 2086 if (curr) {
2088 // We have a dirty line. 2087 // We have a dirty line.
2089 if (RootInlineBox* prevRootBox = curr->prevRootBox()) { 2088 if (RootInlineBox* prevRootBox = curr->prevRootBox()) {
2090 // We have a previous line. 2089 // We have a previous line.
2091 if (!dirtiedByFloat && (!prevRootBox->endsWithBreak() || !prevRo otBox->lineBreakObj() || (prevRootBox->lineBreakObj()->isText() && prevRootBox-> lineBreakPos() >= toRenderText(prevRootBox->lineBreakObj())->textLength()))) 2090 if (!dirtiedByFloat && (!prevRootBox->endsWithBreak() || !prevRo otBox->lineBreakObj() || (prevRootBox->lineBreakObj()->isText() && prevRootBox-> lineBreakPos() >= toRenderText(prevRootBox->lineBreakObj())->textLength())))
2092 // The previous line didn't break cleanly or broke at a newl ine 2091 // The previous line didn't break cleanly or broke at a newl ine
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 2249
2251 bool matched = false; 2250 bool matched = false;
2252 RootInlineBox* result = line->nextRootBox(); 2251 RootInlineBox* result = line->nextRootBox();
2253 layoutState.setEndLine(result); 2252 layoutState.setEndLine(result);
2254 if (result) { 2253 if (result) {
2255 layoutState.setEndLineLogicalTop(line->lineBottomWithLeading()); 2254 layoutState.setEndLineLogicalTop(line->lineBottomWithLeading());
2256 matched = checkPaginationAndFloatsAtEndLine(layoutState); 2255 matched = checkPaginationAndFloatsAtEndLine(layoutState);
2257 } 2256 }
2258 2257
2259 // Now delete the lines that we failed to sync. 2258 // Now delete the lines that we failed to sync.
2260 deleteLineRange(layoutState, renderArena(), originalEndLine, result) ; 2259 deleteLineRange(layoutState, originalEndLine, result);
2261 return matched; 2260 return matched;
2262 } 2261 }
2263 } 2262 }
2264 2263
2265 return false; 2264 return false;
2266 } 2265 }
2267 2266
2268 enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace }; 2267 enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
2269 static inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const Line Info& lineInfo, WhitespacePosition whitespacePosition) 2268 static inline bool shouldCollapseWhiteSpace(const RenderStyle* style, const Line Info& lineInfo, WhitespacePosition whitespacePosition)
2270 { 2269 {
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3382 3381
3383 void RenderBlock::layoutLineGridBox() 3382 void RenderBlock::layoutLineGridBox()
3384 { 3383 {
3385 if (style()->lineGrid() == RenderStyle::initialLineGrid()) { 3384 if (style()->lineGrid() == RenderStyle::initialLineGrid()) {
3386 setLineGridBox(0); 3385 setLineGridBox(0);
3387 return; 3386 return;
3388 } 3387 }
3389 3388
3390 setLineGridBox(0); 3389 setLineGridBox(0);
3391 3390
3392 RootInlineBox* lineGridBox = new (renderArena()) RootInlineBox(this); 3391 RootInlineBox* lineGridBox = new RootInlineBox(this);
3393 lineGridBox->setHasTextChildren(); // Needed to make the line ascent/descent actually be honored in quirks mode. 3392 lineGridBox->setHasTextChildren(); // Needed to make the line ascent/descent actually be honored in quirks mode.
3394 lineGridBox->setConstructed(); 3393 lineGridBox->setConstructed();
3395 GlyphOverflowAndFallbackFontsMap textBoxDataMap; 3394 GlyphOverflowAndFallbackFontsMap textBoxDataMap;
3396 VerticalPositionCache verticalPositionCache; 3395 VerticalPositionCache verticalPositionCache;
3397 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); 3396 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache);
3398 3397
3399 setLineGridBox(lineGridBox); 3398 setLineGridBox(lineGridBox);
3400 3399
3401 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying 3400 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying
3402 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping 3401 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping
3403 // to this grid. 3402 // to this grid.
3404 } 3403 }
3405 3404
3406 } 3405 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698