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

Side by Side 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 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return NoPaintLayer; 113 return NoPaintLayer;
114 } 114 }
115 115
116 void LayoutBox::willBeDestroyed() 116 void LayoutBox::willBeDestroyed()
117 { 117 {
118 clearOverrideSize(); 118 clearOverrideSize();
119 clearContainingBlockOverrideSize(); 119 clearContainingBlockOverrideSize();
120 clearExtraInlineAndBlockOffests(); 120 clearExtraInlineAndBlockOffests();
121 121
122 LayoutBlock::removePercentHeightDescendantIfNeeded(this); 122 LayoutBlock::removePercentHeightDescendantIfNeeded(this);
123 if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot())
124 unmarkOrthogonalWritingModeRoot();
123 125
124 ShapeOutsideInfo::removeInfo(*this); 126 ShapeOutsideInfo::removeInfo(*this);
125 127
126 LayoutBoxModelObject::willBeDestroyed(); 128 LayoutBoxModelObject::willBeDestroyed();
127 } 129 }
128 130
131 void LayoutBox::insertedIntoTree()
132 {
133 LayoutBoxModelObject::insertedIntoTree();
134
135 if (isOrthogonalWritingModeRoot())
136 markOrthogonalWritingModeRoot();
137 }
138
139 void LayoutBox::willBeRemovedFromTree()
140 {
141 if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot())
142 unmarkOrthogonalWritingModeRoot();
143
144 LayoutBoxModelObject::willBeRemovedFromTree();
145 }
146
129 void LayoutBox::removeFloatingOrPositionedChildFromBlockLists() 147 void LayoutBox::removeFloatingOrPositionedChildFromBlockLists()
130 { 148 {
131 ASSERT(isFloatingOrOutOfFlowPositioned()); 149 ASSERT(isFloatingOrOutOfFlowPositioned());
132 150
133 if (documentBeingDestroyed()) 151 if (documentBeingDestroyed())
134 return; 152 return;
135 153
136 if (isFloating()) { 154 if (isFloating()) {
137 LayoutBlockFlow* parentBlockFlow = nullptr; 155 LayoutBlockFlow* parentBlockFlow = nullptr;
138 for (LayoutObject* curr = parent(); curr && !curr->isLayoutView(); curr = curr->parent()) { 156 for (LayoutObject* curr = parent(); curr && !curr->isLayoutView(); curr = curr->parent()) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // (as part of the LayoutBoxModelObject::styleDidChange call below). So, we can safely cache the horizontal 221 // (as part of the LayoutBoxModelObject::styleDidChange call below). So, we can safely cache the horizontal
204 // writing mode value before style change here. 222 // writing mode value before style change here.
205 bool oldHorizontalWritingMode = isHorizontalWritingMode(); 223 bool oldHorizontalWritingMode = isHorizontalWritingMode();
206 224
207 LayoutBoxModelObject::styleDidChange(diff, oldStyle); 225 LayoutBoxModelObject::styleDidChange(diff, oldStyle);
208 226
209 const ComputedStyle& newStyle = styleRef(); 227 const ComputedStyle& newStyle = styleRef();
210 if (needsLayout() && oldStyle) 228 if (needsLayout() && oldStyle)
211 LayoutBlock::removePercentHeightDescendantIfNeeded(this); 229 LayoutBlock::removePercentHeightDescendantIfNeeded(this);
212 230
213 if (LayoutBlock::hasPercentHeightContainerMap() && slowFirstChild() 231 if (oldHorizontalWritingMode != isHorizontalWritingMode()) {
214 && oldHorizontalWritingMode != isHorizontalWritingMode()) 232 if (parent()) {
215 LayoutBlock::clearPercentHeightDescendantsFrom(this); 233 if (isOrthogonalWritingModeRoot())
234 markOrthogonalWritingModeRoot();
235 else
236 unmarkOrthogonalWritingModeRoot();
237 }
238
239 if (LayoutBlock::hasPercentHeightContainerMap() && slowFirstChild())
240 LayoutBlock::clearPercentHeightDescendantsFrom(this);
241 }
216 242
217 // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the 243 // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
218 // new zoomed coordinate space. 244 // new zoomed coordinate space.
219 if (hasOverflowClip() && oldStyle && oldStyle->effectiveZoom() != newStyle.e ffectiveZoom() && layer()) { 245 if (hasOverflowClip() && oldStyle && oldStyle->effectiveZoom() != newStyle.e ffectiveZoom() && layer()) {
220 if (int left = layer()->scrollableArea()->scrollXOffset()) { 246 if (int left = layer()->scrollableArea()->scrollXOffset()) {
221 left = (left / oldStyle->effectiveZoom()) * newStyle.effectiveZoom() ; 247 left = (left / oldStyle->effectiveZoom()) * newStyle.effectiveZoom() ;
222 layer()->scrollableArea()->scrollToXOffset(left); 248 layer()->scrollableArea()->scrollToXOffset(left);
223 } 249 }
224 if (int top = layer()->scrollableArea()->scrollYOffset()) { 250 if (int top = layer()->scrollableArea()->scrollYOffset()) {
225 top = (top / oldStyle->effectiveZoom()) * newStyle.effectiveZoom(); 251 top = (top / oldStyle->effectiveZoom()) * newStyle.effectiveZoom();
(...skipping 3981 matching lines...) Expand 10 before | Expand all | Expand 10 after
4207 4233
4208 void LayoutBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop e) 4234 void LayoutBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop e)
4209 { 4235 {
4210 ASSERT(!needsLayout()); 4236 ASSERT(!needsLayout());
4211 // If fragmentation height has changed, we need to lay out. No need to enter the layoutObject if it 4237 // If fragmentation height has changed, we need to lay out. No need to enter the layoutObject if it
4212 // is childless, though. 4238 // is childless, though.
4213 if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild()) 4239 if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild())
4214 layoutScope.setChildNeedsLayout(this); 4240 layoutScope.setChildNeedsLayout(this);
4215 } 4241 }
4216 4242
4243 void LayoutBox::markOrthogonalWritingModeRoot()
4244 {
4245 ASSERT(frameView());
4246 frameView()->addOrthogonalWritingModeRoot(*this);
4247 }
4248
4249 void LayoutBox::unmarkOrthogonalWritingModeRoot()
4250 {
4251 ASSERT(frameView());
4252 frameView()->removeOrthogonalWritingModeRoot(*this);
4253 }
4254
4217 void LayoutBox::addVisualEffectOverflow() 4255 void LayoutBox::addVisualEffectOverflow()
4218 { 4256 {
4219 if (!style()->hasVisualOverflowingEffect()) 4257 if (!style()->hasVisualOverflowingEffect())
4220 return; 4258 return;
4221 4259
4222 // Add in the final overflow with shadows, outsets and outline combined. 4260 // Add in the final overflow with shadows, outsets and outline combined.
4223 LayoutRect visualEffectOverflow = borderBoxRect(); 4261 LayoutRect visualEffectOverflow = borderBoxRect();
4224 visualEffectOverflow.expand(computeVisualEffectOverflowOutsets()); 4262 visualEffectOverflow.expand(computeVisualEffectOverflowOutsets());
4225 addVisualOverflow(visualEffectOverflow); 4263 addVisualOverflow(visualEffectOverflow);
4226 } 4264 }
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
4889 } 4927 }
4890 4928
4891 void LayoutBox::clearPreviousPaintInvalidationRects() 4929 void LayoutBox::clearPreviousPaintInvalidationRects()
4892 { 4930 {
4893 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); 4931 LayoutBoxModelObject::clearPreviousPaintInvalidationRects();
4894 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) 4932 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea())
4895 scrollableArea->clearPreviousPaintInvalidationRects(); 4933 scrollableArea->clearPreviousPaintInvalidationRects();
4896 } 4934 }
4897 4935
4898 } // namespace blink 4936 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698