| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <title>Test UseCounters for border-image with border-style: none</title> | |
| 3 <script src="../../resources/js-test.js"></script> | |
| 4 <script src="../../resources/run-after-layout-and-paint.js"></script> | |
| 5 <style> | |
| 6 .test { | |
| 7 width: 100px; | |
| 8 height: 100px; | |
| 9 } | |
| 10 </style> | |
| 11 <div class="test"></div> | |
| 12 <script> | |
| 13 var BorderImageWithBorderStyleNone = 1026; // From UseCounter.h | |
| 14 window.jsTestIsAsync = true; | |
| 15 | |
| 16 shouldBeFalse("window.internals.isUseCounted(document, BorderImageWithBorder
StyleNone)"); | |
| 17 | |
| 18 var style = document.querySelector('.test').style; | |
| 19 | |
| 20 // Set a solid border-image; expect no hit | |
| 21 style.borderWidth = '20px'; | |
| 22 style.borderStyle = 'solid'; | |
| 23 style.borderImage = 'linear-gradient(to bottom, blue, white) 1 repeat'; | |
| 24 | |
| 25 runAfterLayoutAndPaint(function() { | |
| 26 shouldBeFalse("window.internals.isUseCounted(document, BorderImageWithBo
rderStyleNone)"); | |
| 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(function() { | |
| 33 shouldBeFalse("window.internals.isUseCounted(document, BorderImageWi
thBorderStyleNone)"); | |
| 34 | |
| 35 // Add fill to trigger more border-image code; expect no hit | |
| 36 style.borderImage = 'linear-gradient(to bottom, blue, white) fill 1
repeat'; | |
| 37 | |
| 38 runAfterLayoutAndPaint(function() { | |
| 39 shouldBeFalse("window.internals.isUseCounted(document, BorderIma
geWithBorderStyleNone)"); | |
| 40 | |
| 41 // Add a top border width that according to spec should be clamp
ed to zero because | |
| 42 // border-top-style is none; expect hit | |
| 43 style.borderTopWidth = '10px'; | |
| 44 | |
| 45 runAfterLayoutAndPaint(function() { | |
| 46 shouldBeFalse("window.internals.isUseCounted(document, Borde
rImageWithBorderStyleNone)"); | |
| 47 finishJSTest(); | |
| 48 }); | |
| 49 }); | |
| 50 }); | |
| 51 }); | |
| 52 </script> | |
| OLD | NEW |