LayoutTests/ChangeLog

 12013-04-21 Dirk Schulze <krit@webkit.org>
 2
 3 [Part 4] Parse the custom() function in -webkit-filter: parse the matN() functions
 4 https://bugs.webkit.org/show_bug.cgi?id=71444
 5
 6 Reviewed by Dean Jackson.
 7
 8 Added tests for mat2 to mat4 parameter functions on custom fiter function and
 9 parameter descriptor.
 10
 11 * css3/filters/custom-with-at-rule-syntax/parsing-custom-function-invalid-expected.txt:
 12 * css3/filters/custom-with-at-rule-syntax/parsing-custom-function-valid-expected.txt:
 13 * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid-expected.txt:
 14 * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid-expected.txt:
 15 * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-custom-function-invalid.js:
 16 * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-custom-function-valid.js:
 17 * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-invalid.js:
 18 * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-valid.js:
 19
1202013-04-20 Dirk Schulze <krit@webkit.org>
221
322 [Part 5] Parse color value for custom() function parameters

LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-custom-function-invalid-expected.txt

@@PASS declaration.length is 0
341341PASS declaration.getPropertyValue('-webkit-filter') is null
342342
343343========================================
 344Mat2 parameter tests.
 345========================================
 346
 347Empty mat2.
 348custom(my-filter, a mat2())
 349PASS styleRule.type is CSSRule.STYLE_RULE
 350PASS declaration.length is 0
 351PASS declaration.getPropertyValue('-webkit-filter') is null
 352
 353Too view arguments.
 354custom(my-filter, a mat2(0, 0, 0))
 355PASS styleRule.type is CSSRule.STYLE_RULE
 356PASS declaration.length is 0
 357PASS declaration.getPropertyValue('-webkit-filter') is null
 358
 359No arguments but commas.
 360custom(my-filter, a mat2(,,,))
 361PASS styleRule.type is CSSRule.STYLE_RULE
 362PASS declaration.length is 0
 363PASS declaration.getPropertyValue('-webkit-filter') is null
 364
 365Ending commas.
 366custom(my-filter, a mat2(0, 0,,))
 367PASS styleRule.type is CSSRule.STYLE_RULE
 368PASS declaration.length is 0
 369PASS declaration.getPropertyValue('-webkit-filter') is null
 370
 371Idents in mat2 function.
 372custom(my-filter, a mat2(0, 0, a, b))
 373PASS styleRule.type is CSSRule.STYLE_RULE
 374PASS declaration.length is 0
 375PASS declaration.getPropertyValue('-webkit-filter') is null
 376
 377Too many arguments.
 378custom(my-filter, a mat2(0, 0, 0, 0, 1))
 379PASS styleRule.type is CSSRule.STYLE_RULE
 380PASS declaration.length is 0
 381PASS declaration.getPropertyValue('-webkit-filter') is null
 382
 383No commas.
 384custom(my-filter, a mat2(1 0 0 1))
 385PASS styleRule.type is CSSRule.STYLE_RULE
 386PASS declaration.length is 0
 387PASS declaration.getPropertyValue('-webkit-filter') is null
 388
 389Some commas.
 390custom(my-filter, a mat2(1, 0, 0 1))
 391PASS styleRule.type is CSSRule.STYLE_RULE
 392PASS declaration.length is 0
 393PASS declaration.getPropertyValue('-webkit-filter') is null
 394
 395Leading commas.
 396custom(my-filter, a mat2(, 0, 0, 1))
 397PASS styleRule.type is CSSRule.STYLE_RULE
 398PASS declaration.length is 0
 399PASS declaration.getPropertyValue('-webkit-filter') is null
 400
 401No length units.
 402custom(my-filter, a mat2(1px, 0px, 0px, 1px))
 403PASS styleRule.type is CSSRule.STYLE_RULE
 404PASS declaration.length is 0
 405PASS declaration.getPropertyValue('-webkit-filter') is null
 406
 407No degree units.
 408custom(my-filter, a mat2(1deg, 0deg, 0deg, 1deg))
 409PASS styleRule.type is CSSRule.STYLE_RULE
 410PASS declaration.length is 0
 411PASS declaration.getPropertyValue('-webkit-filter') is null
 412
 413NaN in mat2.
 414custom(my-filter, a mat2(1, 0, 0, NaN))
 415PASS styleRule.type is CSSRule.STYLE_RULE
 416PASS declaration.length is 0
 417PASS declaration.getPropertyValue('-webkit-filter') is null
 418
 419========================================
 420Mat3 parameter tests.
 421========================================
 422
 423Empty mat3.
 424custom(my-filter, a mat3())
 425PASS styleRule.type is CSSRule.STYLE_RULE
 426PASS declaration.length is 0
 427PASS declaration.getPropertyValue('-webkit-filter') is null
 428
 429Too view arguments.
 430custom(my-filter, a mat3(0, 0, 0, 0))
 431PASS styleRule.type is CSSRule.STYLE_RULE
 432PASS declaration.length is 0
 433PASS declaration.getPropertyValue('-webkit-filter') is null
 434
 435No arguments but commas.
 436custom(my-filter, a mat3(,,,,,,,,,,,,,,,))
 437PASS styleRule.type is CSSRule.STYLE_RULE
 438PASS declaration.length is 0
 439PASS declaration.getPropertyValue('-webkit-filter') is null
 440
 441Ending commas.
 442custom(my-filter, a mat3(1, 0, 0, 0, 1, 0, 0,,))
 443PASS styleRule.type is CSSRule.STYLE_RULE
 444PASS declaration.length is 0
 445PASS declaration.getPropertyValue('-webkit-filter') is null
 446
 447Idents in mat3 function.
 448custom(my-filter, a mat3(1, 0, 0, 0, 1, 0, 0, a, b))
 449PASS styleRule.type is CSSRule.STYLE_RULE
 450PASS declaration.length is 0
 451PASS declaration.getPropertyValue('-webkit-filter') is null
 452
 453Too many arguments.
 454custom(my-filter, a mat3(1, 0, 0, 0, 1, 0, 0, 0, 1, 0))
 455PASS styleRule.type is CSSRule.STYLE_RULE
 456PASS declaration.length is 0
 457PASS declaration.getPropertyValue('-webkit-filter') is null
 458
 459No commas.
 460custom(my-filter, a mat3(1 0 0 0 1 0 0 0 1))
 461PASS styleRule.type is CSSRule.STYLE_RULE
 462PASS declaration.length is 0
 463PASS declaration.getPropertyValue('-webkit-filter') is null
 464
 465Some commas.
 466custom(my-filter, a mat3(1, 0, 0, 0, 1, 0 0 0 1))
 467PASS styleRule.type is CSSRule.STYLE_RULE
 468PASS declaration.length is 0
 469PASS declaration.getPropertyValue('-webkit-filter') is null
 470
 471Leading commas.
 472custom(my-filter, a mat3(, 0, 0, 0, 1, 0, 0, 0, 1))
 473PASS styleRule.type is CSSRule.STYLE_RULE
 474PASS declaration.length is 0
 475PASS declaration.getPropertyValue('-webkit-filter') is null
 476
 477No length units.
 478custom(my-filter, a mat3(1px, 0, 0, 0, 1px, 0, 0, 0, 1px))
 479PASS styleRule.type is CSSRule.STYLE_RULE
 480PASS declaration.length is 0
 481PASS declaration.getPropertyValue('-webkit-filter') is null
 482
 483No degree units.
 484custom(my-filter, a mat3(1deg, 0, 0, 0, 1deg, 0, 0, 0, 1deg))
 485PASS styleRule.type is CSSRule.STYLE_RULE
 486PASS declaration.length is 0
 487PASS declaration.getPropertyValue('-webkit-filter') is null
 488
 489NaN in mat3.
 490custom(my-filter, a mat2(NaN, 0, 0, 0, 1, 0, 0, 0, 1))
 491PASS styleRule.type is CSSRule.STYLE_RULE
 492PASS declaration.length is 0
 493PASS declaration.getPropertyValue('-webkit-filter') is null
 494
 495========================================
 496Mat4 parameter tests.
 497========================================
 498
 499Empty mat4.
 500custom(my-filter, a mat4())
 501PASS styleRule.type is CSSRule.STYLE_RULE
 502PASS declaration.length is 0
 503PASS declaration.getPropertyValue('-webkit-filter') is null
 504
 505Too view arguments.
 506custom(my-filter, a mat4(1, 0, 0, 0, 1, 0, 0, 0, 1))
 507PASS styleRule.type is CSSRule.STYLE_RULE
 508PASS declaration.length is 0
 509PASS declaration.getPropertyValue('-webkit-filter') is null
 510
 511No arguments but commas.
 512custom(my-filter, a mat4(,,,,,,,,,,,,,,,))
 513PASS styleRule.type is CSSRule.STYLE_RULE
 514PASS declaration.length is 0
 515PASS declaration.getPropertyValue('-webkit-filter') is null
 516
 517Ending commas.
 518custom(my-filter, a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,,))
 519PASS styleRule.type is CSSRule.STYLE_RULE
 520PASS declaration.length is 0
 521PASS declaration.getPropertyValue('-webkit-filter') is null
 522
 523Idents in mat4 function.
 524custom(my-filter, a mat4(1, 0, 0, 0, 1, 0, 0, a, b))
 525PASS styleRule.type is CSSRule.STYLE_RULE
 526PASS declaration.length is 0
 527PASS declaration.getPropertyValue('-webkit-filter') is null
 528
 529Too many arguments.
 530custom(my-filter, a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0))
 531PASS styleRule.type is CSSRule.STYLE_RULE
 532PASS declaration.length is 0
 533PASS declaration.getPropertyValue('-webkit-filter') is null
 534
 535No commas.
 536custom(my-filter, a mat4(1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1))
 537PASS styleRule.type is CSSRule.STYLE_RULE
 538PASS declaration.length is 0
 539PASS declaration.getPropertyValue('-webkit-filter') is null
 540
 541Some commas.
 542custom(my-filter, a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0 0 0 0 1))
 543PASS styleRule.type is CSSRule.STYLE_RULE
 544PASS declaration.length is 0
 545PASS declaration.getPropertyValue('-webkit-filter') is null
 546
 547Leading commas.
 548custom(my-filter, a mat4(, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))
 549PASS styleRule.type is CSSRule.STYLE_RULE
 550PASS declaration.length is 0
 551PASS declaration.getPropertyValue('-webkit-filter') is null
 552
 553No length units.
 554custom(my-filter, a mat4(1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px))
 555PASS styleRule.type is CSSRule.STYLE_RULE
 556PASS declaration.length is 0
 557PASS declaration.getPropertyValue('-webkit-filter') is null
 558
 559No degree units.
 560custom(my-filter, a mat4(1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg))
 561PASS styleRule.type is CSSRule.STYLE_RULE
 562PASS declaration.length is 0
 563PASS declaration.getPropertyValue('-webkit-filter') is null
 564
 565NaN in mat4.
 566custom(my-filter, a mat4(NaN, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))
 567PASS styleRule.type is CSSRule.STYLE_RULE
 568PASS declaration.length is 0
 569PASS declaration.getPropertyValue('-webkit-filter') is null
 570
 571========================================
344572Mixing parameter types.
345573========================================
346574

@@custom(my-filter, a rgb(255, 0, 0) rotate(45deg))
391619PASS styleRule.type is CSSRule.STYLE_RULE
392620PASS declaration.length is 0
393621PASS declaration.getPropertyValue('-webkit-filter') is null
 622
 623Color with mat2.
 624custom(my-filter, a rgb(255, 0, 0) mat2(0, 0, 0, 0))
 625PASS styleRule.type is CSSRule.STYLE_RULE
 626PASS declaration.length is 0
 627PASS declaration.getPropertyValue('-webkit-filter') is null
 628
 629mat2 with mat3.
 630custom(my-filter, a mat2(1, 0, 0, 1) mat3(0, 0, 0, 0, 0, 0, 0, 0, 0))
 631PASS styleRule.type is CSSRule.STYLE_RULE
 632PASS declaration.length is 0
 633PASS declaration.getPropertyValue('-webkit-filter') is null
394634PASS successfullyParsed is true
395635
396636TEST COMPLETE

LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-custom-function-valid-expected.txt

@@PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
301301PASS subValue.cssText is 'custom(my-filter, a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3))'
302302
303303========================================
 304Mat2 parameter tests.
 305========================================
 306
 307Mat2 parameter.
 308custom(my-filter, m mat2(1, 0, 0, 1))
 309PASS styleRule.type is CSSRule.STYLE_RULE
 310PASS styleDeclaration.length is 1
 311PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat2(1, 0, 0, 1))'
 312PASS filterPropertyValue instanceof CSSValueList is true
 313PASS filterPropertyValue.constructor === CSSValueList is true
 314PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 315PASS filterPropertyValue.length is 1
 316PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 317PASS subValue.cssText is 'custom(my-filter, m mat2(1, 0, 0, 1))'
 318
 319Mat2 parameter with negative values.
 320custom(my-filter, m mat2(-1, -1, -1, -1))
 321PASS styleRule.type is CSSRule.STYLE_RULE
 322PASS styleDeclaration.length is 1
 323PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat2(-1, -1, -1, -1))'
 324PASS filterPropertyValue instanceof CSSValueList is true
 325PASS filterPropertyValue.constructor === CSSValueList is true
 326PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 327PASS filterPropertyValue.length is 1
 328PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 329PASS subValue.cssText is 'custom(my-filter, m mat2(-1, -1, -1, -1))'
 330
 331Mat2 parameter with negative and positive values.
 332custom(my-filter, m mat2(-1, 1, 1, -1))
 333PASS styleRule.type is CSSRule.STYLE_RULE
 334PASS styleDeclaration.length is 1
 335PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat2(-1, 1, 1, -1))'
 336PASS filterPropertyValue instanceof CSSValueList is true
 337PASS filterPropertyValue.constructor === CSSValueList is true
 338PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 339PASS filterPropertyValue.length is 1
 340PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 341PASS subValue.cssText is 'custom(my-filter, m mat2(-1, 1, 1, -1))'
 342
 343Mat2 parameter with multiple signed floats.
 344custom(my-filter, m mat2(1, -2.2, 3.14, 0.4))
 345PASS styleRule.type is CSSRule.STYLE_RULE
 346PASS styleDeclaration.length is 1
 347PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat2(1, -2.2, 3.14, 0.4))'
 348PASS filterPropertyValue instanceof CSSValueList is true
 349PASS filterPropertyValue.constructor === CSSValueList is true
 350PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 351PASS filterPropertyValue.length is 1
 352PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 353PASS subValue.cssText is 'custom(my-filter, m mat2(1, -2.2, 3.14, 0.4))'
 354
 355========================================
 356Mat3 parameter tests.
 357========================================
 358
 359Mat3 parameter.
 360custom(my-filter, m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1))
 361PASS styleRule.type is CSSRule.STYLE_RULE
 362PASS styleDeclaration.length is 1
 363PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1))'
 364PASS filterPropertyValue instanceof CSSValueList is true
 365PASS filterPropertyValue.constructor === CSSValueList is true
 366PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 367PASS filterPropertyValue.length is 1
 368PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 369PASS subValue.cssText is 'custom(my-filter, m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1))'
 370
 371Mat3 parameter with negative values.
 372custom(my-filter, m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1))
 373PASS styleRule.type is CSSRule.STYLE_RULE
 374PASS styleDeclaration.length is 1
 375PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1))'
 376PASS filterPropertyValue instanceof CSSValueList is true
 377PASS filterPropertyValue.constructor === CSSValueList is true
 378PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 379PASS filterPropertyValue.length is 1
 380PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 381PASS subValue.cssText is 'custom(my-filter, m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1))'
 382
 383Mat3 parameter with negative and positive values.
 384custom(my-filter, m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1))
 385PASS styleRule.type is CSSRule.STYLE_RULE
 386PASS styleDeclaration.length is 1
 387PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1))'
 388PASS filterPropertyValue instanceof CSSValueList is true
 389PASS filterPropertyValue.constructor === CSSValueList is true
 390PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 391PASS filterPropertyValue.length is 1
 392PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 393PASS subValue.cssText is 'custom(my-filter, m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1))'
 394
 395Mat3 parameter with multiple signed floats.
 396custom(my-filter, m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1))
 397PASS styleRule.type is CSSRule.STYLE_RULE
 398PASS styleDeclaration.length is 1
 399PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1))'
 400PASS filterPropertyValue instanceof CSSValueList is true
 401PASS filterPropertyValue.constructor === CSSValueList is true
 402PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 403PASS filterPropertyValue.length is 1
 404PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 405PASS subValue.cssText is 'custom(my-filter, m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1))'
 406
 407========================================
 408Mat4 parameter tests.
 409========================================
 410
 411Mat4 parameter.
 412custom(my-filter, m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))
 413PASS styleRule.type is CSSRule.STYLE_RULE
 414PASS styleDeclaration.length is 1
 415PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))'
 416PASS filterPropertyValue instanceof CSSValueList is true
 417PASS filterPropertyValue.constructor === CSSValueList is true
 418PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 419PASS filterPropertyValue.length is 1
 420PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 421PASS subValue.cssText is 'custom(my-filter, m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))'
 422
 423Mat4 parameter with negative values.
 424custom(my-filter, m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1))
 425PASS styleRule.type is CSSRule.STYLE_RULE
 426PASS styleDeclaration.length is 1
 427PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1))'
 428PASS filterPropertyValue instanceof CSSValueList is true
 429PASS filterPropertyValue.constructor === CSSValueList is true
 430PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 431PASS filterPropertyValue.length is 1
 432PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 433PASS subValue.cssText is 'custom(my-filter, m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1))'
 434
 435Mat4 parameter with negative and positive values.
 436custom(my-filter, m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1))
 437PASS styleRule.type is CSSRule.STYLE_RULE
 438PASS styleDeclaration.length is 1
 439PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1))'
 440PASS filterPropertyValue instanceof CSSValueList is true
 441PASS filterPropertyValue.constructor === CSSValueList is true
 442PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 443PASS filterPropertyValue.length is 1
 444PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 445PASS subValue.cssText is 'custom(my-filter, m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1))'
 446
 447Mat4 parameter with multiple signed floats.
 448custom(my-filter, m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4))
 449PASS styleRule.type is CSSRule.STYLE_RULE
 450PASS styleDeclaration.length is 1
 451PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4))'
 452PASS filterPropertyValue instanceof CSSValueList is true
 453PASS filterPropertyValue.constructor === CSSValueList is true
 454PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
 455PASS filterPropertyValue.length is 1
 456PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
 457PASS subValue.cssText is 'custom(my-filter, m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4))'
 458
 459========================================
304460Combined parameter tests.
305461========================================
306462
307 Number parameter, color parameter, transform parameter, and array parameter.
308 custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1))
 463Number parameter, color parameter, transform parameter, matrix parameters and array parameter.
 464custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1))
309465PASS styleRule.type is CSSRule.STYLE_RULE
310466PASS styleDeclaration.length is 1
311 PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1))'
 467PASS styleDeclaration.getPropertyValue('-webkit-filter') is 'custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1))'
312468PASS filterPropertyValue instanceof CSSValueList is true
313469PASS filterPropertyValue.constructor === CSSValueList is true
314470PASS filterPropertyValue.__proto__ === CSSValueList.prototype is true
315471PASS filterPropertyValue.length is 1
316472PASS subValue.operationType is WebKitCSSFilterValue.CSS_FILTER_CUSTOM
317 PASS subValue.cssText is 'custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1))'
 473PASS subValue.cssText is 'custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1))'
318474PASS successfullyParsed is true
319475
320476TEST COMPLETE

LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid-expected.txt

@@PASS styleDeclaration.length is 0
267267PASS styleDeclaration.getPropertyValue('parameters') is null
268268
269269========================================
 270Mat2 parameter tests.
 271========================================
 272
 273Empty mat2.
 274parameters: a mat2();
 275PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 276PASS styleDeclaration.length is 0
 277PASS styleDeclaration.getPropertyValue('parameters') is null
 278
 279Too view arguments.
 280parameters: a mat2(0, 0, 0);
 281PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 282PASS styleDeclaration.length is 0
 283PASS styleDeclaration.getPropertyValue('parameters') is null
 284
 285No arguments but commas.
 286parameters: a mat2(,,,);
 287PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 288PASS styleDeclaration.length is 0
 289PASS styleDeclaration.getPropertyValue('parameters') is null
 290
 291Ending commas.
 292parameters: a mat2(0, 0,,);
 293PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 294PASS styleDeclaration.length is 0
 295PASS styleDeclaration.getPropertyValue('parameters') is null
 296
 297Idents in mat2 function.
 298parameters: a mat2(0, 0, a, b);
 299PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 300PASS styleDeclaration.length is 0
 301PASS styleDeclaration.getPropertyValue('parameters') is null
 302
 303Too many arguments.
 304parameters: a mat2(0, 0, 0, 0, 1);
 305PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 306PASS styleDeclaration.length is 0
 307PASS styleDeclaration.getPropertyValue('parameters') is null
 308
 309No commas.
 310parameters: a mat2(1 0 0 1);
 311PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 312PASS styleDeclaration.length is 0
 313PASS styleDeclaration.getPropertyValue('parameters') is null
 314
 315Some commas.
 316parameters: a mat2(1, 0, 0 1);
 317PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 318PASS styleDeclaration.length is 0
 319PASS styleDeclaration.getPropertyValue('parameters') is null
 320
 321Leading commas.
 322parameters: a mat2(, 0, 0, 1);
 323PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 324PASS styleDeclaration.length is 0
 325PASS styleDeclaration.getPropertyValue('parameters') is null
 326
 327No length units.
 328parameters: a mat2(1px, 0px, 0px, 1px);
 329PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 330PASS styleDeclaration.length is 0
 331PASS styleDeclaration.getPropertyValue('parameters') is null
 332
 333No degree units.
 334parameters: a mat2(1deg, 0deg, 0deg, 1deg);
 335PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 336PASS styleDeclaration.length is 0
 337PASS styleDeclaration.getPropertyValue('parameters') is null
 338
 339NaN in mat2.
 340parameters: a mat2(1, 0, 0, NaN);
 341PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 342PASS styleDeclaration.length is 0
 343PASS styleDeclaration.getPropertyValue('parameters') is null
 344
 345========================================
 346Mat3 parameter tests.
 347========================================
 348
 349Empty mat3.
 350parameters: a mat3();
 351PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 352PASS styleDeclaration.length is 0
 353PASS styleDeclaration.getPropertyValue('parameters') is null
 354
 355Too view arguments.
 356parameters: a mat3(0, 0, 0, 0);
 357PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 358PASS styleDeclaration.length is 0
 359PASS styleDeclaration.getPropertyValue('parameters') is null
 360
 361No arguments but commas.
 362parameters: a mat3(,,,,,,,,,,,,,,,);
 363PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 364PASS styleDeclaration.length is 0
 365PASS styleDeclaration.getPropertyValue('parameters') is null
 366
 367Ending commas.
 368parameters: a mat3(1, 0, 0, 0, 1, 0, 0,,);
 369PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 370PASS styleDeclaration.length is 0
 371PASS styleDeclaration.getPropertyValue('parameters') is null
 372
 373Idents in mat3 function.
 374parameters: a mat3(1, 0, 0, 0, 1, 0, 0, a, b);
 375PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 376PASS styleDeclaration.length is 0
 377PASS styleDeclaration.getPropertyValue('parameters') is null
 378
 379Too many arguments.
 380parameters: a mat3(1, 0, 0, 0, 1, 0, 0, 0, 1, 0);
 381PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 382PASS styleDeclaration.length is 0
 383PASS styleDeclaration.getPropertyValue('parameters') is null
 384
 385No commas.
 386parameters: a mat3(1 0 0 0 1 0 0 0 1);
 387PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 388PASS styleDeclaration.length is 0
 389PASS styleDeclaration.getPropertyValue('parameters') is null
 390
 391Some commas.
 392parameters: a mat3(1, 0, 0, 0, 1, 0 0 0 1);
 393PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 394PASS styleDeclaration.length is 0
 395PASS styleDeclaration.getPropertyValue('parameters') is null
 396
 397Leading commas.
 398parameters: a mat3(, 0, 0, 0, 1, 0, 0, 0, 1);
 399PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 400PASS styleDeclaration.length is 0
 401PASS styleDeclaration.getPropertyValue('parameters') is null
 402
 403No length units.
 404parameters: a mat3(1px, 0, 0, 0, 1px, 0, 0, 0, 1px);
 405PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 406PASS styleDeclaration.length is 0
 407PASS styleDeclaration.getPropertyValue('parameters') is null
 408
 409No degree units.
 410parameters: a mat3(1deg, 0, 0, 0, 1deg, 0, 0, 0, 1deg);
 411PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 412PASS styleDeclaration.length is 0
 413PASS styleDeclaration.getPropertyValue('parameters') is null
 414
 415NaN in mat3.
 416parameters: a mat2(NaN, 0, 0, 0, 1, 0, 0, 0, 1);
 417PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 418PASS styleDeclaration.length is 0
 419PASS styleDeclaration.getPropertyValue('parameters') is null
 420
 421========================================
 422Mat4 parameter tests.
 423========================================
 424
 425Empty mat4.
 426parameters: a mat4();
 427PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 428PASS styleDeclaration.length is 0
 429PASS styleDeclaration.getPropertyValue('parameters') is null
 430
 431Too view arguments.
 432parameters: a mat4(1, 0, 0, 0, 1, 0, 0, 0, 1);
 433PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 434PASS styleDeclaration.length is 0
 435PASS styleDeclaration.getPropertyValue('parameters') is null
 436
 437No arguments but commas.
 438parameters: a mat4(,,,,,,,,,,,,,,,);
 439PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 440PASS styleDeclaration.length is 0
 441PASS styleDeclaration.getPropertyValue('parameters') is null
 442
 443Ending commas.
 444parameters: a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,,);
 445PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 446PASS styleDeclaration.length is 0
 447PASS styleDeclaration.getPropertyValue('parameters') is null
 448
 449Idents in mat4 function.
 450parameters: a mat4(1, 0, 0, 0, 1, 0, 0, a, b);
 451PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 452PASS styleDeclaration.length is 0
 453PASS styleDeclaration.getPropertyValue('parameters') is null
 454
 455Too many arguments.
 456parameters: a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0);
 457PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 458PASS styleDeclaration.length is 0
 459PASS styleDeclaration.getPropertyValue('parameters') is null
 460
 461No commas.
 462parameters: a mat4(1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1);
 463PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 464PASS styleDeclaration.length is 0
 465PASS styleDeclaration.getPropertyValue('parameters') is null
 466
 467Some commas.
 468parameters: a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0 0 0 0 1);
 469PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 470PASS styleDeclaration.length is 0
 471PASS styleDeclaration.getPropertyValue('parameters') is null
 472
 473Leading commas.
 474parameters: a mat4(, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
 475PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 476PASS styleDeclaration.length is 0
 477PASS styleDeclaration.getPropertyValue('parameters') is null
 478
 479No length units.
 480parameters: a mat4(1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px);
 481PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 482PASS styleDeclaration.length is 0
 483PASS styleDeclaration.getPropertyValue('parameters') is null
 484
 485No degree units.
 486parameters: a mat4(1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg);
 487PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 488PASS styleDeclaration.length is 0
 489PASS styleDeclaration.getPropertyValue('parameters') is null
 490
 491NaN in mat4.
 492parameters: a mat4(NaN, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
 493PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 494PASS styleDeclaration.length is 0
 495PASS styleDeclaration.getPropertyValue('parameters') is null
 496
 497========================================
270498Mixing parameter types.
271499========================================
272500

@@parameters: a rgb(255, 0, 0) rotate(45deg);
317545PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
318546PASS styleDeclaration.length is 0
319547PASS styleDeclaration.getPropertyValue('parameters') is null
 548
 549Color after array values.
 550parameters: a array(0) rgb(255, 0, 0);
 551PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 552PASS styleDeclaration.length is 0
 553PASS styleDeclaration.getPropertyValue('parameters') is null
 554
 555Color with mat2.
 556parameters: a rgb(255, 0, 0) mat2(0, 0, 0, 0);
 557PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 558PASS styleDeclaration.length is 0
 559PASS styleDeclaration.getPropertyValue('parameters') is null
 560
 561mat2 with mat3.
 562parameters: a mat2(1, 0, 0, 1) mat3(0, 0, 0, 0, 0, 0, 0, 0, 0);
 563PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 564PASS styleDeclaration.length is 0
 565PASS styleDeclaration.getPropertyValue('parameters') is null
320566PASS successfullyParsed is true
321567
322568TEST COMPLETE

LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid-expected.txt

@@PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
253253PASS removeBaseURL(subValue.cssText) is "c rgba(0, 255, 0, 0.2)"
254254
255255========================================
 256Mat2 parameter tests.
 257========================================
 258
 259Mat2 parameter.
 260parameters: m mat2(1, 0, 0, 1);
 261PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 262PASS styleDeclaration.length is 1
 263PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat2(1, 0, 0, 1)"
 264PASS parametersPropertyValue instanceof CSSValueList is true
 265PASS parametersPropertyValue.constructor === CSSValueList is true
 266PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 267PASS parametersPropertyValue.length is 1
 268PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 269PASS removeBaseURL(subValue.cssText) is "m mat2(1, 0, 0, 1)"
 270
 271Mat2 parameter with negative values.
 272parameters: m mat2(-1, -1, -1, -1);
 273PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 274PASS styleDeclaration.length is 1
 275PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat2(-1, -1, -1, -1)"
 276PASS parametersPropertyValue instanceof CSSValueList is true
 277PASS parametersPropertyValue.constructor === CSSValueList is true
 278PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 279PASS parametersPropertyValue.length is 1
 280PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 281PASS removeBaseURL(subValue.cssText) is "m mat2(-1, -1, -1, -1)"
 282
 283Mat2 parameter with negative and positive values.
 284parameters: m mat2(-1, 1, 1, -1);
 285PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 286PASS styleDeclaration.length is 1
 287PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat2(-1, 1, 1, -1)"
 288PASS parametersPropertyValue instanceof CSSValueList is true
 289PASS parametersPropertyValue.constructor === CSSValueList is true
 290PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 291PASS parametersPropertyValue.length is 1
 292PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 293PASS removeBaseURL(subValue.cssText) is "m mat2(-1, 1, 1, -1)"
 294
 295Mat2 parameter with multiple signed floats.
 296parameters: m mat2(1, -2.2, 3.14, 0.4);
 297PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 298PASS styleDeclaration.length is 1
 299PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat2(1, -2.2, 3.14, 0.4)"
 300PASS parametersPropertyValue instanceof CSSValueList is true
 301PASS parametersPropertyValue.constructor === CSSValueList is true
 302PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 303PASS parametersPropertyValue.length is 1
 304PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 305PASS removeBaseURL(subValue.cssText) is "m mat2(1, -2.2, 3.14, 0.4)"
 306
 307========================================
 308Mat3 parameter tests.
 309========================================
 310
 311Mat3 parameter.
 312parameters: m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1);
 313PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 314PASS styleDeclaration.length is 1
 315PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)"
 316PASS parametersPropertyValue instanceof CSSValueList is true
 317PASS parametersPropertyValue.constructor === CSSValueList is true
 318PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 319PASS parametersPropertyValue.length is 1
 320PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 321PASS removeBaseURL(subValue.cssText) is "m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)"
 322
 323Mat3 parameter with negative values.
 324parameters: m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1);
 325PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 326PASS styleDeclaration.length is 1
 327PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1)"
 328PASS parametersPropertyValue instanceof CSSValueList is true
 329PASS parametersPropertyValue.constructor === CSSValueList is true
 330PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 331PASS parametersPropertyValue.length is 1
 332PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 333PASS removeBaseURL(subValue.cssText) is "m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1)"
 334
 335Mat3 parameter with negative and positive values.
 336parameters: m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1);
 337PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 338PASS styleDeclaration.length is 1
 339PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1)"
 340PASS parametersPropertyValue instanceof CSSValueList is true
 341PASS parametersPropertyValue.constructor === CSSValueList is true
 342PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 343PASS parametersPropertyValue.length is 1
 344PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 345PASS removeBaseURL(subValue.cssText) is "m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1)"
 346
 347Mat3 parameter with multiple signed floats.
 348parameters: m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1);
 349PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 350PASS styleDeclaration.length is 1
 351PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1)"
 352PASS parametersPropertyValue instanceof CSSValueList is true
 353PASS parametersPropertyValue.constructor === CSSValueList is true
 354PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 355PASS parametersPropertyValue.length is 1
 356PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 357PASS removeBaseURL(subValue.cssText) is "m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1)"
 358
 359========================================
 360Mat4 parameter tests.
 361========================================
 362
 363Mat4 parameter.
 364parameters: m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
 365PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 366PASS styleDeclaration.length is 1
 367PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"
 368PASS parametersPropertyValue instanceof CSSValueList is true
 369PASS parametersPropertyValue.constructor === CSSValueList is true
 370PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 371PASS parametersPropertyValue.length is 1
 372PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 373PASS removeBaseURL(subValue.cssText) is "m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"
 374
 375Mat4 parameter with negative values.
 376parameters: m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
 377PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 378PASS styleDeclaration.length is 1
 379PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)"
 380PASS parametersPropertyValue instanceof CSSValueList is true
 381PASS parametersPropertyValue.constructor === CSSValueList is true
 382PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 383PASS parametersPropertyValue.length is 1
 384PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 385PASS removeBaseURL(subValue.cssText) is "m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)"
 386
 387Mat4 parameter with negative and positive values.
 388parameters: m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1);
 389PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 390PASS styleDeclaration.length is 1
 391PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1)"
 392PASS parametersPropertyValue instanceof CSSValueList is true
 393PASS parametersPropertyValue.constructor === CSSValueList is true
 394PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 395PASS parametersPropertyValue.length is 1
 396PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 397PASS removeBaseURL(subValue.cssText) is "m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1)"
 398
 399Mat4 parameter with multiple signed floats.
 400parameters: m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4);
 401PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
 402PASS styleDeclaration.length is 1
 403PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4)"
 404PASS parametersPropertyValue instanceof CSSValueList is true
 405PASS parametersPropertyValue.constructor === CSSValueList is true
 406PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
 407PASS parametersPropertyValue.length is 1
 408PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 409PASS removeBaseURL(subValue.cssText) is "m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4)"
 410
 411========================================
256412Combined parameter tests.
257413========================================
258414
259 Number parameter, color parameter, transform parameter and array parameter.
260 parameters: n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1);
 415Number parameter, color parameter, transform parameter, matrix parameters and array parameter.
 416parameters: n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1);
261417PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
262418PASS styleDeclaration.length is 1
263 PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1)"
 419PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1)"
264420PASS parametersPropertyValue instanceof CSSValueList is true
265421PASS parametersPropertyValue.constructor === CSSValueList is true
266422PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
267 PASS parametersPropertyValue.length is 4
 423PASS parametersPropertyValue.length is 7
268424PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
269425PASS removeBaseURL(subValue.cssText) is "n 1"
270426PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST

@@PASS removeBaseURL(subValue.cssText) is "c rgb(0, 128, 0)"
272428PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
273429PASS removeBaseURL(subValue.cssText) is "t rotate(0deg)"
274430PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 431PASS removeBaseURL(subValue.cssText) is "m1 mat2(1, 0, 0, 1)"
 432PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 433PASS removeBaseURL(subValue.cssText) is "m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)"
 434PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
 435PASS removeBaseURL(subValue.cssText) is "m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"
 436PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
275437PASS removeBaseURL(subValue.cssText) is "a array(1)"
276438PASS successfullyParsed is true
277439

LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-custom-function-invalid.js

@@testInvalidFilterRule("Invalid value unit 'px' in array.", "custom(my-filter, a
8282testInvalidFilterRule("Invalid value unit 'deg' in array.", "custom(my-filter, a array(1deg))");
8383testInvalidFilterRule("Invalid value unit 'px' in array after valid values.", "custom(my-filter, a array(1, 2, 3, 4px))");
8484
 85
 86heading("Mat2 parameter tests.");
 87testInvalidFilterRule("Empty mat2.", "custom(my-filter, a mat2())");
 88testInvalidFilterRule("Too view arguments.", "custom(my-filter, a mat2(0, 0, 0))");
 89testInvalidFilterRule("No arguments but commas.", "custom(my-filter, a mat2(,,,))");
 90testInvalidFilterRule("Ending commas.", "custom(my-filter, a mat2(0, 0,,))");
 91testInvalidFilterRule("Idents in mat2 function.", "custom(my-filter, a mat2(0, 0, a, b))");
 92testInvalidFilterRule("Too many arguments.", "custom(my-filter, a mat2(0, 0, 0, 0, 1))");
 93testInvalidFilterRule("No commas.", "custom(my-filter, a mat2(1 0 0 1))");
 94testInvalidFilterRule("Some commas.", "custom(my-filter, a mat2(1, 0, 0 1))");
 95testInvalidFilterRule("Leading commas.", "custom(my-filter, a mat2(, 0, 0, 1))");
 96testInvalidFilterRule("No length units.", "custom(my-filter, a mat2(1px, 0px, 0px, 1px))");
 97testInvalidFilterRule("No degree units.", "custom(my-filter, a mat2(1deg, 0deg, 0deg, 1deg))");
 98testInvalidFilterRule("NaN in mat2.", "custom(my-filter, a mat2(1, 0, 0, NaN))");
 99
 100heading("Mat3 parameter tests.");
 101testInvalidFilterRule("Empty mat3.", "custom(my-filter, a mat3())");
 102testInvalidFilterRule("Too view arguments.", "custom(my-filter, a mat3(0, 0, 0, 0))");
 103testInvalidFilterRule("No arguments but commas.", "custom(my-filter, a mat3(,,,,,,,,,,,,,,,))");
 104testInvalidFilterRule("Ending commas.", "custom(my-filter, a mat3(1, 0, 0, 0, 1, 0, 0,,))");
 105testInvalidFilterRule("Idents in mat3 function.", "custom(my-filter, a mat3(1, 0, 0, 0, 1, 0, 0, a, b))");
 106testInvalidFilterRule("Too many arguments.", "custom(my-filter, a mat3(1, 0, 0, 0, 1, 0, 0, 0, 1, 0))");
 107testInvalidFilterRule("No commas.", "custom(my-filter, a mat3(1 0 0 0 1 0 0 0 1))");
 108testInvalidFilterRule("Some commas.", "custom(my-filter, a mat3(1, 0, 0, 0, 1, 0 0 0 1))");
 109testInvalidFilterRule("Leading commas.", "custom(my-filter, a mat3(, 0, 0, 0, 1, 0, 0, 0, 1))");
 110testInvalidFilterRule("No length units.", "custom(my-filter, a mat3(1px, 0, 0, 0, 1px, 0, 0, 0, 1px))");
 111testInvalidFilterRule("No degree units.", "custom(my-filter, a mat3(1deg, 0, 0, 0, 1deg, 0, 0, 0, 1deg))");
 112testInvalidFilterRule("NaN in mat3.", "custom(my-filter, a mat2(NaN, 0, 0, 0, 1, 0, 0, 0, 1))");
 113
 114heading("Mat4 parameter tests.");
 115testInvalidFilterRule("Empty mat4.", "custom(my-filter, a mat4())");
 116testInvalidFilterRule("Too view arguments.", "custom(my-filter, a mat4(1, 0, 0, 0, 1, 0, 0, 0, 1))");
 117testInvalidFilterRule("No arguments but commas.", "custom(my-filter, a mat4(,,,,,,,,,,,,,,,))");
 118testInvalidFilterRule("Ending commas.", "custom(my-filter, a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,,))");
 119testInvalidFilterRule("Idents in mat4 function.", "custom(my-filter, a mat4(1, 0, 0, 0, 1, 0, 0, a, b))");
 120testInvalidFilterRule("Too many arguments.", "custom(my-filter, a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0))");
 121testInvalidFilterRule("No commas.", "custom(my-filter, a mat4(1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1))");
 122testInvalidFilterRule("Some commas.", "custom(my-filter, a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0 0 0 0 1))");
 123testInvalidFilterRule("Leading commas.", "custom(my-filter, a mat4(, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))");
 124testInvalidFilterRule("No length units.", "custom(my-filter, a mat4(1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px))");
 125testInvalidFilterRule("No degree units.", "custom(my-filter, a mat4(1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg))");
 126testInvalidFilterRule("NaN in mat4.", "custom(my-filter, a mat4(NaN, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))");
 127
 128
85129heading("Mixing parameter types.");
86130testInvalidFilterRule("Number parameter with hex color.", "custom(my-filter, n1 1 2 #FF0000)");
87131testInvalidFilterRule("Number parameter with color keyword.", "custom(my-filter, n1 1 2 red)");

@@testInvalidFilterRule("Color with number parameter.", "custom(my-filter, a rgb(2
90134testInvalidFilterRule("Color in array.", "custom(my-filter, a array(0, rgb(255, 0, 0)))");
91135testInvalidFilterRule("Color and array.", "custom(my-filter, a array(0, 0) rgb(255, 0, 0))");
92136testInvalidFilterRule("Color with transform values.", "custom(my-filter, a rotate(45deg) rgb(255, 0, 0))");
93 testInvalidFilterRule("Color with transform values.", "custom(my-filter, a rgb(255, 0, 0) rotate(45deg))");
94137\ No newline at end of file
 138testInvalidFilterRule("Color with transform values.", "custom(my-filter, a rgb(255, 0, 0) rotate(45deg))");
 139testInvalidFilterRule("Color with mat2.", "custom(my-filter, a rgb(255, 0, 0) mat2(0, 0, 0, 0))");
 140testInvalidFilterRule("mat2 with mat3.", "custom(my-filter, a mat2(1, 0, 0, 1) mat3(0, 0, 0, 0, 0, 0, 0, 0, 0))");

LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-custom-function-valid.js

@@testFilterProperty("Multiple array parameters.",
119119 "custom(my-filter, a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3))",
120120 "custom(my-filter, a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3))");
121121
 122heading("Mat2 parameter tests.");
 123testFilterProperty("Mat2 parameter.",
 124 "custom(my-filter, m mat2(1, 0, 0, 1))",
 125 "custom(my-filter, m mat2(1, 0, 0, 1))");
 126testFilterProperty("Mat2 parameter with negative values.",
 127 "custom(my-filter, m mat2(-1, -1, -1, -1))",
 128 "custom(my-filter, m mat2(-1, -1, -1, -1))");
 129testFilterProperty("Mat2 parameter with negative and positive values.",
 130 "custom(my-filter, m mat2(-1, 1, 1, -1))",
 131 "custom(my-filter, m mat2(-1, 1, 1, -1))");
 132testFilterProperty("Mat2 parameter with multiple signed floats.",
 133 "custom(my-filter, m mat2(1, -2.2, 3.14, 0.4))",
 134 "custom(my-filter, m mat2(1, -2.2, 3.14, 0.4))");
 135
 136heading("Mat3 parameter tests.");
 137testFilterProperty("Mat3 parameter.",
 138 "custom(my-filter, m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1))",
 139 "custom(my-filter, m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1))");
 140testFilterProperty("Mat3 parameter with negative values.",
 141 "custom(my-filter, m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1))",
 142 "custom(my-filter, m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1))");
 143testFilterProperty("Mat3 parameter with negative and positive values.",
 144 "custom(my-filter, m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1))",
 145 "custom(my-filter, m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1))");
 146testFilterProperty("Mat3 parameter with multiple signed floats.",
 147 "custom(my-filter, m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1))",
 148 "custom(my-filter, m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1))");
 149
 150heading("Mat4 parameter tests.");
 151testFilterProperty("Mat4 parameter.",
 152 "custom(my-filter, m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))",
 153 "custom(my-filter, m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))");
 154testFilterProperty("Mat4 parameter with negative values.",
 155 "custom(my-filter, m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1))",
 156 "custom(my-filter, m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1))");
 157testFilterProperty("Mat4 parameter with negative and positive values.",
 158 "custom(my-filter, m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1))",
 159 "custom(my-filter, m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1))");
 160testFilterProperty("Mat4 parameter with multiple signed floats.",
 161 "custom(my-filter, m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4))",
 162 "custom(my-filter, m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4))");
 163
122164heading("Combined parameter tests.");
123 testFilterProperty("Number parameter, color parameter, transform parameter, and array parameter.",
124  "custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1))",
125  "custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1))");
 165testFilterProperty("Number parameter, color parameter, transform parameter, matrix parameters and array parameter.",
 166 "custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1))",
 167 "custom(my-filter, n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1))");

LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-invalid.js

@@testInvalidParametersProperty("Invalid value unit 'px' in array.", "a array(1px)
7070testInvalidParametersProperty("Invalid value unit 'deg' in array.", "a array(1deg)");
7171testInvalidParametersProperty("Invalid value unit 'px' in array after valid values.", "a array(1, 2, 3, 4px)");
7272
 73heading("Mat2 parameter tests.");
 74testInvalidParametersProperty("Empty mat2.", "a mat2()");
 75testInvalidParametersProperty("Too view arguments.", "a mat2(0, 0, 0)");
 76testInvalidParametersProperty("No arguments but commas.", "a mat2(,,,)");
 77testInvalidParametersProperty("Ending commas.", "a mat2(0, 0,,)");
 78testInvalidParametersProperty("Idents in mat2 function.", "a mat2(0, 0, a, b)");
 79testInvalidParametersProperty("Too many arguments.", "a mat2(0, 0, 0, 0, 1)");
 80testInvalidParametersProperty("No commas.", "a mat2(1 0 0 1)");
 81testInvalidParametersProperty("Some commas.", "a mat2(1, 0, 0 1)");
 82testInvalidParametersProperty("Leading commas.", "a mat2(, 0, 0, 1)");
 83testInvalidParametersProperty("No length units.", "a mat2(1px, 0px, 0px, 1px)");
 84testInvalidParametersProperty("No degree units.", "a mat2(1deg, 0deg, 0deg, 1deg)");
 85testInvalidParametersProperty("NaN in mat2.", "a mat2(1, 0, 0, NaN)");
 86
 87heading("Mat3 parameter tests.");
 88testInvalidParametersProperty("Empty mat3.", "a mat3()");
 89testInvalidParametersProperty("Too view arguments.", "a mat3(0, 0, 0, 0)");
 90testInvalidParametersProperty("No arguments but commas.", "a mat3(,,,,,,,,,,,,,,,)");
 91testInvalidParametersProperty("Ending commas.", "a mat3(1, 0, 0, 0, 1, 0, 0,,)");
 92testInvalidParametersProperty("Idents in mat3 function.", "a mat3(1, 0, 0, 0, 1, 0, 0, a, b)");
 93testInvalidParametersProperty("Too many arguments.", "a mat3(1, 0, 0, 0, 1, 0, 0, 0, 1, 0)");
 94testInvalidParametersProperty("No commas.", "a mat3(1 0 0 0 1 0 0 0 1)");
 95testInvalidParametersProperty("Some commas.", "a mat3(1, 0, 0, 0, 1, 0 0 0 1)");
 96testInvalidParametersProperty("Leading commas.", "a mat3(, 0, 0, 0, 1, 0, 0, 0, 1)");
 97testInvalidParametersProperty("No length units.", "a mat3(1px, 0, 0, 0, 1px, 0, 0, 0, 1px)");
 98testInvalidParametersProperty("No degree units.", "a mat3(1deg, 0, 0, 0, 1deg, 0, 0, 0, 1deg)");
 99testInvalidParametersProperty("NaN in mat3.", "a mat2(NaN, 0, 0, 0, 1, 0, 0, 0, 1)");
 100
 101heading("Mat4 parameter tests.");
 102testInvalidParametersProperty("Empty mat4.", "a mat4()");
 103testInvalidParametersProperty("Too view arguments.", "a mat4(1, 0, 0, 0, 1, 0, 0, 0, 1)");
 104testInvalidParametersProperty("No arguments but commas.", "a mat4(,,,,,,,,,,,,,,,)");
 105testInvalidParametersProperty("Ending commas.", "a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,,)");
 106testInvalidParametersProperty("Idents in mat4 function.", "a mat4(1, 0, 0, 0, 1, 0, 0, a, b)");
 107testInvalidParametersProperty("Too many arguments.", "a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)");
 108testInvalidParametersProperty("No commas.", "a mat4(1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1)");
 109testInvalidParametersProperty("Some commas.", "a mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0 0 0 0 1)");
 110testInvalidParametersProperty("Leading commas.", "a mat4(, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)");
 111testInvalidParametersProperty("No length units.", "a mat4(1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px, 0, 0, 0, 0, 1px)");
 112testInvalidParametersProperty("No degree units.", "a mat4(1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg, 0, 0, 0, 0, 1deg)");
 113testInvalidParametersProperty("NaN in mat4.", "a mat4(NaN, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)");
 114
73115heading("Mixing parameter types.");
74116testInvalidParametersProperty("Number parameter with hex color.", "n1 1 2 #FF0000");
75117testInvalidParametersProperty("Number parameter with color keyword.", "n1 1 2 red");

@@testInvalidParametersProperty("Color in array.", "a array(0, rgb(255, 0, 0))");
79121testInvalidParametersProperty("Color and array.", "a array(0, 0) rgb(255, 0, 0)");
80122testInvalidParametersProperty("Color with transform values.", "a rotate(45deg) rgb(255, 0, 0)");
81123testInvalidParametersProperty("Color with transform values.", "a rgb(255, 0, 0) rotate(45deg)");
 124testInvalidParametersProperty("Color after array values.", "a array(0) rgb(255, 0, 0)");
 125testInvalidParametersProperty("Color with mat2.", "a rgb(255, 0, 0) mat2(0, 0, 0, 0)");
 126testInvalidParametersProperty("mat2 with mat3.", "a mat2(1, 0, 0, 1) mat3(0, 0, 0, 0, 0, 0, 0, 0, 0)");
82127

LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-valid.js

@@testParametersProperty("Color hsla function.",
112112 "c rgba(0, 255, 0, 0.2)",
113113 ["c rgba(0, 255, 0, 0.2)"]);
114114
 115heading("Mat2 parameter tests.");
 116testParametersProperty("Mat2 parameter.",
 117 "m mat2(1, 0, 0, 1)",
 118 "m mat2(1, 0, 0, 1)",
 119 ["m mat2(1, 0, 0, 1)"]);
 120testParametersProperty("Mat2 parameter with negative values.",
 121 "m mat2(-1, -1, -1, -1)",
 122 "m mat2(-1, -1, -1, -1)",
 123 ["m mat2(-1, -1, -1, -1)"]);
 124testParametersProperty("Mat2 parameter with negative and positive values.",
 125 "m mat2(-1, 1, 1, -1)",
 126 "m mat2(-1, 1, 1, -1)",
 127 ["m mat2(-1, 1, 1, -1)"]);
 128testParametersProperty("Mat2 parameter with multiple signed floats.",
 129 "m mat2(1, -2.2, 3.14, 0.4)",
 130 "m mat2(1, -2.2, 3.14, 0.4)",
 131 ["m mat2(1, -2.2, 3.14, 0.4)"]);
 132
 133heading("Mat3 parameter tests.");
 134testParametersProperty("Mat3 parameter.",
 135 "m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)",
 136 "m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)",
 137 ["m mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)"]);
 138testParametersProperty("Mat3 parameter with negative values.",
 139 "m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1)",
 140 "m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1)",
 141 ["m mat3(-1, -1, -1, -1, -1, -1, -1, -1, -1)"]);
 142testParametersProperty("Mat3 parameter with negative and positive values.",
 143 "m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1)",
 144 "m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1)",
 145 ["m mat3(-1, 1, 1, -1, -1, 1, 1, -1, 1)"]);
 146testParametersProperty("Mat3 parameter with multiple signed floats.",
 147 "m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1)",
 148 "m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1)",
 149 ["m mat3(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1)"]);
 150
 151heading("Mat4 parameter tests.");
 152testParametersProperty("Mat4 parameter.",
 153 "m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)",
 154 "m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)",
 155 ["m mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"]);
 156testParametersProperty("Mat4 parameter with negative values.",
 157 "m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)",
 158 "m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)",
 159 ["m mat4(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)"]);
 160testParametersProperty("Mat4 parameter with negative and positive values.",
 161 "m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1)",
 162 "m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1)",
 163 ["m mat4(-1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1)"]);
 164testParametersProperty("Mat4 parameter with multiple signed floats.",
 165 "m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4)",
 166 "m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4)",
 167 ["m mat4(1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4, 1, -2.2, 3.14, 0.4)"]);
 168
115169heading("Combined parameter tests.");
116 testParametersProperty("Number parameter, color parameter, transform parameter and array parameter.",
117  "n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1)",
118  "n 1, c rgb(0, 128, 0), t rotate(0deg), a array(1)",
119  ["n 1", "c rgb(0, 128, 0)", "t rotate(0deg)", "a array(1)"]);
120170\ No newline at end of file
 171testParametersProperty("Number parameter, color parameter, transform parameter, matrix parameters and array parameter.",
 172 "n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1)",
 173 "n 1, c rgb(0, 128, 0), t rotate(0deg), m1 mat2(1, 0, 0, 1), m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1), m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), a array(1)",
 174 ["n 1", "c rgb(0, 128, 0)", "t rotate(0deg)", "m1 mat2(1, 0, 0, 1)", "m2 mat3(1, 0, 0, 0, 1, 0, 0, 0, 1)", "m3 mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)", "a array(1)"]);
121175\ No newline at end of file

Source/WebCore/ChangeLog

 12013-04-21 Dirk Schulze <krit@webkit.org>
 2
 3 [Part 4] Parse the custom() function in -webkit-filter: parse the matN() functions
 4 https://bugs.webkit.org/show_bug.cgi?id=71444
 5
 6 Reviewed by Dean Jackson.
 7
 8 Custom filter parameters should support mat2 to mat4 value functions. Added parsing
 9 and style resolving bits to support the matrix function values. A later patch will
 10 add the matrices to the shader program.
 11
 12 https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#custom-filter-parameters
 13
 14 Modified existing tests to cover changes.
 15
 16 * GNUmakefile.list.am: Added WebKitCSSMatFunctionValue to individual build systems.
 17 * Target.pri:
 18 * WebCore.vcproj/WebCore.vcproj:
 19 * WebCore.vcxproj/WebCore.vcxproj:
 20 * WebCore.vcxproj/WebCore.vcxproj.filters:
 21 * WebCore.xcodeproj/project.pbxproj:
 22 * css/CSSComputedStyleDeclaration.cpp:
 23 (WebCore::valueForCustomFilterMatParameter):
 24 (WebCore):
 25 (WebCore::valueForCustomFilterParameter):
 26 * css/CSSParser.cpp:
 27 (WebCore::CSSParser::parseTransform):
 28 (WebCore::CSSParser::parseMatValue):
 29 (WebCore):
 30 (WebCore::CSSParser::parseCustomFilterParameters):
 31 * css/CSSParser.h:
 32 (WebCore):
 33 * css/CSSValue.cpp:
 34 (WebCore::CSSValue::reportMemoryUsage):
 35 (WebCore::CSSValue::equals):
 36 (WebCore::CSSValue::cssText):
 37 (WebCore::CSSValue::destroy):
 38 (WebCore::CSSValue::cloneForCSSOM):
 39 * css/CSSValue.h:
 40 (WebCore::CSSValue::isWebKitCSSMatFunctionValue):
 41 * css/StyleResolver.cpp:
 42 (WebCore::StyleResolver::parseCustomFilterArrayParameter):
 43 (WebCore::StyleResolver::parseCustomFilterParameter):
 44 * css/StyleResolver.h:
 45 (StyleResolver):
 46 * css/WebKitCSSMatFunctionValue.cpp:
 47 (WebCore::WebKitCSSMatFunctionValue::WebKitCSSMatFunctionValue):
 48 (WebCore::WebKitCSSMatFunctionValue::customCssText):
 49 (WebCore::WebKitCSSMatFunctionValue::cloneForCSSOM):
 50 (WebCore::WebKitCSSMatFunctionValue::equals):
 51 (WebCore::WebKitCSSMatFunctionValue::reportDescendantMemoryUsage):
 52 * css/WebKitCSSMatFunctionValue.h:
 53 (WebKitCSSMatFunctionValue):
 54 (WebCore::WebKitCSSMatFunctionValue::create):
 55 * platform/graphics/filters/CustomFilterArrayParameter.h:
 56 (WebCore::CustomFilterArrayParameter::create):
 57 (WebCore::CustomFilterArrayParameter::CustomFilterArrayParameter):
 58 * platform/graphics/filters/CustomFilterParameter.h:
 59 (CustomFilterParameter):
 60 * platform/graphics/filters/CustomFilterRenderer.cpp:
 61 (WebCore::CustomFilterRenderer::bindProgramParameters):
 62
1632013-04-20 Dirk Schulze <krit@webkit.org>
264
365 [Part 5] Parse color value for custom() function parameters

Source/WebCore/GNUmakefile.list.am

@@webcore_sources += \
27842784 Source/WebCore/css/WebKitCSSKeyframesRule.h \
27852785 Source/WebCore/css/WebKitCSSMatrix.cpp \
27862786 Source/WebCore/css/WebKitCSSMatrix.h \
 2787 Source/WebCore/css/WebKitCSSMatFunctionValue.cpp \
 2788 Source/WebCore/css/WebKitCSSMatFunctionValue.h \
27872789 Source/WebCore/css/WebKitCSSMixFunctionValue.cpp \
27882790 Source/WebCore/css/WebKitCSSMixFunctionValue.h \
27892791 Source/WebCore/css/WebKitCSSRegionRule.cpp \

Source/WebCore/Target.pri

@@SOURCES += \
351351 css/WebKitCSSKeyframeRule.cpp \
352352 css/WebKitCSSKeyframesRule.cpp \
353353 css/WebKitCSSMatrix.cpp \
 354 css/WebKitCSSMatFunctionValue.cpp \
354355 css/WebKitCSSMixFunctionValue.cpp \
355356 css/WebKitCSSRegionRule.cpp \
356357 css/WebKitCSSSVGDocumentValue.cpp \

@@HEADERS += \
15921593 css/WebKitCSSKeyframeRule.h \
15931594 css/WebKitCSSKeyframesRule.h \
15941595 css/WebKitCSSMatrix.h \
 1596 css/WebKitCSSMatFunctionValue.h \
15951597 css/WebKitCSSMixFunctionValue.h \
15961598 css/WebKitCSSRegionRule.h \
15971599 css/WebKitCSSSVGDocumentValue.h \

Source/WebCore/WebCore.vcproj/WebCore.vcproj

3901139011 >
3901239012 </File>
3901339013 <File
 39014 RelativePath="..\css\WebKitCSSMatFunctionValue.cpp"
 39015 >
 39016 </File>
 39017 <File
 39018 RelativePath="..\css\WebKitCSSMatFunctionValue.h"
 39019 >
 39020 </File>
 39021 <File
3901439022 RelativePath="..\css\WebKitCSSMixFunctionValue.cpp"
3901539023 >
3901639024 </File>

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

53955395 <ClCompile Include="..\css\WebKitCSSKeyframeRule.cpp" />
53965396 <ClCompile Include="..\css\WebKitCSSKeyframesRule.cpp" />
53975397 <ClCompile Include="..\css\WebKitCSSMatrix.cpp" />
 5398 <ClCompile Include="..\css\WebKitCSSMatFunctionValue.cpp" />
53985399 <ClCompile Include="..\css\WebKitCSSMixFunctionValue.cpp" />
53995400 <ClCompile Include="..\css\WebKitCSSRegionRule.cpp" />
54005401 <ClCompile Include="..\css\WebKitCSSShaderValue.cpp" />

1217712178 <ClInclude Include="..\css\WebKitCSSKeyframeRule.h" />
1217812179 <ClInclude Include="..\css\WebKitCSSKeyframesRule.h" />
1217912180 <ClInclude Include="..\css\WebKitCSSMatrix.h" />
 12181 <ClInclude Include="..\css\WebKitCSSMatFunctionValue.h" />
1218012182 <ClInclude Include="..\css\WebKitCSSMixFunctionValue.h" />
1218112183 <ClInclude Include="..\css\WebKitCSSRegionRule.h" />
1218212184 <ClInclude Include="..\css\WebKitCSSShaderValue.h" />

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

38043804 <ClCompile Include="..\css\WebKitCSSMatrix.cpp">
38053805 <Filter>css</Filter>
38063806 </ClCompile>
 3807 <ClCompile Include="..\css\WebKitCSSMatFunctionValue.cpp">
 3808 <Filter>css</Filter>
 3809 </ClCompile>
38073810 <ClCompile Include="..\css\WebKitCSSMixFunctionValue.cpp">
38083811 <Filter>css</Filter>
38093812 </ClCompile>

1058710590 <ClInclude Include="..\css\WebKitCSSMatrix.h">
1058810591 <Filter>css</Filter>
1058910592 </ClInclude>
 10593 <ClInclude Include="..\css\WebKitCSSMatFunctionValue.h">
 10594 <Filter>css</Filter>
 10595 </ClInclude>
1059010596 <ClInclude Include="..\css\WebKitCSSMixFunctionValue.h">
1059110597 <Filter>css</Filter>
1059210598 </ClInclude>

Source/WebCore/WebCore.xcodeproj/project.pbxproj

57545754 FB484F4C171F821E00040755 /* TransformFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB484F4A171F821E00040755 /* TransformFunctions.cpp */; };
57555755 FB484F4D171F821E00040755 /* TransformFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = FB484F4B171F821E00040755 /* TransformFunctions.h */; };
57565756 FB49C39D16784947007FFB5D /* CSSHostRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB49C39C16784947007FFB5D /* CSSHostRule.h */; };
 5757 FB719C3F17238CA80022DE34 /* WebKitCSSMatFunctionValue.h in Headers */ = {isa = PBXBuildFile; fileRef = FB0B75EF1723428500F05D2A /* WebKitCSSMatFunctionValue.h */; };
 5758 FB719C4017238CAE0022DE34 /* WebKitCSSMatFunctionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB0B75EE1723428500F05D2A /* WebKitCSSMatFunctionValue.cpp */; };
57575759 FB78AD2E151BF5E600FE54D3 /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = FB78AD2C151BF5D200FE54D3 /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
57585760 FB91392416AE4C17001FE682 /* DOMPath.h in Headers */ = {isa = PBXBuildFile; fileRef = FB91392016AE4B0B001FE682 /* DOMPath.h */; };
57595761 FB91392616AE4C2F001FE682 /* CanvasPathMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = FB91391F16AE4B0B001FE682 /* CanvasPathMethods.h */; };

1261812620 FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElementFactory.cpp; sourceTree = "<group>"; };
1261912621 FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; };
1262012622 FB1A66D917225A6600BAA7AF /* CustomFilterColorParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterColorParameter.h; path = filters/CustomFilterColorParameter.h; sourceTree = "<group>"; };
 12623 FB0B75EE1723428500F05D2A /* WebKitCSSMatFunctionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSMatFunctionValue.cpp; sourceTree = "<group>"; };
 12624 FB0B75EF1723428500F05D2A /* WebKitCSSMatFunctionValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSMatFunctionValue.h; sourceTree = "<group>"; };
1262112625 FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGDocumentReference.h; sourceTree = "<group>"; };
1262212626 FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGroupingRule.h; sourceTree = "<group>"; };
1262312627 FB484F4A171F821E00040755 /* TransformFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformFunctions.cpp; sourceTree = "<group>"; };

1996119965 31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */,
1996219966 31288E710E3005D6003619AE /* WebKitCSSKeyframesRule.h */,
1996319967 316FE0920E6CCD7F00BF6088 /* WebKitCSSKeyframesRule.idl */,
 19968 FB0B75EE1723428500F05D2A /* WebKitCSSMatFunctionValue.cpp */,
 19969 FB0B75EF1723428500F05D2A /* WebKitCSSMatFunctionValue.h */,
1996419970 498391550F1E776900C23782 /* WebKitCSSMatrix.cpp */,
1996519971 498391560F1E776900C23782 /* WebKitCSSMatrix.h */,
1996619972 498391570F1E776900C23782 /* WebKitCSSMatrix.idl */,

2413324139 BE8EF045171C8FF9009B48C3 /* JSAudioTrackList.h in Headers */,
2413424140 BE8EF04B171C9014009B48C3 /* JSVideoTrack.h in Headers */,
2413524141 BE8EF04D171C9014009B48C3 /* JSVideoTrackList.h in Headers */,
 24142 FB719C3F17238CA80022DE34 /* WebKitCSSMatFunctionValue.h in Headers */,
2413624143 );
2413724144 runOnlyForDeploymentPostprocessing = 0;
2413824145 };

2709627103 BE6DF70D171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp in Sources */,
2709727104 BE6DF711171CA2DA00DD52B8 /* JSAudioTrackCustom.cpp in Sources */,
2709827105 BE6DF713171CA2DA00DD52B8 /* JSAudioTrackListCustom.cpp in Sources */,
 27106 FB719C4017238CAE0022DE34 /* WebKitCSSMatFunctionValue.cpp in Sources */,
2709927107 );
2710027108 runOnlyForDeploymentPostprocessing = 0;
2710127109 };

Source/WebCore/css/CSSComputedStyleDeclaration.cpp

7878#include "CustomFilterParameter.h"
7979#include "CustomFilterTransformParameter.h"
8080#include "WebKitCSSArrayFunctionValue.h"
 81#include "WebKitCSSMatFunctionValue.h"
8182#include "WebKitCSSMixFunctionValue.h"
8283#endif
8384

@@static PassRefPtr<CSSValue> valueForCustomFilterArrayParameter(const CustomFilte
840841 return arrayParameterValue.release();
841842}
842843
 844static PassRefPtr<CSSValue> valueForCustomFilterMatParameter(const CustomFilterArrayParameter* matrixParameter)
 845{
 846 RefPtr<WebKitCSSMatFunctionValue> matrixParameterValue = WebKitCSSMatFunctionValue::create();
 847 for (unsigned i = 0, size = matrixParameter->size(); i < size; ++i)
 848 matrixParameterValue->append(cssValuePool().createValue(matrixParameter->valueAt(i), CSSPrimitiveValue::CSS_NUMBER));
 849 return matrixParameterValue.release();
 850}
 851
843852static PassRefPtr<CSSValue> valueForCustomFilterColorParameter(const CustomFilterColorParameter* colorParameter)
844853{
845854 RefPtr<CSSValueList> colorParameterValue = CSSValueList::createSpaceSeparated();

@@static PassRefPtr<CSSValue> valueForCustomFilterParameter(const RenderObject* re
873882 return valueForCustomFilterArrayParameter(static_cast<const CustomFilterArrayParameter*>(parameter));
874883 case CustomFilterParameter::COLOR:
875884 return valueForCustomFilterColorParameter(static_cast<const CustomFilterColorParameter*>(parameter));
 885 case CustomFilterParameter::MATRIX:
 886 return valueForCustomFilterMatParameter(static_cast<const CustomFilterArrayParameter*>(parameter));
876887 case CustomFilterParameter::NUMBER:
877888 return valueForCustomFilterNumberParameter(static_cast<const CustomFilterNumberParameter*>(parameter));
878889 case CustomFilterParameter::TRANSFORM:

Source/WebCore/css/CSSParser.cpp

106106
107107#if ENABLE(CSS_SHADERS)
108108#include "WebKitCSSArrayFunctionValue.h"
 109#include "WebKitCSSMatFunctionValue.h"
109110#include "WebKitCSSMixFunctionValue.h"
110111#include "WebKitCSSShaderValue.h"
111112#endif

@@PassRefPtr<CSSValueList> CSSParser::parseTransform()
83078308
83088309 return list.release();
83098310}
8310 
83118311
83128312PassRefPtr<CSSValue> CSSParser::parseTransformValue(CSSParserValue *value)
83138313{

@@PassRefPtr<WebKitCSSArrayFunctionValue> CSSParser::parseCustomFilterArrayFunctio
84658465 return arrayFunction;
84668466}
84678467
 8468PassRefPtr<WebKitCSSMatFunctionValue> CSSParser::parseMatValue(CSSParserValue* value)
 8469{
 8470 if (value->unit != CSSParserValue::Function || !value->function)
 8471 return 0;
 8472
 8473 unsigned numberOfValues = 0;
 8474 if (equalIgnoringCase(value->function->name, "mat2("))
 8475 numberOfValues = 4;
 8476 else if (equalIgnoringCase(value->function->name, "mat3("))
 8477 numberOfValues = 9;
 8478 else if (equalIgnoringCase(value->function->name, "mat4("))
 8479 numberOfValues = 16;
 8480 else
 8481 return 0;
 8482
 8483 CSSParserValueList* args = value->function->args.get();
 8484 if (!args || args->size() != (numberOfValues * 2 - 1))
 8485 return 0;
 8486
 8487 RefPtr<WebKitCSSMatFunctionValue> matValueList = WebKitCSSMatFunctionValue::create();
 8488 CSSParserValue* arg = args->current();
 8489 while (arg) {
 8490 if (!validUnit(arg, FNumber, CSSStrictMode))
 8491 return 0;
 8492 matValueList->append(cssValuePool().createValue(arg->fValue, CSSPrimitiveValue::CSS_NUMBER));
 8493 arg = args->next();
 8494
 8495 if (!arg)
 8496 break;
 8497
 8498 if (!isComma(arg))
 8499 return 0;
 8500
 8501 arg = args->next();
 8502 }
 8503
 8504 if (!matValueList || matValueList->length() != numberOfValues)
 8505 return 0;
 8506
 8507 return matValueList.release();
 8508}
 8509
84688510PassRefPtr<WebKitCSSMixFunctionValue> CSSParser::parseMixFunction(CSSParserValue* value)
84698511{
84708512 ASSERT(value->unit == CSSParserValue::Function && value->function);

@@PassRefPtr<CSSValueList> CSSParser::parseCustomFilterParameters(CSSParserValueLi
85528594 if (arg->unit == CSSParserValue::Function && arg->function) {
85538595 // FIXME: Implement parsing for the other parameter types.
85548596 // textures: https://bugs.webkit.org/show_bug.cgi?id=71442
8555  // mat2, mat3, mat4: https://bugs.webkit.org/show_bug.cgi?id=71444
85568597 if (equalIgnoringCase(arg->function->name, "array(")) {
85578598 parameterValue = parseCustomFilterArrayFunction(arg);
85588599 // This parsing step only consumes function arguments,
85598600 // argsList is therefore moved forward explicitely.
85608601 argsList->next();
8561  } else
8562  parameterValue = parseCustomFilterTransform(argsList);
 8602 } else {
 8603 // Parse mat2, mat3 and mat4 functions.
 8604 parameterValue = parseMatValue(arg);
 8605 if (!parameterValue && arg)
 8606 parameterValue = parseCustomFilterTransform(argsList);
 8607 else if (parameterValue)
 8608 argsList->next();
 8609 }
85638610 } else if (validUnit(arg, FNumber, CSSStrictMode)) {
85648611 RefPtr<CSSValueList> paramValueList = CSSValueList::createSpaceSeparated();
85658612 while (arg) {

Source/WebCore/css/CSSParser.h

@@class StyledElement;
6868
6969#if ENABLE(CSS_SHADERS)
7070class WebKitCSSArrayFunctionValue;
 71class WebKitCSSMatFunctionValue;
7172class WebKitCSSMixFunctionValue;
7273class WebKitCSSShaderValue;
7374#endif

@@public:
246247 PassRefPtr<CSSValueList> parseFilter();
247248 PassRefPtr<WebKitCSSFilterValue> parseBuiltinFilterArguments(CSSParserValueList*, WebKitCSSFilterValue::FilterOperationType);
248249#if ENABLE(CSS_SHADERS)
 250 PassRefPtr<WebKitCSSMatFunctionValue> parseMatValue(CSSParserValue*);
249251 PassRefPtr<WebKitCSSMixFunctionValue> parseMixFunction(CSSParserValue*);
250252 PassRefPtr<WebKitCSSArrayFunctionValue> parseCustomFilterArrayFunction(CSSParserValue*);
251253 PassRefPtr<CSSValueList> parseCustomFilterTransform(CSSParserValueList*);

Source/WebCore/css/CSSValue.cpp

5858#include "WebCoreMemoryInstrumentation.h"
5959#include "WebKitCSSArrayFunctionValue.h"
6060#include "WebKitCSSFilterValue.h"
 61#include "WebKitCSSMatFunctionValue.h"
6162#include "WebKitCSSMixFunctionValue.h"
6263#include "WebKitCSSShaderValue.h"
6364#include "WebKitCSSTransformValue.h"

@@void CSSValue::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
233234 case WebKitCSSArrayFunctionValueClass:
234235 static_cast<const WebKitCSSArrayFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
235236 return;
 237 case WebKitCSSMatFunctionValueClass:
 238 static_cast<const WebKitCSSMatFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
 239 return;
236240 case WebKitCSSMixFunctionValueClass:
237241 static_cast<const WebKitCSSMixFunctionValue*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
238242 return;

@@bool CSSValue::equals(const CSSValue& other) const
351355#if ENABLE(CSS_SHADERS)
352356 case WebKitCSSArrayFunctionValueClass:
353357 return compareCSSValues<WebKitCSSArrayFunctionValue>(*this, other);
 358 case WebKitCSSMatFunctionValueClass:
 359 return compareCSSValues<WebKitCSSMatFunctionValue>(*this, other);
354360 case WebKitCSSMixFunctionValueClass:
355361 return compareCSSValues<WebKitCSSMixFunctionValue>(*this, other);
356362 case WebKitCSSShaderClass:

@@String CSSValue::cssText() const
449455#if ENABLE(CSS_SHADERS)
450456 case WebKitCSSArrayFunctionValueClass:
451457 return static_cast<const WebKitCSSArrayFunctionValue*>(this)->customCssText();
 458 case WebKitCSSMatFunctionValueClass:
 459 return static_cast<const WebKitCSSMatFunctionValue*>(this)->customCssText();
452460 case WebKitCSSMixFunctionValueClass:
453461 return static_cast<const WebKitCSSMixFunctionValue*>(this)->customCssText();
454462 case WebKitCSSShaderClass:

@@void CSSValue::destroy()
588596 case WebKitCSSArrayFunctionValueClass:
589597 delete static_cast<WebKitCSSArrayFunctionValue*>(this);
590598 return;
 599 case WebKitCSSMatFunctionValueClass:
 600 delete static_cast<WebKitCSSMatFunctionValue*>(this);
 601 return;
591602 case WebKitCSSMixFunctionValueClass:
592603 delete static_cast<WebKitCSSMixFunctionValue*>(this);
593604 return;

@@PassRefPtr<CSSValue> CSSValue::cloneForCSSOM() const
632643#if ENABLE(CSS_SHADERS)
633644 case WebKitCSSArrayFunctionValueClass:
634645 return static_cast<const WebKitCSSArrayFunctionValue*>(this)->cloneForCSSOM();
 646 case WebKitCSSMatFunctionValueClass:
 647 return static_cast<const WebKitCSSMatFunctionValue*>(this)->cloneForCSSOM();
635648 case WebKitCSSMixFunctionValueClass:
636649 return static_cast<const WebKitCSSMixFunctionValue*>(this)->cloneForCSSOM();
637650#endif

Source/WebCore/css/CSSValue.h

@@public:
9595 bool isWebKitCSSFilterValue() const { return m_classType == WebKitCSSFilterClass; }
9696#if ENABLE(CSS_SHADERS)
9797 bool isWebKitCSSArrayFunctionValue() const { return m_classType == WebKitCSSArrayFunctionValueClass; }
 98 bool isWebKitCSSMatFunctionValue() const { return m_classType == WebKitCSSMatFunctionValueClass; }
9899 bool isWebKitCSSMixFunctionValue() const { return m_classType == WebKitCSSMixFunctionValueClass; }
99100 bool isWebKitCSSShaderValue() const { return m_classType == WebKitCSSShaderClass; }
100101#endif

@@protected:
186187 WebKitCSSFilterClass,
187188#if ENABLE(CSS_SHADERS)
188189 WebKitCSSArrayFunctionValueClass,
 190 WebKitCSSMatFunctionValueClass,
189191 WebKitCSSMixFunctionValueClass,
190192#endif
191193#endif

Source/WebCore/css/StyleResolver.cpp

@@static bool sortParametersByNameComparator(const RefPtr<CustomFilterParameter>&
36793679 return codePointCompareLessThan(a->name(), b->name());
36803680}
36813681
3682 PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterArrayParameter(const String& name, CSSValueList* values)
 3682PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterArrayParameter(const String& name, CSSValueList* values, bool isArray)
36833683{
3684  RefPtr<CustomFilterArrayParameter> arrayParameter = CustomFilterArrayParameter::create(name);
 3684 RefPtr<CustomFilterArrayParameter> arrayParameter = CustomFilterArrayParameter::create(name, isArray ? CustomFilterArrayParameter::ARRAY : CustomFilterArrayParameter::MATRIX);
36853685 for (unsigned i = 0, length = values->length(); i < length; ++i) {
36863686 CSSValue* value = values->itemWithoutBoundsCheck(i);
36873687 if (!value->isPrimitiveValue())

@@PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterParameter(cons
37423742 return 0;
37433743
37443744 if (parameterValue->isWebKitCSSArrayFunctionValue())
3745  return parseCustomFilterArrayParameter(name, values);
 3745 return parseCustomFilterArrayParameter(name, values, true);
 3746
 3747 if (parameterValue->isWebKitCSSMatFunctionValue())
 3748 return parseCustomFilterArrayParameter(name, values, false);
37463749
37473750 // If the first value of the list is a transform function,
37483751 // then we could safely assume that all the remaining items

Source/WebCore/css/StyleResolver.h

@@public:
314314 StyleShader* cachedOrPendingStyleShaderFromValue(WebKitCSSShaderValue*);
315315 bool parseCustomFilterParameterList(CSSValue*, CustomFilterParameterList&);
316316 PassRefPtr<CustomFilterParameter> parseCustomFilterParameter(const String& name, CSSValue*);
317  PassRefPtr<CustomFilterParameter> parseCustomFilterArrayParameter(const String& name, CSSValueList*);
318317 PassRefPtr<CustomFilterParameter> parseCustomFilterColorParameter(const String& name, CSSValueList*);
 318 PassRefPtr<CustomFilterParameter> parseCustomFilterArrayParameter(const String& name, CSSValueList*, bool);
319319 PassRefPtr<CustomFilterParameter> parseCustomFilterNumberParameter(const String& name, CSSValueList*);
320320 PassRefPtr<CustomFilterParameter> parseCustomFilterTransformParameter(const String& name, CSSValueList*);
321321 PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleReferenceSyntax(WebKitCSSFilterValue*);

Source/WebCore/css/WebKitCSSMatFunctionValue.cpp

 1/*
 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 *
 8 * 1. Redistributions of source code must retain the above
 9 * copyright notice, this list of conditions and the following
 10 * disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above
 12 * copyright notice, this list of conditions and the following
 13 * disclaimer in the documentation and/or other materials
 14 * provided with the distribution.
 15 *
 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 21 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 27 * SUCH DAMAGE.
 28 */
 29
 30#include "config.h"
 31#include "WebKitCSSMatFunctionValue.h"
 32
 33#include "WebCoreMemoryInstrumentation.h"
 34
 35#if ENABLE(CSS_SHADERS)
 36
 37namespace WebCore {
 38
 39WebKitCSSMatFunctionValue::WebKitCSSMatFunctionValue()
 40 : CSSValueList(WebKitCSSMatFunctionValueClass, CommaSeparator)
 41{
 42}
 43
 44WebKitCSSMatFunctionValue::WebKitCSSMatFunctionValue(const WebKitCSSMatFunctionValue& cloneFrom)
 45 : CSSValueList(cloneFrom)
 46{
 47}
 48
 49String WebKitCSSMatFunctionValue::customCssText() const
 50{
 51 StringBuilder builder;
 52 if (length() == 4)
 53 builder.append("mat2(");
 54 else if (length() == 9)
 55 builder.append("mat3(");
 56 else if (length() == 16)
 57 builder.append("mat4(");
 58 else {
 59 ASSERT_NOT_REACHED();
 60 return String();
 61 }
 62
 63 builder.append(CSSValueList::customCssText());
 64 builder.append(')');
 65 return builder.toString();
 66}
 67
 68PassRefPtr<WebKitCSSMatFunctionValue> WebKitCSSMatFunctionValue::cloneForCSSOM() const
 69{
 70 return adoptRef(new WebKitCSSMatFunctionValue(*this));
 71}
 72
 73bool WebKitCSSMatFunctionValue::equals(const WebKitCSSMatFunctionValue& other) const
 74{
 75 return CSSValueList::equals(other);
 76}
 77
 78void WebKitCSSMatFunctionValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 79{
 80 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
 81 CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo);
 82}
 83
 84} // namespace WebCore
 85
 86#endif // ENABLE(CSS_SHADERS)

Source/WebCore/css/WebKitCSSMatFunctionValue.h

 1/*
 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 *
 8 * 1. Redistributions of source code must retain the above
 9 * copyright notice, this list of conditions and the following
 10 * disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above
 12 * copyright notice, this list of conditions and the following
 13 * disclaimer in the documentation and/or other materials
 14 * provided with the distribution.
 15 *
 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 21 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 27 * SUCH DAMAGE.
 28 */
 29
 30#ifndef WebKitCSSMatFunctionValue_h
 31#define WebKitCSSMatFunctionValue_h
 32
 33#if ENABLE(CSS_SHADERS)
 34
 35#include "CSSValueList.h"
 36#include <wtf/PassRefPtr.h>
 37
 38namespace WebCore {
 39
 40class WebKitCSSMatFunctionValue : public CSSValueList {
 41public:
 42 static PassRefPtr<WebKitCSSMatFunctionValue> create()
 43 {
 44 return adoptRef(new WebKitCSSMatFunctionValue());
 45 }
 46
 47 String customCssText() const;
 48
 49 PassRefPtr<WebKitCSSMatFunctionValue> cloneForCSSOM() const;
 50
 51 bool equals(const WebKitCSSMatFunctionValue&) const;
 52
 53 void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
 54
 55private:
 56 WebKitCSSMatFunctionValue();
 57 WebKitCSSMatFunctionValue(const WebKitCSSMatFunctionValue& cloneFrom);
 58};
 59
 60} // namespace WebCore
 61
 62#endif // ENABLE(CSS_SHADERS)
 63
 64#endif

Source/WebCore/platform/graphics/filters/CustomFilterArrayParameter.h

@@namespace WebCore {
3939
4040class CustomFilterArrayParameter : public CustomFilterParameter {
4141public:
42  static PassRefPtr<CustomFilterArrayParameter> create(const String& name)
 42 static PassRefPtr<CustomFilterArrayParameter> create(const String& name, CustomFilterParameter::ParameterType parameterType = CustomFilterParameter::ARRAY)
4343 {
44  return adoptRef(new CustomFilterArrayParameter(name));
 44 return adoptRef(new CustomFilterArrayParameter(parameterType, name));
4545 }
4646
4747 unsigned size() const { return m_data.size(); }

@@public:
7676 }
7777
7878private:
79  CustomFilterArrayParameter(const String& name)
80  : CustomFilterParameter(ARRAY, name)
 79 CustomFilterArrayParameter(ParameterType parameterType, const String& name)
 80 : CustomFilterParameter(parameterType, name)
8181 {
8282 }
8383

Source/WebCore/platform/graphics/filters/CustomFilterParameter.h

@@class CustomFilterParameter : public RefCounted<CustomFilterParameter> {
4141public:
4242 // FIXME: Implement other parameters types:
4343 // textures: https://bugs.webkit.org/show_bug.cgi?id=71442
44  // mat2, mat3, mat4: https://bugs.webkit.org/show_bug.cgi?id=71444
4544 enum ParameterType {
4645 ARRAY,
4746 COLOR,
 47 MATRIX,
4848 NUMBER,
4949 TRANSFORM
5050 };

Source/WebCore/platform/graphics/filters/CustomFilterRenderer.cpp

@@void CustomFilterRenderer::bindProgramParameters()
215215 case CustomFilterParameter::ARRAY:
216216 bindProgramArrayParameters(uniformLocation, static_cast<CustomFilterArrayParameter*>(parameter));
217217 break;
218  case CustomFilterParameter::COLOR:
219  // FIXME: Bind color to context.
 218 case CustomFilterParameter::COLOR:
 219 case CustomFilterParameter::MATRIX:
 220 // FIXME: Bind color and matrix to context.
220221 break;
221222 case CustomFilterParameter::NUMBER:
222223 bindProgramNumberParameters(uniformLocation, static_cast<CustomFilterNumberParameter*>(parameter));