tor-browser

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

test-logical-values.js (813B)


      1 import {
      2  testElement,
      3  writingModes,
      4  testCSSValues,
      5  testComputedValues,
      6  makeDeclaration
      7 } from "./test-shared.js";
      8 
      9 /**
     10 * Tests flow-relative values for a CSS property in different writing modes.
     11 *
     12 * @param {string} property
     13 *        The CSS property to be tested.
     14 * @param {string[]} values
     15 *        An array with the flow-relative values to be tested.
     16 */
     17 export function runTests(property, values) {
     18  for (const value of values) {
     19    test(function() {
     20      const {style} = testElement;
     21      style.cssText = "";
     22      style.setProperty(property, value);
     23      testCSSValues("logical values in inline style", style, [[property, value]]);
     24      testComputedValues("logical values in computed style", style, [[property, value]]);
     25    }, `Test that '${property}: ${value}' is supported.`);
     26  }
     27 }