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

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

Issue 1544543003: Adding support of viewport units to SVG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Align with review comments Created 4 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 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 "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSPropertyParser.h" 6 #include "core/css/parser/CSSPropertyParser.h"
7 7
8 #include "core/StylePropertyShorthand.h" 8 #include "core/StylePropertyShorthand.h"
9 #include "core/css/CSSCalculationValue.h" 9 #include "core/css/CSSCalculationValue.h"
10 #include "core/css/CSSCrossfadeValue.h" 10 #include "core/css/CSSCrossfadeValue.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 case CSSPrimitiveValue::UnitType::Rems: 462 case CSSPrimitiveValue::UnitType::Rems:
463 case CSSPrimitiveValue::UnitType::Chs: 463 case CSSPrimitiveValue::UnitType::Chs:
464 case CSSPrimitiveValue::UnitType::Exs: 464 case CSSPrimitiveValue::UnitType::Exs:
465 case CSSPrimitiveValue::UnitType::Pixels: 465 case CSSPrimitiveValue::UnitType::Pixels:
466 case CSSPrimitiveValue::UnitType::Centimeters: 466 case CSSPrimitiveValue::UnitType::Centimeters:
467 case CSSPrimitiveValue::UnitType::Millimeters: 467 case CSSPrimitiveValue::UnitType::Millimeters:
468 case CSSPrimitiveValue::UnitType::Inches: 468 case CSSPrimitiveValue::UnitType::Inches:
469 case CSSPrimitiveValue::UnitType::Points: 469 case CSSPrimitiveValue::UnitType::Points:
470 case CSSPrimitiveValue::UnitType::Picas: 470 case CSSPrimitiveValue::UnitType::Picas:
471 case CSSPrimitiveValue::UnitType::UserUnits: 471 case CSSPrimitiveValue::UnitType::UserUnits:
472 break;
473 case CSSPrimitiveValue::UnitType::ViewportWidth: 472 case CSSPrimitiveValue::UnitType::ViewportWidth:
474 case CSSPrimitiveValue::UnitType::ViewportHeight: 473 case CSSPrimitiveValue::UnitType::ViewportHeight:
475 case CSSPrimitiveValue::UnitType::ViewportMin: 474 case CSSPrimitiveValue::UnitType::ViewportMin:
476 case CSSPrimitiveValue::UnitType::ViewportMax: 475 case CSSPrimitiveValue::UnitType::ViewportMax:
477 if (cssParserMode == SVGAttributeMode)
478 return nullptr;
479 break; 476 break;
480 default: 477 default:
481 return nullptr; 478 return nullptr;
482 } 479 }
483 if (valueRange == ValueRangeNonNegative && token.numericValue() < 0) 480 if (valueRange == ValueRangeNonNegative && token.numericValue() < 0)
484 return nullptr; 481 return nullptr;
485 return cssValuePool().createValue(range.consumeIncludingWhitespace().num ericValue(), token.unitType()); 482 return cssValuePool().createValue(range.consumeIncludingWhitespace().num ericValue(), token.unitType());
486 } 483 }
487 if (token.type() == NumberToken) { 484 if (token.type() == NumberToken) {
488 if (!shouldAcceptUnitlessValues(token.numericValue(), cssParserMode, uni tless) 485 if (!shouldAcceptUnitlessValues(token.numericValue(), cssParserMode, uni tless)
(...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 return consumeShorthandGreedily(flexFlowShorthand(), important); 3624 return consumeShorthandGreedily(flexFlowShorthand(), important);
3628 case CSSPropertyWebkitColumnRule: 3625 case CSSPropertyWebkitColumnRule:
3629 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important); 3626 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important);
3630 default: 3627 default:
3631 m_currentShorthand = oldShorthand; 3628 m_currentShorthand = oldShorthand;
3632 return false; 3629 return false;
3633 } 3630 }
3634 } 3631 }
3635 3632
3636 } // namespace blink 3633 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/dom/SVGLength-viewport-units.html ('k') | third_party/WebKit/Source/core/svg/SVGLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698