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