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

Side by Side Diff: sky/engine/core/rendering/style/RenderStyle.h

Issue 1075023002: Remove CSS table-layout property. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // don't inherit 160 // don't inherit
161 struct NonInheritedFlags { 161 struct NonInheritedFlags {
162 bool operator==(const NonInheritedFlags& other) const 162 bool operator==(const NonInheritedFlags& other) const
163 { 163 {
164 return effectiveDisplay == other.effectiveDisplay 164 return effectiveDisplay == other.effectiveDisplay
165 && originalDisplay == other.originalDisplay 165 && originalDisplay == other.originalDisplay
166 && overflowX == other.overflowX 166 && overflowX == other.overflowX
167 && overflowY == other.overflowY 167 && overflowY == other.overflowY
168 && verticalAlign == other.verticalAlign 168 && verticalAlign == other.verticalAlign
169 && position == other.position 169 && position == other.position
170 && tableLayout == other.tableLayout
171 && styleType == other.styleType 170 && styleType == other.styleType
172 && affectedByFocus == other.affectedByFocus 171 && affectedByFocus == other.affectedByFocus
173 && affectedByHover == other.affectedByHover 172 && affectedByHover == other.affectedByHover
174 && affectedByActive == other.affectedByActive 173 && affectedByActive == other.affectedByActive
175 && unicodeBidi == other.unicodeBidi 174 && unicodeBidi == other.unicodeBidi
176 && explicitInheritance == other.explicitInheritance 175 && explicitInheritance == other.explicitInheritance
177 && currentColor == other.currentColor 176 && currentColor == other.currentColor
178 && unique == other.unique 177 && unique == other.unique
179 && emptyState == other.emptyState 178 && emptyState == other.emptyState
180 && firstChildState == other.firstChildState 179 && firstChildState == other.firstChildState
181 && lastChildState == other.lastChildState 180 && lastChildState == other.lastChildState
182 && isLink == other.isLink; 181 && isLink == other.isLink;
183 } 182 }
184 183
185 bool operator!=(const NonInheritedFlags& other) const { return !(*this = = other); } 184 bool operator!=(const NonInheritedFlags& other) const { return !(*this = = other); }
186 185
187 unsigned effectiveDisplay : 5; // EDisplay 186 unsigned effectiveDisplay : 5; // EDisplay
188 unsigned originalDisplay : 5; // EDisplay 187 unsigned originalDisplay : 5; // EDisplay
189 unsigned overflowX : 3; // EOverflow 188 unsigned overflowX : 3; // EOverflow
190 unsigned overflowY : 3; // EOverflow 189 unsigned overflowY : 3; // EOverflow
191 unsigned verticalAlign : 4; // EVerticalAlign 190 unsigned verticalAlign : 4; // EVerticalAlign
192 unsigned position : 1; // EPosition 191 unsigned position : 1; // EPosition
193 unsigned tableLayout : 1; // ETableLayout
194 unsigned unicodeBidi : 3; // EUnicodeBidi 192 unsigned unicodeBidi : 3; // EUnicodeBidi
195 193
196 // This is set if we used viewport units when resolving a length. 194 // This is set if we used viewport units when resolving a length.
197 // It is mutable so we can pass around const RenderStyles to resolve len gths. 195 // It is mutable so we can pass around const RenderStyles to resolve len gths.
198 mutable unsigned hasViewportUnits : 1; 196 mutable unsigned hasViewportUnits : 1;
199 197
200 // 32 bits 198 // 32 bits
201 199
202 unsigned styleType : 6; // PseudoId 200 unsigned styleType : 6; // PseudoId
203 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property 201 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property
(...skipping 25 matching lines...) Expand all
229 inherited_flags._direction = initialDirection(); 227 inherited_flags._direction = initialDirection();
230 inherited_flags._white_space = initialWhiteSpace(); 228 inherited_flags._white_space = initialWhiteSpace();
231 inherited_flags.m_rtlOrdering = initialRTLOrdering(); 229 inherited_flags.m_rtlOrdering = initialRTLOrdering();
232 inherited_flags._pointerEvents = initialPointerEvents(); 230 inherited_flags._pointerEvents = initialPointerEvents();
233 231
234 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay = initialDisplay(); 232 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay = initialDisplay();
235 noninherited_flags.overflowX = initialOverflowX(); 233 noninherited_flags.overflowX = initialOverflowX();
236 noninherited_flags.overflowY = initialOverflowY(); 234 noninherited_flags.overflowY = initialOverflowY();
237 noninherited_flags.verticalAlign = initialVerticalAlign(); 235 noninherited_flags.verticalAlign = initialVerticalAlign();
238 noninherited_flags.position = initialPosition(); 236 noninherited_flags.position = initialPosition();
239 noninherited_flags.tableLayout = initialTableLayout();
240 noninherited_flags.unicodeBidi = initialUnicodeBidi(); 237 noninherited_flags.unicodeBidi = initialUnicodeBidi();
241 noninherited_flags.explicitInheritance = false; 238 noninherited_flags.explicitInheritance = false;
242 noninherited_flags.currentColor = false; 239 noninherited_flags.currentColor = false;
243 noninherited_flags.unique = false; 240 noninherited_flags.unique = false;
244 noninherited_flags.emptyState = false; 241 noninherited_flags.emptyState = false;
245 noninherited_flags.firstChildState = false; 242 noninherited_flags.firstChildState = false;
246 noninherited_flags.lastChildState = false; 243 noninherited_flags.lastChildState = false;
247 noninherited_flags.hasViewportUnits = false; 244 noninherited_flags.hasViewportUnits = false;
248 noninherited_flags.affectedByFocus = false; 245 noninherited_flags.affectedByFocus = false;
249 noninherited_flags.affectedByHover = false; 246 noninherited_flags.affectedByHover = false;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 426
430 const Length& clipLeft() const { return visual->clip.left(); } 427 const Length& clipLeft() const { return visual->clip.left(); }
431 const Length& clipRight() const { return visual->clip.right(); } 428 const Length& clipRight() const { return visual->clip.right(); }
432 const Length& clipTop() const { return visual->clip.top(); } 429 const Length& clipTop() const { return visual->clip.top(); }
433 const Length& clipBottom() const { return visual->clip.bottom(); } 430 const Length& clipBottom() const { return visual->clip.bottom(); }
434 const LengthBox& clip() const { return visual->clip; } 431 const LengthBox& clip() const { return visual->clip; }
435 bool hasAutoClip() const { return visual->hasAutoClip; } 432 bool hasAutoClip() const { return visual->hasAutoClip; }
436 433
437 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninher ited_flags.unicodeBidi); } 434 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninher ited_flags.unicodeBidi); }
438 435
439 ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninher ited_flags.tableLayout); }
440 bool isFixedTableLayout() const { return tableLayout() == TFIXED && !logical Width().isAuto(); }
441
442 const Font& font() const; 436 const Font& font() const;
443 const FontMetrics& fontMetrics() const; 437 const FontMetrics& fontMetrics() const;
444 const FontDescription& fontDescription() const; 438 const FontDescription& fontDescription() const;
445 float specifiedFontSize() const; 439 float specifiedFontSize() const;
446 float computedFontSize() const; 440 float computedFontSize() const;
447 int fontSize() const; 441 int fontSize() const;
448 FontWeight fontWeight() const; 442 FontWeight fontWeight() const;
449 FontStretch fontStretch() const; 443 FontStretch fontStretch() const;
450 444
451 const Length& textIndent() const { return rareInheritedData->indent; } 445 const Length& textIndent() const { return rareInheritedData->indent; }
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 void setOverflowY(EOverflow v) { noninherited_flags.overflowY = v; } 810 void setOverflowY(EOverflow v) { noninherited_flags.overflowY = v; }
817 void setVisibility(EVisibility v) { inherited_flags._visibility = v; } 811 void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
818 void setVerticalAlign(EVerticalAlign v) { noninherited_flags.verticalAlign = v; } 812 void setVerticalAlign(EVerticalAlign v) { noninherited_flags.verticalAlign = v; }
819 void setVerticalAlignLength(const Length& length) { setVerticalAlign(LENGTH) ; SET_VAR(m_box, m_verticalAlign, length); } 813 void setVerticalAlignLength(const Length& length) { setVerticalAlign(LENGTH) ; SET_VAR(m_box, m_verticalAlign, length); }
820 814
821 void setHasAutoClip() { SET_VAR(visual, hasAutoClip, true); SET_VAR(visual, clip, RenderStyle::initialClip()); } 815 void setHasAutoClip() { SET_VAR(visual, hasAutoClip, true); SET_VAR(visual, clip, RenderStyle::initialClip()); }
822 void setClip(const LengthBox& box) { SET_VAR(visual, hasAutoClip, false); SE T_VAR(visual, clip, box); } 816 void setClip(const LengthBox& box) { SET_VAR(visual, hasAutoClip, false); SE T_VAR(visual, clip, box); }
823 817
824 void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.unicodeBidi = b; } 818 void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.unicodeBidi = b; }
825 819
826 void setTableLayout(ETableLayout v) { noninherited_flags.tableLayout = v; }
827
828 bool setFontDescription(const FontDescription&); 820 bool setFontDescription(const FontDescription&);
829 // Only used for blending font sizes when animating and for text autosizing. 821 // Only used for blending font sizes when animating and for text autosizing.
830 void setFontSize(float); 822 void setFontSize(float);
831 void setFontStretch(FontStretch); 823 void setFontStretch(FontStretch);
832 void setFontWeight(FontWeight); 824 void setFontWeight(FontWeight);
833 825
834 void setColor(const Color&); 826 void setColor(const Color&);
835 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); } 827 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); }
836 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); } 828 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); }
837 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); } 829 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); }
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 static LengthBox initialClip() { return LengthBox(); } 1035 static LengthBox initialClip() { return LengthBox(); }
1044 static TextDirection initialDirection() { return LTR; } 1036 static TextDirection initialDirection() { return LTR; }
1045 static TextOrientation initialTextOrientation() { return TextOrientationVert icalRight; } 1037 static TextOrientation initialTextOrientation() { return TextOrientationVert icalRight; }
1046 static ObjectFit initialObjectFit() { return ObjectFitFill; } 1038 static ObjectFit initialObjectFit() { return ObjectFitFill; }
1047 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); } 1039 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); }
1048 static EDisplay initialDisplay() { return FLEX; } 1040 static EDisplay initialDisplay() { return FLEX; }
1049 static EEmptyCell initialEmptyCells() { return SHOW; } 1041 static EEmptyCell initialEmptyCells() { return SHOW; }
1050 static EOverflow initialOverflowX() { return OVISIBLE; } 1042 static EOverflow initialOverflowX() { return OVISIBLE; }
1051 static EOverflow initialOverflowY() { return OVISIBLE; } 1043 static EOverflow initialOverflowY() { return OVISIBLE; }
1052 static EPosition initialPosition() { return StaticPosition; } 1044 static EPosition initialPosition() { return StaticPosition; }
1053 static ETableLayout initialTableLayout() { return TAUTO; }
1054 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } 1045 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
1055 static EVisibility initialVisibility() { return VISIBLE; } 1046 static EVisibility initialVisibility() { return VISIBLE; }
1056 static EWhiteSpace initialWhiteSpace() { return NORMAL; } 1047 static EWhiteSpace initialWhiteSpace() { return NORMAL; }
1057 static short initialHorizontalBorderSpacing() { return 0; } 1048 static short initialHorizontalBorderSpacing() { return 0; }
1058 static short initialVerticalBorderSpacing() { return 0; } 1049 static short initialVerticalBorderSpacing() { return 0; }
1059 static Color initialColor() { return Color::black; } 1050 static Color initialColor() { return Color::black; }
1060 static unsigned initialBorderWidth() { return 3; } 1051 static unsigned initialBorderWidth() { return 3; }
1061 static unsigned short initialColumnRuleWidth() { return 3; } 1052 static unsigned short initialColumnRuleWidth() { return 3; }
1062 static unsigned short initialOutlineWidth() { return 3; } 1053 static unsigned short initialOutlineWidth() { return 3; }
1063 static float initialLetterWordSpacing() { return 0.0f; } 1054 static float initialLetterWordSpacing() { return 0.0f; }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 1217
1227 rareInheritedData.access()->m_textOrientation = textOrientation; 1218 rareInheritedData.access()->m_textOrientation = textOrientation;
1228 return true; 1219 return true;
1229 } 1220 }
1230 1221
1231 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&); 1222 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&);
1232 1223
1233 } // namespace blink 1224 } // namespace blink
1234 1225
1235 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ 1226 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/parser/BisonCSSParser-in.cpp ('k') | sky/engine/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698