| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/CSSPropertyParserHelpers.h" | 5 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 6 | 6 |
| 7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
| 8 #include "core/css/CSSCalculationValue.h" | 8 #include "core/css/CSSCalculationValue.h" |
| 9 #include "core/css/CSSColorValue.h" | 9 #include "core/css/CSSColorValue.h" |
| 10 #include "core/css/CSSCrossfadeValue.h" | 10 #include "core/css/CSSCrossfadeValue.h" |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 // https://drafts.csswg.org/css-shapes-1/#typedef-shape-box | 1454 // https://drafts.csswg.org/css-shapes-1/#typedef-shape-box |
| 1455 CSSIdentifierValue* ConsumeShapeBox(CSSParserTokenRange& range) { | 1455 CSSIdentifierValue* ConsumeShapeBox(CSSParserTokenRange& range) { |
| 1456 return ConsumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, | 1456 return ConsumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, |
| 1457 CSSValueMarginBox>(range); | 1457 CSSValueMarginBox>(range); |
| 1458 } | 1458 } |
| 1459 | 1459 |
| 1460 void AddProperty(CSSPropertyID resolved_property, | 1460 void AddProperty(CSSPropertyID resolved_property, |
| 1461 CSSPropertyID current_shorthand, | 1461 CSSPropertyID current_shorthand, |
| 1462 const CSSValue& value, | 1462 const CSSValue& value, |
| 1463 bool important, | 1463 bool important, |
| 1464 bool implicit, | 1464 IsImplicitProperty implicit, |
| 1465 HeapVector<CSSProperty, 256>& properties) { | 1465 HeapVector<CSSProperty, 256>& properties) { |
| 1466 DCHECK(!isPropertyAlias(resolved_property)); | 1466 DCHECK(!isPropertyAlias(resolved_property)); |
| 1467 DCHECK(implicit == IsImplicitProperty::kNotImplicit || |
| 1468 implicit == IsImplicitProperty::kImplicit); |
| 1467 | 1469 |
| 1468 int shorthand_index = 0; | 1470 int shorthand_index = 0; |
| 1469 bool set_from_shorthand = false; | 1471 bool set_from_shorthand = false; |
| 1470 | 1472 |
| 1471 if (current_shorthand) { | 1473 if (current_shorthand) { |
| 1472 Vector<StylePropertyShorthand, 4> shorthands; | 1474 Vector<StylePropertyShorthand, 4> shorthands; |
| 1473 getMatchingShorthandsForLonghand(resolved_property, &shorthands); | 1475 getMatchingShorthandsForLonghand(resolved_property, &shorthands); |
| 1474 set_from_shorthand = true; | 1476 set_from_shorthand = true; |
| 1475 if (shorthands.size() > 1) { | 1477 if (shorthands.size() > 1) { |
| 1476 shorthand_index = | 1478 shorthand_index = |
| 1477 indexOfShorthandForLonghand(current_shorthand, shorthands); | 1479 indexOfShorthandForLonghand(current_shorthand, shorthands); |
| 1478 } | 1480 } |
| 1479 } | 1481 } |
| 1480 | 1482 |
| 1481 properties.push_back(CSSProperty(resolved_property, value, important, | 1483 properties.push_back(CSSProperty(resolved_property, value, important, |
| 1482 set_from_shorthand, shorthand_index, | 1484 set_from_shorthand, shorthand_index, |
| 1483 implicit)); | 1485 implicit == IsImplicitProperty::kImplicit)); |
| 1484 } | 1486 } |
| 1485 | 1487 |
| 1486 } // namespace CSSPropertyParserHelpers | 1488 } // namespace CSSPropertyParserHelpers |
| 1487 | 1489 |
| 1488 } // namespace blink | 1490 } // namespace blink |
| OLD | NEW |