commit c0eff0371b1077ff3f57f5871b53c21225f004a1 parent 453f116bf7cdf89b45ef36cf2931d2d26d043635 Author: Ravjit Uppal <ravjit@chromium.org> Date: Thu, 4 Dec 2025 16:55:46 +0000 Bug 2003803 [wpt PR 56425] - [PEPC] Add WPTs for <geolocation> element., a=testonly Automatic update from web-platform-tests [PEPC] Add WPTs for <geolocation> element. This CL matches the <geolocation> element's WPT test coverage to that of the <permission> element [1/2] Change-Id: I410b2d8dc8fb9df713b2c325fbd9ca057e0853fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7168484 Commit-Queue: Ravjit Uppal <ravjit@chromium.org> Reviewed-by: Andy Paicu <andypaicu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1553384} -- wpt-commits: b24f0b982455761d856576587fcc60046894c973 wpt-pr: 56425 Diffstat:
55 files changed, 1255 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-different-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-different-ref.html @@ -0,0 +1,12 @@ +<!doctype html> +<html> + <meta charset="utf-8" /> + <body> + <style> + geolocation { + border-radius: 25%/50%; + } + </style> + <geolocation></geolocation> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-different.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-different.tentative.html @@ -0,0 +1,17 @@ +<!doctype html> +<html> + <meta charset="utf-8" /> + <link rel="match" href="border-radius-different-ref.html" /> + <link + rel="help" + href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style" + /> + <body> + <style> + geolocation { + border-radius: 1000px/1001px; + } + </style> + <geolocation></geolocation> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-identical-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-identical-ref.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Geolocation Element Border Radius Clamping Reference</title> +<p>This test verifies that a large border-radius on a geolocation element is clamped to half of the element's smallest dimension, resulting in a pill shape.</p> +<style> + geolocation { + width: 100px; + height: 40px; + border-radius: 25px; + background-color: blue; + display: inline-block; + } +</style> +<geolocation></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-identical.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/border-radius-identical.tentative.html @@ -0,0 +1,22 @@ +<!doctype html> +<meta charset="utf-8" /> +<title>Geolocation Element Border Radius Clamping</title> +<link + rel="help" + href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style" +/> +<link rel="match" href="border-radius-identical-ref.html" /> +<p> + This test verifies that a large border-radius on a geolocation element is clamped to half of the + element's smallest dimension, resulting in a pill shape. +</p> +<style> + geolocation { + width: 100px; + height: 40px; + border-radius: 1000px; + background-color: blue; + display: inline-block; + } +</style> +<geolocation></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-css-properties-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-css-properties-reftest-ref.html @@ -0,0 +1,35 @@ +<!doctype html> +<meta charset="utf-8" /> +<body> + <div> + The geolocation 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> + + <geolocation id="id1"></geolocation> + <geolocation id="id2"></geolocation> +</body> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-css-properties-reftest.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-css-properties-reftest.tentative.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="bounded-css-properties-reftest-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <div> + The geolocation 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> + +<geolocation id="id1"></geolocation> +<geolocation id="id2"></geolocation> +</body> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-css-properties.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-css-properties.tentative.html @@ -0,0 +1,70 @@ +<!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 geolocation 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; + box-shadow: 5px 5px inset; + } + #id-under-bounds { + word-spacing: -1px; + font-size: 100px; + letter-spacing: -6px; + box-shadow: rgb(255, 0, 0) 5px 4px 3px 2px, 5px 5px inset; + } + #id-within-bounds { + font-weight: 300; + font-style: italic; + word-spacing: 0.4em; + font-size: 100px; + letter-spacing: 15px; + box-shadow: rgb(255, 0, 0) 5px 4px 3px 2px; + } +</style> + + +<geolocation id="id-over-bounds"></geolocation> +<geolocation id="id-under-bounds"></geolocation> +<geolocation id="id-within-bounds"></geolocation> + +<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"); + assert_equals(getComputedStyle(el).boxShadow, "none", "box-shadow"); + + el = document.getElementById("id-under-bounds"); + assert_equals(getComputedStyle(el).wordSpacing, "0px", "word-spacing, negative"); + assert_equals(getComputedStyle(el).letterSpacing, "-5px", "letter-spacing, negative"); + assert_equals(getComputedStyle(el).boxShadow, "none", "box-shadow, multiple"); + }, "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"); + assert_equals(getComputedStyle(el).boxShadow, "rgb(255, 0, 0) 5px 4px 3px 2px", "box-shadow"); + + 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/geolocation-element/bounded-sizes.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/bounded-sizes.tentative.html @@ -0,0 +1,92 @@ +<!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 the min/max-width/height: + * min-width should be sufficient to fit the element text (depends on user agent implementation) + * max-width should be at most 3x min-width + * min-height should be sufficient to fit the element text (1em) + * max-height should be at most 3x min-height +--> +<style> + #el_outside_bounds { + font-size: 10px; + width: auto; + height: auto; + border: 0px; + + min-height: 1px; + max-height: 100px; + + padding-top: 12px; + padding-left: 60px; + padding-bottom: 1000px; + padding-right: 1000px; + + /* These values are extreme enough that they should be out of bounds for any implementation */ + min-width: 10px; + max-width: 1000px; + } + #el_inside_bounds { + font-size: 10px; + width: auto; + height: auto; + border: 0px; + + min-height: 11px; + max-height: 29px; + + padding-top: 5px; + padding-left: 45px; + padding-bottom: 6px; + padding-right: 46px; + } + #el_large_min_size { + font-size: 10px; + width: auto; + height: auto; + border: 0px; + + min-height: 50px; + min-width: 1000px; + } +</style> + + +<geolocation id="el_outside_bounds"></geolocation> +<geolocation id="el_inside_bounds"></geolocation> +<geolocation id="el_large_min_size"></geolocation> + +<script> + test(function(){ + let min_height = getComputedStyle(el_outside_bounds).minHeight; + let max_height = getComputedStyle(el_outside_bounds).maxHeight; + assert_true(min_height === "calc(10px)" || min_height === "10px", "min-height"); + assert_true(max_height === "calc(30px)" || max_height === "30px", "max-height"); + assert_not_equals(getComputedStyle(el_outside_bounds).minWidth, "10px", "min-width"); + assert_not_equals(getComputedStyle(el_outside_bounds).maxWidth, "1000px", "max-width"); + assert_equals(getComputedStyle(el_outside_bounds).paddingLeft, "50px", "padding-left"); + assert_equals(getComputedStyle(el_outside_bounds).paddingRight, "50px", "padding-right"); + assert_equals(getComputedStyle(el_outside_bounds).paddingTop, "10px", "padding-top"); + assert_equals(getComputedStyle(el_outside_bounds).paddingBottom, "10px", "padding-bottom"); + }, "Properties with out-of-bounds values should be corrected"); + + test(function(){ + assert_equals(getComputedStyle(el_inside_bounds).minHeight, "calc(11px)", "min-height"); + assert_equals(getComputedStyle(el_inside_bounds).maxHeight, "calc(29px)", "max-height"); + assert_equals(getComputedStyle(el_inside_bounds).paddingLeft, "45px", "padding-left"); + assert_equals(getComputedStyle(el_inside_bounds).paddingRight, "45px", "padding-right"); + assert_equals(getComputedStyle(el_inside_bounds).paddingTop, "5px", "padding-top"); + assert_equals(getComputedStyle(el_inside_bounds).paddingBottom, "5px", "padding-bottom"); + }, "Properties with values in bounds should not be modified"); + + test(function() { + let min_height = getComputedStyle(el_large_min_size).minHeight; + assert_true(min_height === "calc(30px)" || min_height === "30px", "min-height"); + assert_not_equals(getComputedStyle(el_outside_bounds).minWidth, "1000px", "min-width"); + }, "'Min' properties should not be allowed to go over the maximum allowed values for 'max' properties"); + +</script> +</body> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/display-values.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/display-values.tentative.html @@ -0,0 +1,72 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8" /> + <title>Geolocation Element: display style validation</title> + <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> + </head> + <body> + <script> + function createGeolocationElementWithStyle(displayValue) { + const element = document.createElement("geolocation"); + + element.style.display = displayValue; + // Clear the body and append the element. This is necessary because + // there can be a max of 3 geolocation elements on the page at a time. + document.body.appendChild(element); + return element; + } + + const testCases = [ + ["block", ""], + ["inline-block", ""], + ["flex", ""], + ["inline-flex", ""], + ["inline", "style_invalid"], + ["contents", "style_invalid"], + ["inline-table", "style_invalid"], + ["list-item", "style_invalid"], + ["ruby", "style_invalid"], + ["ruby-text", "style_invalid"], + ["table", "style_invalid"], + ["table-caption", "style_invalid"], + ["table-cell", "style_invalid"], + ["table-column", "style_invalid"], + ["table-column-group", "style_invalid"], + ["table-footer-group", "style_invalid"], + ["table-header-group", "style_invalid"], + ["table-row", "style_invalid"], + ["table-row-group", "style_invalid"], + ]; + + async_test((t) => { + let completedTests = 0; + + testCases.forEach(([displayValue, expectedInvalidReason]) => { + const element = createGeolocationElementWithStyle(displayValue); + element.onvalidationstatuschange = t.step_func(() => { + // These two invalid reasons are expected when the geolocation element was just created. + if ( + element.invalidReason == "unsuccessful_registration" || + element.invalidReason == "intersection_changed" + ) { + return; + } + assert_equals( + element.invalidReason, + expectedInvalidReason, + `display: ${displayValue} should be ${expectedInvalidReason === "" ? "valid" : "invalid"}`, + ); + element.remove(); + if (++completedTests === testCases.length) t.done(); + }); + }); + }, "Geolocation element display style validation"); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/geolocation-element-with-comment-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/geolocation-element-with-comment-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> + +<geolocation></geolocation> +<geolocation></geolocation> +<div style="display: flex;"> + <geolocation></geolocation> +</div> +<geolocation></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/geolocation-element-with-comment.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/geolocation-element-with-comment.tentative.html @@ -0,0 +1,21 @@ +<!doctype html> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md" /> +<link rel="match" href="geolocation-element-with-comment-ref.html" /> + +<geolocation> <!-- Comment 1 --> </geolocation> +<geolocation> + <!-- C1 --> + Text + <!-- C2 --> +</geolocation> +<div style="display: flex"> + <geolocation> <!-- Comment 1 --> </geolocation> +</div> +<geolocation> + <!-- Comment Before --> + <span> + <button>Click Me</button> + <textarea>Some text</textarea> + </span> + <!-- Comment After --> +</geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/granted-selector.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/granted-selector.html @@ -0,0 +1,42 @@ +<!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> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<body> + <geolocation id="geolocation_element"></geolocation> + + <script> + promise_test( + async () => { + // Set the initial geolocation state to denied. + await test_driver.set_permission({ name: "geolocation" }, "denied"); + await navigator.permissions.query({ name: "geolocation" }); + + assert_false(geolocation_element.matches(":granted")); + + // Set the camera state to allowed. + await test_driver.set_permission({ name: "geolocation" }, "granted"); + await navigator.permissions.query({ name: "geolocation" }); + + // The granted selector should now be applied. + assert_true(geolocation_element.matches(":granted")); + + // Set the camera state to denied. + await test_driver.set_permission({ name: "geolocation" }, "denied"); + await navigator.permissions.query({ name: "geolocation" }); + + // The granted selector should now be removed. + assert_false(geolocation_element.matches(":granted")); + }, + "Geolocation element should not have the granted selector when the \ + permission is not granted.", + ); + </script> +</body> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-color-defaults-to-text-color.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-color-defaults-to-text-color.html @@ -0,0 +1,25 @@ +<!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> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<body> + + <style> + geolocation { + color: #ff0000; + } + </style> + + <geolocation id="geolocation_element"></geolocation> + + <script> + promise_test(async() => { + let geolocation_element = document.getElementById("geolocation_element"); + assert_equals(getComputedStyle(geolocation_element, "::permission-icon").fill, 'rgb(255, 0, 0)') + }, "Permission element icon's color should be same as the text color unless explicitly changed.") + </script> +</body> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-fill-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-fill-reftest-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>A standard permission element of type location, with blue text and icon color</title> + +<style> + geolocation { + color: blue; + } +</style> + +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-fill-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-fill-reftest.html @@ -0,0 +1,14 @@ +<!doctype html> +<title>The icon of the element should change if the fill color is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="mismatch" href="icon-css-property-fill-reftest-ref.html"> +<style> + geolocation { + color: blue; + } + ::permission-icon { + fill: red; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-height-bounded-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-height-bounded-reftest-ref.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title> + A standard permission element of type location, with the maximum allowed + height. +</title> + +<style> + + geolocation { + font-size: 10px; + } + + ::permission-icon { + /* 15px is 1.5em */ + height: 15px; + } +</style> + +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-height-bounded-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-height-bounded-reftest.html @@ -0,0 +1,17 @@ +<!doctype html> +<title> + The icon is set to the exact maximum height in the reference. + Increasing it further should have no effect. +</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md" /> +<link rel="match" href="icon-css-property-height-bounded-reftest-ref.html" /> +<style> + geolocation { + font-size: 10px; + } + ::permission-icon { + height: 100px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-height-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-height-reftest.html @@ -0,0 +1,11 @@ +<!doctype html> +<title>The icon of the element should change if the height is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md" /> +<link rel="mismatch" href="standard-location-element-ref.html" /> +<style> + ::permission-icon { + height: 20px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-margin-bounded-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-margin-bounded-reftest-ref.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title> + A standard permission element of type location, with the maximum allowed + margin. +</title> + +<style> + + geolocation { + font-size: 10px; + } + + ::permission-icon { + /* 30px is 3em */ + margin-inline-end: 30px; + } +</style> + +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-margin-bounded-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-margin-bounded-reftest.html @@ -0,0 +1,17 @@ +<!doctype html> +<title> + The margin-inline-end is set to the exact maximum allowed limit in the ref. + Increasing it further should have no effect. +</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md" /> +<link rel="match" href="icon-css-property-margin-bounded-reftest-ref.html" /> +<style> + geolocation { + font-size: 10px; + } + ::permission-icon { + margin-inline-end: 100px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-margin-inline-end-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-margin-inline-end-reftest.html @@ -0,0 +1,11 @@ +<!doctype html> +<title>The icon of the element should change if the margin-inline-end is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="mismatch" href="standard-location-element-ref.html"> +<style> + ::permission-icon { + margin-inline-end: 50px; + } +</style> +<geolocation id="geolocation"> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-max-height-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-max-height-reftest-ref.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title> + A standard permission element of type location, with 50px height. +</title> + +<style> + ::permission-icon { + height: 50px; + } +</style> + +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-max-height-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-max-height-reftest.html @@ -0,0 +1,12 @@ +<!doctype html> +<title>The icon of the element should be restricted to 50px due to the max-height property.</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="match" href="icon-css-property-max-height-reftest-ref.html"> +<style> + ::permission-icon { + height: 60px; + max-height: 50px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-min-height-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-min-height-reftest-ref.html @@ -0,0 +1,10 @@ +<!doctype html> +<meta charset="utf-8" /> +<title>A standard permission element of type location, with a height of 10px</title> + +<style> + ::permission-icon { + height: 10px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-min-height-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-min-height-reftest.html @@ -0,0 +1,11 @@ +<!doctype html> +<title>The icon of the element should change if the min-height is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md" /> +<link rel="mismatch" href="icon-css-property-min-height-reftest-ref.html" /> +<style> + ::permission-icon { + min-height: 15px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-stroke-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-stroke-reftest.html @@ -0,0 +1,11 @@ +<!doctype html> +<title>The icon of the element should change if the stroke is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="mismatch" href="standard-location-element-ref.html"> +<style> + ::permission-icon { + stroke: red; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-stroke-width-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-stroke-width-reftest-ref.html @@ -0,0 +1,12 @@ +<!doctype html> +<title> + A standard permission element of type location, with a red stroke with the + default stroke-width of 1px. +</title> + +<style> + ::permission-icon { + stroke: red; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-stroke-width-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-css-property-stroke-width-reftest.html @@ -0,0 +1,11 @@ +<!doctype html> +<title>The icon of the element should change if the stroke-width is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="mismatch" href="icon-css-property-stroke-width-reftest-ref.html"> +<style> + ::permission-icon { + stroke-width: 2px; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-different-for-precise-location-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-different-for-precise-location-reftest.html @@ -0,0 +1,6 @@ +<!doctype html> +<title>The icon of the element should change if the height is changed</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md" /> +<link rel="mismatch" href="standard-location-element-ref.html" /> +<geolocation id="geolocation" accuracymode="precise"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-hidden-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-hidden-reftest.html @@ -0,0 +1,11 @@ +<!doctype html> +<title>The icon of the location permission element should not be visibe if it is set to display:none</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="mismatch" href="standard-location-element-ref.html"> +<style> + ::permission-icon { + display: none; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-restricted-css-no-effect-reftest.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/icon-restricted-css-no-effect-reftest.html @@ -0,0 +1,16 @@ +<!doctype html> +<title>The icon of the permission element should not change when any of the restricted CSS properties are changed.</title> +<!-- TODO: Update the link to the permission icon spec --> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="match" href="standard-location-element-ref.html"> +<style> + ::permission-icon { + margin-inline-start: 100px; + float: inline-end; + padding: 50px; + opacity: 0.5; + stroke-opacity: 0.5; + fill-rule: evenodd; + } +</style> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/inherited-css-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/inherited-css-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/inherited-css-tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/inherited-css-tentative.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="inherited-css-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<!-- The geolocation element not inherit css properties from the parent div. +--> +<body> + <style> + div { + text-emphasis: "x"; + text-emphasis-position: over right; + text-shadow: 1px 1px 2px black; + } + </style> + <div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/invalid-css-properties.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/invalid-css-properties.tentative.html @@ -0,0 +1,53 @@ +<!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 geolocation element does not allow certain CSS properties +--> +<style> + #id1 { + border-image: url('test-url'); + background-image: url('test-url'); + clip-path: circle(10px); + filter: blur(10px); + mask: url('test-url'); + padding-left: 10px; /* this is not allowed because width is not set to 'auto' */ + width: 200px; + transform: rotate(10); + border: 0px; + cursor: none; + content-visibility: hidden; + contain: size; + corner-shape: notch; + corner-top-left-shape: scoop; + corner-top-right-shape: bevel; + corner-bottom-left-shape: squircle; + corner-bottom-right-shape: square; + } +</style> + +<geolocation id="id1"></geolocation> + +<script> + test(function(){ + var el_with_negatives = document.getElementById("id1"); + assert_equals(getComputedStyle(el_with_negatives).borderImage, "none", "border-image"); + assert_equals(getComputedStyle(el_with_negatives).backgroundImage, "none", "background-image"); + assert_equals(getComputedStyle(el_with_negatives).clipPath, "none", "clip-path"); + assert_equals(getComputedStyle(el_with_negatives).filter, "none", "filter"); + assert_equals(getComputedStyle(el_with_negatives).mask, "none", "mask"); + assert_equals(getComputedStyle(el_with_negatives).paddingLeft, "0px", "padding-left"); + assert_equals(getComputedStyle(el_with_negatives).transform, "none", "transform"); + assert_equals(getComputedStyle(el_with_negatives).cursor, "pointer", "cursor"); + assert_equals(getComputedStyle(el_with_negatives).contentVisibility, "visible", "content-visibility"); + assert_equals(getComputedStyle(el_with_negatives).contain, "none", "contain"); + assert_equals(getComputedStyle(el_with_negatives).cornerShape, "round", "corner-shape"); + assert_equals(getComputedStyle(el_with_negatives).cornerTopLeftShape, "round", "corner-top-left-shape"); + assert_equals(getComputedStyle(el_with_negatives).cornerTopRightShape, "round", "corner-top-right-shape"); + assert_equals(getComputedStyle(el_with_negatives).cornerBottomLeftShape, "round", "corner-bottom-left-shape"); + assert_equals(getComputedStyle(el_with_negatives).cornerBottomRightShape, "round", "corner-bottom-right-shape"); + }, "None of the listed properties should be applied"); +</script> +</body> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/negative-offset.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/negative-offset.tentative.html @@ -0,0 +1,79 @@ +<!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 geolocation element should not allow setting negative outline-offset. +--> +<style> + #id1 { + outline-offset: -50px; + } + #id2 { + outline-offset: 50px; + } + + /* These various expressions all result in a negative value when calculated */ + #id3 { + outline-offset: min(-50px, 50px); + } + #id4 { + outline-offset: min(10%, -50px); + } + #id5 { + outline-offset: clamp(-100px, 1vw, -50px); + } + #id6 { + outline-offset: 1% - 10000px; + } + #id7 { + outline-offset: max(min(-1em, 10em), -5%); + } +</style> + +<geolocation id="id1"></geolocation> +<geolocation id="id2"></geolocation> +<geolocation id="id3"></geolocation> +<geolocation id="id4"></geolocation> +<geolocation id="id5"></geolocation> +<geolocation id="id6"></geolocation> +<geolocation id="id7"></geolocation> + +<script> + test(function(){ + var el_with_negatives = document.getElementById("id1"); + assert_equals(getComputedStyle(el_with_negatives).outlineOffset, "0px", "outline-offset"); + }, "Negative offset should be changed to 0px"); + + test(function(){ + var el_with_positives = document.getElementById("id2"); + assert_equals(getComputedStyle(el_with_positives).outlineOffset, "50px", "outline-offset"); + }, "Positive offset are unaffected"); + + test(function(){ + var el_with_negative_expr = document.getElementById("id3"); + assert_equals(getComputedStyle(el_with_negative_expr).outlineOffset, "0px", "outline-offset"); + }, "Expressions offset min(-50px, 50px) should return at least 0px"); + + test(function(){ + var el_with_negative_expr = document.getElementById("id4"); + assert_equals(getComputedStyle(el_with_negative_expr).outlineOffset, "0px", "outline-offset"); + }, "Expressions offset outline-offset: min(10%, -50px) should return at least 0px"); + + test(function(){ + var el_with_negative_expr = document.getElementById("id5"); + assert_equals(getComputedStyle(el_with_negative_expr).outlineOffset, "0px", "outline-offset"); + }, "Expressions offset clamp(-100px, 1vw, -50px) should return at least 0px"); + + test(function(){ + var el_with_negative_expr = document.getElementById("id6"); + assert_equals(getComputedStyle(el_with_negative_expr).outlineOffset, "0px", "outline-offset"); + }, "Expressions offset 1% - 10000px should return at least 0px"); + + test(function(){ + var el_with_negative_expr = document.getElementById("id7"); + assert_equals(getComputedStyle(el_with_negative_expr).outlineOffset, "0px", "outline-offset"); + }, "Expressions offset max(min(-1em, 10em), -5%) should return at least 0px"); +</script> +</body> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/no-children-rendered.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/no-children-rendered.tentative.html @@ -0,0 +1,31 @@ +<!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 geolocation element is not a void element. Its children do not render. --> + +<!-- This tests for implementations that used to have no end tag for the geolocation element + In those implementations there would be 2 geolocation elements in this div. --> +<div id="geolocation-element-div"> + <geolocation> + <geolocation> +</div> + +<geolocation id="el1">This is some text</geolocation> + +<!-- The geolocation element does not automatically close <p> tags --> +<p id="paragraph">Foo <geolocation>bar</geolocation> baz</p> + +<script> + test(function(){ + assert_equals(1, document.getElementById("geolocation-element-div").childElementCount); + assert_equals('', document.getElementById("el1").innerText); + assert_equals('This is some text', document.getElementById("el1").textContent); + assert_equals('This is some text', document.getElementById("el1").innerHTML); + assert_equals(4, document.body.childElementCount); //div, geolocation, script, p + assert_equals('Foo bar baz', document.getElementById("paragraph").textContent); + }, "The geolocation element should have no end tag or contents"); +</script> +</body> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/parent-image-mask.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/parent-image-mask.tentative.html @@ -0,0 +1,43 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8" /> + <title>Geolocation Element: invalid if parent has mask-image</title> + <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> + </head> + <body> + <script> + async_test((t) => { + const parent = document.createElement("div"); + const element = document.createElement("geolocation"); + element.setAttribute("type", "camera"); + parent.appendChild(element); + + parent.style.maskImage = "url(mask.png)"; + + element.onvalidationstatuschange = t.step_func(() => { + // These two invalid reasons are expected when the geolocation element was just created. + if ( + element.invalidReason == "unsuccessful_registration" || + element.invalidReason == "intersection_changed" + ) { + return; + } + assert_equals( + element.invalidReason, + "style_invalid", + `Parent with mask-image should be invalid`, + ); + t.done(); + }); + + document.body.appendChild(parent); + }, "Geolocation element is invalid if it has a parent with mask-image."); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/parent-mask.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/parent-mask.tentative.html @@ -0,0 +1,42 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8" /> + <title>Geolocation Element: invalid if parent has mask</title> + <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> + </head> + <body> + <script> + async_test((t) => { + const parent = document.createElement("div"); + const element = document.createElement("geolocation"); + parent.appendChild(element); + + parent.style.mask = "linear-gradient(black, transparent)"; + + element.onvalidationstatuschange = t.step_func(() => { + // These two invalid reasons are expected when the geolocation element was just created. + if ( + element.invalidReason == "unsuccessful_registration" || + element.invalidReason == "intersection_changed" + ) { + return; + } + assert_equals( + element.invalidReason, + "style_invalid", + `Parent with mask should be invalid`, + ); + t.done(); + }); + + document.body.appendChild(parent); + }, "Geolocation element is invalid if it has a parent with a mask."); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/permission-element-with-comment-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/permission-element-with-comment-ref.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> + +<geolocation></geolocation> +<geolocation></geolocation> +<div style="display: flex;"> + <geolocation></geolocation> +</div> +<geolocation></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/permission-element-with-comment.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/permission-element-with-comment.tentative.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md"> +<link rel="match" href="permission-element-with-comment-ref.html"> + +<geolocation> <!-- Comment 1 --> </geolocation> +<geolocation> <!-- C1 --> Text <!-- C2 --> </geolocation> +<div style="display: flex;"> + <geolocation> <!-- Comment 1 --> </geolocation> +</div> +<geolocation> + <!-- Comment Before --> + <span> + <button>Click Me</button> + <textarea>Some text</textarea> + </span> + <!-- Comment After --> +</geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements-in-div-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements-in-div-ref.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<body> + <div> + The geolocation element should not create any pseudo elements. + </div> + + <style> + .inner::before { + content: 'BEFORE'; + } + .inner::after { + content: 'AFTER'; + } + </style> + + <p>Should only see BEFOREAFTER once below</p> + + <div> + <div class="inner"></div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements-in-div.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements-in-div.tentative.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="pseudo-elements-in-div-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<link rel="help" href="https://crbug.com/342355738"> +<body> + <div> + The geolocation element should not create any pseudo elements. + </div> + + <style> + /* The space (descendent combinator) is necessary to apply this CSS to children of .outer */ + .outer ::before { + content: 'BEFORE'; + } + .outer ::after { + content: 'AFTER'; + } + </style> + + <p>Should only see BEFOREAFTER once below</p> + + <!-- Apply the ::before/::after to descendants of the .outer div. The empty inner div + simulates a quirk scenario discovered in chromium, but the expectation should match + all implementation. --> + <div class="outer"> + <div></div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements-ref.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> +<meta charset=utf-8> +<body> + <div> + The geolocation element should not create any pseudo elements. + </div> + + <p>You should not see the word FAIL below.</p> + + <geolocation></geolocation> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/pseudo-elements.tentative.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="pseudo-elements-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <div> + The geolocation element should not create any pseudo elements. + </div> + + <style> + geolocation::before, geolocation::after { content: "FAIL"; } + </style> + + <p>You should not see the word FAIL below.</p> + + <geolocation></geolocation> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/quirks-mode-no-height-is-still-bounded-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/quirks-mode-no-height-is-still-bounded-ref.html @@ -0,0 +1,17 @@ +<html> +<!-- Quirks mode used deliberately --> +<meta charset=utf-8> +<style> + geolocation { + font-size: 14px; + height: fit-content; + } +</style> +<body> + <geolocation id="geolocation"></geolocation> + <script> + let el = document.getElementById("geolocation"); + el.style.height = (el.clientHeight + 20) + "px"; + </script> +</body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/quirks-mode-no-height-is-still-bounded.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/quirks-mode-no-height-is-still-bounded.tentative.html @@ -0,0 +1,15 @@ +<html> +<!-- Quirks mode used deliberately --> +<meta charset=utf-8> +<link rel="match" href="quirks-mode-no-height-is-still-bounded-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<style> + geolocation { + font-size: 14px; + padding-top: 10px; + } +</style> +<body> + <geolocation></geolocation> +</body> +</html> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/standard-location-element-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/standard-location-element-ref.html @@ -0,0 +1,4 @@ +<!doctype html> +<meta charset="utf-8" /> +<title>A standard permission element of type location, without any non-default styling</title> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/standard-location-permission-element-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/standard-location-permission-element-ref.html @@ -0,0 +1,4 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>A standard permission element of type location, without any non-default styling</title> +<geolocation id="geolocation"></geolocation> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-decoration-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-decoration-ref.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<body> + <div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-decoration-tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-decoration-tentative.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="text-decoration-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <style> + geolocation { + text-decoration: underline; + } + div { + text-decoration: underline; + } + </style> + <div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-stroke-and-fill-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-stroke-and-fill-ref.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<body> + <div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-stroke-and-fill.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/text-stroke-and-fill.tentative.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<link rel="match" href="text-stroke-and-fill-ref.html"> +<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style"> +<body> + <style> + geolocation, div { + -webkit-text-stroke-width: 10px; + -webkit-text-stroke-color: blue; + -webkit-text-fill-color: red; + } + </style> + <div> + <geolocation></geolocation> + </div> +</body> +</html> +\ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/type-supported-feature-detect.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/type-supported-feature-detect.tentative.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Permission Element: Feature detection</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> + test(() => { + assert_not_equals(typeof HTMLPermissionElement, undefined, + `HTMLPermissionElement should not be "undefined"`); + assert_equals(typeof HTMLPermissionElement.isTypeSupported, "function", + `The type of the isTypeSupported should be "function"`); + }, "Test HTMLPermissionElement and isTypeSupported existence"); + + [ + "geolocation", + "camera", + "microphone", + " camera microphone ", + " microphone camera ", + " camera camera microphone", + "microphone microphone camera " + ].forEach((type) => { + test(() => { + assert_true(HTMLPermissionElement.isTypeSupported(type)); + }, `Test HTMLPermissionElement should support type ${type}`); + }); + + [ + "invalid", + "cameraa", + "microphone geolocation", + "camera geolocation", + "camera geolocation microphone", + ].forEach((type) => { + test(() => { + assert_false(HTMLPermissionElement.isTypeSupported(type)); + }, `Test HTMLPermissionElement should not support type ${type}`); + }); +</script> +</body> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/webkit-text-security-on-parent-ref.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/webkit-text-security-on-parent-ref.html @@ -0,0 +1,5 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Reference for Geolocation Element with -webkit-text-security on parent</title> + +<div id="container"><geolocation id="p"></geolocation></div> diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/webkit-text-security-on-parent.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/webkit-text-security-on-parent.tentative.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Geolocation Element with -webkit-text-security on parent</title> +<link rel="help" href="https://github.com/WICG/PEPC"> +<link rel="match" href="webkit-text-security-on-parent-ref.html"> +<style> + #container { + -webkit-text-security: disc; + } +</style> + +<div id="container"><geolocation id="p"></geolocation></div>