OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <div id="test"> </div> | 4 <div id="test"> </div> |
5 <script> | 5 <script> |
6 description("Tests a flag to make background shorthand property not override bac
kground-size when it's already set."); | 6 description("Tests a flag to make background shorthand property not override bac
kground-size when it's already set."); |
7 | 7 |
8 var e = document.getElementById('test'); | 8 var e = document.getElementById('test'); |
9 | 9 |
10 if (window.internals) { | 10 if (window.internals) { |
11 window.internals.settings.setUseLegacyBackgroundSizeShorthandBehavior(true); | 11 window.internals.settings.setUseLegacyBackgroundSizeShorthandBehavior(true); |
12 | 12 |
13 e.style.backgroundSize = "cover"; | 13 e.style.backgroundSize = "cover"; |
14 e.style.background = "center red url(dummy://test.png) no-repeat border-box"
; | 14 e.style.background = "center red url(dummy://test.png) no-repeat border-box"
; |
15 shouldBeEqualToString("e.style.background", 'url("dummy://test.png") 50% 50%
/ cover no-repeat border-box border-box red') | 15 shouldBeEqualToString("e.style.background", 'url("dummy://test.png") center
center / cover no-repeat border-box border-box red') |
16 shouldBeEqualToString("e.style.backgroundSize", 'cover'); | 16 shouldBeEqualToString("e.style.backgroundSize", 'cover'); |
17 debug("") | 17 debug("") |
18 | 18 |
19 window.internals.settings.setUseLegacyBackgroundSizeShorthandBehavior(false)
; | 19 window.internals.settings.setUseLegacyBackgroundSizeShorthandBehavior(false)
; |
20 } | 20 } |
21 | 21 |
22 </script> | 22 </script> |
23 </body> | 23 </body> |
24 </html> | 24 </html> |
OLD | NEW |