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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2354263006: Freeze scrollbars for relayout if overflow:auto added scrollbars. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/scrollbars/overflow-auto-infinite-loop.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 464
465 // Reset the flag here instead of in layoutInlineChildren() in case that 465 // Reset the flag here instead of in layoutInlineChildren() in case that
466 // all inline children are removed from this block. 466 // all inline children are removed from this block.
467 setContainsInlineWithOutlineAndContinuation(false); 467 setContainsInlineWithOutlineAndContinuation(false);
468 if (childrenInline()) 468 if (childrenInline())
469 layoutInlineChildren(relayoutChildren, afterEdge); 469 layoutInlineChildren(relayoutChildren, afterEdge);
470 else 470 else
471 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge ); 471 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge );
472 472
473 bool preferredLogicalWidthsBecameDirty = !preferredLogicalWidthsWereDirty && preferredLogicalWidthsDirty(); 473 bool preferredLogicalWidthsBecameDirty = !preferredLogicalWidthsWereDirty && preferredLogicalWidthsDirty();
474 if (preferredLogicalWidthsBecameDirty) 474 if (preferredLogicalWidthsBecameDirty) {
475 return false; 475 // The only thing that should dirty preferred widths at this point is th e addition of
476 // overflow:auto scrollbars in a descendant. To avoid a potential infin ite loop,
477 // run layout again with auto scrollbars frozen in their current state.
478 PaintLayerScrollableArea::FreezeScrollbarsScope freezeScrollbars;
479 return layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope) ;
480 }
476 481
477 // Expand our intrinsic height to encompass floats. 482 // Expand our intrinsic height to encompass floats.
478 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext()) 483 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext())
479 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); 484 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge);
480 485
481 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { 486 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
482 if (flowThread->columnHeightsChanged()) { 487 if (flowThread->columnHeightsChanged()) {
483 setChildNeedsLayout(MarkOnlyThis); 488 setChildNeedsLayout(MarkOnlyThis);
484 return false; 489 return false;
485 } 490 }
(...skipping 3289 matching lines...) Expand 10 before | Expand all | Expand 10 after
3775 if (!rect.isEmpty()) 3780 if (!rect.isEmpty())
3776 rects.append(rect); 3781 rects.append(rect);
3777 } 3782 }
3778 } 3783 }
3779 3784
3780 if (inlineElementContinuation) 3785 if (inlineElementContinuation)
3781 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows); 3786 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows);
3782 } 3787 }
3783 3788
3784 } // namespace blink 3789 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/scrollbars/overflow-auto-infinite-loop.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698