diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/permission-element')
10 files changed, 211 insertions, 38 deletions
diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference-expected.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference-expected.html new file mode 100644 index 0000000000..c62ff5b24d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference-expected.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<body> + <div> + The permission element should have some limits for specific properties: + <ul> + <li>font-weight is adjusted to be at least 200.</li> + <li>font-style should only have "normal" or "italic" values.</li> + <li>word-spacing should be at most 0.5 of the font size, and non-negative.</li> + <li>letter-spacing should be between -0.05 and 0.2 of the font size.</li> + </ul> + </div> + +<style> + #id1 { + font-weight: 200; + font-style: normal; + word-spacing: 0.5em; + font-size: 100px; + height: auto; + width: auto; + letter-spacing: 20px; + } + #id2 { + word-spacing: 0em; + height: auto; + width: auto; + font-size: 10px; + letter-spacing: -0.5px; + } +</style> + +<permission id="id1" type="geolocation"> +<permission id="id2" type="camera"> +</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference.tentative.html new file mode 100644 index 0000000000..b8337ab87d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference.tentative.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="bounded-css-properties-reference-expected.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <div> + The permission element should have some limits for specific properties: + <ul> + <li>font-weight is adjusted to be at least 200.</li> + <li>font-style should only have "normal" or "italic" values.</li> + <li>word-spacing should be at most 0.5 of the font size, and non-negative.</li> + <li>letter-spacing should be between -0.05 and 0.2 of the font size.</li> + </ul> + </div> + +<style> + #id1 { + font-weight: 100; + font-style: oblique 30deg; + word-spacing: 1em; + font-size: 100px; + height: auto; + width: auto; + letter-spacing: 25px; + } + #id2 { + word-spacing: -1000px; + height: auto; + width: auto; + font-size: 10px; + letter-spacing: -1px; + } +</style> + +<permission id="id1" type="geolocation"> +<permission id="id2" type="camera"> +</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties.html deleted file mode 100644 index 98c3d70e98..0000000000 --- a/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties.html +++ /dev/null @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<body> -<!--The permission element should have some limits for specific properties: - * font-weight is adjusted to be at least 200. - * font-style should only have "normal" or "italic" values. ---> -<style> - #id1 { - font-weight: 100; - font-style: oblique 30deg; - } - #id2 { - font-weight: 300; - font-style: italic; - } -</style> - - -<permission id="id1" type="geolocation"> -<permission id="id2" type="camera"> - -<script> - test(function(){ - var el_outside_bounds = document.getElementById("id1"); - assert_equals(getComputedStyle(el_outside_bounds).fontWeight, "200", "font-weight"); - assert_equals(getComputedStyle(el_outside_bounds).fontStyle, "normal", "font-style"); - }, "Properties with out-of-bounds values should be corrected"); - - test(function(){ - var el_inside_bounds = document.getElementById("id2"); - assert_equals(getComputedStyle(el_inside_bounds).fontWeight, "300", "font-weight"); - assert_equals(getComputedStyle(el_inside_bounds).fontStyle, "italic", "font-style"); - }, "Properties with values in bounds should not be modified"); -</script> -</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties.tentative.html new file mode 100644 index 0000000000..c0f0fe3454 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties.tentative.html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<!--The permission element should have some limits for specific properties: + * font-weight is adjusted to be at least 200. + * font-style should only have "normal" or "italic" values. + * word-spacing should be at most 0.5 of the font size, and non-negative. + * letter-spacing should be between -0.05 and 0.2 of the font size. +--> +<style> + #id-over-bounds { + font-weight: 100; + font-style: oblique 30deg; + word-spacing: 1em; + font-size: 100px; + letter-spacing: 21px; + } + #id-under-bounds { + word-spacing: -1px; + font-size: 100px; + letter-spacing: -6px; + } + #id-within-bounds { + font-weight: 300; + font-style: italic; + word-spacing: 0.4em; + font-size: 100px; + letter-spacing: 15px; + } +</style> + + +<permission id="id-over-bounds" type="geolocation"> +<permission id="id-under-bounds" type="camera"> +<permission id="id-within-bounds" type="microphone"> + +<script> + test(function(){ + var el = document.getElementById("id-over-bounds"); + assert_equals(getComputedStyle(el).fontWeight, "200", "font-weight"); + assert_equals(getComputedStyle(el).fontStyle, "normal", "font-style"); + assert_equals(getComputedStyle(el).wordSpacing, "50px", "word-spacing"); + assert_equals(getComputedStyle(el).letterSpacing, "20px", "letter-spacing"); + + el = document.getElementById("id-under-bounds"); + assert_equals(getComputedStyle(el).wordSpacing, "0px", "word-spacing, negative"); + assert_equals(getComputedStyle(el).letterSpacing, "-5px", "letter-spacing, negative"); + }, "Properties with out-of-bounds values should be corrected"); + + test(function(){ + var el = document.getElementById("id-within-bounds"); + assert_equals(getComputedStyle(el).fontWeight, "300", "font-weight"); + assert_equals(getComputedStyle(el).fontStyle, "italic", "font-style"); + assert_equals(getComputedStyle(el).wordSpacing, "40px", "word-spacing"); + assert_equals(getComputedStyle(el).letterSpacing, "15px", "letter-spacing"); + + el.style.letterSpacing = "-4px"; + assert_equals(getComputedStyle(el).letterSpacing, "-4px", "letter-spacing, negative"); + }, "Properties with values in bounds should not be modified"); +</script> +</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference-expected.html b/testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference-expected.html new file mode 100644 index 0000000000..6a04c94c03 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference-expected.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<body> + <div> + The permission element should either be display 'none' or 'inline-block' + </div> + +<style> + #id1 { + display: inline-block; + } +</style> + +<permission id="id1" type="geolocation"> +<span>After element</span> +</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference.tentative.html new file mode 100644 index 0000000000..973a76d723 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference.tentative.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="display-css-property-reference-expected.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <div> + The permission element should either be display 'none' or 'inline-block' + </div> + +<style> + #id1 { + display: flex; + } + #id2 { + display: none; + } +</style> + +<permission id="id1" type="geolocation"> +<permission id="id2" type="camera"> +<span>After element</span> +</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/display-css-property.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/display-css-property.tentative.html new file mode 100644 index 0000000000..7aa22ef4a2 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/display-css-property.tentative.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<!-- + 'display' should either be 'none' or 'inline-block' +--> +<style> + #id1 { + display: inline-block; + } + #id2 { + display: block; + } + #id3 { + display: none; + } +</style> + + +<permission id="id1" type="geolocation"> +<permission id="id2" type="camera"> +<permission id="id3" type="microphone"> + +<script> + test(function(){ + assert_equals(getComputedStyle(document.getElementById("id1")).display, "inline-block", "'inline-block' should be kept"); + assert_equals(getComputedStyle(document.getElementById("id2")).display, "inline-block", "'block' should be changed to 'inline-block'"); + assert_equals(getComputedStyle(document.getElementById("id3")).display, "none", "'none' should be kept"); + }, "'display' should be either 'inline-block' or 'none'"); +</script> +</body>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/invalid-css-properties.html b/testing/web-platform/tests/html/semantics/permission-element/invalid-css-properties.tentative.html index c7186563f0..334280c83b 100644 --- a/testing/web-platform/tests/html/semantics/permission-element/invalid-css-properties.html +++ b/testing/web-platform/tests/html/semantics/permission-element/invalid-css-properties.tentative.html @@ -1,5 +1,6 @@ <!DOCTYPE html> <meta charset=utf-8> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <body> diff --git a/testing/web-platform/tests/html/semantics/permission-element/negative-offset-and-margin.html b/testing/web-platform/tests/html/semantics/permission-element/negative-offset-and-margin.tentative.html index 97290bb4df..de622bbb3e 100644 --- a/testing/web-platform/tests/html/semantics/permission-element/negative-offset-and-margin.html +++ b/testing/web-platform/tests/html/semantics/permission-element/negative-offset-and-margin.tentative.html @@ -1,5 +1,6 @@ <!DOCTYPE html> <meta charset=utf-8> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <body> diff --git a/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html b/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.tentative.html index 5fcce1421b..bea3d7102c 100644 --- a/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html +++ b/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.tentative.html @@ -1,5 +1,6 @@ <!DOCTYPE html> <meta charset=utf-8> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <body> |