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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1556 // the replaced elements later. In partial layout mode, line boxes are n ot | 1556 // the replaced elements later. In partial layout mode, line boxes are n ot |
1557 // deleted and only dirtied. In that case, we can layout the replaced | 1557 // deleted and only dirtied. In that case, we can layout the replaced |
1558 // elements at the same time. | 1558 // elements at the same time. |
1559 Vector<LayoutBox*> replacedChildren; | 1559 Vector<LayoutBox*> replacedChildren; |
1560 for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { | 1560 for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { |
1561 LayoutObject* o = walker.current(); | 1561 LayoutObject* o = walker.current(); |
1562 | 1562 |
1563 if (!layoutState.hasInlineChild() && o->isInline()) | 1563 if (!layoutState.hasInlineChild() && o->isInline()) |
1564 layoutState.setHasInlineChild(true); | 1564 layoutState.setHasInlineChild(true); |
1565 | 1565 |
1566 if (o->isBR() && o->style()->clear() != CNONE) | |
1567 layoutState.setContainsBRWithClear(true); | |
1568 | |
1566 if (o->isReplaced() || o->isFloating() || o->isOutOfFlowPositioned() ) { | 1569 if (o->isReplaced() || o->isFloating() || o->isOutOfFlowPositioned() ) { |
1567 LayoutBox* box = toLayoutBox(o); | 1570 LayoutBox* box = toLayoutBox(o); |
1568 | 1571 |
1569 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, *box); | 1572 updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, *box); |
1570 | 1573 |
1571 if (o->isOutOfFlowPositioned()) { | 1574 if (o->isOutOfFlowPositioned()) { |
1572 o->containingBlock()->insertPositionedObject(box); | 1575 o->containingBlock()->insertPositionedObject(box); |
1573 } else if (o->isFloating()) { | 1576 } else if (o->isFloating()) { |
1574 layoutState.floats().append(FloatWithRect(box)); | 1577 layoutState.floats().append(FloatWithRect(box)); |
1575 } else if (isFullLayout || o->needsLayout()) { | 1578 } else if (isFullLayout || o->needsLayout()) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1851 } | 1854 } |
1852 | 1855 |
1853 return true; | 1856 return true; |
1854 } | 1857 } |
1855 | 1858 |
1856 bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB idiResolver& resolver, const InlineIterator& endLineStart, const BidiStatus& end LineStatus) | 1859 bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB idiResolver& resolver, const InlineIterator& endLineStart, const BidiStatus& end LineStatus) |
1857 { | 1860 { |
1858 if (resolver.position() == endLineStart) { | 1861 if (resolver.position() == endLineStart) { |
1859 if (resolver.status() != endLineStatus) | 1862 if (resolver.status() != endLineStatus) |
1860 return false; | 1863 return false; |
1864 | |
1865 // For partial layout where the block contains floats, the end line here is the last visible one. | |
1866 // It misleads shorter height of the block than expected. We should chec k until the end line | |
leviw_travelin_and_unemployed
2015/05/20 21:22:29
"It misleads shorter height of the block than expe
changseok
2015/05/21 09:32:40
Hrm.. what does not make sense to you? If you coul
leviw_travelin_and_unemployed
2015/05/21 17:49:50
It's not proper English... "shorter height of the
changseok
2015/05/22 08:47:35
Oops, English is not my mother language so I used
| |
1867 // of the block for the case. | |
1868 if (layoutState.containsBRWithClear() && containsFloats()) | |
1869 return false; | |
1861 return checkPaginationAndFloatsAtEndLine(layoutState); | 1870 return checkPaginationAndFloatsAtEndLine(layoutState); |
1862 } | 1871 } |
1863 | 1872 |
1864 // The first clean line doesn't match, but we can check a handful of followi ng lines to try | 1873 // The first clean line doesn't match, but we can check a handful of followi ng lines to try |
1865 // to match back up. | 1874 // to match back up. |
1866 static int numLines = 8; // The # of lines we're willing to match against. | 1875 static int numLines = 8; // The # of lines we're willing to match against. |
1867 RootInlineBox* originalEndLine = layoutState.endLine(); | 1876 RootInlineBox* originalEndLine = layoutState.endLine(); |
1868 RootInlineBox* line = originalEndLine; | 1877 RootInlineBox* line = originalEndLine; |
1869 for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) { | 1878 for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) { |
1870 if (line->lineBreakObj() == resolver.position().object() && line->lineBr eakPos() == resolver.position().offset()) { | 1879 if (line->lineBreakObj() == resolver.position().object() && line->lineBr eakPos() == resolver.position().offset()) { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2051 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); | 2060 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); |
2052 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; | 2061 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; |
2053 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); | 2062 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); |
2054 | 2063 |
2055 if (!style()->isLeftToRightDirection()) | 2064 if (!style()->isLeftToRightDirection()) |
2056 return logicalWidth() - logicalLeft; | 2065 return logicalWidth() - logicalLeft; |
2057 return logicalLeft; | 2066 return logicalLeft; |
2058 } | 2067 } |
2059 | 2068 |
2060 } | 2069 } |
OLD | NEW |