Changeset 217610 in webkit
- Timestamp:
- May 31, 2017 10:49:04 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r217607 r217610 1 2017-05-31 Frederic Wang <fwang@igalia.com> 2 3 ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits is wrongly set 4 https://bugs.webkit.org/show_bug.cgi?id=172349 5 6 Reviewed by Simon Fraser. 7 8 ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits was introduced in 9 r133022 so that ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode 10 know the number of bits use for properties in their parent class. 11 12 In r172649, r210560, r185762 and r183702 new properties were added to 13 ScrollingStateScrollingNode but NumScrollingStateNodeBits was not increased accordingly. This 14 means that there are potential conflicts between these new properties and those of derived 15 classes ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode. It is not 16 clear how to write a test case reproducing such conflict, though. 17 18 No new tests, this is a coding mistake but its effect is unclear. 19 20 * page/scrolling/ScrollingStateNode.cpp: 21 (WebCore::ScrollingStateNode::setPropertyChanged): Use hasChangedProperty and cast to 22 64-bits integer before shifting. 23 * page/scrolling/ScrollingStateNode.h: Add a comment to make clear NumStateNodeBits must 24 remain at the last position. Ensure we have enough bits available. 25 (WebCore::ScrollingStateNode::hasChangedProperty): Cast to 64-bits integer before shifting. 26 * page/scrolling/ScrollingStateScrollingNode.h: Fix position of NumScrollingStateNodeBits and 27 also add a similar comment. 28 1 29 2017-05-31 Matt Lewis <jlewis3@apple.com> 2 30 -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r216478 r217610 66 66 void ScrollingStateNode::setPropertyChanged(unsigned propertyBit) 67 67 { 68 if ( m_changedProperties & (1 <<propertyBit))68 if (hasChangedProperty(propertyBit)) 69 69 return; 70 70 71 m_changedProperties |= ( 1<< propertyBit);71 m_changedProperties |= (static_cast<ChangedProperties>(1) << propertyBit); 72 72 m_scrollingStateTree.setHasChangedProperties(); 73 73 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r216478 r217610 30 30 #include "GraphicsLayer.h" 31 31 #include "ScrollingCoordinator.h" 32 #include <stdint.h> 32 33 #include <wtf/RefCounted.h> 33 34 #include <wtf/TypeCasts.h> … … 203 204 enum { 204 205 ScrollLayer = 0, 205 NumStateNodeBits = 1206 NumStateNodeBits // This must remain at the last position. 206 207 }; 207 typedef u nsignedChangedProperties;208 typedef uint64_t ChangedProperties; 208 209 209 210 bool hasChangedProperties() const { return m_changedProperties; } 210 bool hasChangedProperty(unsigned propertyBit) const { return m_changedProperties & ( 1<< propertyBit); }211 bool hasChangedProperty(unsigned propertyBit) const { return m_changedProperties & (static_cast<ChangedProperties>(1) << propertyBit); } 211 212 void resetChangedProperties() { m_changedProperties = 0; } 212 213 void setPropertyChanged(unsigned propertyBit); -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r216478 r217610 47 47 ScrollableAreaParams, 48 48 RequestedScrollPosition, 49 NumScrollingStateNodeBits,50 49 #if ENABLE(CSS_SCROLL_SNAP) 51 50 HorizontalSnapOffsets, … … 57 56 #endif 58 57 ExpectsWheelEventTestTrigger, 58 NumScrollingStateNodeBits // This must remain at the last position. 59 59 }; 60 60
Note: See TracChangeset
for help on using the changeset viewer.