Changeset 209006 in webkit
- Timestamp:
- Nov 28, 2016 12:28:15 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r209005 r209006 1 2016-11-28 Dave Hyatt <hyatt@apple.com> 2 3 [CSS Parser] Filters and Reflections Fixes 4 https://bugs.webkit.org/show_bug.cgi?id=165103 5 6 Reviewed by Zalan Bujtas. 7 8 * css/parser/CSSPropertyParser.cpp: 9 (WebCore::consumeReflect): 10 Support the "none" keyword for box-reflect. 11 12 * css/parser/CSSPropertyParserHelpers.cpp: 13 (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): 14 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction): 15 Don't rely on range checking, since invert isn't grouped with the other 16 function values. Actually check every keyword. 17 1 18 2016-11-28 Brent Fulgham <bfulgham@apple.com> 2 19 -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r209003 r209006 2621 2621 static RefPtr<CSSValue> consumeReflect(CSSParserTokenRange& range, const CSSParserContext& context) 2622 2622 { 2623 if (range.peek().id() == CSSValueNone) 2624 return consumeIdent(range); 2625 2623 2626 RefPtr<CSSPrimitiveValue> direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range); 2624 2627 if (!direction) -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
r208700 r209006 1183 1183 || id == CSSValueCrossFade || id == CSSValueWebkitNamedImage || id == CSSValueWebkitFilter || id == CSSValueFilter; 1184 1184 } 1185 1186 static bool isValidPrimitiveFilterFunction(CSSValueID filterFunction) 1187 { 1188 switch (filterFunction) { 1189 case CSSValueBlur: 1190 case CSSValueBrightness: 1191 case CSSValueContrast: 1192 case CSSValueDropShadow: 1193 case CSSValueGrayscale: 1194 case CSSValueHueRotate: 1195 case CSSValueInvert: 1196 case CSSValueOpacity: 1197 case CSSValueSaturate: 1198 case CSSValueSepia: 1199 return true; 1200 default: 1201 return false; 1202 } 1203 } 1185 1204 1186 1205 RefPtr<CSSFunctionValue> consumeFilterFunction(CSSParserTokenRange& range, const CSSParserContext& context) 1187 1206 { 1188 1207 CSSValueID filterType = range.peek().functionId(); 1189 if ( filterType < CSSValueInvert || filterType > CSSValueDropShadow)1208 if (!isValidPrimitiveFilterFunction(filterType)) 1190 1209 return nullptr; 1191 1210 CSSParserTokenRange args = consumeFunction(range); 1192 autofilterValue = CSSFunctionValue::create(filterType);1211 RefPtr<CSSFunctionValue> filterValue = CSSFunctionValue::create(filterType); 1193 1212 RefPtr<CSSValue> parsedValue; 1194 1213 … … 1197 1216 else { 1198 1217 if (args.atEnd()) 1199 return filterValue .ptr();1218 return filterValue; 1200 1219 if (filterType == CSSValueBrightness) { 1201 1220 parsedValue = consumePercent(args, ValueRangeAll); … … 1220 1239 if (!parsedValue || !args.atEnd()) 1221 1240 return nullptr; 1222 filterValue->append( *parsedValue);1223 return filterValue .ptr();1241 filterValue->append(parsedValue.releaseNonNull()); 1242 return filterValue; 1224 1243 } 1225 1244
Note: See TracChangeset
for help on using the changeset viewer.