| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 DataRef<StyleInheritedData> m_styleInheritedData; | 196 DataRef<StyleInheritedData> m_styleInheritedData; |
| 197 | 197 |
| 198 // list of associated pseudo styles | 198 // list of associated pseudo styles |
| 199 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; | 199 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; |
| 200 | 200 |
| 201 DataRef<SVGComputedStyle> m_svgStyle; | 201 DataRef<SVGComputedStyle> m_svgStyle; |
| 202 | 202 |
| 203 // !START SYNC!: Keep this in sync with the copy constructor in | 203 // !START SYNC!: Keep this in sync with the copy constructor in |
| 204 // ComputedStyle.cpp. | 204 // ComputedStyle.cpp. |
| 205 | 205 |
| 206 // inherit | |
| 207 struct InheritedData { | |
| 208 InheritedData() | |
| 209 : m_hasSimpleUnderline(false), | |
| 210 m_insideLink(static_cast<unsigned>(EInsideLink::kNotInsideLink)) {} | |
| 211 | |
| 212 bool operator==(const InheritedData& other) const { | |
| 213 // Generated properties are compared in ComputedStyleBase | |
| 214 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && | |
| 215 (m_insideLink == other.m_insideLink); | |
| 216 } | |
| 217 | |
| 218 bool operator!=(const InheritedData& other) const { | |
| 219 return !(*this == other); | |
| 220 } | |
| 221 | |
| 222 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only | |
| 223 // text decoration on this element. | |
| 224 | |
| 225 // non CSS2 inherited | |
| 226 unsigned m_insideLink : 2; // EInsideLink | |
| 227 } m_inheritedData; | |
| 228 | |
| 229 // don't inherit | 206 // don't inherit |
| 230 struct NonInheritedData { | 207 struct NonInheritedData { |
| 231 NonInheritedData() | 208 NonInheritedData() |
| 232 : m_effectiveDisplay(static_cast<unsigned>(initialDisplay())), | 209 : m_effectiveDisplay(static_cast<unsigned>(initialDisplay())), |
| 233 m_originalDisplay(static_cast<unsigned>(initialDisplay())), | 210 m_originalDisplay(static_cast<unsigned>(initialDisplay())), |
| 234 m_verticalAlign(static_cast<unsigned>(initialVerticalAlign())), | 211 m_verticalAlign(static_cast<unsigned>(initialVerticalAlign())), |
| 235 m_hasViewportUnits(false), | 212 m_hasViewportUnits(false), |
| 236 m_hasRemUnits(false) {} | 213 m_hasRemUnits(false) {} |
| 237 | 214 |
| 238 // Compare computed styles, differences in inherited bits or other flags | 215 // Compare computed styles, differences in inherited bits or other flags |
| (...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2411 SET_VAR(m_rareNonInheritedData, m_hasInlineTransform, b); | 2388 SET_VAR(m_rareNonInheritedData, m_hasInlineTransform, b); |
| 2412 } | 2389 } |
| 2413 | 2390 |
| 2414 bool hasCompositorProxy() const { | 2391 bool hasCompositorProxy() const { |
| 2415 return m_rareNonInheritedData->m_hasCompositorProxy; | 2392 return m_rareNonInheritedData->m_hasCompositorProxy; |
| 2416 } | 2393 } |
| 2417 void setHasCompositorProxy(bool b) { | 2394 void setHasCompositorProxy(bool b) { |
| 2418 SET_VAR(m_rareNonInheritedData, m_hasCompositorProxy, b); | 2395 SET_VAR(m_rareNonInheritedData, m_hasCompositorProxy, b); |
| 2419 } | 2396 } |
| 2420 | 2397 |
| 2421 EInsideLink insideLink() const { | |
| 2422 return static_cast<EInsideLink>(m_inheritedData.m_insideLink); | |
| 2423 } | |
| 2424 void setInsideLink(EInsideLink insideLink) { | |
| 2425 m_inheritedData.m_insideLink = static_cast<unsigned>(insideLink); | |
| 2426 } | |
| 2427 | |
| 2428 bool requiresAcceleratedCompositingForExternalReasons(bool b) { | 2398 bool requiresAcceleratedCompositingForExternalReasons(bool b) { |
| 2429 return m_rareNonInheritedData | 2399 return m_rareNonInheritedData |
| 2430 ->m_requiresAcceleratedCompositingForExternalReasons; | 2400 ->m_requiresAcceleratedCompositingForExternalReasons; |
| 2431 } | 2401 } |
| 2432 void setRequiresAcceleratedCompositingForExternalReasons(bool b) { | 2402 void setRequiresAcceleratedCompositingForExternalReasons(bool b) { |
| 2433 SET_VAR(m_rareNonInheritedData, | 2403 SET_VAR(m_rareNonInheritedData, |
| 2434 m_requiresAcceleratedCompositingForExternalReasons, b); | 2404 m_requiresAcceleratedCompositingForExternalReasons, b); |
| 2435 } | 2405 } |
| 2436 | 2406 |
| 2437 bool hasAuthorBackground() const { | 2407 bool hasAuthorBackground() const { |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3770 m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); | 3740 m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); |
| 3771 } | 3741 } |
| 3772 | 3742 |
| 3773 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3743 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3774 return m_pseudoBits & ElementPseudoIdMask; | 3744 return m_pseudoBits & ElementPseudoIdMask; |
| 3775 } | 3745 } |
| 3776 | 3746 |
| 3777 } // namespace blink | 3747 } // namespace blink |
| 3778 | 3748 |
| 3779 #endif // ComputedStyle_h | 3749 #endif // ComputedStyle_h |
| OLD | NEW |