| OLD | NEW |
| 1 // Valid values for both shape-inside and shape-outside. Two values are specifie
d when the shape property value | 1 // Valid values for both shape-inside and shape-outside. Two values are specifie
d when the shape property value |
| 2 // differs from the specified value. Three values are specified when the compute
d shape property value differs | 2 // differs from the specified value. Three values are specified when the compute
d shape property value differs |
| 3 // from the specified value. | 3 // from the specified value. |
| 4 // eg: "specified value/CSS Text value/computed style value" | 4 // eg: "specified value/CSS Text value/computed style value" |
| 5 // or: ["specified value", "CSS Text value/computed style value"] | 5 // or: ["specified value", "CSS Text value/computed style value"] |
| 6 // or: ["specified value", "CSS Text value", "Computed style value"] | 6 // or: ["specified value", "CSS Text value", "Computed style value"] |
| 7 var validShapeValues = [ | 7 var validShapeValues = [ |
| 8 "none", | 8 "none", |
| 9 | 9 |
| 10 "inset(10px)", | 10 "inset(10px)", |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 shouldBeEqualToString('getComputedStyleValue("' + property + '", "' + value
+ '")', expectedValue); | 246 shouldBeEqualToString('getComputedStyleValue("' + property + '", "' + value
+ '")', expectedValue); |
| 247 } | 247 } |
| 248 | 248 |
| 249 function testNotInheritedShapeChildProperty(property, parentValue, childValue, e
xpectedChildValue) | 249 function testNotInheritedShapeChildProperty(property, parentValue, childValue, e
xpectedChildValue) |
| 250 { | 250 { |
| 251 shouldBeEqualToString('getChildComputedStyle("' + property + '", "' + parent
Value + '", "' + childValue + '")', expectedChildValue); | 251 shouldBeEqualToString('getChildComputedStyle("' + property + '", "' + parent
Value + '", "' + childValue + '")', expectedChildValue); |
| 252 } | 252 } |
| 253 | 253 |
| 254 // Need to remove the base URL to avoid having local paths in the expected resul
ts. | 254 // Need to remove the base URL to avoid having local paths in the expected resul
ts. |
| 255 function removeBaseURL(src) { | 255 function removeBaseURL(src) { |
| 256 var urlRegexp = /url\(([^\)]*)\)/g; | 256 var urlRegexp = /url\(\"([^\)]*)\)/g; |
| 257 return src.replace(urlRegexp, function(match, url) { | 257 return src.replace(urlRegexp, function(match, url) { |
| 258 return "url(" + url.substr(url.lastIndexOf("/") + 1) + ")"; | 258 return 'url(\"' + url.substr(url.lastIndexOf("/") + 1) + ")"; |
| 259 }); | 259 }); |
| 260 } | 260 } |
| 261 | 261 |
| 262 function testLocalURLShapeProperty(property, value, expected) | 262 function testLocalURLShapeProperty(property, value, expected) |
| 263 { | 263 { |
| 264 shouldBeEqualToString('removeBaseURL(getCSSText("' + property + '", "' + val
ue + '"))', expected); | 264 shouldBeEqualToString('removeBaseURL(getCSSText("' + property + '", "' + val
ue + '"))', expected); |
| 265 shouldBeEqualToString('removeBaseURL(getComputedStyleValue("' + property + '
", "' + value + '"))', expected); | 265 shouldBeEqualToString('removeBaseURL(getComputedStyleValue("' + property + '
", "' + value + '"))', expected); |
| 266 } | 266 } |
| 267 | 267 |
| 268 function testShapePropertyParsingFailure(property, value, defaultComputedStyle) | 268 function testShapePropertyParsingFailure(property, value, defaultComputedStyle) |
| 269 { | 269 { |
| 270 shouldBeEqualToString('getCSSText("' + property + '", "' + value + '")', '')
; | 270 shouldBeEqualToString('getCSSText("' + property + '", "' + value + '")', '')
; |
| 271 shouldBeEqualToString('getComputedStyleValue("' + property + '", "' + value
+ '")', defaultComputedStyle); | 271 shouldBeEqualToString('getComputedStyleValue("' + property + '", "' + value
+ '")', defaultComputedStyle); |
| 272 } | 272 } |
| 273 | 273 |
| 274 function testNotInheritedShapeProperty(property, parentValue, childValue, expect
edValue) | 274 function testNotInheritedShapeProperty(property, parentValue, childValue, expect
edValue) |
| 275 { | 275 { |
| 276 shouldBeEqualToString('getParentAndChildComputedStylesString("' + property +
'", "' + parentValue + '", "' + childValue + '")', expectedValue); | 276 shouldBeEqualToString('getParentAndChildComputedStylesString("' + property +
'", "' + parentValue + '", "' + childValue + '")', expectedValue); |
| 277 } | 277 } |
| 278 | 278 |
| 279 function applyToEachArglist(testFunction, arglists) | 279 function applyToEachArglist(testFunction, arglists) |
| 280 { | 280 { |
| 281 arglists.forEach(function(arglist, i, a) {testFunction.apply(null, arglist);
}); | 281 arglists.forEach(function(arglist, i, a) {testFunction.apply(null, arglist);
}); |
| 282 } | 282 } |
| OLD | NEW |