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

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

Issue 1121173002: Fix shrink-to-fit when children's writing-mode is orthogonal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 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 | « Source/core/layout/LayoutBlock.cpp ('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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (!firstChild() && !isAnonymousBlock()) 367 if (!firstChild() && !isAnonymousBlock())
368 setChildrenInline(true); 368 setChildrenInline(true);
369 369
370 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); 370 TextAutosizer::LayoutScope textAutosizerLayoutScope(this);
371 371
372 if (childrenInline()) 372 if (childrenInline())
373 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_ paintInvalidationLogicalBottom, afterEdge); 373 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_ paintInvalidationLogicalBottom, afterEdge);
374 else 374 else
375 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge ); 375 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge );
376 376
377 if (needsRecalcLogicalWidthAfterLayoutChildren()) {
378 // In perpendicular writing-mode, min-content logicalWidth depends on th e child's logicalHeight,
379 // so logicalWidth needs to be updated after children layout is done.
380 // Strictly speaking, children need re-layout if logicalWidth is changed , but in most cases,
381 // perpendicular children do not re-flow according to parent's logicalWi dth.
382 clearNeedsRecalcLogicalWidthAfterLayoutChildren();
383 setPreferredLogicalWidthsDirty(MarkOnlyThis);
384 updateLogicalWidthAndColumnWidth();
385 }
386
377 // Expand our intrinsic height to encompass floats. 387 // Expand our intrinsic height to encompass floats.
378 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext()) 388 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext())
379 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); 389 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge);
380 390
381 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { 391 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
382 if (flowThread->recalculateColumnHeights()) { 392 if (flowThread->recalculateColumnHeights()) {
383 setChildNeedsLayout(MarkOnlyThis); 393 setChildNeedsLayout(MarkOnlyThis);
384 return false; 394 return false;
385 } 395 }
386 } 396 }
(...skipping 2670 matching lines...) Expand 10 before | Expand all | Expand 10 after
3057 FrameView* frameView = document().view(); 3067 FrameView* frameView = document().view();
3058 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3068 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3059 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3069 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3060 if (size().height() < visibleHeight) 3070 if (size().height() < visibleHeight)
3061 top += (visibleHeight - size().height()) / 2; 3071 top += (visibleHeight - size().height()) / 2;
3062 setY(top); 3072 setY(top);
3063 dialog->setCentered(top); 3073 dialog->setCentered(top);
3064 } 3074 }
3065 3075
3066 } // namespace blink 3076 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698