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

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

Issue 1439793003: SVG: Promote d to a property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RefPtrWillBePersistent Created 5 years 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/CSSCursorImageValue.h" 10 #include "core/css/CSSCursorImageValue.h"
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 if (list->hasValue(ident.get())) 1918 if (list->hasValue(ident.get()))
1919 return nullptr; 1919 return nullptr;
1920 list->append(ident.release()); 1920 list->append(ident.release());
1921 } 1921 }
1922 1922
1923 if (!list->length()) 1923 if (!list->length())
1924 return nullptr; 1924 return nullptr;
1925 return list.release(); 1925 return list.release();
1926 } 1926 }
1927 1927
1928 static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& r ange) 1928 static PassRefPtrWillBeRawPtr<CSSValue> consumePath(CSSParserTokenRange& range, CSSPropertyID property)
1929 { 1929 {
1930 CSSValueID id = range.peek().id(); 1930 CSSValueID id = range.peek().id();
1931 if (id == CSSValueNone) 1931 if (id == CSSValueNone && property == CSSPropertyMotionPath)
fs 2015/12/11 13:01:58 Suggestion: Could also do the trivial split - cons
1932 return consumeIdent(range); 1932 return consumeIdent(range);
1933 // FIXME: Add support for <url>, <basic-shape>, <geometry-box>. 1933 // FIXME: Add support for <url>, <basic-shape>, <geometry-box>.
1934 if (range.peek().functionId() != CSSValuePath) 1934 if (range.peek().functionId() != CSSValuePath)
1935 return nullptr; 1935 return nullptr;
1936 1936
1937 // FIXME: Add support for <fill-rule>. 1937 // FIXME: Add support for <fill-rule>.
1938 CSSParserTokenRange functionRange = range; 1938 CSSParserTokenRange functionRange = range;
1939 CSSParserTokenRange functionArgs = consumeFunction(functionRange); 1939 CSSParserTokenRange functionArgs = consumeFunction(functionRange);
1940 1940
1941 if (functionArgs.peek().type() != StringToken) 1941 if (functionArgs.peek().type() != StringToken)
1942 return nullptr; 1942 return nullptr;
1943 String pathString = functionArgs.consumeIncludingWhitespace().value(); 1943 String pathString = functionArgs.consumeIncludingWhitespace().value();
1944 Path path; 1944
1945 if (!buildPathFromString(pathString, path) || !functionArgs.atEnd()) 1945 OwnPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create();
1946 if (!buildByteStreamFromString(pathString, *byteStream) || !functionArgs.atE nd())
1946 return nullptr; 1947 return nullptr;
1947 1948
1948 range = functionRange; 1949 range = functionRange;
1949 return CSSPathValue::create(pathString); 1950 return CSSPathValue::create(byteStream.release());
1950 } 1951 }
1951 1952
1952 static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionRotation(CSSParserTokenRang e& range, CSSParserMode cssParserMode) 1953 static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionRotation(CSSParserTokenRang e& range, CSSParserMode cssParserMode)
1953 { 1954 {
1954 RefPtrWillBeRawPtr<CSSValue> angle = consumeAngle(range, cssParserMode); 1955 RefPtrWillBeRawPtr<CSSValue> angle = consumeAngle(range, cssParserMode);
1955 RefPtrWillBeRawPtr<CSSValue> keyword = consumeIdent<CSSValueAuto, CSSValueRe verse>(range); 1956 RefPtrWillBeRawPtr<CSSValue> keyword = consumeIdent<CSSValueAuto, CSSValueRe verse>(range);
1956 if (!angle && !keyword) 1957 if (!angle && !keyword)
1957 return nullptr; 1958 return nullptr;
1958 1959
1959 if (!angle) 1960 if (!angle)
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 return consumeZIndex(m_range); 2568 return consumeZIndex(m_range);
2568 case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS 3, so treat as CSS3 2569 case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS 3, so treat as CSS3
2569 case CSSPropertyBoxShadow: 2570 case CSSPropertyBoxShadow:
2570 return consumeShadow(m_range, m_context, property == CSSPropertyBoxShado w); 2571 return consumeShadow(m_range, m_context, property == CSSPropertyBoxShado w);
2571 case CSSPropertyWebkitFilter: 2572 case CSSPropertyWebkitFilter:
2572 case CSSPropertyBackdropFilter: 2573 case CSSPropertyBackdropFilter:
2573 return consumeFilter(m_range, m_context); 2574 return consumeFilter(m_range, m_context);
2574 case CSSPropertyWebkitTextDecorationsInEffect: 2575 case CSSPropertyWebkitTextDecorationsInEffect:
2575 case CSSPropertyTextDecorationLine: 2576 case CSSPropertyTextDecorationLine:
2576 return consumeTextDecorationLine(m_range); 2577 return consumeTextDecorationLine(m_range);
2578 case CSSPropertyD:
2577 case CSSPropertyMotionPath: 2579 case CSSPropertyMotionPath:
2578 return consumeMotionPath(m_range); 2580 return consumePath(m_range, property);
2579 case CSSPropertyMotionOffset: 2581 case CSSPropertyMotionOffset:
2580 return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll); 2582 return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll);
2581 case CSSPropertyMotionRotation: 2583 case CSSPropertyMotionRotation:
2582 return consumeMotionRotation(m_range, m_context.mode()); 2584 return consumeMotionRotation(m_range, m_context.mode());
2583 case CSSPropertyWebkitTextEmphasisStyle: 2585 case CSSPropertyWebkitTextEmphasisStyle:
2584 return consumeTextEmphasisStyle(m_range); 2586 return consumeTextEmphasisStyle(m_range);
2585 case CSSPropertyOutlineColor: 2587 case CSSPropertyOutlineColor:
2586 return consumeOutlineColor(m_range, m_context); 2588 return consumeOutlineColor(m_range, m_context);
2587 case CSSPropertyOutlineOffset: 2589 case CSSPropertyOutlineOffset:
2588 return consumeLength(m_range, m_context.mode(), ValueRangeAll); 2590 return consumeLength(m_range, m_context.mode(), ValueRangeAll);
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 return consumeShorthandGreedily(flexFlowShorthand(), important); 3236 return consumeShorthandGreedily(flexFlowShorthand(), important);
3235 case CSSPropertyWebkitColumnRule: 3237 case CSSPropertyWebkitColumnRule:
3236 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important); 3238 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important);
3237 default: 3239 default:
3238 m_currentShorthand = oldShorthand; 3240 m_currentShorthand = oldShorthand;
3239 return false; 3241 return false;
3240 } 3242 }
3241 } 3243 }
3242 3244
3243 } // namespace blink 3245 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698