| 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 LayoutUnit afterEdge = | 531 LayoutUnit afterEdge = |
| 532 borderAfter() + paddingAfter() + scrollbarLogicalHeight(); | 532 borderAfter() + paddingAfter() + scrollbarLogicalHeight(); |
| 533 LayoutUnit previousHeight = logicalHeight(); | 533 LayoutUnit previousHeight = logicalHeight(); |
| 534 setLogicalHeight(beforeEdge); | 534 setLogicalHeight(beforeEdge); |
| 535 | 535 |
| 536 if (!firstChild() && !isAnonymousBlock()) | 536 if (!firstChild() && !isAnonymousBlock()) |
| 537 setChildrenInline(true); | 537 setChildrenInline(true); |
| 538 | 538 |
| 539 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); | 539 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); |
| 540 | 540 |
| 541 bool preferredLogicalWidthsWereDirty = preferredLogicalWidthsDirty(); | |
| 542 | |
| 543 // Reset the flag here instead of in layoutInlineChildren() in case that | 541 // Reset the flag here instead of in layoutInlineChildren() in case that |
| 544 // all inline children are removed from this block. | 542 // all inline children are removed from this block. |
| 545 setContainsInlineWithOutlineAndContinuation(false); | 543 setContainsInlineWithOutlineAndContinuation(false); |
| 546 if (childrenInline()) | 544 if (childrenInline()) |
| 547 layoutInlineChildren(relayoutChildren, afterEdge); | 545 layoutInlineChildren(relayoutChildren, afterEdge); |
| 548 else | 546 else |
| 549 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); | 547 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); |
| 550 | 548 |
| 551 bool preferredLogicalWidthsBecameDirty = | |
| 552 !preferredLogicalWidthsWereDirty && preferredLogicalWidthsDirty(); | |
| 553 if (preferredLogicalWidthsBecameDirty) { | |
| 554 // The only thing that should dirty preferred widths at this point is the | |
| 555 // addition of overflow:auto scrollbars in a descendant. To avoid a | |
| 556 // potential infinite loop, run layout again with auto scrollbars frozen in | |
| 557 // their current state. | |
| 558 PaintLayerScrollableArea::FreezeScrollbarsScope freezeScrollbars; | |
| 559 return layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope); | |
| 560 } | |
| 561 | |
| 562 // Expand our intrinsic height to encompass floats. | 549 // Expand our intrinsic height to encompass floats. |
| 563 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && | 550 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && |
| 564 createsNewFormattingContext()) | 551 createsNewFormattingContext()) |
| 565 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); | 552 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); |
| 566 | 553 |
| 567 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { | 554 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { |
| 568 if (flowThread->columnHeightsChanged()) { | 555 if (flowThread->columnHeightsChanged()) { |
| 569 setChildNeedsLayout(MarkOnlyThis); | 556 setChildNeedsLayout(MarkOnlyThis); |
| 570 return false; | 557 return false; |
| 571 } | 558 } |
| (...skipping 3979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4551 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4538 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 4552 } | 4539 } |
| 4553 | 4540 |
| 4554 void LayoutBlockFlow::invalidateDisplayItemClients( | 4541 void LayoutBlockFlow::invalidateDisplayItemClients( |
| 4555 PaintInvalidationReason invalidationReason) const { | 4542 PaintInvalidationReason invalidationReason) const { |
| 4556 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4543 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
| 4557 invalidationReason); | 4544 invalidationReason); |
| 4558 } | 4545 } |
| 4559 | 4546 |
| 4560 } // namespace blink | 4547 } // namespace blink |
| OLD | NEW |