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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 // 32 bits | 264 // 32 bits |
265 | 265 |
266 unsigned m_styleType : 6; // PseudoId | 266 unsigned m_styleType : 6; // PseudoId |
267 unsigned m_pseudoBits : 8; | 267 unsigned m_pseudoBits : 8; |
268 | 268 |
269 unsigned m_emptyState : 1; | 269 unsigned m_emptyState : 1; |
270 | 270 |
271 // 64 bits | 271 // 64 bits |
272 | 272 |
273 unsigned m_isLink : 1; | |
274 | |
275 mutable unsigned m_hasRemUnits : 1; | 273 mutable unsigned m_hasRemUnits : 1; |
276 | 274 |
277 // If you add more style bits here, you will also need to update | 275 // If you add more style bits here, you will also need to update |
278 // ComputedStyle::copyNonInheritedFromCached() 68 bits | 276 // ComputedStyle::copyNonInheritedFromCached() 68 bits |
279 } m_nonInheritedData; | 277 } m_nonInheritedData; |
280 | 278 |
281 // !END SYNC! | 279 // !END SYNC! |
282 | 280 |
283 // Only call inside the constructor. Generated properties in the base class | 281 // Only call inside the constructor. Generated properties in the base class |
284 // are not initialized in this method. | 282 // are not initialized in this method. |
285 void initializeBitDefaults() { | 283 void initializeBitDefaults() { |
286 m_inheritedData.m_hasSimpleUnderline = false; | 284 m_inheritedData.m_hasSimpleUnderline = false; |
287 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 285 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
288 m_inheritedData.m_insideLink = | 286 m_inheritedData.m_insideLink = |
289 static_cast<unsigned>(EInsideLink::kNotInsideLink); | 287 static_cast<unsigned>(EInsideLink::kNotInsideLink); |
290 | 288 |
291 m_nonInheritedData.m_effectiveDisplay = | 289 m_nonInheritedData.m_effectiveDisplay = |
292 m_nonInheritedData.m_originalDisplay = | 290 m_nonInheritedData.m_originalDisplay = |
293 static_cast<unsigned>(initialDisplay()); | 291 static_cast<unsigned>(initialDisplay()); |
294 m_nonInheritedData.m_verticalAlign = | 292 m_nonInheritedData.m_verticalAlign = |
295 static_cast<unsigned>(initialVerticalAlign()); | 293 static_cast<unsigned>(initialVerticalAlign()); |
296 m_nonInheritedData.m_styleType = PseudoIdNone; | 294 m_nonInheritedData.m_styleType = PseudoIdNone; |
297 m_nonInheritedData.m_pseudoBits = 0; | 295 m_nonInheritedData.m_pseudoBits = 0; |
298 m_nonInheritedData.m_emptyState = false; | 296 m_nonInheritedData.m_emptyState = false; |
299 m_nonInheritedData.m_hasViewportUnits = false; | 297 m_nonInheritedData.m_hasViewportUnits = false; |
300 m_nonInheritedData.m_isLink = false; | |
301 m_nonInheritedData.m_hasRemUnits = false; | 298 m_nonInheritedData.m_hasRemUnits = false; |
302 } | 299 } |
303 | 300 |
304 private: | 301 private: |
305 // TODO(sashab): Move these to the bottom of ComputedStyle. | 302 // TODO(sashab): Move these to the bottom of ComputedStyle. |
306 ALWAYS_INLINE ComputedStyle(); | 303 ALWAYS_INLINE ComputedStyle(); |
307 | 304 |
308 enum InitialStyleTag { InitialStyle }; | 305 enum InitialStyleTag { InitialStyle }; |
309 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); | 306 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); |
310 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); | 307 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); |
(...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2445 SET_VAR(m_rareNonInheritedData, m_hasInlineTransform, b); | 2442 SET_VAR(m_rareNonInheritedData, m_hasInlineTransform, b); |
2446 } | 2443 } |
2447 | 2444 |
2448 bool hasCompositorProxy() const { | 2445 bool hasCompositorProxy() const { |
2449 return m_rareNonInheritedData->m_hasCompositorProxy; | 2446 return m_rareNonInheritedData->m_hasCompositorProxy; |
2450 } | 2447 } |
2451 void setHasCompositorProxy(bool b) { | 2448 void setHasCompositorProxy(bool b) { |
2452 SET_VAR(m_rareNonInheritedData, m_hasCompositorProxy, b); | 2449 SET_VAR(m_rareNonInheritedData, m_hasCompositorProxy, b); |
2453 } | 2450 } |
2454 | 2451 |
2455 bool isLink() const { return m_nonInheritedData.m_isLink; } | |
2456 void setIsLink() { m_nonInheritedData.m_isLink = true; } | |
2457 | |
2458 EInsideLink insideLink() const { | 2452 EInsideLink insideLink() const { |
2459 return static_cast<EInsideLink>(m_inheritedData.m_insideLink); | 2453 return static_cast<EInsideLink>(m_inheritedData.m_insideLink); |
2460 } | 2454 } |
2461 void setInsideLink(EInsideLink insideLink) { | 2455 void setInsideLink(EInsideLink insideLink) { |
2462 m_inheritedData.m_insideLink = static_cast<unsigned>(insideLink); | 2456 m_inheritedData.m_insideLink = static_cast<unsigned>(insideLink); |
2463 } | 2457 } |
2464 | 2458 |
2465 bool requiresAcceleratedCompositingForExternalReasons(bool b) { | 2459 bool requiresAcceleratedCompositingForExternalReasons(bool b) { |
2466 return m_rareNonInheritedData | 2460 return m_rareNonInheritedData |
2467 ->m_requiresAcceleratedCompositingForExternalReasons; | 2461 ->m_requiresAcceleratedCompositingForExternalReasons; |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3804 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); | 3798 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); |
3805 } | 3799 } |
3806 | 3800 |
3807 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3801 inline bool ComputedStyle::hasPseudoElementStyle() const { |
3808 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3802 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
3809 } | 3803 } |
3810 | 3804 |
3811 } // namespace blink | 3805 } // namespace blink |
3812 | 3806 |
3813 #endif // ComputedStyle_h | 3807 #endif // ComputedStyle_h |
OLD | NEW |