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

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

Issue 1549153002: Fix preferred logical widths of orthogonal writing modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: leviw review Created 4 years, 10 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) 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); 368 TextAutosizer::LayoutScope textAutosizerLayoutScope(this);
369 369
370 // Reset the flag here instead of in layoutInlineChildren() in case that 370 // Reset the flag here instead of in layoutInlineChildren() in case that
371 // all inline children are removed from this block. 371 // all inline children are removed from this block.
372 setContainsInlineWithOutlineAndContinuation(false); 372 setContainsInlineWithOutlineAndContinuation(false);
373 if (childrenInline()) 373 if (childrenInline())
374 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_ paintInvalidationLogicalBottom, afterEdge); 374 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_ paintInvalidationLogicalBottom, afterEdge);
375 else 375 else
376 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge ); 376 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge );
377 377
378 if (needsRecalcLogicalWidthAfterLayoutChildren()) {
379 // In perpendicular writing-mode, min-content logicalWidth depends on th e child's logicalHeight,
380 // so logicalWidth needs to be updated after children layout is done.
381 // Strictly speaking, children need re-layout if logicalWidth is changed , but in most cases,
382 // perpendicular children do not re-flow according to parent's logicalWi dth.
383 clearNeedsRecalcLogicalWidthAfterLayoutChildren();
384 setPreferredLogicalWidthsDirty(MarkOnlyThis);
385 updateLogicalWidthAndColumnWidth();
386 }
387
388 // Expand our intrinsic height to encompass floats. 378 // Expand our intrinsic height to encompass floats.
389 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext()) 379 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNew FormattingContext())
390 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); 380 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge);
391 381
392 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { 382 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
393 if (flowThread->columnHeightsChanged()) { 383 if (flowThread->columnHeightsChanged()) {
394 setChildNeedsLayout(MarkOnlyThis); 384 setChildNeedsLayout(MarkOnlyThis);
395 return false; 385 return false;
396 } 386 }
397 } 387 }
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 FrameView* frameView = document().view(); 2825 FrameView* frameView = document().view();
2836 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) ? 0 : fra meView->scrollOffset().height()); 2826 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) ? 0 : fra meView->scrollOffset().height());
2837 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 2827 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
2838 if (size().height() < visibleHeight) 2828 if (size().height() < visibleHeight)
2839 top += (visibleHeight - size().height()) / 2; 2829 top += (visibleHeight - size().height()) / 2;
2840 setY(top); 2830 setY(top);
2841 dialog->setCentered(top); 2831 dialog->setCentered(top);
2842 } 2832 }
2843 2833
2844 } // namespace blink 2834 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698