| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_hasSimpleUnderline == other.m_hasSimpleUnderline) && | 201 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && |
| 202 (m_cursorStyle == other.m_cursorStyle) && | 202 (m_cursorStyle == other.m_cursorStyle) && |
| 203 (m_rtlOrdering == other.m_rtlOrdering) && | |
| 204 (m_insideLink == other.m_insideLink); | 203 (m_insideLink == other.m_insideLink); |
| 205 } | 204 } |
| 206 | 205 |
| 207 bool operator!=(const InheritedData& other) const { | 206 bool operator!=(const InheritedData& other) const { |
| 208 return !(*this == other); | 207 return !(*this == other); |
| 209 } | 208 } |
| 210 | 209 |
| 211 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only | 210 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only |
| 212 // text decoration on this element. | 211 // text decoration on this element. |
| 213 unsigned m_cursorStyle : 6; // ECursor | 212 unsigned m_cursorStyle : 6; // ECursor |
| 214 | 213 |
| 215 // non CSS2 inherited | 214 // non CSS2 inherited |
| 216 unsigned m_rtlOrdering : 1; // EOrder | |
| 217 unsigned m_insideLink : 2; // EInsideLink | 215 unsigned m_insideLink : 2; // EInsideLink |
| 218 } m_inheritedData; | 216 } m_inheritedData; |
| 219 | 217 |
| 220 // don't inherit | 218 // don't inherit |
| 221 struct NonInheritedData { | 219 struct NonInheritedData { |
| 222 // Compare computed styles, differences in inherited bits or other flags | 220 // Compare computed styles, differences in inherited bits or other flags |
| 223 // should not cause an inequality. | 221 // should not cause an inequality. |
| 224 bool operator==(const NonInheritedData& other) const { | 222 bool operator==(const NonInheritedData& other) const { |
| 225 return m_effectiveDisplay == other.m_effectiveDisplay && | 223 return m_effectiveDisplay == other.m_effectiveDisplay && |
| 226 m_originalDisplay == other.m_originalDisplay && | 224 m_originalDisplay == other.m_originalDisplay && |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // If you add more style bits here, you will also need to update | 296 // If you add more style bits here, you will also need to update |
| 299 // ComputedStyle::copyNonInheritedFromCached() 68 bits | 297 // ComputedStyle::copyNonInheritedFromCached() 68 bits |
| 300 } m_nonInheritedData; | 298 } m_nonInheritedData; |
| 301 | 299 |
| 302 // !END SYNC! | 300 // !END SYNC! |
| 303 | 301 |
| 304 void setBitDefaults() { | 302 void setBitDefaults() { |
| 305 ComputedStyleBase::setBitDefaults(); | 303 ComputedStyleBase::setBitDefaults(); |
| 306 m_inheritedData.m_hasSimpleUnderline = false; | 304 m_inheritedData.m_hasSimpleUnderline = false; |
| 307 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 305 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
| 308 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); | |
| 309 m_inheritedData.m_insideLink = NotInsideLink; | 306 m_inheritedData.m_insideLink = NotInsideLink; |
| 310 | 307 |
| 311 m_nonInheritedData.m_effectiveDisplay = | 308 m_nonInheritedData.m_effectiveDisplay = |
| 312 m_nonInheritedData.m_originalDisplay = | 309 m_nonInheritedData.m_originalDisplay = |
| 313 static_cast<unsigned>(initialDisplay()); | 310 static_cast<unsigned>(initialDisplay()); |
| 314 m_nonInheritedData.m_overflowAnchor = | 311 m_nonInheritedData.m_overflowAnchor = |
| 315 static_cast<unsigned>(initialOverflowAnchor()); | 312 static_cast<unsigned>(initialOverflowAnchor()); |
| 316 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); | 313 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); |
| 317 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); | 314 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); |
| 318 m_nonInheritedData.m_verticalAlign = | 315 m_nonInheritedData.m_verticalAlign = |
| (...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 | 2239 |
| 2243 // -webkit-line-clamp | 2240 // -webkit-line-clamp |
| 2244 static LineClampValue initialLineClamp() { return LineClampValue(); } | 2241 static LineClampValue initialLineClamp() { return LineClampValue(); } |
| 2245 const LineClampValue& lineClamp() const { | 2242 const LineClampValue& lineClamp() const { |
| 2246 return m_rareNonInheritedData->lineClamp; | 2243 return m_rareNonInheritedData->lineClamp; |
| 2247 } | 2244 } |
| 2248 void setLineClamp(LineClampValue c) { | 2245 void setLineClamp(LineClampValue c) { |
| 2249 SET_VAR(m_rareNonInheritedData, lineClamp, c); | 2246 SET_VAR(m_rareNonInheritedData, lineClamp, c); |
| 2250 } | 2247 } |
| 2251 | 2248 |
| 2252 // -webkit-rtl-ordering | |
| 2253 static EOrder initialRTLOrdering() { return EOrder::Logical; } | |
| 2254 EOrder rtlOrdering() const { | |
| 2255 return static_cast<EOrder>(m_inheritedData.m_rtlOrdering); | |
| 2256 } | |
| 2257 void setRTLOrdering(EOrder o) { | |
| 2258 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(o); | |
| 2259 } | |
| 2260 | |
| 2261 // -webkit-ruby-position | 2249 // -webkit-ruby-position |
| 2262 static RubyPosition initialRubyPosition() { return RubyPositionBefore; } | 2250 static RubyPosition initialRubyPosition() { return RubyPositionBefore; } |
| 2263 RubyPosition getRubyPosition() const { | 2251 RubyPosition getRubyPosition() const { |
| 2264 return static_cast<RubyPosition>(m_rareInheritedData->m_rubyPosition); | 2252 return static_cast<RubyPosition>(m_rareInheritedData->m_rubyPosition); |
| 2265 } | 2253 } |
| 2266 void setRubyPosition(RubyPosition position) { | 2254 void setRubyPosition(RubyPosition position) { |
| 2267 SET_VAR(m_rareInheritedData, m_rubyPosition, position); | 2255 SET_VAR(m_rareInheritedData, m_rubyPosition, position); |
| 2268 } | 2256 } |
| 2269 | 2257 |
| 2270 // -webkit-tap-highlight-color | 2258 // -webkit-tap-highlight-color |
| (...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3953 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3941 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 3954 } | 3942 } |
| 3955 | 3943 |
| 3956 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3944 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3957 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3945 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 3958 } | 3946 } |
| 3959 | 3947 |
| 3960 } // namespace blink | 3948 } // namespace blink |
| 3961 | 3949 |
| 3962 #endif // ComputedStyle_h | 3950 #endif // ComputedStyle_h |
| OLD | NEW |