Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/layout/style/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_font_family_serialization.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/layout/style/test/test_font_family_serialization.html


<!DOCTYPE html>
<meta charset="UTF-8">
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="display"></div>
<script>
// This cannot be a web-platform test because this doesn't match what
// the spec says at the moment. Specifically, the spec wants to have
// all font family serialized to string, while in practice, all browsers
// serialize simple them to identifiers in some cases.
// We want to check our current behavior. This can be changed once
// browsers have an agreement on the exact behavior to spec.

// format: [input, expected serialization]
const tests = [
  // Basic cases
  ['simple''simple'],
  [' simple ''simple'],
  ['multi idents font''multi idents font'],
  [' multi idents font ''multi idents font'],
  ['"wrapped name"''"wrapped name"'],
  ['" wrapped name "''" wrapped name "'],

  // Special whitespaces
  ['\\ leading ws''" leading ws"'],
  [' \\ leading ws''" leading ws"'],
  ['\\ \\ leading ws''" leading ws"'],
  [' \\ \\ leading ws''" leading ws"'],
  ['\\ \\ \\ leading ws''" leading ws"'],
  ['trailing ws\\ ''"trailing ws "'],
  ['trailing ws\\ ''"trailing ws "'],
  ['trailing ws \\ ''"trailing ws "'],
  ['trailing ws\\ \\ ''"trailing ws "'],
  ['escaped\\ ws''"escaped ws"'],
  ['escaped\\ ws''"escaped ws"'],
  ['escaped\\ \\ ws''"escaped ws"'],
  ['escaped \\ ws''"escaped ws"'],
  ['escaped \\ ws''"escaped ws"'],
  ['escaped number\\ 5''"escaped number 5"'],
];

let el = document.getElementById("display");
for (let [input, expected] of tests) {
  test(function() {
    el.style.fontFamily = input;
    assert_equals(el.style.fontFamily, expected);
  }, "Reserialization for " + JSON.stringify(input));
}
</script>

Messung V0.5
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.