| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StyleDifference_h | 5 #ifndef StyleDifference_h |
| 6 #define StyleDifference_h | 6 #define StyleDifference_h |
| 7 | 7 |
| 8 #include <iosfwd> |
| 9 #include "core/CoreExport.h" |
| 8 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| 9 #include "wtf/Assertions.h" | 11 #include "wtf/Assertions.h" |
| 10 | 12 |
| 11 namespace blink { | 13 namespace blink { |
| 12 | 14 |
| 13 class StyleDifference { | 15 class StyleDifference { |
| 14 STACK_ALLOCATED(); | 16 STACK_ALLOCATED(); |
| 15 | 17 |
| 16 public: | 18 public: |
| 17 enum PropertyDifference { | 19 enum PropertyDifference { |
| 18 TransformChanged = 1 << 0, | 20 TransformChanged = 1 << 0, |
| 19 OpacityChanged = 1 << 1, | 21 OpacityChanged = 1 << 1, |
| 20 ZIndexChanged = 1 << 2, | 22 ZIndexChanged = 1 << 2, |
| 21 FilterChanged = 1 << 3, | 23 FilterChanged = 1 << 3, |
| 22 BackdropFilterChanged = 1 << 4, | 24 BackdropFilterChanged = 1 << 4, |
| 23 CSSClipChanged = 1 << 5, | 25 CSSClipChanged = 1 << 5, |
| 24 // The object needs to issue paint invalidations if it is affected by text | 26 // The object needs to issue paint invalidations if it is affected by text |
| 25 // decorations or properties dependent on color (e.g., border or outline). | 27 // decorations or properties dependent on color (e.g., border or outline). |
| 26 TextDecorationOrColorChanged = 1 << 6, | 28 TextDecorationOrColorChanged = 1 << 6, |
| 27 ScrollAnchorDisablingPropertyChanged = 1 << 7, | 29 ScrollAnchorDisablingPropertyChanged = 1 << 7, |
| 28 // If you add a value here, be sure to update the number of bits on | 30 // If you add a value here, be sure to update the number of bits on |
| 29 // m_propertySpecificDifferences. | 31 // m_propertySpecificDifferences. |
| 32 |
| 33 PropertyDifferenceMax = TextDecorationOrColorChanged |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 StyleDifference() | 36 StyleDifference() |
| 33 : m_paintInvalidationType(NoPaintInvalidation), | 37 : m_paintInvalidationType(NoPaintInvalidation), |
| 34 m_layoutType(NoLayout), | 38 m_layoutType(NoLayout), |
| 35 m_recomputeOverflow(false), | 39 m_recomputeOverflow(false), |
| 36 m_visualRectUpdate(false), | 40 m_visualRectUpdate(false), |
| 37 m_propertySpecificDifferences(0) {} | 41 m_propertySpecificDifferences(0) {} |
| 38 | 42 |
| 39 bool hasDifference() const { | 43 bool hasDifference() const { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 136 } |
| 133 | 137 |
| 134 bool scrollAnchorDisablingPropertyChanged() const { | 138 bool scrollAnchorDisablingPropertyChanged() const { |
| 135 return m_propertySpecificDifferences & ScrollAnchorDisablingPropertyChanged; | 139 return m_propertySpecificDifferences & ScrollAnchorDisablingPropertyChanged; |
| 136 } | 140 } |
| 137 void setScrollAnchorDisablingPropertyChanged() { | 141 void setScrollAnchorDisablingPropertyChanged() { |
| 138 m_propertySpecificDifferences |= ScrollAnchorDisablingPropertyChanged; | 142 m_propertySpecificDifferences |= ScrollAnchorDisablingPropertyChanged; |
| 139 } | 143 } |
| 140 | 144 |
| 141 private: | 145 private: |
| 146 friend CORE_EXPORT std::ostream& operator<<(std::ostream&, |
| 147 const StyleDifference&); |
| 148 |
| 142 enum PaintInvalidationType { | 149 enum PaintInvalidationType { |
| 143 NoPaintInvalidation, | 150 NoPaintInvalidation, |
| 144 PaintInvalidationObject, | 151 PaintInvalidationObject, |
| 145 PaintInvalidationSubtree, | 152 PaintInvalidationSubtree, |
| 146 }; | 153 }; |
| 147 unsigned m_paintInvalidationType : 2; | 154 unsigned m_paintInvalidationType : 2; |
| 148 | 155 |
| 149 enum LayoutType { NoLayout = 0, PositionedMovement, FullLayout }; | 156 enum LayoutType { NoLayout = 0, PositionedMovement, FullLayout }; |
| 150 unsigned m_layoutType : 2; | 157 unsigned m_layoutType : 2; |
| 151 unsigned m_recomputeOverflow : 1; | 158 unsigned m_recomputeOverflow : 1; |
| 152 unsigned m_visualRectUpdate : 1; | 159 unsigned m_visualRectUpdate : 1; |
| 153 unsigned m_propertySpecificDifferences : 8; | 160 unsigned m_propertySpecificDifferences : 8; |
| 154 }; | 161 }; |
| 155 | 162 |
| 163 CORE_EXPORT std::ostream& operator<<(std::ostream&, const StyleDifference&); |
| 164 |
| 156 } // namespace blink | 165 } // namespace blink |
| 157 | 166 |
| 158 #endif // StyleDifference_h | 167 #endif // StyleDifference_h |
| OLD | NEW |