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

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

Issue 1447173002: Parse marker shorthand in CSSPropertyParser with CSSParserTokens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove more cases Created 5 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/CSSCustomIdentValue.h" 10 #include "core/css/CSSCustomIdentValue.h"
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 paintOrderList->append(stroke.release()); 1818 paintOrderList->append(stroke.release());
1819 } 1819 }
1820 break; 1820 break;
1821 default: 1821 default:
1822 ASSERT_NOT_REACHED(); 1822 ASSERT_NOT_REACHED();
1823 } 1823 }
1824 1824
1825 return paintOrderList.release(); 1825 return paintOrderList.release();
1826 } 1826 }
1827 1827
1828 static PassRefPtrWillBeRawPtr<CSSValue> consumeNoneOrURI(CSSParserTokenRange& ra nge)
1829 {
1830 if (range.peek().id() == CSSValueNone)
1831 return consumeIdent(range);
1832
1833 String url = consumeUrl(range);
1834 if (url.isNull())
1835 return nullptr;
1836 return CSSURIValue::create(url);
1837 }
1838
1828 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty ID unresolvedProperty) 1839 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty ID unresolvedProperty)
1829 { 1840 {
1830 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); 1841 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
1831 m_range.consumeWhitespace(); 1842 m_range.consumeWhitespace();
1832 switch (property) { 1843 switch (property) {
1833 case CSSPropertyWillChange: 1844 case CSSPropertyWillChange:
1834 return consumeWillChange(m_range); 1845 return consumeWillChange(m_range);
1835 case CSSPropertyPage: 1846 case CSSPropertyPage:
1836 return consumePage(m_range); 1847 return consumePage(m_range);
1837 case CSSPropertyQuotes: 1848 case CSSPropertyQuotes:
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 return consumeLength(m_range, m_context.mode(), ValueRangeAll); 1985 return consumeLength(m_range, m_context.mode(), ValueRangeAll);
1975 case CSSPropertyOutlineWidth: 1986 case CSSPropertyOutlineWidth:
1976 return consumeLineWidth(m_range, m_context.mode()); 1987 return consumeLineWidth(m_range, m_context.mode());
1977 case CSSPropertyTransform: 1988 case CSSPropertyTransform:
1978 return consumeTransform(m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitTransform); 1989 return consumeTransform(m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitTransform);
1979 case CSSPropertyFill: 1990 case CSSPropertyFill:
1980 case CSSPropertyStroke: 1991 case CSSPropertyStroke:
1981 return consumePaint(m_range, m_context); 1992 return consumePaint(m_range, m_context);
1982 case CSSPropertyPaintOrder: 1993 case CSSPropertyPaintOrder:
1983 return consumePaintOrder(m_range); 1994 return consumePaintOrder(m_range);
1995 case CSSPropertyMarkerStart:
1996 case CSSPropertyMarkerMid:
1997 case CSSPropertyMarkerEnd:
1998 return consumeNoneOrURI(m_range);
1984 default: 1999 default:
1985 return nullptr; 2000 return nullptr;
1986 } 2001 }
1987 } 2002 }
1988 2003
1989 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse rTokenRange& range) 2004 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse rTokenRange& range)
1990 { 2005 {
1991 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated (); 2006 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated ();
1992 2007
1993 do { 2008 do {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 case CSSPropertyWebkitBorderStart: 2479 case CSSPropertyWebkitBorderStart:
2465 return consumeShorthandGreedily(webkitBorderStartShorthand(), important) ; 2480 return consumeShorthandGreedily(webkitBorderStartShorthand(), important) ;
2466 case CSSPropertyWebkitBorderEnd: 2481 case CSSPropertyWebkitBorderEnd:
2467 return consumeShorthandGreedily(webkitBorderEndShorthand(), important); 2482 return consumeShorthandGreedily(webkitBorderEndShorthand(), important);
2468 case CSSPropertyWebkitBorderBefore: 2483 case CSSPropertyWebkitBorderBefore:
2469 return consumeShorthandGreedily(webkitBorderBeforeShorthand(), important ); 2484 return consumeShorthandGreedily(webkitBorderBeforeShorthand(), important );
2470 case CSSPropertyWebkitBorderAfter: 2485 case CSSPropertyWebkitBorderAfter:
2471 return consumeShorthandGreedily(webkitBorderAfterShorthand(), important) ; 2486 return consumeShorthandGreedily(webkitBorderAfterShorthand(), important) ;
2472 case CSSPropertyWebkitTextStroke: 2487 case CSSPropertyWebkitTextStroke:
2473 return consumeShorthandGreedily(webkitTextStrokeShorthand(), important); 2488 return consumeShorthandGreedily(webkitTextStrokeShorthand(), important);
2489 case CSSPropertyMarker: {
2490 ImplicitScope implicitScope(this);
2491 RefPtrWillBeRawPtr<CSSValue> marker = parseSingleValue(CSSPropertyMarker Start);
2492 if (!marker || !m_range.atEnd())
2493 return false;
2494 addProperty(CSSPropertyMarkerStart, marker, important);
2495 addProperty(CSSPropertyMarkerMid, marker, important);
2496 addProperty(CSSPropertyMarkerEnd, marker.release(), important);
2497 return true;
2498 }
2474 default: 2499 default:
2475 m_currentShorthand = oldShorthand; 2500 m_currentShorthand = oldShorthand;
2476 return false; 2501 return false;
2477 } 2502 }
2478 } 2503 }
2479 2504
2480 } // namespace blink 2505 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698