commit 0ffbc0492ed89054611dbff54ec512fd4c5cdf6f
parent 53b7c1c9d3f58a4b0f2264ffca33a34a2692a2a7
Author: Mike West <mkwst@chromium.org>
Date: Wed, 19 Nov 2025 04:56:22 +0000
Bug 2000668 [wpt PR 56063] - [<geolocation> element] Add IDL tests., a=testonly
Automatic update from web-platform-tests
[<geolocation> element] Add IDL tests.
This CL copies the IDL from the specification[1], and adds failing test
expectations to match our implementation. ~All of these will be resolved
when we stop inheriting from `HTMLPermissionElement`.
[1]: https://wicg.github.io/PEPC/permission-elements.html
Bug: 430861538
Change-Id: Ic88442203c1c7829e29fe5f0f559a66a04ff8724
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7156740
Reviewed-by: Thomas Nguyen <tungnh@chromium.org>
Commit-Queue: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1546398}
--
wpt-commits: e36541a53cbde6098c48d5dcc757db4647e6bf29
wpt-pr: 56063
Diffstat:
2 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/idlharness.tentative.window.js b/testing/web-platform/tests/html/semantics/permission-element/geolocation-element/idlharness.tentative.window.js
@@ -0,0 +1,12 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+idl_test(
+ ['geolocation-element.tentative'],
+ ['html', 'dom', 'permissions', 'geolocation'],
+ (idl_array) => {
+ idl_array.add_objects({
+ HTMLGeolocationElement: ["document.createElement('geolocation')"],
+ });
+ });
+
diff --git a/testing/web-platform/tests/interfaces/geolocation-element.tentative.idl b/testing/web-platform/tests/interfaces/geolocation-element.tentative.idl
@@ -0,0 +1,40 @@
+// https://wicg.github.io/PEPC/permission-elements.html#mixin-activation
+enum InPagePermissionMixinBlockerReason {
+ // No blocker reason.
+ "",
+
+ // Blocker reasons supported by all InPagePermissionMixin users.
+ "illegal_subframe", "unsuccesful_registration",
+ "recently_attached", "intersection_changed",
+ "intersection_out_of_viewport_or_clipped",
+ "intersection_occluded_or_distorted", "style_invalid",
+
+ // Blocker reason specific to HTMLPermissionElement.
+ "type_invalid",
+};
+
+// https://wicg.github.io/PEPC/permission-elements.html#permission-mixin
+interface mixin InPagePermissionMixin {
+ readonly attribute boolean isValid;
+ readonly attribute InPagePermissionMixinBlockerReason invalidReason;
+ readonly attribute PermissionState initialPermissionStatus;
+ readonly attribute PermissionState permissionStatus;
+
+ attribute EventHandler onpromptaction;
+ attribute EventHandler onpromptdismiss;
+ attribute EventHandler onvalidationstatuschange;
+};
+
+// https://wicg.github.io/PEPC/permission-elements.html#geolocation-element
+[Exposed=Window]
+interface HTMLGeolocationElement : HTMLElement {
+ [HTMLConstructor] constructor();
+
+ readonly attribute GeolocationPosition position;
+ readonly attribute GeolocationPositionError error;
+ [CEReactions, Reflect] attribute boolean autolocate;
+ [CEReactions, Reflect] attribute boolean watch;
+
+ attribute EventHandler onlocation;
+};
+HTMLGeolocationElement includes InPagePermissionMixin;