OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <script src="../../resources/run-after-layout-and-paint.js"></script> |
| 4 <style> |
| 5 .test { |
| 6 width: 100px; |
| 7 height: 100px; |
| 8 } |
| 9 </style> |
| 10 <div class="test"></div> |
| 11 <script> |
| 12 var BorderImageWithBorderStyleNone = 1026; // From UseCounter.h |
| 13 window.jsTestIsAsync = true; |
| 14 |
| 15 shouldBeFalse("window.internals.isUseCounted(document, BorderImageWithBorderSt
yleNone)"); |
| 16 |
| 17 var style = document.querySelector('.test').style; |
| 18 |
| 19 // Set a solid border-image; expect no hit |
| 20 style.borderWidth = '20px'; |
| 21 style.borderStyle = 'solid'; |
| 22 style.borderImage = 'linear-gradient(to bottom, blue, white) 1 repeat'; |
| 23 |
| 24 runAfterLayoutAndPaint( |
| 25 function() { |
| 26 shouldBeFalse("window.internals.isUseCounted(document, BorderImageWith
BorderStyleNone)"); |
| 27 |
| 28 // Set one border to none but nuke all border widths; expect no hit |
| 29 style.borderWidth = '0px'; |
| 30 style.borderTopStyle = 'none'; |
| 31 |
| 32 runAfterLayoutAndPaint( |
| 33 function() { |
| 34 shouldBeFalse("window.internals.isUseCounted(document, BorderI
mageWithBorderStyleNone)"); |
| 35 |
| 36 // Add fill to trigger more border-image code; expect no hit |
| 37 style.borderImage = 'linear-gradient(to bottom, blue, white) f
ill 1 repeat'; |
| 38 |
| 39 runAfterLayoutAndPaint( |
| 40 function() { |
| 41 shouldBeFalse("window.internals.isUseCounted(document,
BorderImageWithBorderStyleNone)"); |
| 42 |
| 43 // Add a top border width that according to spec shoul
d be clamped to zero because |
| 44 // border-top-style is none; expect hit |
| 45 style.borderTopWidth = '10px'; |
| 46 |
| 47 runAfterLayoutAndPaint( |
| 48 function() { |
| 49 shouldBeTrue("window.internals.isUseCounted(do
cument, BorderImageWithBorderStyleNone)"); |
| 50 finishJSTest(); |
| 51 }); |
| 52 }); |
| 53 }); |
| 54 }); |
| 55 </script> |
OLD | NEW |