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

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

Issue 2176633002: [css-grid] Avoid the HashMap for the override containing block size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 return m_rareData->m_overrideLogicalContentHeight; 1092 return m_rareData->m_overrideLogicalContentHeight;
1093 } 1093 }
1094 1094
1095 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1095 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones.
1096 LayoutUnit LayoutBox::overrideContainingBlockContentLogicalWidth() const 1096 LayoutUnit LayoutBox::overrideContainingBlockContentLogicalWidth() const
1097 { 1097 {
1098 ASSERT(hasOverrideContainingBlockLogicalWidth()); 1098 ASSERT(hasOverrideContainingBlockLogicalWidth());
1099 return gOverrideContainingBlockLogicalWidthMap->get(this); 1099 return gOverrideContainingBlockLogicalWidthMap->get(this);
1100 } 1100 }
1101 1101
1102 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1102 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1103 LayoutUnit LayoutBox::overrideContainingBlockContentLogicalHeight() const 1103 LayoutUnit LayoutBox::overrideContainingBlockContentLogicalHeight() const
1104 { 1104 {
1105 ASSERT(hasOverrideContainingBlockLogicalHeight()); 1105 ASSERT(hasOverrideContainingBlockLogicalHeight());
1106 return gOverrideContainingBlockLogicalHeightMap->get(this); 1106 return gOverrideContainingBlockLogicalHeightMap->get(this);
1107 } 1107 }
1108 1108
1109 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1109 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1110 bool LayoutBox::hasOverrideContainingBlockLogicalWidth() const 1110 bool LayoutBox::hasOverrideContainingBlockLogicalWidth() const
1111 { 1111 {
1112 return gOverrideContainingBlockLogicalWidthMap && gOverrideContainingBlockLo gicalWidthMap->contains(this); 1112 return gOverrideContainingBlockLogicalWidthMap && gOverrideContainingBlockLo gicalWidthMap->contains(this);
1113 } 1113 }
1114 1114
1115 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1115 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1116 bool LayoutBox::hasOverrideContainingBlockLogicalHeight() const 1116 bool LayoutBox::hasOverrideContainingBlockLogicalHeight() const
1117 { 1117 {
1118 return gOverrideContainingBlockLogicalHeightMap && gOverrideContainingBlockL ogicalHeightMap->contains(this); 1118 return gOverrideContainingBlockLogicalHeightMap && gOverrideContainingBlockL ogicalHeightMap->contains(this);
1119 } 1119 }
1120 1120
1121 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1121 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1122 void LayoutBox::setOverrideContainingBlockContentLogicalWidth(LayoutUnit logical Width) 1122 void LayoutBox::setOverrideContainingBlockContentLogicalWidth(LayoutUnit logical Width)
1123 { 1123 {
1124 if (!gOverrideContainingBlockLogicalWidthMap) 1124 if (!gOverrideContainingBlockLogicalWidthMap)
1125 gOverrideContainingBlockLogicalWidthMap = new OverrideSizeMap; 1125 gOverrideContainingBlockLogicalWidthMap = new OverrideSizeMap;
1126 gOverrideContainingBlockLogicalWidthMap->set(this, logicalWidth); 1126 gOverrideContainingBlockLogicalWidthMap->set(this, logicalWidth);
1127 } 1127 }
1128 1128
1129 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1129 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1130 void LayoutBox::setOverrideContainingBlockContentLogicalHeight(LayoutUnit logica lHeight) 1130 void LayoutBox::setOverrideContainingBlockContentLogicalHeight(LayoutUnit logica lHeight)
1131 { 1131 {
1132 if (!gOverrideContainingBlockLogicalHeightMap) 1132 if (!gOverrideContainingBlockLogicalHeightMap)
1133 gOverrideContainingBlockLogicalHeightMap = new OverrideSizeMap; 1133 gOverrideContainingBlockLogicalHeightMap = new OverrideSizeMap;
1134 gOverrideContainingBlockLogicalHeightMap->set(this, logicalHeight); 1134 gOverrideContainingBlockLogicalHeightMap->set(this, logicalHeight);
1135 } 1135 }
1136 1136
1137 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1137 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1138 void LayoutBox::clearContainingBlockOverrideSize() 1138 void LayoutBox::clearContainingBlockOverrideSize()
1139 { 1139 {
1140 if (gOverrideContainingBlockLogicalWidthMap) 1140 if (gOverrideContainingBlockLogicalWidthMap)
1141 gOverrideContainingBlockLogicalWidthMap->remove(this); 1141 gOverrideContainingBlockLogicalWidthMap->remove(this);
1142 clearOverrideContainingBlockContentLogicalHeight(); 1142 clearOverrideContainingBlockContentLogicalHeight();
1143 } 1143 }
1144 1144
1145 // TODO (lajava) Now that we have implemented these functions based on physical direction, we'd rather remove the logical ones. 1145 // TODO (lajava) Shouldn't we implement these functions based on physical direct ion ?.
1146 void LayoutBox::clearOverrideContainingBlockContentLogicalHeight() 1146 void LayoutBox::clearOverrideContainingBlockContentLogicalHeight()
1147 { 1147 {
1148 if (gOverrideContainingBlockLogicalHeightMap) 1148 if (gOverrideContainingBlockLogicalHeightMap)
1149 gOverrideContainingBlockLogicalHeightMap->remove(this); 1149 gOverrideContainingBlockLogicalHeightMap->remove(this);
1150 } 1150 }
1151 1151
1152 LayoutUnit LayoutBox::overrideContainingBlockContentWidth() const
1153 {
1154 return containingBlock()->isHorizontalWritingMode() ? overrideContainingBloc kContentLogicalWidth() : overrideContainingBlockContentLogicalHeight();
1155 }
1156
1157 LayoutUnit LayoutBox::overrideContainingBlockContentHeight() const
1158 {
1159 return containingBlock()->isHorizontalWritingMode() ? overrideContainingBloc kContentLogicalHeight() : overrideContainingBlockContentLogicalWidth();
1160 }
1161
1162 bool LayoutBox::hasOverrideContainingBlockWidth() const
1163 {
1164 return containingBlock()->isHorizontalWritingMode() ? hasOverrideContainingB lockLogicalWidth() : hasOverrideContainingBlockLogicalHeight();
1165 }
1166
1167 bool LayoutBox::hasOverrideContainingBlockHeight() const
1168 {
1169 return containingBlock()->isHorizontalWritingMode() ? hasOverrideContainingB lockLogicalHeight() : hasOverrideContainingBlockLogicalWidth();
1170 }
1171
1172 LayoutUnit LayoutBox::extraInlineOffset() const 1152 LayoutUnit LayoutBox::extraInlineOffset() const
1173 { 1153 {
1174 return gExtraInlineOffsetMap ? gExtraInlineOffsetMap->get(this) : LayoutUnit (); 1154 return gExtraInlineOffsetMap ? gExtraInlineOffsetMap->get(this) : LayoutUnit ();
1175 } 1155 }
1176 1156
1177 LayoutUnit LayoutBox::extraBlockOffset() const 1157 LayoutUnit LayoutBox::extraBlockOffset() const
1178 { 1158 {
1179 return gExtraBlockOffsetMap ? gExtraBlockOffsetMap->get(this) : LayoutUnit() ; 1159 return gExtraBlockOffsetMap ? gExtraBlockOffsetMap->get(this) : LayoutUnit() ;
1180 } 1160 }
1181 1161
(...skipping 3790 matching lines...) Expand 10 before | Expand all | Expand 10 after
4972 m_rareData->m_snapAreas->remove(&snapArea); 4952 m_rareData->m_snapAreas->remove(&snapArea);
4973 } 4953 }
4974 } 4954 }
4975 4955
4976 SnapAreaSet* LayoutBox::snapAreas() const 4956 SnapAreaSet* LayoutBox::snapAreas() const
4977 { 4957 {
4978 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4958 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4979 } 4959 }
4980 4960
4981 } // namespace blink 4961 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698