Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 | 384 |
| 385 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer()) | 385 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer()) |
| 386 analyzer->increment((frameRect() == prevRect) ? LayoutAnalyzer::LayoutBl ockRectangleDidNotChange : LayoutAnalyzer::LayoutBlockRectangleChanged); | 386 analyzer->increment((frameRect() == prevRect) ? LayoutAnalyzer::LayoutBl ockRectangleDidNotChange : LayoutAnalyzer::LayoutBlockRectangleChanged); |
| 387 | 387 |
| 388 clearNeedsLayout(); | 388 clearNeedsLayout(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit & pageLogicalHeight, SubtreeLayoutScope& layoutScope) | 391 inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit & pageLogicalHeight, SubtreeLayoutScope& layoutScope) |
| 392 { | 392 { |
| 393 LayoutUnit oldLeft = logicalLeft(); | 393 LayoutUnit oldLeft = logicalLeft(); |
| 394 recalcLogicalWidthAfterLayoutChildren: | |
| 394 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); | 395 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); |
| 395 relayoutChildren |= logicalWidthChanged; | 396 relayoutChildren |= logicalWidthChanged; |
| 396 | 397 |
| 397 rebuildFloatsFromIntruding(); | 398 rebuildFloatsFromIntruding(); |
| 398 | 399 |
| 399 bool pageLogicalHeightChanged = false; | 400 bool pageLogicalHeightChanged = false; |
| 400 bool hasSpecifiedPageLogicalHeight = false; | 401 bool hasSpecifiedPageLogicalHeight = false; |
| 401 checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightCh anged, hasSpecifiedPageLogicalHeight); | 402 checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightCh anged, hasSpecifiedPageLogicalHeight); |
| 402 if (pageLogicalHeightChanged) | 403 if (pageLogicalHeightChanged) |
| 403 relayoutChildren = true; | 404 relayoutChildren = true; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 431 if (!firstChild() && !isAnonymousBlock()) | 432 if (!firstChild() && !isAnonymousBlock()) |
| 432 setChildrenInline(true); | 433 setChildrenInline(true); |
| 433 | 434 |
| 434 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); | 435 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); |
| 435 | 436 |
| 436 if (childrenInline()) | 437 if (childrenInline()) |
| 437 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_ paintInvalidationLogicalBottom, afterEdge); | 438 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_ paintInvalidationLogicalBottom, afterEdge); |
| 438 else | 439 else |
| 439 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge ); | 440 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge ); |
| 440 | 441 |
| 442 if (needsRecalcLogicalWidthAfterLayoutChildren()) { | |
| 443 clearNeedsRecalcLogicalWidthAfterLayoutChildren(); | |
| 444 setPreferredLogicalWidthsDirty(MarkOnlyThis); | |
| 445 goto recalcLogicalWidthAfterLayoutChildren; | |
|
esprehn
2015/05/21 01:52:54
I think you can just return false here instead, th
kojii
2015/05/23 00:22:47
Done.
| |
| 446 } | |
| 447 | |
| 441 // Expand our intrinsic height to encompass floats. | 448 // Expand our intrinsic height to encompass floats. |
| 442 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext()) | 449 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext()) |
| 443 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); | 450 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); |
| 444 | 451 |
| 445 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 452 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
| 446 if (flowThread->recalculateColumnHeights()) { | 453 if (flowThread->recalculateColumnHeights()) { |
| 447 setChildNeedsLayout(MarkOnlyThis); | 454 setChildNeedsLayout(MarkOnlyThis); |
| 448 return false; | 455 return false; |
| 449 } | 456 } |
| 450 } else if (hasColumns()) { | 457 } else if (hasColumns()) { |
| (...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3153 FrameView* frameView = document().view(); | 3160 FrameView* frameView = document().view(); |
| 3154 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); | 3161 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); |
| 3155 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); | 3162 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); |
| 3156 if (size().height() < visibleHeight) | 3163 if (size().height() < visibleHeight) |
| 3157 top += (visibleHeight - size().height()) / 2; | 3164 top += (visibleHeight - size().height()) / 2; |
| 3158 setY(top); | 3165 setY(top); |
| 3159 dialog->setCentered(top); | 3166 dialog->setCentered(top); |
| 3160 } | 3167 } |
| 3161 | 3168 |
| 3162 } // namespace blink | 3169 } // namespace blink |
| OLD | NEW |