10000 Update azimuth/altitude/tiltX/tiltY to not require default values in pointer events web idl by liviutinta · Pull Request #323 · w3c/pointerevents · GitHub
[go: up one dir, main page]

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

Update azimuth/altitude/tiltX/tiltY to not require default values in pointer events web idl #323

Merged

Conversation

liviutinta
Copy link
Contributor
@liviutinta liviutinta commented May 28, 2020

Remove default values for tiltX,tiltY,azimuthAngle,altitudeAngle.
Change default value for altitudeAngle to π/2.
Describe rounding method for calculated tiltX,tiltY.
If only the value for one attribute is specified, the other attribute must be populated with the default value.
+@patrickhlauke
+@smaug----
+@NavidZ
+@domenic


Preview | Diff

…pointer events web interfaces

Remove default values for `tiltX`,`tiltY`,`azimuthAngle`,`altitudeAngle`.
Change default value for `altitudeAngle` to `π/2`.
Describe rounding method for calculated `tiltX`,`tiltY`.
If only the value for one attribute is specified, the other attribute must be populated with the default value.
<p>The altitude (in radians) of the transducer (e.g. pen stylus), in the range [0,π/2] - where 0 is parallel to the surface (X-Y plane), and π/2 is perpendicular to the surface. For hardware and platforms that do not report tilt or angle, the value MUST be π/2.</p>
<div class="note">
When the hardware or platform does not report the tilt or angle, as opposed to the default value of 0 defined for <code>altitudeAngle</code>
in <a href="https://w3c.github.io/touch-events/">Touch Events - Level 2</a> specification,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an editorial comment and not important really. You can also reference the touch events with brackets similar to other places in this spec so that it appear in the normative references.

Copy link
Contributor Author
@liviutinta liviutinta Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the reference database and there is no entry for Touch Events - Level 2. I believe this is why it is referenced like this here.

index.html Outdated
If <code>azimuth</code> and <code>altitude</code> are provided, the user agent MUST initialize <code>tiltX</code>, <code>tiltY</code>
with the calculated values rounded to the nearest integer value. For values falling exactly midway between integers, the user agend MUST always round up.
</p>
<p>If only the value of one of the two attributes is provided, the other attribute MUST be initialized to the default value.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does this line refer to both when out of 4 only 1 is present and when out of 4 only 3 is present?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does this line refer to both when out of 4 only 1 is present and when out of 4 only 3 is present?

My intention was to cover both cases. Basically I would like to apply formulas only in these 2 cases:

  • (hasTiltX || hasTiltY) && !hasAzimuthAngle && !hasAltitudeAngle
  • (hasAzimuthAngle || hasAltitudeAngle) && !hasTiltX && !hasTiltY

If tiltX and tiltY and one of azimuthAngle/altitudeAngle values are provided, I cannot guarantee that azimuthAngle/altitudeAngle value as provided by the user matches the formula with regards to tiltX and tiltY. Same goes if azimuthAngle and altitudeAngle and one of tiltX/tiltY values are provided.

My assumption is that the user agent is not going to overwrite a value provided by the user. If the user provides values that are not correct it is an authoring problem.

@NavidZ
Copy link
Member
NavidZ commented Jun 4, 2020

@liviutinta btw, did this solve our implementation problem we see in Chromium code for "has*" functions?

@liviutinta
Copy link
Contributor Author

@liviutinta btw, did this solve our implementation problem we see in Chromium code for "has*" functions?

Yes, removing default values for tiltX, tiltY, altitudeAngle, azimuthAngle in the pointer_event.idl and pointer_event_init.idl files solves the problem we've had with "has*" functions. Now, the functions work as I originally expected: for all properties in the set (tiltX, tiltY, altitudeAngle, azimuthAngle) with no value in the init dictionary the corresponding "has*" function returns false.

Copy link
Member
@NavidZ NavidZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

Copy link
Member
@mustaqahmed mustaqahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but I would ask for a few minor edits.

Separate explanations for `tiltX` / `tiltY` and `altitudeAngle`/
`azimuthAngle` into 3 paragraphs: first a general description and
how a user agent needs to populate trusted events, second about
calculations for untrusted events and the last one a note related
to rounding resulting `tiltX` / `tiltY` angles to degrees.
Copy link
Member
@mustaqahmed mustaqahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Liviu, this looks good to me now.

@mustaqahmed
Copy link
Member

We will need approvals from @smaug---- and @patrickhlauke.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 26, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add tr
10000
ansform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

See Pointer Events spec Pull Request here:
w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 26, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

See Pointer Events spec Pull Request here:
w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 30, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
@NavidZ
Copy link
Member
NavidZ commented Jul 8, 2020

@smaug---- and @patrickhlauke does this look okay?

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 8, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 10, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 13, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
@patrickhlauke patrickhlauke merged commit abf66fe into w3c:gh-pages Jul 13, 2020
@liviutinta liviutinta deleted the azimuth_altitude_no_default_in_idl branch July 14, 2020 19:08
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 17, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 17, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 21, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790586}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 21, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790586}
blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this pull request Jul 22, 2020
Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790586}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 24, 2020
…a=testonly

Automatic update from web-platform-tests
Add Azimuth/Altitude to Pointer Events

Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790586}

--

wpt-commits: 7a5f4a4eff43a231973fba9ba9527e1b88f54c74
wpt-pr: 23242
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Jul 25, 2020
…a=testonly

Automatic update from web-platform-tests
Add Azimuth/Altitude to Pointer Events

Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Liviu Tinta <liviutinta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790586}

--

wpt-commits: 7a5f4a4eff43a231973fba9ba9527e1b88f54c74
wpt-pr: 23242
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Aug 1, 2020
…a=testonly

Automatic update from web-platform-tests
Add Azimuth/Altitude to Pointer Events

Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokanchromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Commit-Queue: Liviu Tinta <liviutintachromium.org>
Cr-Commit-Position: refs/heads/master{#790586}

--

wpt-commits: 7a5f4a4eff43a231973fba9ba9527e1b88f54c74
wpt-pr: 23242

UltraBlame original commit: f438aea49eaefede895bbd0aeeecc6f5c42a721f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Aug 1, 2020
…a=testonly

Automatic update from web-platform-tests
Add Azimuth/Altitude to Pointer Events

Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokanchromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Commit-Queue: Liviu Tinta <liviutintachromium.org>
Cr-Commit-Position: refs/heads/master{#790586}

--

wpt-commits: 7a5f4a4eff43a231973fba9ba9527e1b88f54c74
wpt-pr: 23242

UltraBlame original commit: f438aea49eaefede895bbd0aeeecc6f5c42a721f
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Aug 1, 2020
…a=testonly

Automatic update from web-platform-tests
Add Azimuth/Altitude to Pointer Events

Add azimuthAngle/altitudeAngle to pointer_events.idl and
pointer_events_init.idl. Remove tiltX/tiltY default values from
pointer_events.idl

Add transform functions from tiltX/tiltY
to azimuth/altitude.

Add web platform test.

Change default values for tiltX/tiltY.  See Pointer Events spec
Pull Request here: w3c/pointerevents#323

Bug: 1069500
Change-Id: Ie04dd991e0223a793a037c784631ddf3a14e70a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165457
Reviewed-by: David Bokan <bokanchromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Commit-Queue: Liviu Tinta <liviutintachromium.org>
Cr-Commit-Position: refs/heads/master{#790586}

--

wpt-commits: 7a5f4a4eff43a231973fba9ba9527e1b88f54c74
wpt-pr: 23242

UltraBlame original commit: f438aea49eaefede895bbd0aeeecc6f5c42a721f
341A @patrickhlauke patrickhlauke added the wpt label Aug 17, 2022
@mustaqahmed
Copy link
Member

We have this WPT for this change: pointerevent_tiltX_tiltY_to_azimuth_altitude.html.

@mustaqahmed mustaqahmed removed the wpt label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0