| OLD | NEW |
| 1 description("Test the computed style of the -webkit-filter property."); | 1 description("Test the computed style of the -webkit-filter property."); |
| 2 | 2 |
| 3 // These have to be global for the test helpers to see them. | 3 // These have to be global for the test helpers to see them. |
| 4 var stylesheet, filterStyle, subRule; | 4 var filterStyle; |
| 5 var styleElement = document.createElement("style"); | 5 var styleElement = document.createElement("style"); |
| 6 document.head.appendChild(styleElement); | 6 document.head.appendChild(styleElement); |
| 7 stylesheet = styleElement.sheet; | 7 var stylesheet = styleElement.sheet; |
| 8 | 8 |
| 9 function testComputedFilterRule(description, rule, expectedLength, expectedTypes
, expectedTexts) | 9 function testComputedFilterRule(description, rule, expectedValue) |
| 10 { | 10 { |
| 11 if (expectedValue === undefined) |
| 12 expectedValue = rule; |
| 13 |
| 11 debug(""); | 14 debug(""); |
| 12 debug(description + " : " + rule); | 15 debug(description + " : " + rule); |
| 13 | 16 |
| 14 stylesheet.insertRule("body { -webkit-filter: " + rule + "; }", 0); | 17 stylesheet.insertRule("body { -webkit-filter: " + rule + "; }", 0); |
| 15 | 18 |
| 16 filterStyle = window.getComputedStyle(document.body).getPropertyCSSValue('-w
ebkit-filter'); | 19 filterStyle = window.getComputedStyle(document.body).getPropertyValue('-webk
it-filter'); |
| 17 shouldBe("filterStyle.length", "" + expectedLength); | 20 shouldBeEqualToString("filterStyle", expectedValue); |
| 18 for (var i = 0; i < expectedLength; i++) { | |
| 19 subRule = filterStyle[i]; | |
| 20 shouldBe("subRule.operationType", expectedTypes[i]); | |
| 21 shouldBe("subRule.cssText", "'" + expectedTexts[i] + "'"); | |
| 22 } | |
| 23 stylesheet.deleteRule(0); | 21 stylesheet.deleteRule(0); |
| 24 } | 22 } |
| 25 | 23 |
| 26 testComputedFilterRule("Basic reference", | 24 testComputedFilterRule("Basic reference", "url('#a')"); |
| 27 "url('#a')", 1, | 25 testComputedFilterRule("Bare unquoted reference converting to quoted form", "url
(#a)", "url('#a')"); |
| 28 ["WebKitCSSFilterValue.CSS_FILTER_REFERENCE"], | 26 testComputedFilterRule("Multiple references", "url('#a') url('#b')"); |
| 29 ["url(\\'#a\\')"]); | 27 testComputedFilterRule("Reference as 2nd value", "grayscale(1) url('#a')"); |
| 30 | 28 testComputedFilterRule("Integer value", "grayscale(1)"); |
| 31 testComputedFilterRule("Bare unquoted reference converting to quoted form", | 29 testComputedFilterRule("Float value converts to integer", "grayscale(1.0)", "gra
yscale(1)"); |
| 32 "url(#a)", 1, | 30 testComputedFilterRule("Zero value", "grayscale(0)"); |
| 33 ["WebKitCSSFilterValue.CSS_FILTER_REFERENCE"], | 31 testComputedFilterRule("No values", "grayscale()", "grayscale(1)"); |
| 34 ["url(\\'#a\\')"]); | 32 testComputedFilterRule("Multiple values", "grayscale(0.5) grayscale(0.25)"); |
| 35 | 33 testComputedFilterRule("Integer value", "sepia(1)"); |
| 36 testComputedFilterRule("Multiple references", | 34 testComputedFilterRule("Float value converts to integer", "sepia(1.0)", "sepia(1
)"); |
| 37 "url('#a') url('#b')", 2, | 35 testComputedFilterRule("Zero value", "sepia(0)"); |
| 38 ["WebKitCSSFilterValue.CSS_FILTER_REFERENCE", "WebKitCSSF
ilterValue.CSS_FILTER_REFERENCE"], | 36 testComputedFilterRule("No values", "sepia()", "sepia(1)"); |
| 39 ["url(\\'#a\\')", "url(\\'#b\\')"]); | 37 testComputedFilterRule("Multiple values", "sepia(0.5) sepia(0.25)"); |
| 40 | 38 testComputedFilterRule("Rule combinations", "sepia(0.5) grayscale(0.25)"); |
| 41 testComputedFilterRule("Reference as 2nd value", | 39 testComputedFilterRule("Integer value", "saturate(1)"); |
| 42 "grayscale(1) url('#a')", 2, | 40 testComputedFilterRule("Float value converts to integer", "saturate(1.0)", "satu
rate(1)"); |
| 43 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE", "WebKitCSSF
ilterValue.CSS_FILTER_REFERENCE"], | 41 testComputedFilterRule("Zero value", "saturate(0)"); |
| 44 ["grayscale(1)", "url(\\'#a\\')"]); | 42 testComputedFilterRule("No values", "saturate()", "saturate(1)"); |
| 45 | 43 testComputedFilterRule("Multiple values", "saturate(0.5) saturate(0.25)"); |
| 46 testComputedFilterRule("Integer value", | 44 testComputedFilterRule("Rule combinations", "saturate(0.5) grayscale(0.25)"); |
| 47 "grayscale(1)", 1, | 45 testComputedFilterRule("Degrees value as integer", "hue-rotate(10deg)"); |
| 48 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], | 46 testComputedFilterRule("Degrees float value converts to integer", "hue-rotate(10
.0deg)", "hue-rotate(10deg)"); |
| 49 ["grayscale(1)"]); | 47 testComputedFilterRule("Radians value", "hue-rotate(10rad)", "hue-rotate(572.957
795130823deg)"); |
| 50 | 48 testComputedFilterRule("Gradians value", "hue-rotate(10grad)", "hue-rotate(9deg)
"); |
| 51 testComputedFilterRule("Float value converts to integer", | 49 testComputedFilterRule("Turns value", "hue-rotate(0.5turn)", "hue-rotate(180deg)
"); |
| 52 "grayscale(1.0)", 1, | 50 testComputedFilterRule("Zero value", "hue-rotate(0)", "hue-rotate(0deg)"); |
| 53 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], | 51 testComputedFilterRule("No values", "hue-rotate()", "hue-rotate(0deg)"); |
| 54 ["grayscale(1)"]); | 52 testComputedFilterRule("Rule combinations", "hue-rotate(10deg) grayscale(0.25)")
; |
| 55 | 53 testComputedFilterRule("Integer value", "invert(1)"); |
| 56 testComputedFilterRule("Zero value", | 54 testComputedFilterRule("Float value converts to integer", "invert(1.0)", "invert
(1)"); |
| 57 "grayscale(0)", 1, | 55 testComputedFilterRule("Zero value", "invert(0)"); |
| 58 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], | 56 testComputedFilterRule("No values", "invert()", "invert(1)"); |
| 59 ["grayscale(0)"]); | 57 testComputedFilterRule("Multiple values", "invert(0.5) invert(0.25)"); |
| 60 | 58 testComputedFilterRule("Rule combinations", "invert(0.5) grayscale(0.25)"); |
| 61 testComputedFilterRule("No values", | 59 testComputedFilterRule("Integer value", "opacity(1)"); |
| 62 "grayscale()", 1, | 60 testComputedFilterRule("Float value converts to integer", "opacity(1.0)", "opaci
ty(1)"); |
| 63 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], | 61 testComputedFilterRule("Zero value", "opacity(0)"); |
| 64 ["grayscale(1)"]); | 62 testComputedFilterRule("No values", "opacity()", "opacity(1)"); |
| 65 | 63 testComputedFilterRule("Multiple values", "opacity(0.5) opacity(0.25)"); |
| 66 testComputedFilterRule("Multiple values", | 64 testComputedFilterRule("Rule combinations", "opacity(0.5) grayscale(0.25)"); |
| 67 "grayscale(0.5) grayscale(0.25)", 2, | 65 testComputedFilterRule("Integer value", "brightness(1)"); |
| 68 ["WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE", "WebKitCSSF
ilterValue.CSS_FILTER_GRAYSCALE"], | 66 testComputedFilterRule("Float value converts to integer", "brightness(1.0)", "br
ightness(1)"); |
| 69 ["grayscale(0.5)", "grayscale(0.25)"]); | 67 testComputedFilterRule("Zero value", "brightness(0)"); |
| 70 | 68 testComputedFilterRule("No values", "brightness()", "brightness(0)"); |
| 71 testComputedFilterRule("Integer value", | 69 testComputedFilterRule("Multiple values", "brightness(0.5) brightness(0.25)"); |
| 72 "sepia(1)", 1, | 70 testComputedFilterRule("Rule combinations", "brightness(0.5) grayscale(0.25)"); |
| 73 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA"], | 71 testComputedFilterRule("Integer value", "contrast(1)"); |
| 74 ["sepia(1)"]); | 72 testComputedFilterRule("Value greater than 1", "contrast(2)"); |
| 75 | 73 testComputedFilterRule("Float value converts to integer", "contrast(1.0)", "cont
rast(1)"); |
| 76 testComputedFilterRule("Float value converts to integer", | 74 testComputedFilterRule("Zero value", "contrast(0)"); |
| 77 "sepia(1.0)", 1, | 75 testComputedFilterRule("No values", "contrast()", "contrast(1)"); |
| 78 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA"], | 76 testComputedFilterRule("Multiple values", "contrast(0.5) contrast(0.25)"); |
| 79 ["sepia(1)"]); | 77 testComputedFilterRule("Rule combinations", "contrast(0.5) grayscale(0.25)"); |
| 80 | 78 testComputedFilterRule("One zero to px", "blur(0)", "blur(0px)"); |
| 81 testComputedFilterRule("Zero value", | 79 testComputedFilterRule("One length", "blur(2em)", "blur(32px)"); |
| 82 "sepia(0)", 1, | 80 testComputedFilterRule("One length", "blur(5px)"); |
| 83 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA"], | 81 testComputedFilterRule("No values", "blur()", "blur(0px)"); |
| 84 ["sepia(0)"]); | |
| 85 | |
| 86 testComputedFilterRule("No values", | |
| 87 "sepia()", 1, | |
| 88 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA"], | |
| 89 ["sepia(1)"]); | |
| 90 | |
| 91 testComputedFilterRule("Multiple values", | |
| 92 "sepia(0.5) sepia(0.25)", 2, | |
| 93 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA", "WebKitCSSFilte
rValue.CSS_FILTER_SEPIA"], | |
| 94 ["sepia(0.5)", "sepia(0.25)"]); | |
| 95 | |
| 96 testComputedFilterRule("Rule combinations", | |
| 97 "sepia(0.5) grayscale(0.25)", 2, | |
| 98 ["WebKitCSSFilterValue.CSS_FILTER_SEPIA", "WebKitCSSFilte
rValue.CSS_FILTER_GRAYSCALE"], | |
| 99 ["sepia(0.5)", "grayscale(0.25)"]); | |
| 100 | |
| 101 testComputedFilterRule("Integer value", | |
| 102 "saturate(1)", 1, | |
| 103 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE"], | |
| 104 ["saturate(1)"]); | |
| 105 | |
| 106 testComputedFilterRule("Float value converts to integer", | |
| 107 "saturate(1.0)", 1, | |
| 108 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE"], | |
| 109 ["saturate(1)"]); | |
| 110 | |
| 111 testComputedFilterRule("Zero value", | |
| 112 "saturate(0)", 1, | |
| 113 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE"], | |
| 114 ["saturate(0)"]); | |
| 115 | |
| 116 testComputedFilterRule("No values", | |
| 117 "saturate()", 1, | |
| 118 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE"], | |
| 119 ["saturate(1)"]); | |
| 120 | |
| 121 testComputedFilterRule("Multiple values", | |
| 122 "saturate(0.5) saturate(0.25)", 2, | |
| 123 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE", "WebKitCSSFi
lterValue.CSS_FILTER_SATURATE"], | |
| 124 ["saturate(0.5)", "saturate(0.25)"]); | |
| 125 | |
| 126 testComputedFilterRule("Rule combinations", | |
| 127 "saturate(0.5) grayscale(0.25)", 2, | |
| 128 ["WebKitCSSFilterValue.CSS_FILTER_SATURATE", "WebKitCSSFi
lterValue.CSS_FILTER_GRAYSCALE"], | |
| 129 ["saturate(0.5)", "grayscale(0.25)"]); | |
| 130 | |
| 131 testComputedFilterRule("Degrees value as integer", | |
| 132 "hue-rotate(10deg)", 1, | |
| 133 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 134 ["hue-rotate(10deg)"]); | |
| 135 | |
| 136 testComputedFilterRule("Degrees float value converts to integer", | |
| 137 "hue-rotate(10.0deg)", 1, | |
| 138 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 139 ["hue-rotate(10deg)"]); | |
| 140 | |
| 141 testComputedFilterRule("Radians value", | |
| 142 "hue-rotate(10rad)", 1, | |
| 143 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 144 ["hue-rotate(572.957795130823deg)"]); | |
| 145 | |
| 146 testComputedFilterRule("Gradians value", | |
| 147 "hue-rotate(10grad)", 1, | |
| 148 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 149 ["hue-rotate(9deg)"]); | |
| 150 | |
| 151 testComputedFilterRule("Turns value", | |
| 152 "hue-rotate(0.5turn)", 1, | |
| 153 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 154 ["hue-rotate(180deg)"]); | |
| 155 | |
| 156 testComputedFilterRule("Zero value", | |
| 157 "hue-rotate(0)", 1, | |
| 158 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 159 ["hue-rotate(0deg)"]); | |
| 160 | |
| 161 testComputedFilterRule("No values", | |
| 162 "hue-rotate()", 1, | |
| 163 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE"], | |
| 164 ["hue-rotate(0deg)"]); | |
| 165 | |
| 166 testComputedFilterRule("Rule combinations", | |
| 167 "hue-rotate(10deg) grayscale(0.25)", 2, | |
| 168 ["WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE", "WebKitCSS
FilterValue.CSS_FILTER_GRAYSCALE"], | |
| 169 ["hue-rotate(10deg)", "grayscale(0.25)"]); | |
| 170 | |
| 171 testComputedFilterRule("Integer value", | |
| 172 "invert(1)", 1, | |
| 173 ["WebKitCSSFilterValue.CSS_FILTER_INVERT"], | |
| 174 ["invert(1)"]); | |
| 175 | |
| 176 testComputedFilterRule("Float value converts to integer", | |
| 177 "invert(1.0)", 1, | |
| 178 ["WebKitCSSFilterValue.CSS_FILTER_INVERT"], | |
| 179 ["invert(1)"]); | |
| 180 | |
| 181 testComputedFilterRule("Zero value", | |
| 182 "invert(0)", 1, | |
| 183 ["WebKitCSSFilterValue.CSS_FILTER_INVERT"], | |
| 184 ["invert(0)"]); | |
| 185 | |
| 186 testComputedFilterRule("No values", | |
| 187 "invert()", 1, | |
| 188 ["WebKitCSSFilterValue.CSS_FILTER_INVERT"], | |
| 189 ["invert(1)"]); | |
| 190 | |
| 191 testComputedFilterRule("Multiple values", | |
| 192 "invert(0.5) invert(0.25)", 2, | |
| 193 ["WebKitCSSFilterValue.CSS_FILTER_INVERT", "WebKitCSSFilt
erValue.CSS_FILTER_INVERT"], | |
| 194 ["invert(0.5)", "invert(0.25)"]); | |
| 195 | |
| 196 testComputedFilterRule("Rule combinations", | |
| 197 "invert(0.5) grayscale(0.25)", 2, | |
| 198 ["WebKitCSSFilterValue.CSS_FILTER_INVERT", "WebKitCSSFilt
erValue.CSS_FILTER_GRAYSCALE"], | |
| 199 ["invert(0.5)", "grayscale(0.25)"]); | |
| 200 | |
| 201 testComputedFilterRule("Integer value", | |
| 202 "opacity(1)", 1, | |
| 203 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY"], | |
| 204 ["opacity(1)"]); | |
| 205 | |
| 206 testComputedFilterRule("Float value converts to integer", | |
| 207 "opacity(1.0)", 1, | |
| 208 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY"], | |
| 209 ["opacity(1)"]); | |
| 210 | |
| 211 testComputedFilterRule("Zero value", | |
| 212 "opacity(0)", 1, | |
| 213 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY"], | |
| 214 ["opacity(0)"]); | |
| 215 | |
| 216 testComputedFilterRule("No values", | |
| 217 "opacity()", 1, | |
| 218 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY"], | |
| 219 ["opacity(1)"]); | |
| 220 | |
| 221 testComputedFilterRule("Multiple values", | |
| 222 "opacity(0.5) opacity(0.25)", 2, | |
| 223 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY", "WebKitCSSFil
terValue.CSS_FILTER_OPACITY"], | |
| 224 ["opacity(0.5)", "opacity(0.25)"]); | |
| 225 | |
| 226 testComputedFilterRule("Rule combinations", | |
| 227 "opacity(0.5) grayscale(0.25)", 2, | |
| 228 ["WebKitCSSFilterValue.CSS_FILTER_OPACITY", "WebKitCSSFil
terValue.CSS_FILTER_GRAYSCALE"], | |
| 229 ["opacity(0.5)", "grayscale(0.25)"]); | |
| 230 | |
| 231 testComputedFilterRule("Integer value", | |
| 232 "brightness(1)", 1, | |
| 233 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS"], | |
| 234 ["brightness(1)"]); | |
| 235 | |
| 236 testComputedFilterRule("Float value converts to integer", | |
| 237 "brightness(1.0)", 1, | |
| 238 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS"], | |
| 239 ["brightness(1)"]); | |
| 240 | |
| 241 testComputedFilterRule("Zero value", | |
| 242 "brightness(0)", 1, | |
| 243 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS"], | |
| 244 ["brightness(0)"]); | |
| 245 | |
| 246 testComputedFilterRule("No values", | |
| 247 "brightness()", 1, | |
| 248 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS"], | |
| 249 ["brightness(0)"]); | |
| 250 | |
| 251 testComputedFilterRule("Multiple values", | |
| 252 "brightness(0.5) brightness(0.25)", 2, | |
| 253 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS", "WebKitCSSF
ilterValue.CSS_FILTER_BRIGHTNESS"], | |
| 254 ["brightness(0.5)", "brightness(0.25)"]); | |
| 255 | |
| 256 testComputedFilterRule("Rule combinations", | |
| 257 "brightness(0.5) grayscale(0.25)", 2, | |
| 258 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS", "WebKitCSSF
ilterValue.CSS_FILTER_GRAYSCALE"], | |
| 259 ["brightness(0.5)", "grayscale(0.25)"]); | |
| 260 | |
| 261 testComputedFilterRule("Integer value", | |
| 262 "contrast(1)", 1, | |
| 263 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST"], | |
| 264 ["contrast(1)"]); | |
| 265 | |
| 266 testComputedFilterRule("Value greater than 1", | |
| 267 "contrast(2)", 1, | |
| 268 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST"], | |
| 269 ["contrast(2)"]); | |
| 270 | |
| 271 testComputedFilterRule("Float value converts to integer", | |
| 272 "contrast(1.0)", 1, | |
| 273 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST"], | |
| 274 ["contrast(1)"]); | |
| 275 | |
| 276 testComputedFilterRule("Zero value", | |
| 277 "contrast(0)", 1, | |
| 278 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST"], | |
| 279 ["contrast(0)"]); | |
| 280 | |
| 281 testComputedFilterRule("No values", | |
| 282 "contrast()", 1, | |
| 283 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST"], | |
| 284 ["contrast(1)"]); | |
| 285 | |
| 286 testComputedFilterRule("Multiple values", | |
| 287 "contrast(0.5) contrast(0.25)", 2, | |
| 288 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST", "WebKitCSSFil
terValue.CSS_FILTER_CONTRAST"], | |
| 289 ["contrast(0.5)", "contrast(0.25)"]); | |
| 290 | |
| 291 testComputedFilterRule("Rule combinations", | |
| 292 "contrast(0.5) grayscale(0.25)", 2, | |
| 293 ["WebKitCSSFilterValue.CSS_FILTER_CONTRAST", "WebKitCSSFil
terValue.CSS_FILTER_GRAYSCALE"], | |
| 294 ["contrast(0.5)", "grayscale(0.25)"]); | |
| 295 | |
| 296 testComputedFilterRule("One zero to px", | |
| 297 "blur(0)", 1, | |
| 298 ["WebKitCSSFilterValue.CSS_FILTER_BLUR"], | |
| 299 ["blur(0px)"]); | |
| 300 | |
| 301 testComputedFilterRule("One length", | |
| 302 "blur(2em)", 1, | |
| 303 ["WebKitCSSFilterValue.CSS_FILTER_BLUR"], | |
| 304 ["blur(32px)"]); | |
| 305 | |
| 306 testComputedFilterRule("One length", | |
| 307 "blur(5px)", 1, | |
| 308 ["WebKitCSSFilterValue.CSS_FILTER_BLUR"], | |
| 309 ["blur(5px)"]); | |
| 310 | |
| 311 testComputedFilterRule("No values", | |
| 312 "blur()", 1, | |
| 313 ["WebKitCSSFilterValue.CSS_FILTER_BLUR"], | |
| 314 ["blur(0px)"]); | |
| 315 | 82 |
| 316 testComputedFilterRule("Color then three values", | 83 testComputedFilterRule("Color then three values", |
| 317 "drop-shadow(red 1px 2px 3px)", 1, | 84 "drop-shadow(red 1px 2px 3px)", "drop-shadow(rgb(255, 0, 0) 1px 2px 3px)"); |
| 318 ["WebKitCSSFilterValue.CSS_FILTER_DROP_SHADOW"], | |
| 319 ["drop-shadow(rgb(255, 0, 0) 1px 2px 3px)"]); | |
| 320 | 85 |
| 321 testComputedFilterRule("Three values then color", | 86 testComputedFilterRule("Three values then color", |
| 322 "drop-shadow(1px 2px 3px red)", 1, | 87 "drop-shadow(1px 2px 3px red)", "drop-shadow(rgb(255, 0, 0) 1px 2px 3px)"); |
| 323 ["WebKitCSSFilterValue.CSS_FILTER_DROP_SHADOW"], | |
| 324 ["drop-shadow(rgb(255, 0, 0) 1px 2px 3px)"]); | |
| 325 | 88 |
| 326 testComputedFilterRule("Color then three values with zero length", | 89 testComputedFilterRule("Color then three values with zero length", |
| 327 "drop-shadow(#abc 0 0 0)", 1, | 90 "drop-shadow(#abc 0 0 0)", "drop-shadow(rgb(170, 187, 204) 0px 0px 0px)"); |
| 328 ["WebKitCSSFilterValue.CSS_FILTER_DROP_SHADOW"], | |
| 329 ["drop-shadow(rgb(170, 187, 204) 0px 0px 0px)"]); | |
| 330 | 91 |
| 331 testComputedFilterRule("Three values with zero length", | 92 testComputedFilterRule("Three values with zero length", |
| 332 "drop-shadow(0 0 0)", 1, | 93 "drop-shadow(0 0 0)", "drop-shadow(rgba(0, 0, 0, 0) 0px 0px 0px)"); |
| 333 ["WebKitCSSFilterValue.CSS_FILTER_DROP_SHADOW"], | |
| 334 ["drop-shadow(rgba(0, 0, 0, 0) 0px 0px 0px)"]); | |
| 335 | 94 |
| 336 testComputedFilterRule("Two values no color", | 95 testComputedFilterRule("Two values no color", |
| 337 "drop-shadow(1px 2px)", 1, | 96 "drop-shadow(1px 2px)", "drop-shadow(rgba(0, 0, 0, 0) 1px 2px 0px)"); |
| 338 ["WebKitCSSFilterValue.CSS_FILTER_DROP_SHADOW"], | |
| 339 ["drop-shadow(rgba(0, 0, 0, 0) 1px 2px 0px)"]); | |
| 340 | 97 |
| 341 testComputedFilterRule("Multiple operations", | 98 testComputedFilterRule("Multiple operations", |
| 342 "grayscale(0.5) sepia(0.25) saturate(0.75) hue-rotate(35d
eg) invert(0.2) opacity(0.9) blur(5px)", 7, | 99 "grayscale(0.5) sepia(0.25) saturate(0.75) hue-rotate(35deg) invert(0.2) opa
city(0.9) blur(5px)"); |
| 343 [ | |
| 344 "WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE", | |
| 345 "WebKitCSSFilterValue.CSS_FILTER_SEPIA", | |
| 346 "WebKitCSSFilterValue.CSS_FILTER_SATURATE", | |
| 347 "WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE", | |
| 348 "WebKitCSSFilterValue.CSS_FILTER_INVERT", | |
| 349 "WebKitCSSFilterValue.CSS_FILTER_OPACITY", | |
| 350 "WebKitCSSFilterValue.CSS_FILTER_BLUR", | |
| 351 ], | |
| 352 [ | |
| 353 "grayscale(0.5)", | |
| 354 "sepia(0.25)", | |
| 355 "saturate(0.75)", | |
| 356 "hue-rotate(35deg)", | |
| 357 "invert(0.2)", | |
| 358 "opacity(0.9)", | |
| 359 "blur(5px)" | |
| 360 ]); | |
| 361 | 100 |
| 362 testComputedFilterRule("Percentage values", | 101 testComputedFilterRule("Percentage values", |
| 363 "grayscale(50%) sepia(25%) saturate(75%) invert(20%) opaci
ty(90%) brightness(60%) contrast(30%)", 7, | 102 "grayscale(50%) sepia(25%) saturate(75%) invert(20%) opacity(90%) brightness
(60%) contrast(30%)", |
| 364 [ | 103 "grayscale(0.5) sepia(0.25) saturate(0.75) invert(0.2) opacity(0.9) brightne
ss(0.6) contrast(0.3)"); |
| 365 "WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE", | |
| 366 "WebKitCSSFilterValue.CSS_FILTER_SEPIA", | |
| 367 "WebKitCSSFilterValue.CSS_FILTER_SATURATE", | |
| 368 "WebKitCSSFilterValue.CSS_FILTER_INVERT", | |
| 369 "WebKitCSSFilterValue.CSS_FILTER_OPACITY", | |
| 370 "WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS", | |
| 371 "WebKitCSSFilterValue.CSS_FILTER_CONTRAST" | |
| 372 ], | |
| 373 [ | |
| 374 "grayscale(0.5)", | |
| 375 "sepia(0.25)", | |
| 376 "saturate(0.75)", | |
| 377 "invert(0.2)", | |
| 378 "opacity(0.9)", | |
| 379 "brightness(0.6)", | |
| 380 "contrast(0.3)" | |
| 381 ]); | |
| 382 | 104 |
| 383 successfullyParsed = true; | 105 successfullyParsed = true; |
| OLD | NEW |