From 1a7f7d9a809eb1499e2a13b69ece265a55bd365b Mon Sep 17 00:00:00 2001 From: Ionel Popescu Date: Sat, 13 Nov 2021 10:07:19 +0000 Subject: [PATCH] Bug 1740373 [wpt PR 31568] - [SelectMenu] Fix popup position when zoom is used., a=testonly Automatic update from web-platform-tests [SelectMenu] Fix popup position when zoom is used. This CL fixes the popup position when zoom is used by ensuring that the computed coordinates are zoom adjusted. This CL also updates the behavior so that recomputing the position isn't required only when the popup is closed since there are some cases where the position needs to be recomputed (e.g. popup receives focus when the scrollbar is clicked). The new behavior is validated by: selectmenu-popup-position-with-zoom and selectmenu-many-options. Bug: 1121840 Change-Id: Ib924000963a241825b83b4555b25c75c5470f097 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3271770 Commit-Queue: Ionel Popescu Reviewed-by: Mason Freed Reviewed-by: Dan Clark Cr-Commit-Position: refs/heads/main@{#940173} -- wpt-commits: 60960e42ad3db540d6bf8310e0cd1f1f9e1948af wpt-pr: 31568 --- .../selectmenu-many-options.tentative.html | 131 +++++++++++++++++ ...trary-content-displayed-ref.tentative.html | 8 +- ...arbitrary-content-displayed.tentative.html | 8 +- ...nu-popup-position-with-zoom.tentative.html | 135 ++++++++++++++++++ 4 files changed, 278 insertions(+), 4 deletions(-) create mode 100644 testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-many-options.tentative.html create mode 100644 testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-popup-position-with-zoom.tentative.html diff --git a/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-many-options.tentative.html b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-many-options.tentative.html new file mode 100644 index 000000000000..8de1318e61d0 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-many-options.tentative.html @@ -0,0 +1,131 @@ + + +HTMLSelectMenuElement Test: many options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed-ref.tentative.html b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed-ref.tentative.html index f4ef3b273bd2..8705cf839450 100644 --- a/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed-ref.tentative.html +++ b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed-ref.tentative.html @@ -25,10 +25,14 @@ /* Per settings in test file: */ width: fit-content; height: fit-content; - border: 1px solid; - padding: 1em; background: -internal-light-dark(white, black); color: -internal-light-dark(black, white); + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0px; + box-shadow: 0px 12.8px 28.8px rgba(0, 0, 0, 0.13), 0px 0px 9.2px rgba(0, 0, 0, 0.11); + box-sizing: border-box; + overflow: auto; + padding: 4px; } selectmenu { diff --git a/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed.tentative.html b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed.tentative.html index 479a04bef03a..f9824d1d520f 100644 --- a/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed.tentative.html +++ b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-option-arbitrary-content-displayed.tentative.html @@ -20,10 +20,14 @@ popup { width: fit-content; height: fit-content; - border: 1px solid; - padding: 1em; background: white; color: black; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0px; + box-shadow: 0px 12.8px 28.8px rgba(0, 0, 0, 0.13), 0px 0px 9.2px rgba(0, 0, 0, 0.11); + box-sizing: border-box; + overflow: auto; + padding: 4px; } option { diff --git a/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-popup-position-with-zoom.tentative.html b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-popup-position-with-zoom.tentative.html new file mode 100644 index 000000000000..caf1bcf4d6c7 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-selectmenu-element/selectmenu-popup-position-with-zoom.tentative.html @@ -0,0 +1,135 @@ + + +HTMLSelectMenuElement Test: popup position with zoom + + + + + + + + + + +
Custom bottom left
+ + + + + +
+
+ + +
Custom top left
+ + + + + +
+ + +
Custom bottom right
+ + + + + +
+ + +
Custom top right
+ + + + + +
+ + \ No newline at end of file