summaryrefslogtreecommitdiffstats
path: root/layout/reftests/font-loading-api/name-collision.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/reftests/font-loading-api/name-collision.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/font-loading-api/name-collision.html')
-rw-r--r--layout/reftests/font-loading-api/name-collision.html79
1 files changed, 79 insertions, 0 deletions
diff --git a/layout/reftests/font-loading-api/name-collision.html b/layout/reftests/font-loading-api/name-collision.html
new file mode 100644
index 0000000000..50a8fffc60
--- /dev/null
+++ b/layout/reftests/font-loading-api/name-collision.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<!-- modeled after ../font-face/name-collision.html -->
+<html class="reftest-wait">
+<!--
+ Font family names in @font-face rules take precedence over locally-available font families,
+ so none of the names of commonly used platform fonts should match against locally available
+ fonts.
+-->
+<style>
+body { margin: 50px; font-family: fallback; }
+table { font-family: Sample; margin-left: 3em; }
+.sample { font-family: Sample, fallback; }
+table td { font-size: 24pt; }
+
+/* Windows */
+
+.arial { font-family: Arial, fallback; }
+.timesnewroman { font-family: Times New Roman, fallback; }
+.couriernew { font-family: Courier New, fallback; }
+
+/* Mac OS X */
+
+.futura { font-family: Futura, fallback; }
+.helvetica { font-family: Helvetica, fallback; }
+.times { font-family: Times, fallback; }
+.courier { font-family: Courier, fallback; }
+
+/* Linux */
+
+.bitstreamverasans { font-family: Bitstream Vera Sans, fallback; }
+.dejavusans { font-family: DejaVu Sans, fallback; }
+.freesans { font-family: FreeSans, fallback; }
+</style>
+<script>
+function addTestFont(aFamily) {
+ document.fonts.add(new FontFace(aFamily, "url(../fonts/mplus/mplus-1p-black.ttf)", { weight: 900 }));
+}
+
+document.fonts.add(new FontFace("fallback", "url(../fonts/mplus/mplus-1p-regular.ttf)"));
+
+addTestFont("Sample");
+
+/* Windows */
+
+addTestFont("Arial");
+addTestFont("Times New Roman");
+addTestFont("Courier New");
+
+/* Mac OS X */
+
+addTestFont("Futura");
+addTestFont("Helvetica");
+addTestFont("Times");
+addTestFont("Courier");
+
+/* Linux */
+
+addTestFont("Bitstream Vera Sans");
+addTestFont("DejaVu Sans");
+addTestFont("FreeSans");
+
+document.fonts.ready.then(function() { document.documentElement.className = ""; });
+</script>
+
+<p>All text below should appear in the same extra bold font face:</p>
+
+<table>
+<tr class="sample"><td>Sample</td></tr>
+<tr class="arial"><td>Arial</td></tr>
+<tr class="timesnewroman"><td>Times New Roman</td></tr>
+<tr class="couriernew"><td>Courier New</td></tr>
+<tr class="futura"><td>Futura</td></tr>
+<tr class="helvetica"><td>Helvetica</td></tr>
+<tr class="times"><td>Times</td></tr>
+<tr class="courier"><td>Courier</td></tr>
+<tr class="bitstreamverasans"><td>Bitstream Vera Sans</td></tr>
+<tr class="dejavusans"><td>DejaVu Sans</td></tr>
+<tr class="freesans"><td>FreeSans</td></tr>
+</table>