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

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

Issue 1074953004: Remove empty-cells (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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // inherited attributes 124 // inherited attributes
125 DataRef<StyleRareInheritedData> rareInheritedData; 125 DataRef<StyleRareInheritedData> rareInheritedData;
126 DataRef<StyleInheritedData> inherited; 126 DataRef<StyleInheritedData> inherited;
127 127
128 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp 128 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp
129 129
130 // inherit 130 // inherit
131 struct InheritedFlags { 131 struct InheritedFlags {
132 bool operator==(const InheritedFlags& other) const 132 bool operator==(const InheritedFlags& other) const
133 { 133 {
134 return (_empty_cells == other._empty_cells) 134 return (_visibility == other._visibility)
135 && (_visibility == other._visibility)
136 && (_text_align == other._text_align) 135 && (_text_align == other._text_align)
137 && (m_textUnderline == other.m_textUnderline) 136 && (m_textUnderline == other.m_textUnderline)
138 && (_direction == other._direction) 137 && (_direction == other._direction)
139 && (_white_space == other._white_space) 138 && (_white_space == other._white_space)
140 && (m_rtlOrdering == other.m_rtlOrdering) 139 && (m_rtlOrdering == other.m_rtlOrdering)
141 && (_pointerEvents == other._pointerEvents); 140 && (_pointerEvents == other._pointerEvents);
142 } 141 }
143 142
144 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); } 143 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); }
145 144
146 unsigned _empty_cells : 1; // EEmptyCell
147 unsigned _visibility : 2; // EVisibility 145 unsigned _visibility : 2; // EVisibility
148 unsigned _text_align : 4; // ETextAlign 146 unsigned _text_align : 4; // ETextAlign
149 unsigned m_textUnderline : 1; 147 unsigned m_textUnderline : 1;
150 unsigned _direction : 1; // TextDirection 148 unsigned _direction : 1; // TextDirection
151 unsigned _white_space : 3; // EWhiteSpace 149 unsigned _white_space : 3; // EWhiteSpace
152 150
153 // non CSS2 inherited 151 // non CSS2 inherited
154 unsigned m_rtlOrdering : 1; // Order 152 unsigned m_rtlOrdering : 1; // Order
155 unsigned _pointerEvents : 4; // EPointerEvents 153 unsigned _pointerEvents : 4; // EPointerEvents
156 154
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 unsigned isLink : 1; 211 unsigned isLink : 1;
214 // If you add more style bits here, you will also need to update RenderS tyle::copyNonInheritedFrom() 212 // If you add more style bits here, you will also need to update RenderS tyle::copyNonInheritedFrom()
215 // 63 bits 213 // 63 bits
216 } noninherited_flags; 214 } noninherited_flags;
217 215
218 // !END SYNC! 216 // !END SYNC!
219 217
220 protected: 218 protected:
221 void setBitDefaults() 219 void setBitDefaults()
222 { 220 {
223 inherited_flags._empty_cells = initialEmptyCells();
224 inherited_flags._visibility = initialVisibility(); 221 inherited_flags._visibility = initialVisibility();
225 inherited_flags._text_align = initialTextAlign(); 222 inherited_flags._text_align = initialTextAlign();
226 inherited_flags.m_textUnderline = false; 223 inherited_flags.m_textUnderline = false;
227 inherited_flags._direction = initialDirection(); 224 inherited_flags._direction = initialDirection();
228 inherited_flags._white_space = initialWhiteSpace(); 225 inherited_flags._white_space = initialWhiteSpace();
229 inherited_flags.m_rtlOrdering = initialRTLOrdering(); 226 inherited_flags.m_rtlOrdering = initialRTLOrdering();
230 inherited_flags._pointerEvents = initialPointerEvents(); 227 inherited_flags._pointerEvents = initialPointerEvents();
231 228
232 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay = initialDisplay(); 229 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay = initialDisplay();
233 noninherited_flags.overflowX = initialOverflowX(); 230 noninherited_flags.overflowX = initialOverflowX();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_backgroun d->background().origin()); } 524 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_backgroun d->background().origin()); }
528 const Length& backgroundXPosition() const { return m_background->background( ).xPosition(); } 525 const Length& backgroundXPosition() const { return m_background->background( ).xPosition(); }
529 const Length& backgroundYPosition() const { return m_background->background( ).yPosition(); } 526 const Length& backgroundYPosition() const { return m_background->background( ).yPosition(); }
530 EFillSizeType backgroundSizeType() const { return m_background->background() .sizeType(); } 527 EFillSizeType backgroundSizeType() const { return m_background->background() .sizeType(); }
531 const LengthSize& backgroundSizeLength() const { return m_background->backgr ound().sizeLength(); } 528 const LengthSize& backgroundSizeLength() const { return m_background->backgr ound().sizeLength(); }
532 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr ound; } 529 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr ound; }
533 const FillLayer& backgroundLayers() const { return m_background->background( ); } 530 const FillLayer& backgroundLayers() const { return m_background->background( ); }
534 531
535 short horizontalBorderSpacing() const; 532 short horizontalBorderSpacing() const;
536 short verticalBorderSpacing() const; 533 short verticalBorderSpacing() const;
537 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_fla gs._empty_cells); }
538 534
539 const Length& marginTop() const { return surround->margin.top(); } 535 const Length& marginTop() const { return surround->margin.top(); }
540 const Length& marginBottom() const { return surround->margin.bottom(); } 536 const Length& marginBottom() const { return surround->margin.bottom(); }
541 const Length& marginLeft() const { return surround->margin.left(); } 537 const Length& marginLeft() const { return surround->margin.left(); }
542 const Length& marginRight() const { return surround->margin.right(); } 538 const Length& marginRight() const { return surround->margin.right(); }
543 const Length& marginBefore() const { return surround->margin.before(); } 539 const Length& marginBefore() const { return surround->margin.before(); }
544 const Length& marginAfter() const { return surround->margin.after(); } 540 const Length& marginAfter() const { return surround->margin.after(); }
545 const Length& marginStart() const { return surround->margin.start(direction( )); } 541 const Length& marginStart() const { return surround->margin.start(direction( )); }
546 const Length& marginEnd() const { return surround->margin.end(direction()); } 542 const Length& marginEnd() const { return surround->margin.end(direction()); }
547 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->direction()); } 543 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->direction()); }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 void adjustBackgroundLayers() 845 void adjustBackgroundLayers()
850 { 846 {
851 if (backgroundLayers().next()) { 847 if (backgroundLayers().next()) {
852 accessBackgroundLayers().cullEmptyLayers(); 848 accessBackgroundLayers().cullEmptyLayers();
853 accessBackgroundLayers().fillUnsetProperties(); 849 accessBackgroundLayers().fillUnsetProperties();
854 } 850 }
855 } 851 }
856 852
857 void setHorizontalBorderSpacing(short); 853 void setHorizontalBorderSpacing(short);
858 void setVerticalBorderSpacing(short); 854 void setVerticalBorderSpacing(short);
859 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
860 855
861 void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRa tio, b); } 856 void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRa tio, b); }
862 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_as pectRatioDenominator, v); } 857 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_as pectRatioDenominator, v); }
863 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspe ctRatioNumerator, v); } 858 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspe ctRatioNumerator, v); }
864 859
865 void setMarginTop(const Length& v) { SET_VAR(surround, margin.m_top, v); } 860 void setMarginTop(const Length& v) { SET_VAR(surround, margin.m_top, v); }
866 void setMarginBottom(const Length& v) { SET_VAR(surround, margin.m_bottom, v ); } 861 void setMarginBottom(const Length& v) { SET_VAR(surround, margin.m_bottom, v ); }
867 void setMarginLeft(const Length& v) { SET_VAR(surround, margin.m_left, v); } 862 void setMarginLeft(const Length& v) { SET_VAR(surround, margin.m_left, v); }
868 void setMarginRight(const Length& v) { SET_VAR(surround, margin.m_right, v); } 863 void setMarginRight(const Length& v) { SET_VAR(surround, margin.m_right, v); }
869 void setMarginStart(const Length&); 864 void setMarginStart(const Length&);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 static EBorderStyle initialBorderStyle() { return BNONE; } 1026 static EBorderStyle initialBorderStyle() { return BNONE; }
1032 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; } 1027 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
1033 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } 1028 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
1034 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed) , Length(0, Fixed)); } 1029 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed) , Length(0, Fixed)); }
1035 static LengthBox initialClip() { return LengthBox(); } 1030 static LengthBox initialClip() { return LengthBox(); }
1036 static TextDirection initialDirection() { return LTR; } 1031 static TextDirection initialDirection() { return LTR; }
1037 static TextOrientation initialTextOrientation() { return TextOrientationVert icalRight; } 1032 static TextOrientation initialTextOrientation() { return TextOrientationVert icalRight; }
1038 static ObjectFit initialObjectFit() { return ObjectFitFill; } 1033 static ObjectFit initialObjectFit() { return ObjectFitFill; }
1039 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); } 1034 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); }
1040 static EDisplay initialDisplay() { return FLEX; } 1035 static EDisplay initialDisplay() { return FLEX; }
1041 static EEmptyCell initialEmptyCells() { return SHOW; }
1042 static EOverflow initialOverflowX() { return OVISIBLE; } 1036 static EOverflow initialOverflowX() { return OVISIBLE; }
1043 static EOverflow initialOverflowY() { return OVISIBLE; } 1037 static EOverflow initialOverflowY() { return OVISIBLE; }
1044 static EPosition initialPosition() { return StaticPosition; } 1038 static EPosition initialPosition() { return StaticPosition; }
1045 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } 1039 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
1046 static EVisibility initialVisibility() { return VISIBLE; } 1040 static EVisibility initialVisibility() { return VISIBLE; }
1047 static EWhiteSpace initialWhiteSpace() { return NORMAL; } 1041 static EWhiteSpace initialWhiteSpace() { return NORMAL; }
1048 static short initialHorizontalBorderSpacing() { return 0; } 1042 static short initialHorizontalBorderSpacing() { return 0; }
1049 static short initialVerticalBorderSpacing() { return 0; } 1043 static short initialVerticalBorderSpacing() { return 0; }
1050 static Color initialColor() { return Color::black; } 1044 static Color initialColor() { return Color::black; }
1051 static unsigned initialBorderWidth() { return 3; } 1045 static unsigned initialBorderWidth() { return 3; }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 1211
1218 rareInheritedData.access()->m_textOrientation = textOrientation; 1212 rareInheritedData.access()->m_textOrientation = textOrientation;
1219 return true; 1213 return true;
1220 } 1214 }
1221 1215
1222 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&); 1216 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&);
1223 1217
1224 } // namespace blink 1218 } // namespace blink
1225 1219
1226 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ 1220 #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/RenderStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698