Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Permissions API integration, start requiring requestPermission() usage #123

Merged
merged 3 commits into from
Dec 4, 2023

Commits on Nov 14, 2023

  1. Add Permissions API integration, start requiring requestPermission() …

    …usage
    
    This substantive and breaking change integrates the existing
    requestPermission() calls with the Permissions API, so that we do not need
    to essentially redefine the "request permission to use" algorithm here.
    
    Additionally, calling requestPermission() is now a requirement, as
    devicemotion, deviceorientation and deviceorientationabsolute events are
    fired only when the permission state is "granted". This matches WebKit's
    current behavior. Blink's plan is to follow suit in the near future.
    
    The powerful feature names are identical to those proposed in #121:
    "accelerometer", "gyroscope", and "magnetometer", which match the low-level
    sensors that provide the data in the events fired by this specification.
    These names also match those in the Accelerometer, Gyroscope and
    Magnetometer specifications, which allows developers who want to transition
    between these APIs to avoid having to request access to different powerful
    feature names with the same goal.
    
    Also similarly to #121, the idea is to:
    - Require "accelerometer" and "gyroscope" for the devicemotion event.
    - Require "accelerometer" and "gyroscope" to provide relative
      orientation data for the deviceorientation event, and additionally
      "magnetometer" to fall back to absolute orientation data.
    - Requires "accelerometer", "gyroscope", and "magnetometer" for the
      deviceorientationabsolute event.
    
    DeviceOrientationEvent.requestPermission() now takes an optional `absolute`
    argument (defaulting to false) to specify whether it will also request the
    "magnetometer" permission.
    
    IMPORTANT: As far as I can see, the WebKit implementation does not integrate
    with the Permissions API. It therefore does not use the powerful feature
    names described above, nor does support the new `absolute` argument or the
    requesting of different permissions depending on whether developers want to
    access to absolute orientation data.
    
    Fixes #70.
    rakuco committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    f6aabb5 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. Export powerful features here

    Instead of doing that in the Accelerometer, Gyroscope and Magnetometer
    specifications, export them here and reference the definitions from said
    specs.
    
    Doing so allows us not to depend on specifications that are less advanced in
    the Rec track and have fewer implementations.
    rakuco committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    b095ccd View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2023

  1. Configuration menu
    Copy the full SHA
    3c965c8 View commit details
    Browse the repository at this point in the history