Changeset 98773 in webkit
- Timestamp:
- Oct 28, 2011 3:55:37 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98768 r98773 1 2011-10-28 Chris Marrin <cmarrin@apple.com> 2 3 CSS grammar doesn't support functions with no parameters 4 https://bugs.webkit.org/show_bug.cgi?id=69110 5 6 Reviewed by Dean Jackson. 7 8 Updated tests to include tests for allowing 0 argument functions and for 9 disallowing functions with trailing commas (to pickup a couple of theses 10 cases not in the current tests). Also fixed one typo. 11 12 * css3/filters/filter-property-computed-style-expected.txt: 13 * css3/filters/filter-property-parsing-expected.txt: 14 * css3/filters/filter-property-parsing-invalid-expected.txt: 15 * css3/filters/script-tests/filter-property-computed-style.js: 16 * css3/filters/script-tests/filter-property-parsing-invalid.js: 17 * css3/filters/script-tests/filter-property-parsing.js: 18 (testFilterRule): 19 1 20 2011-10-28 John Gregg <johnnyg@google.com> 2 21 -
trunk/LayoutTests/css3/filters/filter-property-computed-style-expected.txt
r96775 r98773 44 44 PASS subRule.cssText is 'grayscale(0)' 45 45 46 No values : grayscale() 47 PASS filterStyle.length is 1 48 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE 49 PASS subRule.cssText is 'grayscale(1)' 50 46 51 Multiple values : grayscale(0.5) grayscale(0.25) 47 52 PASS filterStyle.length is 2 … … 66 71 PASS subRule.cssText is 'sepia(0)' 67 72 73 No values : sepia() 74 PASS filterStyle.length is 1 75 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SEPIA 76 PASS subRule.cssText is 'sepia(1)' 77 68 78 Multiple values : sepia(0.5) sepia(0.25) 69 79 PASS filterStyle.length is 2 … … 95 105 PASS subRule.cssText is 'saturate(0)' 96 106 107 No values : saturate() 108 PASS filterStyle.length is 1 109 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SATURATE 110 PASS subRule.cssText is 'saturate(1)' 111 97 112 Multiple values : saturate(0.5) saturate(0.25) 98 113 PASS filterStyle.length is 2 … … 139 154 PASS subRule.cssText is 'hue-rotate(0deg)' 140 155 156 No values : hue-rotate() 157 PASS filterStyle.length is 1 158 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE 159 PASS subRule.cssText is 'hue-rotate(0deg)' 160 141 161 Rule combinations : hue-rotate(10deg) grayscale(0.25) 142 162 PASS filterStyle.length is 2 … … 161 181 PASS subRule.cssText is 'invert(0)' 162 182 183 No values : invert() 184 PASS filterStyle.length is 1 185 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_INVERT 186 PASS subRule.cssText is 'invert(1)' 187 163 188 Multiple values : invert(0.5) invert(0.25) 164 189 PASS filterStyle.length is 2 … … 190 215 PASS subRule.cssText is 'opacity(0)' 191 216 217 No values : opacity() 218 PASS filterStyle.length is 1 219 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_OPACITY 220 PASS subRule.cssText is 'opacity(1)' 221 192 222 Multiple values : opacity(0.5) opacity(0.25) 193 223 PASS filterStyle.length is 2 … … 219 249 PASS subRule.cssText is 'gamma(1 1 0)' 220 250 251 No values : gamma() 252 PASS filterStyle.length is 1 253 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_GAMMA 254 PASS subRule.cssText is 'gamma(1 1 0)' 255 221 256 Float value : gamma(1.3) 222 257 PASS filterStyle.length is 1 … … 249 284 PASS subRule.cssText is 'blur(5px 5px)' 250 285 286 No values : blur() 287 PASS filterStyle.length is 1 288 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_BLUR 289 PASS subRule.cssText is 'blur(0px 0px)' 290 251 291 Three values : sharpen(1.0 10px 1) 252 292 PASS filterStyle.length is 1 … … 268 308 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SHARPEN 269 309 PASS subRule.cssText is 'sharpen(0.5 0px 1)' 310 311 No values : sharpen() 312 PASS filterStyle.length is 1 313 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SHARPEN 314 PASS subRule.cssText is 'sharpen(0 0px 1)' 270 315 271 316 Multiple operations : grayscale(0.5) sepia(0.25) saturate(0.75) hue-rotate(35deg) invert(0.2) opacity(0.9) gamma(2 1.1 1) blur(5px 2em) sharpen(0.5 3px 2) -
trunk/LayoutTests/css3/filters/filter-property-parsing-expected.txt
r96764 r98773 86 86 PASS subRule.cssText is 'grayscale(0)' 87 87 88 No values : grayscale() 89 PASS cssRule.type is 1 90 PASS declaration.length is 1 91 PASS declaration.getPropertyValue('-webkit-filter') is 'grayscale()' 92 PASS jsWrapperClass(filterRule) is 'CSSValueList' 93 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 94 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 95 PASS filterRule.length is 1 96 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE 97 PASS subRule.cssText is 'grayscale()' 98 88 99 Multiple values : grayscale(0.5) grayscale(0.25) 89 100 PASS cssRule.type is 1 … … 132 143 PASS subRule.cssText is 'sepia(0)' 133 144 145 No values : sepia() 146 PASS cssRule.type is 1 147 PASS declaration.length is 1 148 PASS declaration.getPropertyValue('-webkit-filter') is 'sepia()' 149 PASS jsWrapperClass(filterRule) is 'CSSValueList' 150 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 151 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 152 PASS filterRule.length is 1 153 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SEPIA 154 PASS subRule.cssText is 'sepia()' 155 134 156 Multiple values : sepia(0.5) sepia(0.25) 135 157 PASS cssRule.type is 1 … … 191 213 PASS subRule.cssText is 'saturate(0)' 192 214 215 No values : saturate() 216 PASS cssRule.type is 1 217 PASS declaration.length is 1 218 PASS declaration.getPropertyValue('-webkit-filter') is 'saturate()' 219 PASS jsWrapperClass(filterRule) is 'CSSValueList' 220 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 221 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 222 PASS filterRule.length is 1 223 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SATURATE 224 PASS subRule.cssText is 'saturate()' 225 193 226 Multiple values : saturate(0.5) saturate(0.25) 194 227 PASS cssRule.type is 1 … … 283 316 PASS subRule.cssText is 'hue-rotate(0deg)' 284 317 318 No values : hue-rotate() 319 PASS cssRule.type is 1 320 PASS declaration.length is 1 321 PASS declaration.getPropertyValue('-webkit-filter') is 'hue-rotate()' 322 PASS jsWrapperClass(filterRule) is 'CSSValueList' 323 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 324 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 325 PASS filterRule.length is 1 326 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE 327 PASS subRule.cssText is 'hue-rotate()' 328 285 329 Rule combinations : hue-rotate(10deg) grayscale(0.25) 286 330 PASS cssRule.type is 1 … … 329 373 PASS subRule.cssText is 'invert(0)' 330 374 375 No values : invert() 376 PASS cssRule.type is 1 377 PASS declaration.length is 1 378 PASS declaration.getPropertyValue('-webkit-filter') is 'invert()' 379 PASS jsWrapperClass(filterRule) is 'CSSValueList' 380 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 381 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 382 PASS filterRule.length is 1 383 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_INVERT 384 PASS subRule.cssText is 'invert()' 385 331 386 Multiple values : invert(0.5) invert(0.25) 332 387 PASS cssRule.type is 1 … … 387 442 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_OPACITY 388 443 PASS subRule.cssText is 'opacity(0)' 444 445 No values : opacity() 446 PASS cssRule.type is 1 447 PASS declaration.length is 1 448 PASS declaration.getPropertyValue('-webkit-filter') is 'opacity()' 449 PASS jsWrapperClass(filterRule) is 'CSSValueList' 450 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 451 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 452 PASS filterRule.length is 1 453 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_OPACITY 454 PASS subRule.cssText is 'opacity()' 389 455 390 456 Multiple values : opacity(0.5) opacity(0.25) … … 458 524 PASS subRule.cssText is 'gamma(1.3)' 459 525 526 No values : gamma() 527 PASS cssRule.type is 1 528 PASS declaration.length is 1 529 PASS declaration.getPropertyValue('-webkit-filter') is 'gamma()' 530 PASS jsWrapperClass(filterRule) is 'CSSValueList' 531 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 532 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 533 PASS filterRule.length is 1 534 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_GAMMA 535 PASS subRule.cssText is 'gamma()' 536 460 537 Two zeros to px : blur(0 0) 461 538 PASS cssRule.type is 1 … … 502 579 PASS subRule.cssText is 'blur(10%)' 503 580 581 No values : blur() 582 PASS cssRule.type is 1 583 PASS declaration.length is 1 584 PASS declaration.getPropertyValue('-webkit-filter') is 'blur()' 585 PASS jsWrapperClass(filterRule) is 'CSSValueList' 586 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 587 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 588 PASS filterRule.length is 1 589 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_BLUR 590 PASS subRule.cssText is 'blur()' 591 504 592 Three values : sharpen(1.0 10px 1) 505 593 PASS cssRule.type is 1 … … 545 633 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SHARPEN 546 634 PASS subRule.cssText is 'sharpen(0.25)' 635 636 No values : sharpen() 637 PASS cssRule.type is 1 638 PASS declaration.length is 1 639 PASS declaration.getPropertyValue('-webkit-filter') is 'sharpen()' 640 PASS jsWrapperClass(filterRule) is 'CSSValueList' 641 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 642 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 643 PASS filterRule.length is 1 644 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_SHARPEN 645 PASS subRule.cssText is 'sharpen()' 547 646 548 647 Multiple operations : grayscale(0.5) sepia(0.25) saturate(0.75) hue-rotate(35deg) invert(0.2) opacity(0.9) gamma(2 1.1 1) blur(5px 2em) sharpen(0.5 3px 2) -
trunk/LayoutTests/css3/filters/filter-property-parsing-invalid-expected.txt
r96764 r98773 215 215 PASS declaration.getPropertyValue('-webkit-filter') is null 216 216 217 Commas : hue-rotate(1.0, 1.0, 1.0) 217 Commas : gamma(1.0, 1.0, 1.0) 218 PASS cssRule.type is 1 219 PASS declaration.length is 0 220 PASS declaration.getPropertyValue('-webkit-filter') is null 221 222 Trailing comma : gamma(1.0, 1.0,) 218 223 PASS cssRule.type is 1 219 224 PASS declaration.length is 0 … … 255 260 PASS declaration.getPropertyValue('-webkit-filter') is null 256 261 262 Trailing comma : blur(1em,) 263 PASS cssRule.type is 1 264 PASS declaration.length is 0 265 PASS declaration.getPropertyValue('-webkit-filter') is null 266 257 267 Missing length : sharpen(1 1 1) 258 268 PASS cssRule.type is 1 … … 279 289 PASS declaration.length is 0 280 290 PASS declaration.getPropertyValue('-webkit-filter') is null 291 292 Trailing comma : sharpen(1, 10px,) 293 PASS cssRule.type is 1 294 PASS declaration.length is 0 295 PASS declaration.getPropertyValue('-webkit-filter') is null 281 296 PASS successfullyParsed is true 282 297 -
trunk/LayoutTests/css3/filters/script-tests/filter-property-computed-style.js
r96775 r98773 57 57 ["grayscale(0)"]); 58 58 59 testComputedFilterRule("No values", 60 "grayscale()", 1, 61 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], 62 ["grayscale(1)"]); 63 59 64 testComputedFilterRule("Multiple values", 60 65 "grayscale(0.5) grayscale(0.25)", 2, … … 77 82 ["sepia(0)"]); 78 83 84 testComputedFilterRule("No values", 85 "sepia()", 1, 86 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA"], 87 ["sepia(1)"]); 88 79 89 testComputedFilterRule("Multiple values", 80 90 "sepia(0.5) sepia(0.25)", 2, … … 102 112 ["saturate(0)"]); 103 113 114 testComputedFilterRule("No values", 115 "saturate()", 1, 116 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE"], 117 ["saturate(1)"]); 118 104 119 testComputedFilterRule("Multiple values", 105 120 "saturate(0.5) saturate(0.25)", 2, … … 142 157 ["hue-rotate(0deg)"]); 143 158 159 testComputedFilterRule("No values", 160 "hue-rotate()", 1, 161 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], 162 ["hue-rotate(0deg)"]); 163 144 164 testComputedFilterRule("Rule combinations", 145 165 "hue-rotate(10deg) grayscale(0.25)", 2, … … 162 182 ["invert(0)"]); 163 183 184 testComputedFilterRule("No values", 185 "invert()", 1, 186 ["WebKitCSSFilterValue.CSS_FILTER_INVERT"], 187 ["invert(1)"]); 188 164 189 testComputedFilterRule("Multiple values", 165 190 "invert(0.5) invert(0.25)", 2, … … 187 212 ["opacity(0)"]); 188 213 214 testComputedFilterRule("No values", 215 "opacity()", 1, 216 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY"], 217 ["opacity(1)"]); 218 189 219 testComputedFilterRule("Multiple values", 190 220 "opacity(0.5) opacity(0.25)", 2, … … 212 242 ["gamma(1 1 0)"]); 213 243 244 testComputedFilterRule("No values", 245 "gamma()", 1, 246 ["WebKitCSSFilterValue.CSS_FILTER_GAMMA"], 247 ["gamma(1 1 0)"]); 248 214 249 testComputedFilterRule("Float value", 215 250 "gamma(1.3)", 1, … … 242 277 ["blur(5px 5px)"]); 243 278 279 testComputedFilterRule("No values", 280 "blur()", 1, 281 ["WebKitCSSFilterValue.CSS_FILTER_BLUR"], 282 ["blur(0px 0px)"]); 283 244 284 testComputedFilterRule("Three values", 245 285 "sharpen(1.0 10px 1)", 1, … … 261 301 ["WebKitCSSFilterValue.CSS_FILTER_SHARPEN"], 262 302 ["sharpen(0.5 0px 1)"]); 303 304 testComputedFilterRule("No values", 305 "sharpen()", 1, 306 ["WebKitCSSFilterValue.CSS_FILTER_SHARPEN"], 307 ["sharpen(0 0px 1)"]); 263 308 264 309 testComputedFilterRule("Multiple operations", -
trunk/LayoutTests/css3/filters/script-tests/filter-property-parsing-invalid.js
r96764 r98773 69 69 testInvalidFilterRule("Negative number", "gamma(1.0 -0.1)"); 70 70 testInvalidFilterRule("Too many parameters", "gamma(1.0 1.0 1.0 1.0)"); 71 testInvalidFilterRule("Commas", "hue-rotate(1.0, 1.0, 1.0)"); 71 testInvalidFilterRule("Commas", "gamma(1.0, 1.0, 1.0)"); 72 testInvalidFilterRule("Trailing comma", "gamma(1.0, 1.0,)"); 72 73 73 74 testInvalidFilterRule("Bare number", "blur(1)"); … … 78 79 testInvalidFilterRule("Too many parameters and commas", "blur(1em, 1em, 2em)"); 79 80 testInvalidFilterRule("Commas", "blur(10px, 10px)"); 81 testInvalidFilterRule("Trailing comma", "blur(1em,)"); 80 82 81 83 testInvalidFilterRule("Missing length", "sharpen(1 1 1)"); … … 84 86 testInvalidFilterRule("Too many parameters and commas", "sharpen(1, 1px, 1, 1)"); 85 87 testInvalidFilterRule("Commas", "sharpen(1, 10px, 1)"); 88 testInvalidFilterRule("Trailing comma", "sharpen(1, 10px,)"); 86 89 87 90 successfullyParsed = true; -
trunk/LayoutTests/css3/filters/script-tests/filter-property-parsing.js
r96764 r98773 43 43 shouldBe("filterRule.length", "" + expectedLength); // shouldBe expects string arguments 44 44 45 for (var i = 0; i < expectedLength; i++) { 46 subRule = filterRule[i]; 47 shouldBe("subRule.operationType", expectedTypes[i]); 48 shouldBe("subRule.cssText", "'" + expectedTexts[i] + "'"); 45 if (filterRule) { 46 for (var i = 0; i < expectedLength; i++) { 47 subRule = filterRule[i]; 48 shouldBe("subRule.operationType", expectedTypes[i]); 49 shouldBe("subRule.cssText", "'" + expectedTexts[i] + "'"); 50 } 49 51 } 50 52 } … … 85 87 ["grayscale(0)"]); 86 88 89 testFilterRule("No values", 90 "grayscale()", 1, "grayscale()", 91 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], 92 ["grayscale()"]); 93 87 94 testFilterRule("Multiple values", 88 95 "grayscale(0.5) grayscale(0.25)", 2, "grayscale(0.5) grayscale(0.25)", … … 105 112 ["sepia(0)"]); 106 113 114 testFilterRule("No values", 115 "sepia()", 1, "sepia()", 116 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA"], 117 ["sepia()"]); 118 107 119 testFilterRule("Multiple values", 108 120 "sepia(0.5) sepia(0.25)", 2, "sepia(0.5) sepia(0.25)", … … 130 142 ["saturate(0)"]); 131 143 144 testFilterRule("No values", 145 "saturate()", 1, "saturate()", 146 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE"], 147 ["saturate()"]); 148 132 149 testFilterRule("Multiple values", 133 150 "saturate(0.5) saturate(0.25)", 2, "saturate(0.5) saturate(0.25)", … … 170 187 ["hue-rotate(0deg)"]); 171 188 189 testFilterRule("No values", 190 "hue-rotate()", 1, "hue-rotate()", 191 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], 192 ["hue-rotate()"]); 193 172 194 testFilterRule("Rule combinations", 173 195 "hue-rotate(10deg) grayscale(0.25)", 2, "hue-rotate(10deg) grayscale(0.25)", … … 190 212 ["invert(0)"]); 191 213 214 testFilterRule("No values", 215 "invert()", 1, "invert()", 216 ["WebKitCSSFilterValue.CSS_FILTER_INVERT"], 217 ["invert()"]); 218 192 219 testFilterRule("Multiple values", 193 220 "invert(0.5) invert(0.25)", 2, "invert(0.5) invert(0.25)", … … 215 242 ["opacity(0)"]); 216 243 244 testFilterRule("No values", 245 "opacity()", 1, "opacity()", 246 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY"], 247 ["opacity()"]); 248 217 249 testFilterRule("Multiple values", 218 250 "opacity(0.5) opacity(0.25)", 2, "opacity(0.5) opacity(0.25)", … … 245 277 ["gamma(1.3)"]); 246 278 279 testFilterRule("No values", 280 "gamma()", 1, "gamma()", 281 ["WebKitCSSFilterValue.CSS_FILTER_GAMMA"], 282 ["gamma()"]); 283 247 284 testFilterRule("Two zeros to px", 248 285 "blur(0 0)", 1, "blur(0px 0px)", … … 265 302 ["blur(10%)"]); 266 303 304 testFilterRule("No values", 305 "blur()", 1, "blur()", 306 ["WebKitCSSFilterValue.CSS_FILTER_BLUR"], 307 ["blur()"]); 308 267 309 testFilterRule("Three values", 268 310 "sharpen(1.0 10px 1)", 1, "sharpen(1 10px 1)", … … 284 326 ["WebKitCSSFilterValue.CSS_FILTER_SHARPEN"], 285 327 ["sharpen(0.25)"]); 328 329 testFilterRule("No values", 330 "sharpen()", 1, "sharpen()", 331 ["WebKitCSSFilterValue.CSS_FILTER_SHARPEN"], 332 ["sharpen()"]); 286 333 287 334 testFilterRule("Multiple operations", -
trunk/Source/WebCore/ChangeLog
r98771 r98773 1 2011-10-28 Chris Marrin <cmarrin@apple.com> 2 3 CSS grammar doesn't support functions with no parameters 4 https://bugs.webkit.org/show_bug.cgi?id=69110 5 6 Reviewed by Dean Jackson. 7 8 Add rule to grammar to accept functions with 0 args and return 9 this case with a CSSParserValueList with 0 values. Also fixed 10 filter creation function to properly handle filters with 0 11 arguments. 12 13 * css/CSSGrammar.y: 14 * css/CSSStyleSelector.cpp: 15 (WebCore::CSSStyleSelector::createFilterOperations): 16 1 17 2011-10-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 18 -
trunk/Source/WebCore/css/CSSGrammar.y
r97738 r98773 101 101 %} 102 102 103 %expect 5 4103 %expect 55 104 104 105 105 %nonassoc LOWEST_PREC … … 1479 1479 $$.function = f; 1480 1480 } | 1481 FUNCTION maybe_space ')' maybe_space { 1482 CSSParser* p = static_cast<CSSParser*>(parser); 1483 CSSParserFunction* f = p->createFloatingFunction(); 1484 f->name = $1; 1485 CSSParserValueList* valueList = p->createFloatingValueList(); 1486 f->args = adoptPtr(p->sinkFloatingValueList(valueList)); 1487 $$.id = 0; 1488 $$.unit = CSSParserValue::Function; 1489 $$.function = f; 1490 } | 1481 1491 FUNCTION maybe_space error { 1482 1492 CSSParser* p = static_cast<CSSParser*>(parser); -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r98748 r98773 5396 5396 5397 5397 WebKitCSSFilterValue* filterValue = static_cast<WebKitCSSFilterValue*>(i.value()); 5398 if (!filterValue->length())5399 continue;5400 5401 5398 FilterOperation::OperationType operationType = filterOperationForType(filterValue->operationType()); 5402 5399 … … 5411 5408 continue; 5412 5409 5413 CSSPrimitiveValue* firstValue = static_cast<CSSPrimitiveValue*>(filterValue->itemWithoutBoundsCheck(0));5410 CSSPrimitiveValue* firstValue = filterValue->length() ? static_cast<CSSPrimitiveValue*>(filterValue->itemWithoutBoundsCheck(0)) : 0; 5414 5411 switch (filterValue->operationType()) { 5415 5412 case WebKitCSSFilterValue::ReferenceFilterOperation: { 5416 operations.operations().append(ReferenceFilterOperation::create(firstValue->getStringValue(), operationType)); 5413 if (firstValue) 5414 operations.operations().append(ReferenceFilterOperation::create(firstValue->getStringValue(), operationType)); 5417 5415 break; 5418 5416 } … … 5428 5426 } 5429 5427 case WebKitCSSFilterValue::HueRotateFilterOperation: { 5430 double angle = firstValue->getDoubleValue(); 5431 if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_RAD) 5432 angle = rad2deg(angle); 5433 else if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_GRAD) 5434 angle = grad2deg(angle); 5435 else if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_TURN) 5436 angle = turn2deg(angle); 5428 double angle = 0; 5429 if (filterValue->length() == 1) { 5430 angle = firstValue->getDoubleValue(); 5431 if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_RAD) 5432 angle = rad2deg(angle); 5433 else if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_GRAD) 5434 angle = grad2deg(angle); 5435 else if (firstValue->primitiveType() == CSSPrimitiveValue::CSS_TURN) 5436 angle = turn2deg(angle); 5437 } 5437 5438 5438 5439 operations.operations().append(BasicColorMatrixFilterOperation::create(angle, operationType));
Note: See TracChangeset
for help on using the changeset viewer.