|
| 1 | +import { flushSync } from 'svelte'; |
| 2 | +import { test } from '../../test'; |
| 3 | + |
| 4 | +export default test({ |
| 5 | + html: ` |
| 6 | + <div style="font-size:2em;color:red;--my-var:0">style1</div> |
| 7 | + <div style="font-size:2em;color:red;--MY-VAR:0">style2</div> |
| 8 | + <div style="font-size:2em;color:red;--MyVar:0">style3</div> |
| 9 | + <div style="font-size:2em;color:red;--my-var:0">style4</div> |
| 10 | + <div style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">style5</div> |
| 11 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">style6</div> |
| 12 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">spread</div> |
| 13 | + <div style="--bg-color:red;opacity:0.5;font-size:1em"></div> |
| 14 | +
|
| 15 | + <div style="font-size:2em;color:red;--my-var:0">child1:style1</div> |
| 16 | + <div style="font-size:2em;color:red;--MY-VAR:0">child1:style2</div> |
| 17 | + <div style="font-size:2em;color:red;--MyVar:0">child1:style3</div> |
| 18 | + <div style="font-size:2em;color:red;--my-var:0">child1:style4</div> |
| 19 | + <div style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">child1:style5</div> |
| 20 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child1:style6</div> |
| 21 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child1:spread</div> |
| 22 | + <div style="--bg-color:red;opacity:0.5;font-size:1em">child1:</div> |
| 23 | +
|
| 24 | + <div style="font-size:2em;color:red;--my-var:0">child2:style1</div> |
| 25 | + <div style="font-size:2em;color:red;--MY-VAR:0">child2:style2</div> |
| 26 | + <div style="font-size:2em;color:red;--MyVar:0">child2:style3</div> |
| 27 | + <div style="font-size:2em;color:red;--my-var:0">child2:style4</div> |
| 28 | + <div style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">child2:style5</div> |
| 29 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child2:style6</div> |
| 30 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child2:spread</div> |
| 31 | + <div style="--bg-color:red;opacity:0.5;font-size:1em">child2:</div> |
| 32 | +
|
| 33 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0">style1</applied-to-custom-element> |
| 34 | + <applied-to-custom-element style="font-size:2em;color:red;--MY-VAR:0">style2</applied-to-custom-element> |
| 35 | + <applied-to-custom-element style="font-size:2em;color:red;--MyVar:0">style3</applied-to-custom-element> |
| 36 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0">style4</applied-to-custom-element> |
| 37 | + <applied-to-custom-element style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">style5</applied-to-custom-element> |
| 38 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">style6</applied-to-custom-element> |
| 39 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">spread</applied-to-custom-element> |
| 40 | + <applied-to-custom-element style="--bg-color:red;opacity:0.5;font-size:1em"></applied-to-custom-element> |
| 41 | +
|
| 42 | + <button>update</button> |
| 43 | + `, |
| 44 | + test({ assert, target }) { |
| 45 | + const button = target.querySelector('button'); |
| 46 | + |
| 47 | + button?.click(); |
| 48 | + flushSync(); |
| 49 | + |
| 50 | + assert.htmlEqual( |
| 51 | + target.innerHTML, |
| 52 | + ` |
| 53 | + <div style="font-size:2em;color:red;--my-var:0">style1</div> |
| 54 | + <div style="font-size:2em;color:red;--MY-VAR:0">style2</div> |
| 55 | + <div style="font-size:2em;color:red;--MyVar:0">style3</div> |
| 56 | + <div style="font-size:2em;color:red;--my-var:0">style4</div> |
| 57 | + <div style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">style5</div> |
| 58 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">style6</div> |
| 59 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">spread</div> |
| 60 | + <div style="--bg-color:blue;display:inline-block;opacity:0.75"></div> |
| 61 | +
|
| 62 | + <div style="font-size:2em;color:red;--my-var:0">child1:style1</div> |
| 63 | + <div style="font-size:2em;color:red;--MY-VAR:0">child1:style2</div> |
| 64 | + <div style="font-size:2em;color:red;--MyVar:0">child1:style3</div> |
| 65 | + <div style="font-size:2em;color:red;--my-var:0">child1:style4</div> |
| 66 | + <div style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">child1:style5</div> |
| 67 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child1:style6</div> |
| 68 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child1:spread</div> |
| 69 | + <div style="--bg-color:blue;display:inline-block;opacity:0.75">child1:</div> |
| 70 | +
|
| 71 | + <div style="font-size:2em;color:red;--my-var:0">child2:style1</div> |
| 72 | + <div style="font-size:2em;color:red;--MY-VAR:0">child2:style2</div> |
| 73 | + <div style="font-size:2em;color:red;--MyVar:0">child2:style3</div> |
| 74 | + <div style="font-size:2em;color:red;--my-var:0">child2:style4</div> |
| 75 | + <div style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">child2:style5</div> |
| 76 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child2:style6</div> |
| 77 | + <div style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">child2:spread</div> |
| 78 | + <div style="--bg-color:blue;display:inline-block;opacity:0.75">child2:</div> |
| 79 | +
|
| 80 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0">style1</applied-to-custom-element> |
| 81 | + <applied-to-custom-element style="font-size:2em;color:red;--MY-VAR:0">style2</applied-to-custom-element> |
| 82 | + <applied-to-custom-element style="font-size:2em;color:red;--MyVar:0">style3</applied-to-custom-element> |
| 83 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0">style4</applied-to-custom-element> |
| 84 | + <applied-to-custom-element style="font-weight: bold;border-width: 3px; border-color: blue;COLOR: red">style5</applied-to-custom-element> |
| 85 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">style6</applied-to-custom-element> |
| 86 | + <applied-to-custom-element style="font-size:2em;color:red;--my-var:0;font-weight: bold;border-width: 3px; border-color: blue;COLOR: red;opacity: 0">spread</applied-to-custom-element> |
| 87 | + <applied-to-custom-element style="--bg-color:blue;display:inline-block;opacity:0.75"></applied-to-custom-element> |
| 88 | +
|
| 89 | + <button>update</button> |
| 90 | + ` |
| 91 | + ); |
| 92 | + } |
| 93 | +}); |
0 commit comments