summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/permission-element
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /testing/web-platform/tests/html/semantics/permission-element
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/permission-element')
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reftest-ref.html (renamed from testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference-expected.html)0
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reftest.tentative.html (renamed from testing/web-platform/tests/html/semantics/permission-element/bounded-css-properties-reference.tentative.html)2
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest-ref.html56
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest.tentative.html68
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/bounded-sizes.tentative.html75
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/display-css-property-reftest-ref.html (renamed from testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference-expected.html)0
-rw-r--r--testing/web-platform/tests/html/semantics/permission-element/display-css-property-reftest.tentative.html (renamed from testing/web-platform/tests/html/semantics/permission-element/display-css-property-reference.tentative.html)2
7 files changed, 201 insertions, 2 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-reftest-ref.html
index c62ff5b24d..c62ff5b24d 100644
--- 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-reftest-ref.html
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-reftest.tentative.html
index b8337ab87d..ad6986f52b 100644
--- 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-reftest.tentative.html
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
-<link rel="match" href="bounded-css-properties-reference-expected.html">
+<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>
diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest-ref.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest-ref.html
new file mode 100644
index 0000000000..b186dd6445
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest-ref.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<body>
+ <div>
+ The permission element should have some limits for the min/max-width/height:
+ <ul>
+ <li>min-width should be sufficient to fit the element text (depends on user agent implementation)</li>
+ <li>max-width should be at most 3x min-width</li>
+ <li>min-height should be sufficient to fit the element text (1em)</li>
+ <li>max-height should be at most 3x min-height</li>
+ <li>padding-left/top only work with width/height: auto and are at most 5em/1em</li>
+ <li>padding-right/bottom are copied over from padding-left/top in this case</li>
+ </ul>
+ </div>
+
+ <style>
+ #id1 {
+ font-size: 10px;
+ height: 10px;
+ /* width set via JS */
+ }
+ #id2 {
+ font-size: 10px;
+ height: 30px;
+ /* width set via JS */
+ }
+ #id3 {
+ font-size: 10px;
+ height: 30px;
+ color:black;
+ background-color: black;
+
+ /* Used to compute width which will then have the padding
+ artificially added in JS */
+ width: fit-content;
+ }
+ </style>
+
+ <div><permission id="id1" type="geolocation"></div>
+ <div><permission id="id2" type="camera"></div>
+ <div><permission id="id3" type="microphone"></div>
+
+<script>
+ let el = document.getElementById("id1");
+ el.style.width = getComputedStyle(el).minWidth;
+
+ el = document.getElementById("id2");
+ el.style.width = getComputedStyle(el).maxWidth;
+
+ el = document.getElementById("id3");
+ let w = getComputedStyle(el).width;
+ el.style.width = `calc(${w} + 100px)`; // 100px is 2 * 5em;
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest.tentative.html
new file mode 100644
index 0000000000..45ffb633c3
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes-reftest.tentative.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<link rel="match" href="bounded-sizes-reftest-ref.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 the min/max-width/height:
+ <ul>
+ <li>min-width should be sufficient to fit the element text (depends on user agent implementation)</li>
+ <li>max-width should be at most 3x min-width</li>
+ <li>min-height should be sufficient to fit the element text (1em)</li>
+ <li>max-height should be at most 3x min-height</li>
+ <li>padding-left/top only work with width/height: auto and are at most 5em/1em</li>
+ <li>padding-right/bottom are copied over from padding-left/top in this case</li>
+ </ul>
+ </div>
+
+<style>
+ #id1 {
+ font-size: 10px;
+ min-height: 1px;
+ max-height: 100px;
+
+ /* These values are extreme enough that they should be out of bounds for any implementation */
+ min-width: 10px;
+ max-width: 1000px;
+
+ /* This element will be as tiny as possible */
+ width: 1px;
+ height: 1px;
+ }
+ #id2 {
+ font-size: 10px;
+ min-height: 1px;
+ max-height: 100px;
+
+ /* These values are extreme enough that they should be out of bounds for any implementation */
+ min-width: 10px;
+ max-width: 1000px;
+
+ /* This element will be as large as possible */
+ width: 1000px;
+ height: 1000px;
+ }
+ #id3 {
+ font-size: 10px;
+ width: auto;
+ height: auto;
+
+ /* There is a slight misalignment of the text (by 1px) when using
+ padding vs using width/height. Since this test's purpose is to
+ check that the bounds are identical, the color and background-color
+ are set to the same value to cover the slight text misalignment */
+ color:black;
+ background-color: black;
+
+ /* Only padding-top and padding-left are taken into account */
+ padding-top: 1000px;
+ padding-left: 1000px;
+ padding-bottom: 1px;
+ padding-right: 1px;
+ }
+</style>
+
+<div><permission id="id1" type="geolocation"></div>
+<div><permission id="id2" type="camera"></div>
+<div><permission id="id3" type="microphone"></div>
+</body> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes.tentative.html b/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes.tentative.html
new file mode 100644
index 0000000000..2010cd0a54
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/permission-element/bounded-sizes.tentative.html
@@ -0,0 +1,75 @@
+<!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>
+ #id1 {
+ font-size: 10px;
+ width: auto;
+ height: auto;
+
+ 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;
+ }
+ #id2 {
+ font-size: 10px;
+ width: auto;
+ height: auto;
+
+ min-height: 11px;
+ max-height: 29px;
+
+ padding-top: 5px;
+ padding-left: 45px;
+ padding-bottom: 6px;
+ padding-right: 46px;
+ }
+</style>
+
+
+<permission id="id1" type="geolocation">
+<permission id="id2" type="camera">
+
+<script>
+ test(function(){
+ let el_outside_bounds = document.getElementById("id1");
+ 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(){
+ let el_inside_bounds = document.getElementById("id2");
+ 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");
+</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-reftest-ref.html
index 6a04c94c03..6a04c94c03 100644
--- 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-reftest-ref.html
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-reftest.tentative.html
index 973a76d723..e83786373d 100644
--- 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-reftest.tentative.html
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
-<link rel="match" href="display-css-property-reference-expected.html">
+<link rel="match" href="display-css-property-reftest-ref.html">
<link rel="help" href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style">
<body>
<div>