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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; | 191 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; |
192 | 192 |
193 DataRef<SVGComputedStyle> m_svgStyle; | 193 DataRef<SVGComputedStyle> m_svgStyle; |
194 | 194 |
195 // !START SYNC!: Keep this in sync with the copy constructor in | 195 // !START SYNC!: Keep this in sync with the copy constructor in |
196 // ComputedStyle.cpp and implicitlyInherited() in StyleResolver.cpp | 196 // ComputedStyle.cpp and implicitlyInherited() in StyleResolver.cpp |
197 | 197 |
198 // inherit | 198 // inherit |
199 struct InheritedData { | 199 struct InheritedData { |
200 bool operator==(const InheritedData& other) const { | 200 bool operator==(const InheritedData& other) const { |
201 return (m_listStyleType == other.m_listStyleType) && | 201 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && |
202 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && | |
203 (m_cursorStyle == other.m_cursorStyle) && | 202 (m_cursorStyle == other.m_cursorStyle) && |
204 (m_direction == other.m_direction) && | 203 (m_direction == other.m_direction) && |
205 (m_rtlOrdering == other.m_rtlOrdering) && | 204 (m_rtlOrdering == other.m_rtlOrdering) && |
206 (m_insideLink == other.m_insideLink) && | 205 (m_insideLink == other.m_insideLink) && |
207 (m_writingMode == other.m_writingMode); | 206 (m_writingMode == other.m_writingMode); |
208 } | 207 } |
209 | 208 |
210 bool operator!=(const InheritedData& other) const { | 209 bool operator!=(const InheritedData& other) const { |
211 return !(*this == other); | 210 return !(*this == other); |
212 } | 211 } |
213 | 212 |
214 unsigned m_listStyleType : 7; // EListStyleType | |
215 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only | 213 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only |
216 // text decoration on this element. | 214 // text decoration on this element. |
217 unsigned m_cursorStyle : 6; // ECursor | 215 unsigned m_cursorStyle : 6; // ECursor |
218 unsigned m_direction : 1; // TextDirection | 216 unsigned m_direction : 1; // TextDirection |
219 // 32 bits | 217 // 32 bits |
220 | 218 |
221 // non CSS2 inherited | 219 // non CSS2 inherited |
222 unsigned m_rtlOrdering : 1; // EOrder | 220 unsigned m_rtlOrdering : 1; // EOrder |
223 unsigned m_insideLink : 2; // EInsideLink | 221 unsigned m_insideLink : 2; // EInsideLink |
224 | 222 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 mutable unsigned m_hasRemUnits : 1; | 304 mutable unsigned m_hasRemUnits : 1; |
307 | 305 |
308 // If you add more style bits here, you will also need to update | 306 // If you add more style bits here, you will also need to update |
309 // ComputedStyle::copyNonInheritedFromCached() 68 bits | 307 // ComputedStyle::copyNonInheritedFromCached() 68 bits |
310 } m_nonInheritedData; | 308 } m_nonInheritedData; |
311 | 309 |
312 // !END SYNC! | 310 // !END SYNC! |
313 | 311 |
314 void setBitDefaults() { | 312 void setBitDefaults() { |
315 ComputedStyleBase::setBitDefaults(); | 313 ComputedStyleBase::setBitDefaults(); |
316 m_inheritedData.m_listStyleType = | |
317 static_cast<unsigned>(initialListStyleType()); | |
318 m_inheritedData.m_hasSimpleUnderline = false; | 314 m_inheritedData.m_hasSimpleUnderline = false; |
319 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 315 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
320 m_inheritedData.m_direction = static_cast<unsigned>(initialDirection()); | 316 m_inheritedData.m_direction = static_cast<unsigned>(initialDirection()); |
321 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); | 317 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); |
322 m_inheritedData.m_insideLink = NotInsideLink; | 318 m_inheritedData.m_insideLink = NotInsideLink; |
323 m_inheritedData.m_writingMode = initialWritingMode(); | 319 m_inheritedData.m_writingMode = initialWritingMode(); |
324 | 320 |
325 m_nonInheritedData.m_effectiveDisplay = | 321 m_nonInheritedData.m_effectiveDisplay = |
326 m_nonInheritedData.m_originalDisplay = | 322 m_nonInheritedData.m_originalDisplay = |
327 static_cast<unsigned>(initialDisplay()); | 323 static_cast<unsigned>(initialDisplay()); |
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 void setHyphenationString(const AtomicString& h) { | 2049 void setHyphenationString(const AtomicString& h) { |
2054 SET_VAR(m_rareInheritedData, hyphenationString, h); | 2050 SET_VAR(m_rareInheritedData, hyphenationString, h); |
2055 } | 2051 } |
2056 | 2052 |
2057 // line-height | 2053 // line-height |
2058 static Length initialLineHeight() { return Length(-100.0, Percent); } | 2054 static Length initialLineHeight() { return Length(-100.0, Percent); } |
2059 Length lineHeight() const; | 2055 Length lineHeight() const; |
2060 void setLineHeight(const Length& specifiedLineHeight); | 2056 void setLineHeight(const Length& specifiedLineHeight); |
2061 | 2057 |
2062 // List style properties. | 2058 // List style properties. |
2063 // list-style-type | |
2064 static EListStyleType initialListStyleType() { return EListStyleType::Disc; } | |
2065 EListStyleType listStyleType() const { | |
2066 return static_cast<EListStyleType>(m_inheritedData.m_listStyleType); | |
2067 } | |
2068 void setListStyleType(EListStyleType v) { | |
2069 m_inheritedData.m_listStyleType = static_cast<unsigned>(v); | |
2070 } | |
2071 | |
2072 // list-style-image | 2059 // list-style-image |
2073 static StyleImage* initialListStyleImage() { return 0; } | 2060 static StyleImage* initialListStyleImage() { return 0; } |
2074 StyleImage* listStyleImage() const; | 2061 StyleImage* listStyleImage() const; |
2075 void setListStyleImage(StyleImage*); | 2062 void setListStyleImage(StyleImage*); |
2076 | 2063 |
2077 // orphans | 2064 // orphans |
2078 static short initialOrphans() { return 2; } | 2065 static short initialOrphans() { return 2; } |
2079 short orphans() const { return m_rareInheritedData->orphans; } | 2066 short orphans() const { return m_rareInheritedData->orphans; } |
2080 void setOrphans(short o) { SET_VAR(m_rareInheritedData, orphans, o); } | 2067 void setOrphans(short o) { SET_VAR(m_rareInheritedData, orphans, o); } |
2081 | 2068 |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3992 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3979 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
3993 } | 3980 } |
3994 | 3981 |
3995 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3982 inline bool ComputedStyle::hasPseudoElementStyle() const { |
3996 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3983 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
3997 } | 3984 } |
3998 | 3985 |
3999 } // namespace blink | 3986 } // namespace blink |
4000 | 3987 |
4001 #endif // ComputedStyle_h | 3988 #endif // ComputedStyle_h |
OLD | NEW |