| OLD | NEW |
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (_empty_cells == other._empty_cells) |
| 135 && (_caption_side == other._caption_side) | 135 && (_caption_side == other._caption_side) |
| 136 && (_list_style_type == other._list_style_type) | |
| 137 && (_list_style_position == other._list_style_position) | |
| 138 && (_visibility == other._visibility) | 136 && (_visibility == other._visibility) |
| 139 && (_text_align == other._text_align) | 137 && (_text_align == other._text_align) |
| 140 && (m_textUnderline == other.m_textUnderline) | 138 && (m_textUnderline == other.m_textUnderline) |
| 141 && (_direction == other._direction) | 139 && (_direction == other._direction) |
| 142 && (_white_space == other._white_space) | 140 && (_white_space == other._white_space) |
| 143 && (m_rtlOrdering == other.m_rtlOrdering) | 141 && (m_rtlOrdering == other.m_rtlOrdering) |
| 144 && (_pointerEvents == other._pointerEvents); | 142 && (_pointerEvents == other._pointerEvents); |
| 145 } | 143 } |
| 146 | 144 |
| 147 bool operator!=(const InheritedFlags& other) const { return !(*this == o
ther); } | 145 bool operator!=(const InheritedFlags& other) const { return !(*this == o
ther); } |
| 148 | 146 |
| 149 unsigned _empty_cells : 1; // EEmptyCell | 147 unsigned _empty_cells : 1; // EEmptyCell |
| 150 unsigned _caption_side : 2; // ECaptionSide | 148 unsigned _caption_side : 2; // ECaptionSide |
| 151 unsigned _list_style_type : 7; // EListStyleType | |
| 152 unsigned _list_style_position : 1; // EListStylePosition | |
| 153 unsigned _visibility : 2; // EVisibility | 149 unsigned _visibility : 2; // EVisibility |
| 154 unsigned _text_align : 4; // ETextAlign | 150 unsigned _text_align : 4; // ETextAlign |
| 155 unsigned m_textUnderline : 1; | 151 unsigned m_textUnderline : 1; |
| 156 unsigned _direction : 1; // TextDirection | 152 unsigned _direction : 1; // TextDirection |
| 157 unsigned _white_space : 3; // EWhiteSpace | 153 unsigned _white_space : 3; // EWhiteSpace |
| 158 // 32 bits | 154 // 32 bits |
| 159 | 155 |
| 160 // non CSS2 inherited | 156 // non CSS2 inherited |
| 161 unsigned m_rtlOrdering : 1; // Order | 157 unsigned m_rtlOrdering : 1; // Order |
| 162 unsigned _pointerEvents : 4; // EPointerEvents | 158 unsigned _pointerEvents : 4; // EPointerEvents |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // 63 bits | 225 // 63 bits |
| 230 } noninherited_flags; | 226 } noninherited_flags; |
| 231 | 227 |
| 232 // !END SYNC! | 228 // !END SYNC! |
| 233 | 229 |
| 234 protected: | 230 protected: |
| 235 void setBitDefaults() | 231 void setBitDefaults() |
| 236 { | 232 { |
| 237 inherited_flags._empty_cells = initialEmptyCells(); | 233 inherited_flags._empty_cells = initialEmptyCells(); |
| 238 inherited_flags._caption_side = initialCaptionSide(); | 234 inherited_flags._caption_side = initialCaptionSide(); |
| 239 inherited_flags._list_style_type = initialListStyleType(); | |
| 240 inherited_flags._list_style_position = initialListStylePosition(); | |
| 241 inherited_flags._visibility = initialVisibility(); | 235 inherited_flags._visibility = initialVisibility(); |
| 242 inherited_flags._text_align = initialTextAlign(); | 236 inherited_flags._text_align = initialTextAlign(); |
| 243 inherited_flags.m_textUnderline = false; | 237 inherited_flags.m_textUnderline = false; |
| 244 inherited_flags._direction = initialDirection(); | 238 inherited_flags._direction = initialDirection(); |
| 245 inherited_flags._white_space = initialWhiteSpace(); | 239 inherited_flags._white_space = initialWhiteSpace(); |
| 246 inherited_flags.m_rtlOrdering = initialRTLOrdering(); | 240 inherited_flags.m_rtlOrdering = initialRTLOrdering(); |
| 247 inherited_flags._pointerEvents = initialPointerEvents(); | 241 inherited_flags._pointerEvents = initialPointerEvents(); |
| 248 | 242 |
| 249 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay
= initialDisplay(); | 243 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay
= initialDisplay(); |
| 250 noninherited_flags.overflowX = initialOverflowX(); | 244 noninherited_flags.overflowX = initialOverflowX(); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 EFillSizeType backgroundSizeType() const { return m_background->background()
.sizeType(); } | 549 EFillSizeType backgroundSizeType() const { return m_background->background()
.sizeType(); } |
| 556 const LengthSize& backgroundSizeLength() const { return m_background->backgr
ound().sizeLength(); } | 550 const LengthSize& backgroundSizeLength() const { return m_background->backgr
ound().sizeLength(); } |
| 557 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr
ound; } | 551 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr
ound; } |
| 558 const FillLayer& backgroundLayers() const { return m_background->background(
); } | 552 const FillLayer& backgroundLayers() const { return m_background->background(
); } |
| 559 | 553 |
| 560 short horizontalBorderSpacing() const; | 554 short horizontalBorderSpacing() const; |
| 561 short verticalBorderSpacing() const; | 555 short verticalBorderSpacing() const; |
| 562 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_fla
gs._empty_cells); } | 556 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_fla
gs._empty_cells); } |
| 563 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherite
d_flags._caption_side); } | 557 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherite
d_flags._caption_side); } |
| 564 | 558 |
| 565 EListStyleType listStyleType() const { return static_cast<EListStyleType>(in
herited_flags._list_style_type); } | |
| 566 StyleImage* listStyleImage() const; | |
| 567 EListStylePosition listStylePosition() const { return static_cast<EListStyle
Position>(inherited_flags._list_style_position); } | |
| 568 | |
| 569 const Length& marginTop() const { return surround->margin.top(); } | 559 const Length& marginTop() const { return surround->margin.top(); } |
| 570 const Length& marginBottom() const { return surround->margin.bottom(); } | 560 const Length& marginBottom() const { return surround->margin.bottom(); } |
| 571 const Length& marginLeft() const { return surround->margin.left(); } | 561 const Length& marginLeft() const { return surround->margin.left(); } |
| 572 const Length& marginRight() const { return surround->margin.right(); } | 562 const Length& marginRight() const { return surround->margin.right(); } |
| 573 const Length& marginBefore() const { return surround->margin.before(); } | 563 const Length& marginBefore() const { return surround->margin.before(); } |
| 574 const Length& marginAfter() const { return surround->margin.after(); } | 564 const Length& marginAfter() const { return surround->margin.after(); } |
| 575 const Length& marginStart() const { return surround->margin.start(direction(
)); } | 565 const Length& marginStart() const { return surround->margin.start(direction(
)); } |
| 576 const Length& marginEnd() const { return surround->margin.end(direction());
} | 566 const Length& marginEnd() const { return surround->margin.end(direction());
} |
| 577 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return
surround->margin.start(otherStyle->direction()); } | 567 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return
surround->margin.start(otherStyle->direction()); } |
| 578 const Length& marginEndUsing(const RenderStyle* otherStyle) const { return s
urround->margin.end(otherStyle->direction()); } | 568 const Length& marginEndUsing(const RenderStyle* otherStyle) const { return s
urround->margin.end(otherStyle->direction()); } |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 | 888 |
| 899 void setHorizontalBorderSpacing(short); | 889 void setHorizontalBorderSpacing(short); |
| 900 void setVerticalBorderSpacing(short); | 890 void setVerticalBorderSpacing(short); |
| 901 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; } | 891 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; } |
| 902 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; } | 892 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; } |
| 903 | 893 |
| 904 void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRa
tio, b); } | 894 void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRa
tio, b); } |
| 905 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_as
pectRatioDenominator, v); } | 895 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_as
pectRatioDenominator, v); } |
| 906 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspe
ctRatioNumerator, v); } | 896 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspe
ctRatioNumerator, v); } |
| 907 | 897 |
| 908 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type =
v; } | |
| 909 void setListStyleImage(PassRefPtr<StyleImage>); | |
| 910 void setListStylePosition(EListStylePosition v) { inherited_flags._list_styl
e_position = v; } | |
| 911 | |
| 912 void setMarginTop(const Length& v) { SET_VAR(surround, margin.m_top, v); } | 898 void setMarginTop(const Length& v) { SET_VAR(surround, margin.m_top, v); } |
| 913 void setMarginBottom(const Length& v) { SET_VAR(surround, margin.m_bottom, v
); } | 899 void setMarginBottom(const Length& v) { SET_VAR(surround, margin.m_bottom, v
); } |
| 914 void setMarginLeft(const Length& v) { SET_VAR(surround, margin.m_left, v); } | 900 void setMarginLeft(const Length& v) { SET_VAR(surround, margin.m_left, v); } |
| 915 void setMarginRight(const Length& v) { SET_VAR(surround, margin.m_right, v);
} | 901 void setMarginRight(const Length& v) { SET_VAR(surround, margin.m_right, v);
} |
| 916 void setMarginStart(const Length&); | 902 void setMarginStart(const Length&); |
| 917 void setMarginEnd(const Length&); | 903 void setMarginEnd(const Length&); |
| 918 | 904 |
| 919 void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)); } | 905 void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)); } |
| 920 void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b); } | 906 void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b); } |
| 921 void setPaddingTop(const Length& v) { SET_VAR(surround, padding.m_top, v); } | 907 void setPaddingTop(const Length& v) { SET_VAR(surround, padding.m_top, v); } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } | 1081 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } |
| 1096 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed)
, Length(0, Fixed)); } | 1082 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed)
, Length(0, Fixed)); } |
| 1097 static ECaptionSide initialCaptionSide() { return CAPTOP; } | 1083 static ECaptionSide initialCaptionSide() { return CAPTOP; } |
| 1098 static LengthBox initialClip() { return LengthBox(); } | 1084 static LengthBox initialClip() { return LengthBox(); } |
| 1099 static TextDirection initialDirection() { return LTR; } | 1085 static TextDirection initialDirection() { return LTR; } |
| 1100 static TextOrientation initialTextOrientation() { return TextOrientationVert
icalRight; } | 1086 static TextOrientation initialTextOrientation() { return TextOrientationVert
icalRight; } |
| 1101 static ObjectFit initialObjectFit() { return ObjectFitFill; } | 1087 static ObjectFit initialObjectFit() { return ObjectFitFill; } |
| 1102 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } | 1088 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } |
| 1103 static EDisplay initialDisplay() { return FLEX; } | 1089 static EDisplay initialDisplay() { return FLEX; } |
| 1104 static EEmptyCell initialEmptyCells() { return SHOW; } | 1090 static EEmptyCell initialEmptyCells() { return SHOW; } |
| 1105 static EListStylePosition initialListStylePosition() { return OUTSIDE; } | |
| 1106 static EListStyleType initialListStyleType() { return Disc; } | |
| 1107 static EOverflow initialOverflowX() { return OVISIBLE; } | 1091 static EOverflow initialOverflowX() { return OVISIBLE; } |
| 1108 static EOverflow initialOverflowY() { return OVISIBLE; } | 1092 static EOverflow initialOverflowY() { return OVISIBLE; } |
| 1109 static EPageBreak initialPageBreak() { return PBAUTO; } | 1093 static EPageBreak initialPageBreak() { return PBAUTO; } |
| 1110 static EPosition initialPosition() { return StaticPosition; } | 1094 static EPosition initialPosition() { return StaticPosition; } |
| 1111 static ETableLayout initialTableLayout() { return TAUTO; } | 1095 static ETableLayout initialTableLayout() { return TAUTO; } |
| 1112 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } | 1096 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } |
| 1113 static EVisibility initialVisibility() { return VISIBLE; } | 1097 static EVisibility initialVisibility() { return VISIBLE; } |
| 1114 static EWhiteSpace initialWhiteSpace() { return NORMAL; } | 1098 static EWhiteSpace initialWhiteSpace() { return NORMAL; } |
| 1115 static short initialHorizontalBorderSpacing() { return 0; } | 1099 static short initialHorizontalBorderSpacing() { return 0; } |
| 1116 static short initialVerticalBorderSpacing() { return 0; } | 1100 static short initialVerticalBorderSpacing() { return 0; } |
| 1117 static Color initialColor() { return Color::black; } | 1101 static Color initialColor() { return Color::black; } |
| 1118 static StyleImage* initialListStyleImage() { return 0; } | |
| 1119 static unsigned initialBorderWidth() { return 3; } | 1102 static unsigned initialBorderWidth() { return 3; } |
| 1120 static unsigned short initialColumnRuleWidth() { return 3; } | 1103 static unsigned short initialColumnRuleWidth() { return 3; } |
| 1121 static unsigned short initialOutlineWidth() { return 3; } | 1104 static unsigned short initialOutlineWidth() { return 3; } |
| 1122 static float initialLetterWordSpacing() { return 0.0f; } | 1105 static float initialLetterWordSpacing() { return 0.0f; } |
| 1123 static Length initialSize() { return Length(); } | 1106 static Length initialSize() { return Length(); } |
| 1124 static Length initialMinSize() { return Length(Fixed); } | 1107 static Length initialMinSize() { return Length(Fixed); } |
| 1125 static Length initialMaxSize() { return Length(MaxSizeNone); } | 1108 static Length initialMaxSize() { return Length(MaxSizeNone); } |
| 1126 static Length initialOffset() { return Length(); } | 1109 static Length initialOffset() { return Length(); } |
| 1127 static Length initialMargin() { return Length(Fixed); } | 1110 static Length initialMargin() { return Length(Fixed); } |
| 1128 static Length initialPadding() { return Length(Fixed); } | 1111 static Length initialPadding() { return Length(Fixed); } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 | 1273 |
| 1291 rareInheritedData.access()->m_textOrientation = textOrientation; | 1274 rareInheritedData.access()->m_textOrientation = textOrientation; |
| 1292 return true; | 1275 return true; |
| 1293 } | 1276 } |
| 1294 | 1277 |
| 1295 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect
::Radii&); | 1278 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect
::Radii&); |
| 1296 | 1279 |
| 1297 } // namespace blink | 1280 } // namespace blink |
| 1298 | 1281 |
| 1299 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ | 1282 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ |
| OLD | NEW |