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 "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/CSSCursorImageValue.h" | 10 #include "core/css/CSSCursorImageValue.h" |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 if (list->hasValue(ident.get())) | 1772 if (list->hasValue(ident.get())) |
1773 return nullptr; | 1773 return nullptr; |
1774 list->append(ident.release()); | 1774 list->append(ident.release()); |
1775 } | 1775 } |
1776 | 1776 |
1777 if (!list->length()) | 1777 if (!list->length()) |
1778 return nullptr; | 1778 return nullptr; |
1779 return list.release(); | 1779 return list.release(); |
1780 } | 1780 } |
1781 | 1781 |
| 1782 // none | strict | [ layout || style || paint ] |
| 1783 static PassRefPtrWillBeRawPtr<CSSValue> consumeContain(CSSParserTokenRange& rang
e) |
| 1784 { |
| 1785 CSSValueID id = range.peek().id(); |
| 1786 if (id == CSSValueNone) |
| 1787 return consumeIdent(range); |
| 1788 |
| 1789 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 1790 if (id == CSSValueStrict) { |
| 1791 list->append(consumeIdent(range)); |
| 1792 return list.release(); |
| 1793 } |
| 1794 RefPtrWillBeRawPtr<CSSPrimitiveValue> ident = nullptr; |
| 1795 while ((ident = consumeIdent<CSSValuePaint, CSSValueLayout, CSSValueStyle>(r
ange))) { |
| 1796 if (list->hasValue(ident.get())) |
| 1797 return nullptr; |
| 1798 list->append(ident.release()); |
| 1799 } |
| 1800 |
| 1801 if (!list->length()) |
| 1802 return nullptr; |
| 1803 return list.release(); |
| 1804 } |
| 1805 |
1782 static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& r
ange) | 1806 static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& r
ange) |
1783 { | 1807 { |
1784 CSSValueID id = range.peek().id(); | 1808 CSSValueID id = range.peek().id(); |
1785 if (id == CSSValueNone) | 1809 if (id == CSSValueNone) |
1786 return consumeIdent(range); | 1810 return consumeIdent(range); |
1787 // FIXME: Add support for <url>, <basic-shape>, <geometry-box>. | 1811 // FIXME: Add support for <url>, <basic-shape>, <geometry-box>. |
1788 if (range.peek().functionId() != CSSValuePath) | 1812 if (range.peek().functionId() != CSSValuePath) |
1789 return nullptr; | 1813 return nullptr; |
1790 | 1814 |
1791 // FIXME: Add support for <fill-rule>. | 1815 // FIXME: Add support for <fill-rule>. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2438 case CSSPropertyCx: | 2462 case CSSPropertyCx: |
2439 case CSSPropertyCy: | 2463 case CSSPropertyCy: |
2440 case CSSPropertyX: | 2464 case CSSPropertyX: |
2441 case CSSPropertyY: | 2465 case CSSPropertyY: |
2442 case CSSPropertyR: | 2466 case CSSPropertyR: |
2443 case CSSPropertyRx: | 2467 case CSSPropertyRx: |
2444 case CSSPropertyRy: | 2468 case CSSPropertyRy: |
2445 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll,
UnitlessQuirk::Forbid); | 2469 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll,
UnitlessQuirk::Forbid); |
2446 case CSSPropertyCursor: | 2470 case CSSPropertyCursor: |
2447 return consumeCursor(m_range); | 2471 return consumeCursor(m_range); |
| 2472 case CSSPropertyContain: |
| 2473 return consumeContain(m_range); |
2448 default: | 2474 default: |
2449 return nullptr; | 2475 return nullptr; |
2450 } | 2476 } |
2451 } | 2477 } |
2452 | 2478 |
2453 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse
rTokenRange& range) | 2479 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse
rTokenRange& range) |
2454 { | 2480 { |
2455 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated
(); | 2481 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated
(); |
2456 | 2482 |
2457 do { | 2483 do { |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 return consumeShorthandGreedily(flexFlowShorthand(), important); | 3061 return consumeShorthandGreedily(flexFlowShorthand(), important); |
3036 case CSSPropertyWebkitColumnRule: | 3062 case CSSPropertyWebkitColumnRule: |
3037 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important); | 3063 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important); |
3038 default: | 3064 default: |
3039 m_currentShorthand = oldShorthand; | 3065 m_currentShorthand = oldShorthand; |
3040 return false; | 3066 return false; |
3041 } | 3067 } |
3042 } | 3068 } |
3043 | 3069 |
3044 } // namespace blink | 3070 } // namespace blink |
OLD | NEW |