diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-scoping')
9 files changed, 23 insertions, 9 deletions
diff --git a/testing/web-platform/tests/css/css-scoping/font-face-001.html b/testing/web-platform/tests/css/css-scoping/font-face-001.html index 7e47d18cba..4496786449 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-001.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-001.html @@ -12,7 +12,7 @@ </style> <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> @font-face { @@ -27,6 +27,8 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; + assert_not_equals(document.getElementById('in-document').offsetWidth, 160); assert_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face applies in the shadow tree") diff --git a/testing/web-platform/tests/css/css-scoping/font-face-002.html b/testing/web-platform/tests/css/css-scoping/font-face-002.html index 2e3272c44f..3a20d0b808 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-002.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-002.html @@ -13,7 +13,7 @@ </style> <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> #in-shadow { @@ -24,6 +24,8 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; + assert_not_equals(document.getElementById('in-document').offsetWidth, 160); assert_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face from the document applies in the shadow tree"); diff --git a/testing/web-platform/tests/css/css-scoping/font-face-003.html b/testing/web-platform/tests/css/css-scoping/font-face-003.html index d3f83e4ec3..4e8d8ff482 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-003.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-003.html @@ -13,7 +13,7 @@ </style> <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { + promise_test(async function () { host.attachShadow({ mode: "open" }).innerHTML = ` <style> :host { @@ -24,6 +24,7 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; assert_equals(document.getElementById('in-document').offsetWidth, 160); assert_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face from document applies to :host"); diff --git a/testing/web-platform/tests/css/css-scoping/font-face-004.html b/testing/web-platform/tests/css/css-scoping/font-face-004.html index 6ac50bd432..f68e70994f 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-004.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-004.html @@ -14,7 +14,7 @@ </style> <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { +promise_test(async function() { host.attachShadow({ mode: "open" }).innerHTML = ` <style> ::slotted(#in-document) { @@ -25,6 +25,7 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; assert_equals(document.getElementById('in-document').offsetWidth, 160); assert_not_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face from document applies to a slotted element"); diff --git a/testing/web-platform/tests/css/css-scoping/font-face-005.html b/testing/web-platform/tests/css/css-scoping/font-face-005.html index fdf86fb56e..de102f253e 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-005.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-005.html @@ -12,7 +12,7 @@ </style> <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> @font-face { @@ -27,6 +27,8 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; + assert_not_equals(document.getElementById('in-document').offsetWidth, 160); assert_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face should not leak out of shadow tree."); diff --git a/testing/web-platform/tests/css/css-scoping/font-face-006.html b/testing/web-platform/tests/css/css-scoping/font-face-006.html index 8c6e341713..e72d4ec2aa 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-006.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-006.html @@ -16,7 +16,7 @@ </style> <div id="host"></div> <script> -promise_test(async function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> :host::before, :host::after { diff --git a/testing/web-platform/tests/css/css-scoping/font-face-007.html b/testing/web-platform/tests/css/css-scoping/font-face-007.html index ae669f638f..c644a54986 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-007.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-007.html @@ -7,7 +7,7 @@ <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> @font-face { @@ -22,6 +22,8 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; + assert_equals(document.getElementById('in-document').offsetWidth, 160); assert_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face from shadow applies to :host"); diff --git a/testing/web-platform/tests/css/css-scoping/font-face-008.html b/testing/web-platform/tests/css/css-scoping/font-face-008.html index a40b0247d1..52c7869f9f 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-008.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-008.html @@ -8,7 +8,7 @@ <div id="host"><span id="in-document">1234567890</span></div> <script> -test(function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> @font-face { @@ -23,6 +23,8 @@ test(function() { <span id="in-shadow">0123456789</span> `; + await document.fonts.ready; + assert_equals(document.getElementById('in-document').offsetWidth, 160); assert_not_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160); }, "@font-face from shadow applies to a slotted element"); diff --git a/testing/web-platform/tests/css/css-scoping/font-face-009.html b/testing/web-platform/tests/css/css-scoping/font-face-009.html index 5d770929ca..4e08162dcd 100644 --- a/testing/web-platform/tests/css/css-scoping/font-face-009.html +++ b/testing/web-platform/tests/css/css-scoping/font-face-009.html @@ -12,7 +12,7 @@ </style> <div id="host"></div> <script> -test(function() { +promise_test(async () => { host.attachShadow({ mode: "open" }).innerHTML = ` <style> @font-face { @@ -27,6 +27,8 @@ test(function() { <slot></slot> `; + await document.fonts.ready; + //shrinkwrapped size for a default font will be a bit more than 80-90 //if the font is applied, it will be a bit more than 160 assert_greater_than(document.getElementById('host').offsetWidth, 160); |