Changeset 148220 in webkit
- Timestamp:
- Apr 11, 2013 11:54:09 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r148217 r148220 1 2013-04-11 Michelangelo De Simone <michelangelo@webkit.org> 2 3 [CSS Shaders] Parse the geometry descriptor 4 https://bugs.webkit.org/show_bug.cgi?id=110815 5 6 Positive and negative parsing tests for the "geometry" descriptor as 7 per specification: 8 https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#geometry 9 10 Reviewed by Dirk Schulze. 11 12 * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-invalid-expected.txt: Added. 13 * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-invalid.html: Added. 14 * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-valid-expected.txt: Added. 15 * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-valid.html: Added. 16 * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-geometry-property-invalid.js: Added. 17 (testInvalidGeometryProperty): 18 * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-geometry-property-valid.js: Added. 19 (testGeometryProperty): 20 1 21 2013-04-11 Zan Dobersek <zdobersek@igalia.com> 2 22 -
trunk/Source/WebCore/ChangeLog
r148219 r148220 1 2013-04-11 Michelangelo De Simone <michelangelo@webkit.org> 2 3 [CSS Shaders] Parse the geometry descriptor 4 https://bugs.webkit.org/show_bug.cgi?id=110815 5 6 Added initial parsing for the "geometry" descriptor, as per specification: 7 https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#geometry 8 This descriptor allows to specify the mesh geometry for custom filters. 9 10 Reviewed by Dirk Schulze. 11 12 Tests: css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-invalid.html 13 css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-valid.html 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 17 * css/CSSParser.cpp: 18 (WebCore::CSSParser::parseValue): 19 (WebCore::CSSParser::parseGeometry): New method that parses the geometry 20 descriptor (grid()). 21 (WebCore): 22 * css/CSSParser.h: 23 * css/CSSProperty.cpp: 24 (WebCore::CSSProperty::isInheritedProperty): 25 * css/CSSPropertyNames.in: Added conditional "geometry" property. 26 * css/CSSValueKeywords.in: Added conditional "attached" value keyword; detached 27 was already there. 28 1 29 2013-04-11 Anders Carlsson <andersca@apple.com> 2 30 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r148205 r148220 2792 2792 2793 2793 /* Other unimplemented properties */ 2794 #if ENABLE(CSS_SHADERS) 2795 case CSSPropertyGeometry: 2796 #endif 2794 2797 case CSSPropertyPage: // for @page 2795 2798 case CSSPropertyQuotes: // FIXME: needs implementation -
trunk/Source/WebCore/css/CSSParser.cpp
r148208 r148220 2909 2909 return parsePage(propId, important); 2910 2910 case CSSPropertyFontStretch: 2911 #if ENABLE(CSS_SHADERS) 2912 case CSSPropertyGeometry: 2913 return m_inFilterRule ? parseGeometry(propId, value, important) : false; 2914 #endif 2911 2915 case CSSPropertyTextLineThrough: 2912 2916 case CSSPropertyTextOverline: … … 8848 8852 } 8849 8853 8854 bool CSSParser::parseGeometry(CSSPropertyID propId, CSSParserValue* value, bool important) 8855 { 8856 ASSERT(propId == CSSPropertyGeometry); 8857 8858 // <geometry-shape> = grid(<integer>{1,2} || [ detached | attached ]?) 8859 if (value->unit != CSSParserValue::Function || !equalIgnoringCase(value->function->name, "grid(")) 8860 return false; 8861 8862 ASSERT(value->function->args); 8863 8864 // grid() function should have from 1 to 3 arguments. 8865 unsigned size = value->function->args->size(); 8866 if (!size || size > 3) 8867 return false; 8868 8869 CSSParserValueList* gridParserValueList = value->function->args.get(); 8870 CSSParserValue* gridParserValue = gridParserValueList->current(); 8871 RefPtr<CSSValueList> geometryList = CSSValueList::createSpaceSeparated(); 8872 8873 bool hasDimensions = false; 8874 bool hasConnectivity = false; 8875 8876 while (gridParserValue) { 8877 if (hasDimensions && hasConnectivity) { 8878 geometryList.release(); 8879 return false; 8880 } 8881 8882 if (gridParserValue->id == CSSValueAttached || gridParserValue->id == CSSValueDetached) { 8883 hasConnectivity = true; 8884 geometryList->append(cssValuePool().createIdentifierValue(gridParserValue->id)); 8885 gridParserValue = gridParserValueList->next(); 8886 } else if (!hasDimensions && parseGridDimensions(gridParserValueList, geometryList)) { 8887 hasDimensions = true; 8888 gridParserValue = gridParserValueList->current(); 8889 } else { 8890 geometryList.release(); 8891 return false; 8892 } 8893 } 8894 8895 addProperty(propId, geometryList.release(), important); 8896 return hasDimensions; 8897 } 8898 8899 bool CSSParser::parseGridDimensions(CSSParserValueList* args, RefPtr<CSSValueList>& gridValueList) 8900 { 8901 ASSERT(args); 8902 8903 // There must be at least one valid numeric value. 8904 CSSParserValue* arg = args->current(); 8905 if (!arg || !validUnit(arg, FPositiveInteger)) 8906 return false; 8907 8908 // A valid numeric value is parsed and then we move on. 8909 gridValueList->append(createPrimitiveNumericValue(arg)); 8910 arg = args->next(); 8911 8912 // If the next argument is not numeric, we are done parsing the grid dimensions. 8913 if (!arg || !validUnit(arg, FPositiveInteger)) 8914 return true; 8915 8916 // Commit the second numeric value we found. 8917 gridValueList->append(createPrimitiveNumericValue(arg)); 8918 args->next(); 8919 return true; 8920 } 8921 8850 8922 StyleRuleBase* CSSParser::createFilterRule(const CSSParserString& filterName) 8851 8923 { -
trunk/Source/WebCore/css/CSSParser.h
r148205 r148220 255 255 bool parseFilterRuleSrc(); 256 256 bool parseFilterRuleMix(); 257 bool parseGeometry(CSSPropertyID, CSSParserValue*, bool); 258 bool parseGridDimensions(CSSParserValueList*, RefPtr<CSSValueList>&); 257 259 PassRefPtr<WebKitCSSShaderValue> parseFilterRuleSrcUriAndFormat(CSSParserValueList*); 258 260 #endif -
trunk/Source/WebCore/css/CSSProperty.cpp
r148205 r148220 442 442 case CSSPropertyFloat: 443 443 case CSSPropertyFontStretch: 444 #if ENABLE(CSS_SHADERS) 445 case CSSPropertyGeometry: 446 #endif 444 447 case CSSPropertyHeight: 445 448 case CSSPropertyLeft: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r148205 r148220 106 106 float 107 107 font-stretch 108 #if defined(ENABLE_CSS_SHADERS) && ENABLE_CSS_SHADERS 109 geometry 110 #endif 108 111 height 109 112 #if defined(ENABLE_CSS_IMAGE_ORIENTATION) && ENABLE_CSS_IMAGE_ORIENTATION -
trunk/Source/WebCore/css/CSSValueKeywords.in
r148208 r148220 987 987 // padding-box 988 988 // content-box 989 attached 989 990 filter-box 990 991 detached
Note: See TracChangeset
for help on using the changeset viewer.