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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #define SET_BORDERVALUE_COLOR(group, variable, value) \ | 90 #define SET_BORDERVALUE_COLOR(group, variable, value) \ |
91 if (!compareEqual(group->variable.color(), value)) \ | 91 if (!compareEqual(group->variable.color(), value)) \ |
92 group.access()->variable.setColor(value) | 92 group.access()->variable.setColor(value) |
93 | 93 |
94 namespace WebCore { | 94 namespace WebCore { |
95 | 95 |
96 using std::max; | 96 using std::max; |
97 | 97 |
98 class FilterOperations; | 98 class FilterOperations; |
99 | 99 |
| 100 class AppliedTextDecoration; |
100 class BorderData; | 101 class BorderData; |
101 class CounterContent; | 102 class CounterContent; |
102 class CursorList; | 103 class CursorList; |
103 class Font; | 104 class Font; |
104 class FontMetrics; | 105 class FontMetrics; |
105 class IntRect; | 106 class IntRect; |
106 class Pair; | 107 class Pair; |
107 class ShadowList; | 108 class ShadowList; |
108 class StyleImage; | 109 class StyleImage; |
109 class StyleInheritedData; | 110 class StyleInheritedData; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 struct InheritedFlags { | 157 struct InheritedFlags { |
157 bool operator==(const InheritedFlags& other) const | 158 bool operator==(const InheritedFlags& other) const |
158 { | 159 { |
159 return (_empty_cells == other._empty_cells) | 160 return (_empty_cells == other._empty_cells) |
160 && (_caption_side == other._caption_side) | 161 && (_caption_side == other._caption_side) |
161 && (_list_style_type == other._list_style_type) | 162 && (_list_style_type == other._list_style_type) |
162 && (_list_style_position == other._list_style_position) | 163 && (_list_style_position == other._list_style_position) |
163 && (_visibility == other._visibility) | 164 && (_visibility == other._visibility) |
164 && (_text_align == other._text_align) | 165 && (_text_align == other._text_align) |
165 && (_text_transform == other._text_transform) | 166 && (_text_transform == other._text_transform) |
166 && (_text_decorations == other._text_decorations) | 167 && (m_textUnderline == other.m_textUnderline) |
167 && (_cursor_style == other._cursor_style) | 168 && (_cursor_style == other._cursor_style) |
168 && (_direction == other._direction) | 169 && (_direction == other._direction) |
169 && (_white_space == other._white_space) | 170 && (_white_space == other._white_space) |
170 && (_border_collapse == other._border_collapse) | 171 && (_border_collapse == other._border_collapse) |
171 && (_box_direction == other._box_direction) | 172 && (_box_direction == other._box_direction) |
172 && (m_rtlOrdering == other.m_rtlOrdering) | 173 && (m_rtlOrdering == other.m_rtlOrdering) |
173 && (m_printColorAdjust == other.m_printColorAdjust) | 174 && (m_printColorAdjust == other.m_printColorAdjust) |
174 && (_pointerEvents == other._pointerEvents) | 175 && (_pointerEvents == other._pointerEvents) |
175 && (_insideLink == other._insideLink) | 176 && (_insideLink == other._insideLink) |
176 && (m_writingMode == other.m_writingMode); | 177 && (m_writingMode == other.m_writingMode); |
177 } | 178 } |
178 | 179 |
179 bool operator!=(const InheritedFlags& other) const { return !(*this == o
ther); } | 180 bool operator!=(const InheritedFlags& other) const { return !(*this == o
ther); } |
180 | 181 |
181 unsigned _empty_cells : 1; // EEmptyCell | 182 unsigned _empty_cells : 1; // EEmptyCell |
182 unsigned _caption_side : 2; // ECaptionSide | 183 unsigned _caption_side : 2; // ECaptionSide |
183 unsigned _list_style_type : 7; // EListStyleType | 184 unsigned _list_style_type : 7; // EListStyleType |
184 unsigned _list_style_position : 1; // EListStylePosition | 185 unsigned _list_style_position : 1; // EListStylePosition |
185 unsigned _visibility : 2; // EVisibility | 186 unsigned _visibility : 2; // EVisibility |
186 unsigned _text_align : 4; // ETextAlign | 187 unsigned _text_align : 4; // ETextAlign |
187 unsigned _text_transform : 2; // ETextTransform | 188 unsigned _text_transform : 2; // ETextTransform |
188 unsigned _text_decorations : TextDecorationBits; | 189 unsigned m_textUnderline : 1; |
189 unsigned _cursor_style : 6; // ECursor | 190 unsigned _cursor_style : 6; // ECursor |
190 unsigned _direction : 1; // TextDirection | 191 unsigned _direction : 1; // TextDirection |
191 unsigned _white_space : 3; // EWhiteSpace | 192 unsigned _white_space : 3; // EWhiteSpace |
192 // 32 bits | |
193 unsigned _border_collapse : 1; // EBorderCollapse | 193 unsigned _border_collapse : 1; // EBorderCollapse |
194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper
ty, flexible box layout module) | 194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper
ty, flexible box layout module) |
| 195 // 32 bits |
195 | 196 |
196 // non CSS2 inherited | 197 // non CSS2 inherited |
197 unsigned m_rtlOrdering : 1; // Order | 198 unsigned m_rtlOrdering : 1; // Order |
198 unsigned m_printColorAdjust : PrintColorAdjustBits; | 199 unsigned m_printColorAdjust : PrintColorAdjustBits; |
199 unsigned _pointerEvents : 4; // EPointerEvents | 200 unsigned _pointerEvents : 4; // EPointerEvents |
200 unsigned _insideLink : 2; // EInsideLink | 201 unsigned _insideLink : 2; // EInsideLink |
201 // 43 bits | 202 // 40 bits |
202 | 203 |
203 // CSS Text Layout Module Level 3: Vertical writing support | 204 // CSS Text Layout Module Level 3: Vertical writing support |
204 unsigned m_writingMode : 2; // WritingMode | 205 unsigned m_writingMode : 2; // WritingMode |
205 // 45 bits | 206 // 42 bits |
206 } inherited_flags; | 207 } inherited_flags; |
207 | 208 |
208 // don't inherit | 209 // don't inherit |
209 struct NonInheritedFlags { | 210 struct NonInheritedFlags { |
210 bool operator==(const NonInheritedFlags& other) const | 211 bool operator==(const NonInheritedFlags& other) const |
211 { | 212 { |
212 return _effectiveDisplay == other._effectiveDisplay | 213 return _effectiveDisplay == other._effectiveDisplay |
213 && _originalDisplay == other._originalDisplay | 214 && _originalDisplay == other._originalDisplay |
214 && _overflowX == other._overflowX | 215 && _overflowX == other._overflowX |
215 && _overflowY == other._overflowY | 216 && _overflowY == other._overflowY |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 protected: | 296 protected: |
296 void setBitDefaults() | 297 void setBitDefaults() |
297 { | 298 { |
298 inherited_flags._empty_cells = initialEmptyCells(); | 299 inherited_flags._empty_cells = initialEmptyCells(); |
299 inherited_flags._caption_side = initialCaptionSide(); | 300 inherited_flags._caption_side = initialCaptionSide(); |
300 inherited_flags._list_style_type = initialListStyleType(); | 301 inherited_flags._list_style_type = initialListStyleType(); |
301 inherited_flags._list_style_position = initialListStylePosition(); | 302 inherited_flags._list_style_position = initialListStylePosition(); |
302 inherited_flags._visibility = initialVisibility(); | 303 inherited_flags._visibility = initialVisibility(); |
303 inherited_flags._text_align = initialTextAlign(); | 304 inherited_flags._text_align = initialTextAlign(); |
304 inherited_flags._text_transform = initialTextTransform(); | 305 inherited_flags._text_transform = initialTextTransform(); |
305 inherited_flags._text_decorations = initialTextDecoration(); | 306 inherited_flags.m_textUnderline = false; |
306 inherited_flags._cursor_style = initialCursor(); | 307 inherited_flags._cursor_style = initialCursor(); |
307 inherited_flags._direction = initialDirection(); | 308 inherited_flags._direction = initialDirection(); |
308 inherited_flags._white_space = initialWhiteSpace(); | 309 inherited_flags._white_space = initialWhiteSpace(); |
309 inherited_flags._border_collapse = initialBorderCollapse(); | 310 inherited_flags._border_collapse = initialBorderCollapse(); |
310 inherited_flags.m_rtlOrdering = initialRTLOrdering(); | 311 inherited_flags.m_rtlOrdering = initialRTLOrdering(); |
311 inherited_flags._box_direction = initialBoxDirection(); | 312 inherited_flags._box_direction = initialBoxDirection(); |
312 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); | 313 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); |
313 inherited_flags._pointerEvents = initialPointerEvents(); | 314 inherited_flags._pointerEvents = initialPointerEvents(); |
314 inherited_flags._insideLink = NotInsideLink; | 315 inherited_flags._insideLink = NotInsideLink; |
315 inherited_flags.m_writingMode = initialWritingMode(); | 316 inherited_flags.m_writingMode = initialWritingMode(); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 575 |
575 float textAutosizingMultiplier() const { return visual->m_textAutosizingMult
iplier; } | 576 float textAutosizingMultiplier() const { return visual->m_textAutosizingMult
iplier; } |
576 | 577 |
577 const Length& textIndent() const { return rareInheritedData->indent; } | 578 const Length& textIndent() const { return rareInheritedData->indent; } |
578 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r
areInheritedData->m_textIndentLine); } | 579 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r
areInheritedData->m_textIndentLine); } |
579 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r
areInheritedData->m_textIndentType); } | 580 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r
areInheritedData->m_textIndentType); } |
580 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag
s._text_align); } | 581 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag
s._text_align); } |
581 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare
InheritedData->m_textAlignLast); } | 582 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare
InheritedData->m_textAlignLast); } |
582 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri
tedData->m_textJustify); } | 583 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri
tedData->m_textJustify); } |
583 ETextTransform textTransform() const { return static_cast<ETextTransform>(in
herited_flags._text_transform); } | 584 ETextTransform textTransform() const { return static_cast<ETextTransform>(in
herited_flags._text_transform); } |
584 TextDecoration textDecorationsInEffect() const { return static_cast<TextDeco
ration>(inherited_flags._text_decorations); } | 585 TextDecoration textDecorationsInEffect() const; |
| 586 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; |
| 587 bool hasAppliedTextDecorations() const { return appliedTextDecorations().siz
e(); } |
585 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v
isual->textDecoration); } | 588 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v
isual->textDecoration); } |
586 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex
tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } | 589 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex
tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } |
587 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec
orationStyle>(rareNonInheritedData->m_textDecorationStyle); } | 590 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec
orationStyle>(rareNonInheritedData->m_textDecorationStyle); } |
588 float wordSpacing() const; | 591 float wordSpacing() const; |
589 float letterSpacing() const; | 592 float letterSpacing() const; |
590 | 593 |
591 float zoom() const { return visual->m_zoom; } | 594 float zoom() const { return visual->m_zoom; } |
592 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } | 595 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } |
593 | 596 |
594 TextDirection direction() const { return static_cast<TextDirection>(inherite
d_flags._direction); } | 597 TextDirection direction() const { return static_cast<TextDirection>(inherite
d_flags._direction); } |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 } | 1110 } |
1108 | 1111 |
1109 void setColor(const Color&); | 1112 void setColor(const Color&); |
1110 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); } | 1113 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); } |
1111 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text
IndentLine, v); } | 1114 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text
IndentLine, v); } |
1112 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text
IndentType, v); } | 1115 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text
IndentType, v); } |
1113 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } | 1116 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } |
1114 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl
ignLast, v); } | 1117 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl
ignLast, v); } |
1115 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif
y, v); } | 1118 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif
y, v); } |
1116 void setTextTransform(ETextTransform v) { inherited_flags._text_transform =
v; } | 1119 void setTextTransform(ETextTransform v) { inherited_flags._text_transform =
v; } |
1117 void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_
decorations |= v; } | 1120 void addAppliedTextDecoration(const AppliedTextDecoration&); |
1118 void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_de
corations = v; } | 1121 void applyTextDecorations(); |
| 1122 void clearAppliedTextDecorations(); |
1119 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v
); } | 1123 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v
); } |
1120 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit
edData, m_textUnderlinePosition, v); } | 1124 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit
edData, m_textUnderlinePosition, v); } |
1121 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite
dData, m_textDecorationStyle, v); } | 1125 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite
dData, m_textDecorationStyle, v); } |
1122 void setDirection(TextDirection v) { inherited_flags._direction = v; } | 1126 void setDirection(TextDirection v) { inherited_flags._direction = v; } |
1123 void setLineHeight(Length specifiedLineHeight); | 1127 void setLineHeight(Length specifiedLineHeight); |
1124 bool setZoom(float); | 1128 bool setZoom(float); |
1125 void setZoomWithoutReturnValue(float f) { setZoom(f); } | 1129 void setZoomWithoutReturnValue(float f) { setZoom(f); } |
1126 bool setEffectiveZoom(float); | 1130 bool setEffectiveZoom(float); |
1127 | 1131 |
1128 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima
geRendering, v); } | 1132 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima
geRendering, v); } |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 | 1512 |
1509 bool isSharable() const; | 1513 bool isSharable() const; |
1510 | 1514 |
1511 bool emptyState() const { return noninherited_flags.emptyState; } | 1515 bool emptyState() const { return noninherited_flags.emptyState; } |
1512 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b;
} | 1516 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b;
} |
1513 bool firstChildState() const { return noninherited_flags.firstChildState; } | 1517 bool firstChildState() const { return noninherited_flags.firstChildState; } |
1514 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState
= true; } | 1518 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState
= true; } |
1515 bool lastChildState() const { return noninherited_flags.lastChildState; } | 1519 bool lastChildState() const { return noninherited_flags.lastChildState; } |
1516 void setLastChildState() { setUnique(); noninherited_flags.lastChildState =
true; } | 1520 void setLastChildState() { setUnique(); noninherited_flags.lastChildState =
true; } |
1517 | 1521 |
1518 StyleColor visitedDependentDecorationColor() const; | 1522 StyleColor visitedDependentDecorationStyleColor() const; |
| 1523 Color visitedDependentDecorationColor() const; |
1519 Color visitedDependentColor(int colorProperty) const; | 1524 Color visitedDependentColor(int colorProperty) const; |
1520 | 1525 |
1521 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe
ritance = true; } | 1526 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe
ritance = true; } |
1522 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex
plicitInheritance; } | 1527 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex
plicitInheritance; } |
1523 | 1528 |
1524 void setHasCurrentColor() { noninherited_flags.currentColor = true; } | 1529 void setHasCurrentColor() { noninherited_flags.currentColor = true; } |
1525 bool hasCurrentColor() const { return noninherited_flags.currentColor; } | 1530 bool hasCurrentColor() const { return noninherited_flags.currentColor; } |
1526 | 1531 |
1527 // Initial values for all the properties | 1532 // Initial values for all the properties |
1528 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; } | 1533 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; } |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 inline bool RenderStyle::hasPseudoElementStyle() const | 1883 inline bool RenderStyle::hasPseudoElementStyle() const |
1879 { | 1884 { |
1880 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK; | 1885 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK; |
1881 } | 1886 } |
1882 | 1887 |
1883 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect
::Radii&); | 1888 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect
::Radii&); |
1884 | 1889 |
1885 } // namespace WebCore | 1890 } // namespace WebCore |
1886 | 1891 |
1887 #endif // RenderStyle_h | 1892 #endif // RenderStyle_h |
OLD | NEW |