tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_fontinspector_editor-values.js (991B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 const TEST_URI = URL_ROOT + "doc_browser_fontinspector.html";
      6 
      7 add_task(async function () {
      8  const { inspector, view } = await openFontInspectorForURL(TEST_URI);
      9  const viewDoc = view.document;
     10 
     11  await testDiv(inspector, viewDoc);
     12  await testNestedSpan(inspector, viewDoc);
     13 });
     14 
     15 async function testDiv(inspector, viewDoc) {
     16  await selectNode("DIV", inspector);
     17  const { value, unit } = getPropertyValue(viewDoc, "font-size");
     18 
     19  is(value + unit, "1em", "DIV should be have font-size of 1em");
     20 }
     21 
     22 async function testNestedSpan(inspector, viewDoc) {
     23  await selectNode(".nested-span", inspector);
     24  const { value, unit } = getPropertyValue(viewDoc, "font-size");
     25 
     26  isnot(
     27    value + unit,
     28    "1em",
     29    "Nested span should not reflect parent's font size."
     30  );
     31  is(
     32    value + unit,
     33    "36px",
     34    "Nested span should have computed font-size of 36px"
     35  );
     36 }