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

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

Issue 1549153002: Fix preferred logical widths of orthogonal writing modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations Created 5 years 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
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 e7dde710055129368066dc36d0f2f12cd54851cf..425b13dc5ca118cd828060ecf37201d3a852c8a7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -120,12 +120,30 @@ void LayoutBox::willBeDestroyed()
clearExtraInlineAndBlockOffests();
LayoutBlock::removePercentHeightDescendantIfNeeded(this);
+ if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot())
+ unmarkOrthogonalWritingModeRoot();
ShapeOutsideInfo::removeInfo(*this);
LayoutBoxModelObject::willBeDestroyed();
}
+void LayoutBox::insertedIntoTree()
+{
+ LayoutBoxModelObject::insertedIntoTree();
+
+ if (isOrthogonalWritingModeRoot())
+ markOrthogonalWritingModeRoot();
+}
+
+void LayoutBox::willBeRemovedFromTree()
+{
+ if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot())
+ unmarkOrthogonalWritingModeRoot();
+
+ LayoutBoxModelObject::willBeRemovedFromTree();
+}
+
void LayoutBox::removeFloatingOrPositionedChildFromBlockLists()
{
ASSERT(isFloatingOrOutOfFlowPositioned());
@@ -210,9 +228,17 @@ void LayoutBox::styleDidChange(StyleDifference diff, const ComputedStyle* oldSty
if (needsLayout() && oldStyle)
LayoutBlock::removePercentHeightDescendantIfNeeded(this);
- if (LayoutBlock::hasPercentHeightContainerMap() && slowFirstChild()
- && oldHorizontalWritingMode != isHorizontalWritingMode())
- LayoutBlock::clearPercentHeightDescendantsFrom(this);
+ if (oldHorizontalWritingMode != isHorizontalWritingMode()) {
+ if (parent()) {
+ if (isOrthogonalWritingModeRoot())
+ markOrthogonalWritingModeRoot();
+ else
+ unmarkOrthogonalWritingModeRoot();
+ }
+
+ if (LayoutBlock::hasPercentHeightContainerMap() && slowFirstChild())
+ LayoutBlock::clearPercentHeightDescendantsFrom(this);
+ }
// If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
// new zoomed coordinate space.
@@ -4214,6 +4240,18 @@ void LayoutBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
layoutScope.setChildNeedsLayout(this);
}
+void LayoutBox::markOrthogonalWritingModeRoot()
+{
+ ASSERT(frameView());
+ frameView()->addOrthogonalWritingModeRoot(*this);
+}
+
+void LayoutBox::unmarkOrthogonalWritingModeRoot()
+{
+ ASSERT(frameView());
+ frameView()->removeOrthogonalWritingModeRoot(*this);
+}
+
void LayoutBox::addVisualEffectOverflow()
{
if (!style()->hasVisualOverflowingEffect())

Powered by Google App Engine
This is Rietveld 408576698