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

Side by Side Diff: Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1102953002: BR styled clear is ignored while partially relayouting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comments Created 5 years, 7 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
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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
leviw_travelin_and_unemployed 2015/05/14 02:22:19 It's sad that we're doing this whenever there's an
changseok 2015/05/14 16:18:46 Yeah.. Do you have any better idea to reduce itera
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottom ForFloat(floatingObject) < logicalBottom) 1852 if (logicalBottomForFloat(floatingObject) >= logicalTop && logicalBottom ForFloat(floatingObject) < logicalBottom)
1850 return false; 1853 return false;
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 || (containsFloats() && layoutSta te.containsBRWithClear()))
leviw_travelin_and_unemployed 2015/05/14 02:22:19 I think I'd prefer the following: if (resolver.st
changseok 2015/05/14 16:18:46 Make sense.
1860 return false; 1863 return false;
1861 return checkPaginationAndFloatsAtEndLine(layoutState); 1864 return checkPaginationAndFloatsAtEndLine(layoutState);
1862 } 1865 }
1863 1866
1864 // The first clean line doesn't match, but we can check a handful of followi ng lines to try 1867 // The first clean line doesn't match, but we can check a handful of followi ng lines to try
1865 // to match back up. 1868 // to match back up.
1866 static int numLines = 8; // The # of lines we're willing to match against. 1869 static int numLines = 8; // The # of lines we're willing to match against.
1867 RootInlineBox* originalEndLine = layoutState.endLine(); 1870 RootInlineBox* originalEndLine = layoutState.endLine();
1868 RootInlineBox* line = originalEndLine; 1871 RootInlineBox* line = originalEndLine;
1869 for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) { 1872 for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); 2054 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat ();
2052 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; 2055 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft;
2053 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 2056 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
2054 2057
2055 if (!style()->isLeftToRightDirection()) 2058 if (!style()->isLeftToRightDirection())
2056 return logicalWidth() - logicalLeft; 2059 return logicalWidth() - logicalLeft;
2057 return logicalLeft; 2060 return logicalLeft;
2058 } 2061 }
2059 2062
2060 } 2063 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/block/float/br-with-clear-4-expected.html ('k') | Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698