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

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

Issue 2154593003: [css-grid] Fix indefinite height detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check skipContainingBlockForPercentHeightCalculation() Created 4 years, 3 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 explicit LayoutBox(ContainerNode*); 195 explicit LayoutBox(ContainerNode*);
196 196
197 PaintLayerType layerTypeRequired() const override; 197 PaintLayerType layerTypeRequired() const override;
198 198
199 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const ov erride; 199 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const ov erride;
200 200
201 virtual bool backgroundShouldAlwaysBeClipped() const { return false; } 201 virtual bool backgroundShouldAlwaysBeClipped() const { return false; }
202 202
203 // Use this with caution! No type checking is done! 203 // Use this with caution! No type checking is done!
204 LayoutBox* firstChildBox() const; 204 LayoutBox* firstChildBox() const;
205 LayoutBox* firstInFlowChildBox() const;
206 LayoutBox* lastChildBox() const; 205 LayoutBox* lastChildBox() const;
207 206
208 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); } 207 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
209 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); } 208 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
210 209
211 void setX(LayoutUnit x) 210 void setX(LayoutUnit x)
212 { 211 {
213 if (x == m_frameRect.x()) 212 if (x == m_frameRect.x())
214 return; 213 return;
215 m_frameRect.setX(x); 214 m_frameRect.setX(x);
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 1020
1022 void excludeScrollbars(LayoutRect&, OverlayScrollbarClipBehavior = IgnoreOve rlayScrollbarSize) const; 1021 void excludeScrollbars(LayoutRect&, OverlayScrollbarClipBehavior = IgnoreOve rlayScrollbarSize) const;
1023 1022
1024 LayoutUnit containingBlockLogicalWidthForPositioned(const LayoutBoxModelObje ct* containingBlock, bool checkForPerpendicularWritingMode = true) const; 1023 LayoutUnit containingBlockLogicalWidthForPositioned(const LayoutBoxModelObje ct* containingBlock, bool checkForPerpendicularWritingMode = true) const;
1025 LayoutUnit containingBlockLogicalHeightForPositioned(const LayoutBoxModelObj ect* containingBlock, bool checkForPerpendicularWritingMode = true) const; 1024 LayoutUnit containingBlockLogicalHeightForPositioned(const LayoutBoxModelObj ect* containingBlock, bool checkForPerpendicularWritingMode = true) const;
1026 1025
1027 static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBo ttom, const LayoutBox* child, const LayoutBoxModelObject* containerBlock); 1026 static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBo ttom, const LayoutBox* child, const LayoutBoxModelObject* containerBlock);
1028 static void computeInlineStaticDistance(Length& logicalLeft, Length& logical Right, const LayoutBox* child, const LayoutBoxModelObject* containerBlock, Layou tUnit containerLogicalWidth); 1027 static void computeInlineStaticDistance(Length& logicalLeft, Length& logical Right, const LayoutBox* child, const LayoutBoxModelObject* containerBlock, Layou tUnit containerLogicalWidth);
1029 static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, c onst LayoutBox* child, LayoutUnit logicalWidthValue, const LayoutBoxModelObject* containerBlock, LayoutUnit containerLogicalWidth); 1028 static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, c onst LayoutBox* child, LayoutUnit logicalWidthValue, const LayoutBoxModelObject* containerBlock, LayoutUnit containerLogicalWidth);
1030 static void computeLogicalTopPositionedOffset(LayoutUnit& logicalTopPos, con st LayoutBox* child, LayoutUnit logicalHeightValue, const LayoutBoxModelObject* containerBlock, LayoutUnit containerLogicalHeight); 1029 static void computeLogicalTopPositionedOffset(LayoutUnit& logicalTopPos, con st LayoutBox* child, LayoutUnit logicalHeightValue, const LayoutBoxModelObject* containerBlock, LayoutUnit containerLogicalHeight);
1030 bool skipContainingBlockForPercentHeightCalculation(const LayoutBox* contain ingBlock) const;
1031 1031
1032 private: 1032 private:
1033 void updateShapeOutsideInfoAfterStyleChange(const ComputedStyle&, const Comp utedStyle* oldStyle); 1033 void updateShapeOutsideInfoAfterStyleChange(const ComputedStyle&, const Comp utedStyle* oldStyle);
1034 void updateGridPositionAfterStyleChange(const ComputedStyle*); 1034 void updateGridPositionAfterStyleChange(const ComputedStyle*);
1035 void updateScrollSnapMappingAfterStyleChange(const ComputedStyle*, const Com putedStyle* oldStyle); 1035 void updateScrollSnapMappingAfterStyleChange(const ComputedStyle*, const Com putedStyle* oldStyle);
1036 void clearScrollSnapMapping(); 1036 void clearScrollSnapMapping();
1037 void addScrollSnapMapping(); 1037 void addScrollSnapMapping();
1038 1038
1039 bool autoWidthShouldFitContent() const; 1039 bool autoWidthShouldFitContent() const;
1040 LayoutUnit shrinkToFitLogicalWidth(LayoutUnit availableLogicalWidth, LayoutU nit bordersPlusPadding) const; 1040 LayoutUnit shrinkToFitLogicalWidth(LayoutUnit availableLogicalWidth, LayoutU nit bordersPlusPadding) const;
1041 1041
1042 bool stretchesToViewportInQuirksMode() const; 1042 bool stretchesToViewportInQuirksMode() const;
1043 bool skipContainingBlockForPercentHeightCalculation(const LayoutBox* contain ingBlock) const;
1044 1043
1045 virtual void computePositionedLogicalHeight(LogicalExtentComputedValues&) co nst; 1044 virtual void computePositionedLogicalHeight(LogicalExtentComputedValues&) co nst;
1046 void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const LayoutBoxModelObject* containerBlock, TextDirection containerDirection, 1045 void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const LayoutBoxModelObject* containerBlock, TextDirection containerDirection,
1047 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, 1046 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
1048 const Length& logicalLeft, const Length& logicalRight, const Length& mar ginLogicalLeft, 1047 const Length& logicalLeft, const Length& logicalRight, const Length& mar ginLogicalLeft,
1049 const Length& marginLogicalRight, LogicalExtentComputedValues&) const; 1048 const Length& marginLogicalRight, LogicalExtentComputedValues&) const;
1050 void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLengt h, const LayoutBoxModelObject* containerBlock, 1049 void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLengt h, const LayoutBoxModelObject* containerBlock,
1051 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, Layout Unit logicalHeight, 1050 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, Layout Unit logicalHeight,
1052 const Length& logicalTop, const Length& logicalBottom, const Length& mar ginLogicalTop, 1051 const Length& logicalTop, const Length& logicalBottom, const Length& mar ginLogicalTop,
1053 const Length& marginLogicalBottom, LogicalExtentComputedValues&) const; 1052 const Length& marginLogicalBottom, LogicalExtentComputedValues&) const;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 inline LayoutBox* LayoutBox::parentBox() const 1167 inline LayoutBox* LayoutBox::parentBox() const
1169 { 1168 {
1170 return toLayoutBox(parent()); 1169 return toLayoutBox(parent());
1171 } 1170 }
1172 1171
1173 inline LayoutBox* LayoutBox::firstChildBox() const 1172 inline LayoutBox* LayoutBox::firstChildBox() const
1174 { 1173 {
1175 return toLayoutBox(slowFirstChild()); 1174 return toLayoutBox(slowFirstChild());
1176 } 1175 }
1177 1176
1178 inline LayoutBox* LayoutBox::firstInFlowChildBox() const
1179 {
1180 LayoutBox* child = firstChildBox();
1181 while (child && child->isOutOfFlowPositioned())
1182 child = child->nextSiblingBox();
1183 return child;
1184 }
1185
1186 inline LayoutBox* LayoutBox::lastChildBox() const 1177 inline LayoutBox* LayoutBox::lastChildBox() const
1187 { 1178 {
1188 return toLayoutBox(slowLastChild()); 1179 return toLayoutBox(slowLastChild());
1189 } 1180 }
1190 1181
1191 inline LayoutBox* LayoutBox::previousSiblingMultiColumnBox() const 1182 inline LayoutBox* LayoutBox::previousSiblingMultiColumnBox() const
1192 { 1183 {
1193 ASSERT(isLayoutMultiColumnSpannerPlaceholder() || isLayoutMultiColumnSet()); 1184 ASSERT(isLayoutMultiColumnSpannerPlaceholder() || isLayoutMultiColumnSet());
1194 LayoutBox* previousBox = previousSiblingBox(); 1185 LayoutBox* previousBox = previousSiblingBox();
1195 if (previousBox->isLayoutFlowThread()) 1186 if (previousBox->isLayoutFlowThread())
(...skipping 28 matching lines...) Expand all
1224 || breakValue == BreakLeft 1215 || breakValue == BreakLeft
1225 || breakValue == BreakPage 1216 || breakValue == BreakPage
1226 || breakValue == BreakRecto 1217 || breakValue == BreakRecto
1227 || breakValue == BreakRight 1218 || breakValue == BreakRight
1228 || breakValue == BreakVerso; 1219 || breakValue == BreakVerso;
1229 } 1220 }
1230 1221
1231 } // namespace blink 1222 } // namespace blink
1232 1223
1233 #endif // LayoutBox_h 1224 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698