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 | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 inline bool compareEqualIndependent(const InheritedData& other) const { | 209 inline bool compareEqualIndependent(const InheritedData& other) const { |
210 // These must match the properties tagged 'independent' in | 210 // These must match the properties tagged 'independent' in |
211 // CSSProperties.in. | 211 // CSSProperties.in. |
212 // TODO(sashab): Generate this function. | 212 // TODO(sashab): Generate this function. |
213 return (m_pointerEvents == other.m_pointerEvents); | 213 return (m_pointerEvents == other.m_pointerEvents); |
214 } | 214 } |
215 | 215 |
216 inline bool compareEqualNonIndependent(const InheritedData& other) const { | 216 inline bool compareEqualNonIndependent(const InheritedData& other) const { |
217 return (m_captionSide == other.m_captionSide) && | 217 return (m_listStyleType == other.m_listStyleType) && |
218 (m_listStyleType == other.m_listStyleType) && | |
219 (m_listStylePosition == other.m_listStylePosition) && | 218 (m_listStylePosition == other.m_listStylePosition) && |
220 (m_textAlign == other.m_textAlign) && | 219 (m_textAlign == other.m_textAlign) && |
221 (m_textTransform == other.m_textTransform) && | 220 (m_textTransform == other.m_textTransform) && |
222 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && | 221 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && |
223 (m_cursorStyle == other.m_cursorStyle) && | 222 (m_cursorStyle == other.m_cursorStyle) && |
224 (m_direction == other.m_direction) && | 223 (m_direction == other.m_direction) && |
225 (m_whiteSpace == other.m_whiteSpace) && | 224 (m_whiteSpace == other.m_whiteSpace) && |
226 (m_borderCollapse == other.m_borderCollapse) && | 225 (m_borderCollapse == other.m_borderCollapse) && |
227 (m_boxDirection == other.m_boxDirection) && | 226 (m_boxDirection == other.m_boxDirection) && |
228 (m_rtlOrdering == other.m_rtlOrdering) && | 227 (m_rtlOrdering == other.m_rtlOrdering) && |
229 (m_printColorAdjust == other.m_printColorAdjust) && | 228 (m_printColorAdjust == other.m_printColorAdjust) && |
230 (m_insideLink == other.m_insideLink) && | 229 (m_insideLink == other.m_insideLink) && |
231 (m_writingMode == other.m_writingMode); | 230 (m_writingMode == other.m_writingMode); |
232 } | 231 } |
233 | 232 |
234 unsigned m_captionSide : 2; // ECaptionSide | |
235 unsigned m_listStyleType : 7; // EListStyleType | 233 unsigned m_listStyleType : 7; // EListStyleType |
236 unsigned m_listStylePosition : 1; // EListStylePosition | 234 unsigned m_listStylePosition : 1; // EListStylePosition |
237 unsigned m_textAlign : 4; // ETextAlign | 235 unsigned m_textAlign : 4; // ETextAlign |
238 unsigned m_textTransform : 2; // ETextTransform | 236 unsigned m_textTransform : 2; // ETextTransform |
239 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only | 237 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only |
240 // text decoration on this element. | 238 // text decoration on this element. |
241 unsigned m_cursorStyle : 6; // ECursor | 239 unsigned m_cursorStyle : 6; // ECursor |
242 unsigned m_direction : 1; // TextDirection | 240 unsigned m_direction : 1; // TextDirection |
243 unsigned m_whiteSpace : 3; // EWhiteSpace | 241 unsigned m_whiteSpace : 3; // EWhiteSpace |
244 unsigned m_borderCollapse : 1; // EBorderCollapse | 242 unsigned m_borderCollapse : 1; // EBorderCollapse |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 unsigned m_isVisibilityInherited : 1; | 354 unsigned m_isVisibilityInherited : 1; |
357 | 355 |
358 // If you add more style bits here, you will also need to update | 356 // If you add more style bits here, you will also need to update |
359 // ComputedStyle::copyNonInheritedFromCached() 68 bits | 357 // ComputedStyle::copyNonInheritedFromCached() 68 bits |
360 } m_nonInheritedData; | 358 } m_nonInheritedData; |
361 | 359 |
362 // !END SYNC! | 360 // !END SYNC! |
363 | 361 |
364 void setBitDefaults() { | 362 void setBitDefaults() { |
365 ComputedStyleBase::setBitDefaults(); | 363 ComputedStyleBase::setBitDefaults(); |
366 m_inheritedData.m_captionSide = static_cast<unsigned>(initialCaptionSide()); | |
367 m_inheritedData.m_listStyleType = | 364 m_inheritedData.m_listStyleType = |
368 static_cast<unsigned>(initialListStyleType()); | 365 static_cast<unsigned>(initialListStyleType()); |
369 m_inheritedData.m_listStylePosition = | 366 m_inheritedData.m_listStylePosition = |
370 static_cast<unsigned>(initialListStylePosition()); | 367 static_cast<unsigned>(initialListStylePosition()); |
371 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); | 368 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); |
372 m_inheritedData.m_textTransform = initialTextTransform(); | 369 m_inheritedData.m_textTransform = initialTextTransform(); |
373 m_inheritedData.m_hasSimpleUnderline = false; | 370 m_inheritedData.m_hasSimpleUnderline = false; |
374 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 371 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
375 m_inheritedData.m_direction = initialDirection(); | 372 m_inheritedData.m_direction = initialDirection(); |
376 m_inheritedData.m_whiteSpace = initialWhiteSpace(); | 373 m_inheritedData.m_whiteSpace = initialWhiteSpace(); |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 // -webkit-border-horizontal-spacing | 2068 // -webkit-border-horizontal-spacing |
2072 static short initialHorizontalBorderSpacing() { return 0; } | 2069 static short initialHorizontalBorderSpacing() { return 0; } |
2073 short horizontalBorderSpacing() const; | 2070 short horizontalBorderSpacing() const; |
2074 void setHorizontalBorderSpacing(short); | 2071 void setHorizontalBorderSpacing(short); |
2075 | 2072 |
2076 // -webkit-border-vertical-spacing | 2073 // -webkit-border-vertical-spacing |
2077 static short initialVerticalBorderSpacing() { return 0; } | 2074 static short initialVerticalBorderSpacing() { return 0; } |
2078 short verticalBorderSpacing() const; | 2075 short verticalBorderSpacing() const; |
2079 void setVerticalBorderSpacing(short); | 2076 void setVerticalBorderSpacing(short); |
2080 | 2077 |
2081 // caption-side (aka -epub-caption-side) | |
2082 static ECaptionSide initialCaptionSide() { return ECaptionSide::Top; } | |
2083 ECaptionSide captionSide() const { | |
2084 return static_cast<ECaptionSide>(m_inheritedData.m_captionSide); | |
2085 } | |
2086 void setCaptionSide(ECaptionSide v) { | |
2087 m_inheritedData.m_captionSide = static_cast<unsigned>(v); | |
2088 } | |
2089 | |
2090 // cursor | 2078 // cursor |
2091 static ECursor initialCursor() { return ECursor::Auto; } | 2079 static ECursor initialCursor() { return ECursor::Auto; } |
2092 ECursor cursor() const { | 2080 ECursor cursor() const { |
2093 return static_cast<ECursor>(m_inheritedData.m_cursorStyle); | 2081 return static_cast<ECursor>(m_inheritedData.m_cursorStyle); |
2094 } | 2082 } |
2095 void setCursor(ECursor c) { | 2083 void setCursor(ECursor c) { |
2096 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c); | 2084 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c); |
2097 } | 2085 } |
2098 | 2086 |
2099 // direction | 2087 // direction |
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4111 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 4099 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
4112 } | 4100 } |
4113 | 4101 |
4114 inline bool ComputedStyle::hasPseudoElementStyle() const { | 4102 inline bool ComputedStyle::hasPseudoElementStyle() const { |
4115 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 4103 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
4116 } | 4104 } |
4117 | 4105 |
4118 } // namespace blink | 4106 } // namespace blink |
4119 | 4107 |
4120 #endif // ComputedStyle_h | 4108 #endif // ComputedStyle_h |
OLD | NEW |