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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h

Issue 1485973005: Add CSS support for Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test expectation Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 4577 matching lines...) Expand 10 before | Expand all | Expand 10 after
4588 return ScrollSnapTypeMandatory; 4588 return ScrollSnapTypeMandatory;
4589 case CSSValueProximity: 4589 case CSSValueProximity:
4590 return ScrollSnapTypeProximity; 4590 return ScrollSnapTypeProximity;
4591 default: 4591 default:
4592 break; 4592 break;
4593 } 4593 }
4594 ASSERT_NOT_REACHED(); 4594 ASSERT_NOT_REACHED();
4595 return ScrollSnapTypeNone; 4595 return ScrollSnapTypeNone;
4596 } 4596 }
4597 4597
4598 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Containment snapType)
4599 : CSSValue(PrimitiveClass)
4600 {
4601 init(UnitType::ValueID);
4602 switch (snapType) {
4603 case ContainsNone:
4604 m_value.valueID = CSSValueNone;
4605 break;
4606 case ContainsStrict:
4607 m_value.valueID = CSSValueStrict;
4608 break;
4609 case ContainsPaint:
4610 m_value.valueID = CSSValuePaint;
4611 break;
4612 case ContainsStyle:
4613 m_value.valueID = CSSValueStyle;
4614 break;
4615 case ContainsLayout:
4616 m_value.valueID = CSSValueLayout;
4617 break;
4618 }
4619 }
4620
4621 template<> inline Containment CSSPrimitiveValue::convertTo() const
4622 {
4623 switch (getValueID()) {
4624 case CSSValueNone:
4625 return ContainsNone;
4626 case CSSValueStrict:
4627 return ContainsStrict;
4628 case CSSValuePaint:
4629 return ContainsPaint;
4630 case CSSValueStyle:
4631 return ContainsStyle;
4632 case CSSValueLayout:
4633 return ContainsLayout;
4634 default:
4635 break;
4636 }
4637 ASSERT_NOT_REACHED();
4638 return ContainsNone;
4639 }
4640
4598 } // namespace blink 4641 } // namespace blink
4599 4642
4600 #endif 4643 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698