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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 2531753002: CSS Independent Transform Properties: support rotate: <axes> <angle> (Closed)
Patch Set: tests Created 4 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "core/css/parser/CSSPropertyParser.h" 5 #include "core/css/parser/CSSPropertyParser.h"
6 6
7 #include "core/StylePropertyShorthand.h" 7 #include "core/StylePropertyShorthand.h"
8 #include "core/css/CSSBasicShapeValues.h" 8 #include "core/css/CSSBasicShapeValues.h"
9 #include "core/css/CSSBorderImage.h" 9 #include "core/css/CSSBorderImage.h"
10 #include "core/css/CSSContentDistributionValue.h" 10 #include "core/css/CSSContentDistributionValue.h"
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 CSSPrimitiveValue* lineHeight = consumeNumber(range, ValueRangeNonNegative); 724 CSSPrimitiveValue* lineHeight = consumeNumber(range, ValueRangeNonNegative);
725 if (lineHeight) 725 if (lineHeight)
726 return lineHeight; 726 return lineHeight;
727 return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative); 727 return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
728 } 728 }
729 729
730 static CSSValueList* consumeRotation(CSSParserTokenRange& range) { 730 static CSSValueList* consumeRotation(CSSParserTokenRange& range) {
731 ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); 731 ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
732 CSSValueList* list = CSSValueList::createSpaceSeparated(); 732 CSSValueList* list = CSSValueList::createSpaceSeparated();
733 733
734 for (unsigned i = 0; i < 3; i++) { // 3 dimensions of rotation
735 CSSValue* dimension = consumeNumber(range, ValueRangeAll);
736 if (!dimension) {
737 if (i == 0)
738 break;
739 return nullptr;
740 }
741 list->append(*dimension);
742 }
743
734 CSSValue* rotation = consumeAngle(range); 744 CSSValue* rotation = consumeAngle(range);
735 if (!rotation) 745 if (!rotation)
736 return nullptr; 746 return nullptr;
737 list->append(*rotation); 747 list->append(*rotation);
738 748
739 if (range.atEnd())
740 return list;
741
742 for (unsigned i = 0; i < 3; i++) { // 3 dimensions of rotation
743 CSSValue* dimension = consumeNumber(range, ValueRangeAll);
744 if (!dimension)
745 return nullptr;
746 list->append(*dimension);
747 }
748
749 return list; 749 return list;
750 } 750 }
751 751
752 static CSSValueList* consumeScale(CSSParserTokenRange& range) { 752 static CSSValueList* consumeScale(CSSParserTokenRange& range) {
753 ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); 753 ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
754 754
755 CSSValue* scale = consumeNumber(range, ValueRangeAll); 755 CSSValue* scale = consumeNumber(range, ValueRangeAll);
756 if (!scale) 756 if (!scale)
757 return nullptr; 757 return nullptr;
758 CSSValueList* list = CSSValueList::createSpaceSeparated(); 758 CSSValueList* list = CSSValueList::createSpaceSeparated();
(...skipping 4565 matching lines...) Expand 10 before | Expand all | Expand 10 after
5324 case CSSPropertyGridTemplate: 5324 case CSSPropertyGridTemplate:
5325 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); 5325 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
5326 case CSSPropertyGrid: 5326 case CSSPropertyGrid:
5327 return consumeGridShorthand(important); 5327 return consumeGridShorthand(important);
5328 default: 5328 default:
5329 return false; 5329 return false;
5330 } 5330 }
5331 } 5331 }
5332 5332
5333 } // namespace blink 5333 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698