Commit graph

2 commits

Author SHA1 Message Date
Niccolo Antonelli-Dziri
920bb84fd7 LibWeb: Support Geolocation permission
Add the 'requesting permission to use a powerful feature' algorithm to
PermissionsAPI.
In requesting geolocation, now checks for permission status. UI element
to request permission to the user does not exist yet, and like
previously, defaults to denied.

A few tests pass because they use "geolocation" feature.
2026-05-11 21:01:01 +02:00
Niccolo Antonelli-Dziri
9f4a712e57 LibWeb: Add basics for the Permissions API
This adds the basic infrastructure for the Permissions API, including
the `Permissions` and `PermissionStatus` interfaces. The API is exposed
via `navigator.permissions` on both `Window` and `WorkerGlobalScope`.

- `is_permission_supported` is hardcoded to return false.
- The `query()` method checks for a secure context but rejects all
queries since no powerful features are supported yet.

The permission store and permission key related methods and algorithms.
Ability for the user agent to store the permissions entries.

Passes a few more subtests in `permissions/`.

https://wpt.live/permissions/idlharness.any.html

https://wpt.live/permissions/idlharness.any.worker.html

https://wpt.live/permissions/edge-cases.https.html

This one behaves differently because now the `query` property is
defined. And the last subtest passes for the wrong reason.
"Querying "fullscreen" permission with "allowWithoutGesture" false
is unsupported"
but in fact everything is currently unsupported.

https://wpt.live/fullscreen/api/permission.tentative.https.html

permission is marked as experimental in Navigator and WorkerNavigator,
so tests that now pass actually don't because the tests don't have
access to the interfaces.
2026-05-11 21:01:01 +02:00