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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2025543002: Fix when orthogonal writing mode roots have floating siblings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 3rd option Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/writing-mode/orthogonal-writing-modes-floats-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 1cbedcad8db3996a92f175d35cad6c5aeda90a76..e9b9608e380893c02924cfa5d9c8fdc3a95d2e73 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -161,7 +161,7 @@ void LayoutBox::removeFloatingOrPositionedChildFromBlockLists()
if (isFloating()) {
LayoutBlockFlow* parentBlockFlow = nullptr;
- for (LayoutObject* curr = parent(); curr && !curr->isLayoutView(); curr = curr->parent()) {
+ for (LayoutObject* curr = parent(); curr; curr = curr->parent()) {
wkorman 2016/06/08 18:23:33 This line diff seems to already be in ToT. Update
if (curr->isLayoutBlockFlow()) {
LayoutBlockFlow* currBlockFlow = toLayoutBlockFlow(curr);
if (!parentBlockFlow || currBlockFlow->containsFloat(this))
@@ -2317,8 +2317,10 @@ LayoutUnit LayoutBox::computeLogicalWidthUsing(SizeType widthType, const Length&
LayoutUnit marginEnd;
LayoutUnit logicalWidthResult = fillAvailableMeasure(availableLogicalWidth, marginStart, marginEnd);
- if (shrinkToAvoidFloats() && cb->isLayoutBlockFlow() && toLayoutBlockFlow(cb)->containsFloats())
+ if (shrinkToAvoidFloats() && cb->isLayoutBlockFlow() && toLayoutBlockFlow(cb)->containsFloats()
+ && cb->style()->isHorizontalWritingMode() == style()->isHorizontalWritingMode()) {
wkorman 2016/06/08 18:23:33 Perhaps use static helper method like isParallelWr
logicalWidthResult = std::min(logicalWidthResult, shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, toLayoutBlockFlow(cb)));
+ }
if (widthType == MainOrPreferredSize && sizesLogicalWidthToFitContent(logicalWidth))
return std::max(minPreferredLogicalWidth(), std::min(maxPreferredLogicalWidth(), logicalWidthResult));
@@ -2440,7 +2442,8 @@ void LayoutBox::computeMarginsForDirection(MarginDirection flowDirection, const
LayoutUnit marginEndWidth = minimumValueForLength(marginEndLength, containerWidth);
LayoutUnit availableWidth = containerWidth;
- if (avoidsFloats() && containingBlock->isLayoutBlockFlow() && toLayoutBlockFlow(containingBlock)->containsFloats()) {
+ if (avoidsFloats() && containingBlock->isLayoutBlockFlow() && toLayoutBlockFlow(containingBlock)->containsFloats()
+ && containingBlock->style()->isHorizontalWritingMode() == style()->isHorizontalWritingMode()) {
availableWidth = containingBlockAvailableLineWidth();
if (shrinkToAvoidFloats() && availableWidth < containerWidth) {
marginStart = std::max(LayoutUnit(), marginStartWidth);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/writing-mode/orthogonal-writing-modes-floats-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698