Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 738 | 738 |
| 739 void LayoutBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState) | 739 void LayoutBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState) |
| 740 { | 740 { |
| 741 // We want to skip ahead to the first dirty line | 741 // We want to skip ahead to the first dirty line |
| 742 InlineBidiResolver resolver; | 742 InlineBidiResolver resolver; |
| 743 RootInlineBox* startLine = determineStartPosition(layoutState, resolver); | 743 RootInlineBox* startLine = determineStartPosition(layoutState, resolver); |
| 744 | 744 |
| 745 if (containsFloats()) | 745 if (containsFloats()) |
| 746 layoutState.setLastFloat(m_floatingObjects->set().last().get()); | 746 layoutState.setLastFloat(m_floatingObjects->set().last().get()); |
| 747 | 747 |
| 748 | |
|
leviw_travelin_and_unemployed
2015/05/11 00:25:29
Remove unnecessary empty line.
changseok
2015/05/11 15:56:46
Done.
| |
| 748 // We also find the first clean line and extract these lines. We will add t hem back | 749 // We also find the first clean line and extract these lines. We will add t hem back |
| 749 // if we determine that we're able to synchronize after handling all our dir ty lines. | 750 // if we determine that we're able to synchronize after handling all our dir ty lines. |
| 750 InlineIterator cleanLineStart; | 751 InlineIterator cleanLineStart; |
| 751 BidiStatus cleanLineBidiStatus; | 752 BidiStatus cleanLineBidiStatus; |
| 752 if (!layoutState.isFullLayout() && startLine) | 753 if (!layoutState.isFullLayout() && startLine) |
| 753 determineEndPosition(layoutState, startLine, cleanLineStart, cleanLineBi diStatus); | 754 determineEndPosition(layoutState, startLine, cleanLineStart, cleanLineBi diStatus); |
| 754 | 755 |
| 755 if (startLine) { | 756 if (startLine) { |
| 756 if (!layoutState.usesPaintInvalidationBounds()) | 757 if (!layoutState.usesPaintInvalidationBounds()) |
| 757 layoutState.setPaintInvalidationRange(logicalHeight()); | 758 layoutState.setPaintInvalidationRange(logicalHeight()); |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1557 // the replaced elements later. In partial layout mode, line boxes are n ot | 1558 // the replaced elements later. In partial layout mode, line boxes are n ot |
| 1558 // deleted and only dirtied. In that case, we can layout the replaced | 1559 // deleted and only dirtied. In that case, we can layout the replaced |
| 1559 // elements at the same time. | 1560 // elements at the same time. |
| 1560 Vector<LayoutBox*> replacedChildren; | 1561 Vector<LayoutBox*> replacedChildren; |
| 1561 for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { | 1562 for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { |
| 1562 LayoutObject* o = walker.current(); | 1563 LayoutObject* o = walker.current(); |
| 1563 | 1564 |
| 1564 if (!layoutState.hasInlineChild() && o->isInline()) | 1565 if (!layoutState.hasInlineChild() && o->isInline()) |
| 1565 layoutState.setHasInlineChild(true); | 1566 layoutState.setHasInlineChild(true); |
| 1566 | 1567 |
| 1568 if (o->isBR() && (o->style()->clear() != CNONE)) | |
|
esprehn
2015/05/10 18:23:35
remove parens
changseok
2015/05/11 15:56:46
Done.
| |
| 1569 layoutState.setContainsClearBR(true); | |
| 1570 | |
| 1567 if (o->isReplaced() || o->isFloating() || o->isOutOfFlowPositioned() ) { | 1571 if (o->isReplaced() || o->isFloating() || o->isOutOfFlowPositioned() ) { |
| 1568 LayoutBox* box = toLayoutBox(o); | 1572 LayoutBox* box = toLayoutBox(o); |
| 1569 | 1573 |
| 1570 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, *box); | 1574 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, *box); |
| 1571 | 1575 |
| 1572 if (o->isOutOfFlowPositioned()) { | 1576 if (o->isOutOfFlowPositioned()) { |
| 1573 o->containingBlock()->insertPositionedObject(box); | 1577 o->containingBlock()->insertPositionedObject(box); |
| 1574 } else if (o->isFloating()) { | 1578 } else if (o->isFloating()) { |
| 1575 layoutState.floats().append(FloatWithRect(box)); | 1579 layoutState.floats().append(FloatWithRect(box)); |
| 1576 } else if (isFullLayout || o->needsLayout()) { | 1580 } else if (isFullLayout || o->needsLayout()) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1850 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottom ForFloat(floatingObject) < logicalBottom) | 1854 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottom ForFloat(floatingObject) < logicalBottom) |
| 1851 return false; | 1855 return false; |
| 1852 } | 1856 } |
| 1853 | 1857 |
| 1854 return true; | 1858 return true; |
| 1855 } | 1859 } |
| 1856 | 1860 |
| 1857 bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB idiResolver& resolver, const InlineIterator& endLineStart, const BidiStatus& end LineStatus) | 1861 bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB idiResolver& resolver, const InlineIterator& endLineStart, const BidiStatus& end LineStatus) |
| 1858 { | 1862 { |
| 1859 if (resolver.position() == endLineStart) { | 1863 if (resolver.position() == endLineStart) { |
| 1860 if (resolver.status() != endLineStatus) | 1864 if ((resolver.status() != endLineStatus) || (containsFloats() && layoutS tate.containsClearBR())) |
|
esprehn
2015/05/10 18:23:35
remove extra parens on the first expr.
changseok
2015/05/11 15:56:46
Done.
| |
| 1861 return false; | 1865 return false; |
| 1862 return checkPaginationAndFloatsAtEndLine(layoutState); | 1866 return checkPaginationAndFloatsAtEndLine(layoutState); |
| 1863 } | 1867 } |
| 1864 | 1868 |
| 1865 // The first clean line doesn't match, but we can check a handful of followi ng lines to try | 1869 // The first clean line doesn't match, but we can check a handful of followi ng lines to try |
| 1866 // to match back up. | 1870 // to match back up. |
| 1867 static int numLines = 8; // The # of lines we're willing to match against. | 1871 static int numLines = 8; // The # of lines we're willing to match against. |
| 1868 RootInlineBox* originalEndLine = layoutState.endLine(); | 1872 RootInlineBox* originalEndLine = layoutState.endLine(); |
| 1869 RootInlineBox* line = originalEndLine; | 1873 RootInlineBox* line = originalEndLine; |
| 1870 for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) { | 1874 for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2052 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); | 2056 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); |
| 2053 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; | 2057 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; |
| 2054 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); | 2058 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); |
| 2055 | 2059 |
| 2056 if (!style()->isLeftToRightDirection()) | 2060 if (!style()->isLeftToRightDirection()) |
| 2057 return logicalWidth() - logicalLeft; | 2061 return logicalWidth() - logicalLeft; |
| 2058 return logicalLeft; | 2062 return logicalLeft; |
| 2059 } | 2063 } |
| 2060 | 2064 |
| 2061 } | 2065 } |
| OLD | NEW |