Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: third_party/WebKit/Source/core/style/StyleDifference.h

Issue 2250523003: Implement SANACLAP (http://bit.ly/sanaclap). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "wtf/Allocator.h" 8 #include "wtf/Allocator.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 10
(...skipping 11 matching lines...) Expand all
22 // The object needs to issue paint invalidations if it is affected by te xt decorations or properties dependent on color (e.g., border or outline). 22 // The object needs to issue paint invalidations if it is affected by te xt decorations or properties dependent on color (e.g., border or outline).
23 TextDecorationOrColorChanged = 1 << 5, 23 TextDecorationOrColorChanged = 1 << 5,
24 // If you add a value here, be sure to update the number of bits on m_pr opertySpecificDifferences. 24 // If you add a value here, be sure to update the number of bits on m_pr opertySpecificDifferences.
25 }; 25 };
26 26
27 StyleDifference() 27 StyleDifference()
28 : m_paintInvalidationType(NoPaintInvalidation) 28 : m_paintInvalidationType(NoPaintInvalidation)
29 , m_layoutType(NoLayout) 29 , m_layoutType(NoLayout)
30 , m_recomputeOverflow(false) 30 , m_recomputeOverflow(false)
31 , m_propertySpecificDifferences(0) 31 , m_propertySpecificDifferences(0)
32 , m_scrollAnchorDisablingPropertyChanged(false)
32 { } 33 { }
33 34
34 bool hasDifference() const { return m_paintInvalidationType || m_layoutType || m_propertySpecificDifferences; } 35 bool hasDifference() const { return m_paintInvalidationType || m_layoutType || m_propertySpecificDifferences; }
35 36
36 bool hasAtMostPropertySpecificDifferences(unsigned propertyDifferences) cons t 37 bool hasAtMostPropertySpecificDifferences(unsigned propertyDifferences) cons t
37 { 38 {
38 return !m_paintInvalidationType && !m_layoutType && !(m_propertySpecific Differences & ~propertyDifferences); 39 return !m_paintInvalidationType && !m_layoutType && !(m_propertySpecific Differences & ~propertyDifferences);
39 } 40 }
40 41
41 bool needsPaintInvalidation() const { return m_paintInvalidationType != NoPa intInvalidation; } 42 bool needsPaintInvalidation() const { return m_paintInvalidationType != NoPa intInvalidation; }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 82
82 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh anged; } 83 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh anged; }
83 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } 84 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; }
84 85
85 bool backdropFilterChanged() const { return m_propertySpecificDifferences & BackdropFilterChanged; } 86 bool backdropFilterChanged() const { return m_propertySpecificDifferences & BackdropFilterChanged; }
86 void setBackdropFilterChanged() { m_propertySpecificDifferences |= BackdropF ilterChanged; } 87 void setBackdropFilterChanged() { m_propertySpecificDifferences |= BackdropF ilterChanged; }
87 88
88 bool textDecorationOrColorChanged() const { return m_propertySpecificDiffere nces & TextDecorationOrColorChanged; } 89 bool textDecorationOrColorChanged() const { return m_propertySpecificDiffere nces & TextDecorationOrColorChanged; }
89 void setTextDecorationOrColorChanged() { m_propertySpecificDifferences |= Te xtDecorationOrColorChanged; } 90 void setTextDecorationOrColorChanged() { m_propertySpecificDifferences |= Te xtDecorationOrColorChanged; }
90 91
92 bool scrollAnchorDisablingPropertyChanged() const { return m_scrollAnchorDis ablingPropertyChanged; }
93 void setScrollAnchorDisablingPropertyChanged() { m_scrollAnchorDisablingProp ertyChanged = true; }
94
91 private: 95 private:
92 enum PaintInvalidationType { 96 enum PaintInvalidationType {
93 NoPaintInvalidation = 0, 97 NoPaintInvalidation = 0,
94 PaintInvalidationObject, 98 PaintInvalidationObject,
95 PaintInvalidationSubtree 99 PaintInvalidationSubtree
96 }; 100 };
97 unsigned m_paintInvalidationType : 2; 101 unsigned m_paintInvalidationType : 2;
98 102
99 enum LayoutType { 103 enum LayoutType {
100 NoLayout = 0, 104 NoLayout = 0,
101 PositionedMovement, 105 PositionedMovement,
102 FullLayout 106 FullLayout
103 }; 107 };
104 unsigned m_layoutType : 2; 108 unsigned m_layoutType : 2;
105 unsigned m_recomputeOverflow : 1; 109 unsigned m_recomputeOverflow : 1;
106 unsigned m_propertySpecificDifferences : 6; 110 unsigned m_propertySpecificDifferences : 6;
111 unsigned m_scrollAnchorDisablingPropertyChanged : 1;
107 }; 112 };
108 113
109 } // namespace blink 114 } // namespace blink
110 115
111 #endif // StyleDifference_h 116 #endif // StyleDifference_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698