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

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: Rebase (merge conflict resolved) Created 4 years, 11 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
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 d0c904e9c63fda921f0c2b284ff6d27d49e23845..7e972405786ba049268e822d5bf98dad21d6c168 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -133,12 +133,30 @@ void LayoutBox::willBeDestroyed()
if (isOutOfFlowPositioned())
LayoutBlock::removePositionedObject(this);
removeFromPercentHeightContainer();
+ 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());
@@ -223,8 +241,16 @@ void LayoutBox::styleDidChange(StyleDifference diff, const ComputedStyle* oldSty
if (needsLayout() && oldStyle)
removeFromPercentHeightContainer();
- if (oldHorizontalWritingMode != isHorizontalWritingMode())
+ if (oldHorizontalWritingMode != isHorizontalWritingMode()) {
+ if (parent()) {
esprehn 2016/01/31 00:44:56 The only times you go through here without a paren
kojii 2016/01/31 01:12:20 This "if" avoids: * Mark/unmark twice for when fir
+ if (isOrthogonalWritingModeRoot())
+ markOrthogonalWritingModeRoot();
+ else
+ unmarkOrthogonalWritingModeRoot();
+ }
+
clearPercentHeightDescendants();
+ }
// If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
// new zoomed coordinate space.
@@ -3934,6 +3960,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