OLD | NEW |
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 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 if (list->hasValue(*ident)) | 1516 if (list->hasValue(*ident)) |
1517 return nullptr; | 1517 return nullptr; |
1518 list->append(*ident); | 1518 list->append(*ident); |
1519 } | 1519 } |
1520 | 1520 |
1521 if (!list->length()) | 1521 if (!list->length()) |
1522 return nullptr; | 1522 return nullptr; |
1523 return list; | 1523 return list; |
1524 } | 1524 } |
1525 | 1525 |
| 1526 static CSSValue* consumeTextDecorationSkip(CSSParserTokenRange& range) { |
| 1527 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 1528 while (true) { |
| 1529 CSSIdentifierValue* ident = |
| 1530 consumeIdent<CSSValueObjects, CSSValueInk>(range); |
| 1531 if (!ident) |
| 1532 break; |
| 1533 if (list->hasValue(*ident)) |
| 1534 return nullptr; |
| 1535 list->append(*ident); |
| 1536 } |
| 1537 |
| 1538 if (!list->length()) |
| 1539 return nullptr; |
| 1540 |
| 1541 return list; |
| 1542 } |
| 1543 |
1526 // none | strict | content | [ layout || style || paint || size ] | 1544 // none | strict | content | [ layout || style || paint || size ] |
1527 static CSSValue* consumeContain(CSSParserTokenRange& range) { | 1545 static CSSValue* consumeContain(CSSParserTokenRange& range) { |
1528 CSSValueID id = range.peek().id(); | 1546 CSSValueID id = range.peek().id(); |
1529 if (id == CSSValueNone) | 1547 if (id == CSSValueNone) |
1530 return consumeIdent(range); | 1548 return consumeIdent(range); |
1531 | 1549 |
1532 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 1550 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
1533 if (id == CSSValueStrict || id == CSSValueContent) { | 1551 if (id == CSSValueStrict || id == CSSValueContent) { |
1534 list->append(*consumeIdent(range)); | 1552 list->append(*consumeIdent(range)); |
1535 return list; | 1553 return list; |
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3610 property == CSSPropertyBoxShadow); | 3628 property == CSSPropertyBoxShadow); |
3611 case CSSPropertyFilter: | 3629 case CSSPropertyFilter: |
3612 case CSSPropertyBackdropFilter: | 3630 case CSSPropertyBackdropFilter: |
3613 return consumeFilter(m_range, m_context); | 3631 return consumeFilter(m_range, m_context); |
3614 case CSSPropertyTextDecoration: | 3632 case CSSPropertyTextDecoration: |
3615 ASSERT(!RuntimeEnabledFeatures::css3TextDecorationsEnabled()); | 3633 ASSERT(!RuntimeEnabledFeatures::css3TextDecorationsEnabled()); |
3616 // fallthrough | 3634 // fallthrough |
3617 case CSSPropertyWebkitTextDecorationsInEffect: | 3635 case CSSPropertyWebkitTextDecorationsInEffect: |
3618 case CSSPropertyTextDecorationLine: | 3636 case CSSPropertyTextDecorationLine: |
3619 return consumeTextDecorationLine(m_range); | 3637 return consumeTextDecorationLine(m_range); |
| 3638 case CSSPropertyTextDecorationSkip: |
| 3639 DCHECK(RuntimeEnabledFeatures::css3TextDecorationsEnabled()); |
| 3640 return consumeTextDecorationSkip(m_range); |
3620 case CSSPropertyOffsetAnchor: | 3641 case CSSPropertyOffsetAnchor: |
3621 return consumeOffsetAnchor(m_range, m_context.mode()); | 3642 return consumeOffsetAnchor(m_range, m_context.mode()); |
3622 case CSSPropertyOffsetPosition: | 3643 case CSSPropertyOffsetPosition: |
3623 return consumeOffsetPosition(m_range, m_context.mode(), | 3644 return consumeOffsetPosition(m_range, m_context.mode(), |
3624 m_context.useCounter()); | 3645 m_context.useCounter()); |
3625 case CSSPropertyD: | 3646 case CSSPropertyD: |
3626 return consumePathOrNone(m_range); | 3647 return consumePathOrNone(m_range); |
3627 case CSSPropertyOffsetPath: | 3648 case CSSPropertyOffsetPath: |
3628 return consumeOffsetPath( | 3649 return consumeOffsetPath( |
3629 m_range, m_context.useCounter(), | 3650 m_range, m_context.useCounter(), |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5300 case CSSPropertyGridTemplate: | 5321 case CSSPropertyGridTemplate: |
5301 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5322 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
5302 case CSSPropertyGrid: | 5323 case CSSPropertyGrid: |
5303 return consumeGridShorthand(important); | 5324 return consumeGridShorthand(important); |
5304 default: | 5325 default: |
5305 return false; | 5326 return false; |
5306 } | 5327 } |
5307 } | 5328 } |
5308 | 5329 |
5309 } // namespace blink | 5330 } // namespace blink |
OLD | NEW |