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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 2037383002: [css-grid] Fix definite/indefinite size detection on block axis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-percentage-widths
Patch Set: Use firstInFlowChildBox() 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 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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 explicit LayoutBox(ContainerNode*); 192 explicit LayoutBox(ContainerNode*);
193 193
194 PaintLayerType layerTypeRequired() const override; 194 PaintLayerType layerTypeRequired() const override;
195 195
196 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const ov erride; 196 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const ov erride;
197 197
198 virtual bool backgroundShouldAlwaysBeClipped() const { return false; } 198 virtual bool backgroundShouldAlwaysBeClipped() const { return false; }
199 199
200 // Use this with caution! No type checking is done! 200 // Use this with caution! No type checking is done!
201 LayoutBox* firstChildBox() const; 201 LayoutBox* firstChildBox() const;
202 LayoutBox* firstInFlowChildBox() const;
202 LayoutBox* lastChildBox() const; 203 LayoutBox* lastChildBox() const;
203 204
204 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); } 205 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
205 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); } 206 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
206 207
207 void setX(LayoutUnit x) 208 void setX(LayoutUnit x)
208 { 209 {
209 if (x == m_frameRect.x()) 210 if (x == m_frameRect.x())
210 return; 211 return;
211 m_frameRect.setX(x); 212 m_frameRect.setX(x);
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 LayoutUnit computeReplacedLogicalWidthUsing(SizeType, const Length& width) c onst; 734 LayoutUnit computeReplacedLogicalWidthUsing(SizeType, const Length& width) c onst;
734 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logic alWidth, ShouldComputePreferred = ComputeActual) const; 735 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logic alWidth, ShouldComputePreferred = ComputeActual) const;
735 LayoutUnit computeReplacedLogicalHeightUsing(SizeType, const Length& height) const; 736 LayoutUnit computeReplacedLogicalHeightUsing(SizeType, const Length& height) const;
736 LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit log icalHeight) const; 737 LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit log icalHeight) const;
737 738
738 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const; 739 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const;
739 virtual LayoutUnit computeReplacedLogicalHeight(LayoutUnit estimatedUsedWidt h = LayoutUnit()) const; 740 virtual LayoutUnit computeReplacedLogicalHeight(LayoutUnit estimatedUsedWidt h = LayoutUnit()) const;
740 741
741 bool hasDefiniteLogicalWidth() const; 742 bool hasDefiniteLogicalWidth() const;
742 bool percentageLogicalHeightIsResolvable() const; 743 bool percentageLogicalHeightIsResolvable() const;
743 bool hasDefiniteLogicalHeight() const;
744 LayoutUnit computePercentageLogicalHeight(const Length& height) const; 744 LayoutUnit computePercentageLogicalHeight(const Length& height) const;
745 745
746 // Block flows subclass availableWidth/Height to handle multi column layout (shrinking the width/height available to children when laying out.) 746 // Block flows subclass availableWidth/Height to handle multi column layout (shrinking the width/height available to children when laying out.)
747 LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); } 747 LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); }
748 LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const; 748 LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const;
749 LayoutUnit availableLogicalHeightUsing(const Length&, AvailableLogicalHeight Type) const; 749 LayoutUnit availableLogicalHeightUsing(const Length&, AvailableLogicalHeight Type) const;
750 750
751 // There are a few cases where we need to refer specifically to the availabl e physical width and available physical height. 751 // There are a few cases where we need to refer specifically to the availabl e physical width and available physical height.
752 // Relative positioning is one of those cases, since left/top offsets are ph ysical. 752 // Relative positioning is one of those cases, since left/top offsets are ph ysical.
753 LayoutUnit availableWidth() const { return style()->isHorizontalWritingMode( ) ? availableLogicalWidth() : availableLogicalHeight(IncludeMarginBorderPadding) ; } 753 LayoutUnit availableWidth() const { return style()->isHorizontalWritingMode( ) ? availableLogicalWidth() : availableLogicalHeight(IncludeMarginBorderPadding) ; }
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 inline LayoutBox* LayoutBox::parentBox() const 1163 inline LayoutBox* LayoutBox::parentBox() const
1164 { 1164 {
1165 return toLayoutBox(parent()); 1165 return toLayoutBox(parent());
1166 } 1166 }
1167 1167
1168 inline LayoutBox* LayoutBox::firstChildBox() const 1168 inline LayoutBox* LayoutBox::firstChildBox() const
1169 { 1169 {
1170 return toLayoutBox(slowFirstChild()); 1170 return toLayoutBox(slowFirstChild());
1171 } 1171 }
1172 1172
1173 inline LayoutBox* LayoutBox::firstInFlowChildBox() const
1174 {
1175 LayoutBox* child = firstChildBox();
1176 while (child && child->isOutOfFlowPositioned())
1177 child = child->nextSiblingBox();
1178 return child;
1179 }
1180
1173 inline LayoutBox* LayoutBox::lastChildBox() const 1181 inline LayoutBox* LayoutBox::lastChildBox() const
1174 { 1182 {
1175 return toLayoutBox(slowLastChild()); 1183 return toLayoutBox(slowLastChild());
1176 } 1184 }
1177 1185
1178 inline LayoutBox* LayoutBox::previousSiblingMultiColumnBox() const 1186 inline LayoutBox* LayoutBox::previousSiblingMultiColumnBox() const
1179 { 1187 {
1180 ASSERT(isLayoutMultiColumnSpannerPlaceholder() || isLayoutMultiColumnSet()); 1188 ASSERT(isLayoutMultiColumnSpannerPlaceholder() || isLayoutMultiColumnSet());
1181 LayoutBox* previousBox = previousSiblingBox(); 1189 LayoutBox* previousBox = previousSiblingBox();
1182 if (previousBox->isLayoutFlowThread()) 1190 if (previousBox->isLayoutFlowThread())
(...skipping 28 matching lines...) Expand all
1211 || breakValue == BreakLeft 1219 || breakValue == BreakLeft
1212 || breakValue == BreakPage 1220 || breakValue == BreakPage
1213 || breakValue == BreakRecto 1221 || breakValue == BreakRecto
1214 || breakValue == BreakRight 1222 || breakValue == BreakRight
1215 || breakValue == BreakVerso; 1223 || breakValue == BreakVerso;
1216 } 1224 }
1217 1225
1218 } // namespace blink 1226 } // namespace blink
1219 1227
1220 #endif // LayoutBox_h 1228 #endif // LayoutBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698