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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 unsigned m_styleType : 6; // PseudoId | 270 unsigned m_styleType : 6; // PseudoId |
271 unsigned m_pseudoBits : 8; | 271 unsigned m_pseudoBits : 8; |
272 unsigned m_explicitInheritance : 1; // Explicitly inherits a non-inherited | 272 unsigned m_explicitInheritance : 1; // Explicitly inherits a non-inherited |
273 // property | 273 // property |
274 unsigned m_variableReference : 1; // A non-inherited property references a | 274 unsigned m_variableReference : 1; // A non-inherited property references a |
275 // variable or @apply is used. | 275 // variable or @apply is used. |
276 unsigned m_unique : 1; // Style can not be shared. | 276 unsigned m_unique : 1; // Style can not be shared. |
277 | 277 |
278 unsigned m_emptyState : 1; | 278 unsigned m_emptyState : 1; |
279 | 279 |
280 unsigned m_affectedByFocus : 1; | |
281 unsigned m_affectedByHover : 1; | |
282 unsigned m_affectedByActive : 1; | |
283 unsigned m_affectedByDrag : 1; | |
284 | |
285 // 64 bits | 280 // 64 bits |
286 | 281 |
287 unsigned m_isLink : 1; | 282 unsigned m_isLink : 1; |
288 | 283 |
289 mutable unsigned m_hasRemUnits : 1; | 284 mutable unsigned m_hasRemUnits : 1; |
290 | 285 |
291 // If you add more style bits here, you will also need to update | 286 // If you add more style bits here, you will also need to update |
292 // ComputedStyle::copyNonInheritedFromCached() 68 bits | 287 // ComputedStyle::copyNonInheritedFromCached() 68 bits |
293 } m_nonInheritedData; | 288 } m_nonInheritedData; |
294 | 289 |
(...skipping 19 matching lines...) Expand all Loading... | |
314 m_nonInheritedData.m_breakBefore = initialBreakBefore(); | 309 m_nonInheritedData.m_breakBefore = initialBreakBefore(); |
315 m_nonInheritedData.m_breakAfter = initialBreakAfter(); | 310 m_nonInheritedData.m_breakAfter = initialBreakAfter(); |
316 m_nonInheritedData.m_breakInside = initialBreakInside(); | 311 m_nonInheritedData.m_breakInside = initialBreakInside(); |
317 m_nonInheritedData.m_styleType = PseudoIdNone; | 312 m_nonInheritedData.m_styleType = PseudoIdNone; |
318 m_nonInheritedData.m_pseudoBits = 0; | 313 m_nonInheritedData.m_pseudoBits = 0; |
319 m_nonInheritedData.m_explicitInheritance = false; | 314 m_nonInheritedData.m_explicitInheritance = false; |
320 m_nonInheritedData.m_variableReference = false; | 315 m_nonInheritedData.m_variableReference = false; |
321 m_nonInheritedData.m_unique = false; | 316 m_nonInheritedData.m_unique = false; |
322 m_nonInheritedData.m_emptyState = false; | 317 m_nonInheritedData.m_emptyState = false; |
323 m_nonInheritedData.m_hasViewportUnits = false; | 318 m_nonInheritedData.m_hasViewportUnits = false; |
324 m_nonInheritedData.m_affectedByFocus = false; | |
325 m_nonInheritedData.m_affectedByHover = false; | |
326 m_nonInheritedData.m_affectedByActive = false; | |
327 m_nonInheritedData.m_affectedByDrag = false; | |
328 m_nonInheritedData.m_isLink = false; | 319 m_nonInheritedData.m_isLink = false; |
329 m_nonInheritedData.m_hasRemUnits = false; | 320 m_nonInheritedData.m_hasRemUnits = false; |
330 } | 321 } |
331 | 322 |
332 private: | 323 private: |
333 // TODO(sashab): Move these to the bottom of ComputedStyle. | 324 // TODO(sashab): Move these to the bottom of ComputedStyle. |
334 ALWAYS_INLINE ComputedStyle(); | 325 ALWAYS_INLINE ComputedStyle(); |
335 | 326 |
336 enum InitialStyleTag { InitialStyle }; | 327 enum InitialStyleTag { InitialStyle }; |
337 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); | 328 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); |
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2525 bool hasViewportUnits() const { | 2516 bool hasViewportUnits() const { |
2526 return m_nonInheritedData.m_hasViewportUnits; | 2517 return m_nonInheritedData.m_hasViewportUnits; |
2527 } | 2518 } |
2528 void setHasViewportUnits(bool hasViewportUnits = true) const { | 2519 void setHasViewportUnits(bool hasViewportUnits = true) const { |
2529 m_nonInheritedData.m_hasViewportUnits = hasViewportUnits; | 2520 m_nonInheritedData.m_hasViewportUnits = hasViewportUnits; |
2530 } | 2521 } |
2531 | 2522 |
2532 bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; } | 2523 bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; } |
2533 void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; } | 2524 void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; } |
2534 | 2525 |
2535 bool affectedByFocus() const { return m_nonInheritedData.m_affectedByFocus; } | |
2536 void setAffectedByFocus() { m_nonInheritedData.m_affectedByFocus = true; } | |
2537 | |
2538 bool affectedByHover() const { return m_nonInheritedData.m_affectedByHover; } | |
2539 void setAffectedByHover() { m_nonInheritedData.m_affectedByHover = true; } | |
sashab
2017/02/03 05:11:05
Can we have a separate discussion about whether we
| |
2540 | |
2541 bool affectedByActive() const { | |
2542 return m_nonInheritedData.m_affectedByActive; | |
2543 } | |
2544 void setAffectedByActive() { m_nonInheritedData.m_affectedByActive = true; } | |
2545 | |
2546 bool affectedByDrag() const { return m_nonInheritedData.m_affectedByDrag; } | |
2547 void setAffectedByDrag() { m_nonInheritedData.m_affectedByDrag = true; } | |
2548 | |
2549 bool emptyState() const { return m_nonInheritedData.m_emptyState; } | 2526 bool emptyState() const { return m_nonInheritedData.m_emptyState; } |
2550 void setEmptyState(bool b) { | 2527 void setEmptyState(bool b) { |
2551 setUnique(); | 2528 setUnique(); |
2552 m_nonInheritedData.m_emptyState = b; | 2529 m_nonInheritedData.m_emptyState = b; |
2553 } | 2530 } |
2554 | 2531 |
2555 bool hasInlineTransform() const { | 2532 bool hasInlineTransform() const { |
2556 return m_rareNonInheritedData->m_hasInlineTransform; | 2533 return m_rareNonInheritedData->m_hasInlineTransform; |
2557 } | 2534 } |
2558 void setHasInlineTransform(bool b) { | 2535 void setHasInlineTransform(bool b) { |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3922 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3899 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
3923 } | 3900 } |
3924 | 3901 |
3925 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3902 inline bool ComputedStyle::hasPseudoElementStyle() const { |
3926 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3903 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
3927 } | 3904 } |
3928 | 3905 |
3929 } // namespace blink | 3906 } // namespace blink |
3930 | 3907 |
3931 #endif // ComputedStyle_h | 3908 #endif // ComputedStyle_h |
OLD | NEW |