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

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

Issue 1441233006: Move remaining SVG properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/CSSCustomIdentValue.h" 10 #include "core/css/CSSCustomIdentValue.h"
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 RefPtrWillBeRawPtr<CSSValueList> dashes = CSSValueList::createCommaSeparated (); 1945 RefPtrWillBeRawPtr<CSSValueList> dashes = CSSValueList::createCommaSeparated ();
1946 do { 1946 do {
1947 RefPtrWillBeRawPtr<CSSPrimitiveValue> dash = consumeLengthOrPercent(rang e, SVGAttributeMode, ValueRangeNonNegative, UnitlessQuirk::Allow); 1947 RefPtrWillBeRawPtr<CSSPrimitiveValue> dash = consumeLengthOrPercent(rang e, SVGAttributeMode, ValueRangeNonNegative, UnitlessQuirk::Allow);
1948 if (!dash || (consumeCommaIncludingWhitespace(range) && range.atEnd())) 1948 if (!dash || (consumeCommaIncludingWhitespace(range) && range.atEnd()))
1949 return nullptr; 1949 return nullptr;
1950 dashes->append(dash.release()); 1950 dashes->append(dash.release());
1951 } while (!range.atEnd()); 1951 } while (!range.atEnd());
1952 return dashes.release(); 1952 return dashes.release();
1953 } 1953 }
1954 1954
1955 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeOpacity(CSSParserTokenRa nge& range)
Timothy Loh 2015/11/30 06:09:57 consumeSVGOpacity since opacity isn't going to cal
fs 2015/11/30 09:52:59 They really should be the same though (according t
rwlbuis 2015/11/30 22:17:43 The plot thickens. The only difference I saw was t
fs 2015/11/30 23:10:31 SGTM to remove if <other browser> passes the new t
1956 {
1957 RefPtrWillBeRawPtr<CSSPrimitiveValue> opacity = consumePercent(range, ValueR angeAll);
1958 if (opacity)
1959 return opacity;
Timothy Loh 2015/11/30 06:09:57 opacity.release();
rwlbuis 2015/11/30 22:17:43 Correct, however we may not need it.
1960 return consumeNumber(range, ValueRangeAll);
1961 }
1962
1963 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeBaselineShift(CSSParserT okenRange& range)
1964 {
1965 CSSValueID id = range.peek().id();
1966 if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper)
1967 return consumeIdent(range);
1968 return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll, Unitle ssQuirk::Allow);
Timothy Loh 2015/11/30 06:09:57 Should be UnitlessQuirk::Forbid. SVGAttributeMode
rwlbuis 2015/11/30 22:17:43 Done.
1969 }
1970
1955 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty ID unresolvedProperty) 1971 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty ID unresolvedProperty)
1956 { 1972 {
1957 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); 1973 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
1958 switch (property) { 1974 switch (property) {
1959 case CSSPropertyWillChange: 1975 case CSSPropertyWillChange:
1960 return consumeWillChange(m_range); 1976 return consumeWillChange(m_range);
1961 case CSSPropertyPage: 1977 case CSSPropertyPage:
1962 return consumePage(m_range); 1978 return consumePage(m_range);
1963 case CSSPropertyQuotes: 1979 case CSSPropertyQuotes:
1964 return consumeQuotes(m_range); 1980 return consumeQuotes(m_range);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 case CSSPropertyTransform: 2137 case CSSPropertyTransform:
2122 return consumeTransform(m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitTransform); 2138 return consumeTransform(m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitTransform);
2123 case CSSPropertyFill: 2139 case CSSPropertyFill:
2124 case CSSPropertyStroke: 2140 case CSSPropertyStroke:
2125 return consumePaint(m_range, m_context); 2141 return consumePaint(m_range, m_context);
2126 case CSSPropertyPaintOrder: 2142 case CSSPropertyPaintOrder:
2127 return consumePaintOrder(m_range); 2143 return consumePaintOrder(m_range);
2128 case CSSPropertyMarkerStart: 2144 case CSSPropertyMarkerStart:
2129 case CSSPropertyMarkerMid: 2145 case CSSPropertyMarkerMid:
2130 case CSSPropertyMarkerEnd: 2146 case CSSPropertyMarkerEnd:
2147 case CSSPropertyClipPath:
2148 case CSSPropertyFilter:
2149 case CSSPropertyMask:
2131 return consumeNoneOrURI(m_range); 2150 return consumeNoneOrURI(m_range);
2132 case CSSPropertyFlexBasis: 2151 case CSSPropertyFlexBasis:
2133 return consumeFlexBasis(m_range, m_context.mode()); 2152 return consumeFlexBasis(m_range, m_context.mode());
2134 case CSSPropertyFlexGrow: 2153 case CSSPropertyFlexGrow:
2135 case CSSPropertyFlexShrink: 2154 case CSSPropertyFlexShrink:
2136 return consumeNumber(m_range, ValueRangeNonNegative); 2155 return consumeNumber(m_range, ValueRangeNonNegative);
2137 case CSSPropertyStrokeDasharray: 2156 case CSSPropertyStrokeDasharray:
2138 return consumeStrokeDasharray(m_range); 2157 return consumeStrokeDasharray(m_range);
2139 case CSSPropertyWebkitColumnRuleWidth: 2158 case CSSPropertyWebkitColumnRuleWidth:
2140 return consumeColumnRuleWidth(m_range, m_context.mode()); 2159 return consumeColumnRuleWidth(m_range, m_context.mode());
2160 case CSSPropertyStrokeOpacity:
2161 case CSSPropertyFillOpacity:
2162 case CSSPropertyStopOpacity:
2163 case CSSPropertyFloodOpacity:
2164 return consumeOpacity(m_range);
2165 case CSSPropertyBaselineShift:
2166 return consumeBaselineShift(m_range);
2167 case CSSPropertyStrokeMiterlimit:
2168 return consumeNumber(m_range, ValueRangeNonNegative);
2169 case CSSPropertyStrokeWidth:
2170 case CSSPropertyStrokeDashoffset:
2171 case CSSPropertyCx:
2172 case CSSPropertyCy:
2173 case CSSPropertyX:
2174 case CSSPropertyY:
2175 case CSSPropertyR:
2176 case CSSPropertyRx:
2177 case CSSPropertyRy:
2178 return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Allow);
Timothy Loh 2015/11/30 06:09:57 ::Forbid
rwlbuis 2015/11/30 22:17:43 Done.
2141 default: 2179 default:
2142 return nullptr; 2180 return nullptr;
2143 } 2181 }
2144 } 2182 }
2145 2183
2146 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse rTokenRange& range) 2184 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse rTokenRange& range)
2147 { 2185 {
2148 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated (); 2186 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated ();
2149 2187
2150 do { 2188 do {
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 return consumeShorthandGreedily(flexFlowShorthand(), important); 2766 return consumeShorthandGreedily(flexFlowShorthand(), important);
2729 case CSSPropertyWebkitColumnRule: 2767 case CSSPropertyWebkitColumnRule:
2730 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important); 2768 return consumeShorthandGreedily(webkitColumnRuleShorthand(), important);
2731 default: 2769 default:
2732 m_currentShorthand = oldShorthand; 2770 m_currentShorthand = oldShorthand;
2733 return false; 2771 return false;
2734 } 2772 }
2735 } 2773 }
2736 2774
2737 } // namespace blink 2775 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698