'use strict'; // Dependency Notice: This helper relies on 'mathml-fragments.js' // to be loaded prior to this script in the test HTML file. const APPLIED_COLOR_RGB = 'rgb(0, 128, 0)'; const TEST_CSS_TEXT = `color: ${APPLIED_COLOR_RGB}`; const CSS_TEXT_HASH = 'sha256-cgrWcJeXGgvsbzqeXr9ARPkciN38f5Rd6u0ahueqhkU='; const ELEM_CSS_TEXT = `math { ${TEST_CSS_TEXT}; }`; const ELEM_CSS_HASH = 'sha256-/n1LY0Mb4Hs1ejsIuf7bVyNgdFVUEPsG/esgnIQgikY='; /** * Executes a single CSP style test on a MathML element inside an isolated * iframe. * * @param {Object} t - WPT test instance (provides add_cleanup). * @param {Object} options - Test execution configuration. * @param {string} options.tag - MathML element tag name present in * MathMLFragments. * @param {string} options.policy - CSP directive header (e.g., * "style-src-attr 'unsafe-inline'"). * @param {boolean} options.shouldApply - True if the style is expected to be * allowed & applied; false if blocked. * @param {'styleAttribute' | 'styleElement'} [options.styleApplication] - * Manner in which style is applied: * - 'styleAttribute': Tests inline `style` attribute (governed by * style-src-attr / style-src). * - 'styleElement': Tests `