summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html')
-rw-r--r--testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html b/testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html
new file mode 100644
index 0000000000..8838e05eaf
--- /dev/null
+++ b/testing/web-platform/tests/css/css-font-loading/fontface-load-in-modal-dialog.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<link rel="author" title="Xiaocheng Hu" href="xiaochengh@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-font-loading/#font-face-load">
+<link rel="help" href="https://crbug.com/1092411">
+<meta name="assert" content="Ensure that content of a modal dialog is re-rendered with loaded web font." />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+#target {
+ font: 25px/1 custom-font, monospace;
+}
+</style>
+<dialog><span id=target>0123456789</span></dialog>
+<script>
+document.querySelector('dialog').showModal();
+
+function raf() {
+ return new Promise(resolve => requestAnimationFrame(resolve));
+}
+
+promise_test(async () => {
+ await raf();
+
+ const face = new FontFace('custom-font', 'url(/fonts/Ahem.ttf)');
+ document.fonts.add(face);
+ await face.load();
+
+ assert_equals(target.offsetWidth, 250);
+}, 'Modal dialog content should be re-rendered with loaded web font');
+</script>