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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2664713002: Use switch statement instead of bit masking for EPosition. (Closed)
Patch Set: Merge switch cases Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 1bbb9604592bb5b17c5640125e1aabdd5787ed34..5fe833ad53c6a052d1150a2cdd0c7fd5a2004268 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -2430,9 +2430,26 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
}
void setPositionedState(int positionState) {
- // This mask maps FixedPosition and AbsolutePosition to
+ // This maps FixedPosition and AbsolutePosition to
// IsOutOfFlowPositioned, saving one bit.
- m_positionedState = static_cast<PositionedState>(positionState & 0x3);
+ switch (positionState) {
+ case StaticPosition:
+ m_positionedState = IsStaticallyPositioned;
+ break;
+ case RelativePosition:
+ m_positionedState = IsRelativelyPositioned;
+ break;
+ case AbsolutePosition:
+ case FixedPosition:
+ m_positionedState = IsOutOfFlowPositioned;
+ break;
+ case StickyPosition:
+ m_positionedState = IsStickyPositioned;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
}
void clearPositionedState() { m_positionedState = StaticPosition; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698