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

WebVR 1.1 spec compatibility #17608

Merged
merged 2 commits into from Jul 6, 2017
Merged

WebVR 1.1 spec compatibility #17608

merged 2 commits into from Jul 6, 2017

Conversation

@MortimerGoro
Copy link
Contributor

MortimerGoro commented Jul 5, 2017

Servo WebVR implementation started when WebVR spec 1.2 was about to be released. 1.2 API included some minor breaking changes from spec 1.1 in order to improve the support of the API in WebWorkers.

But eventually the WebVR committee decided not to release 1.2 and make it a major version number with a lot more changes. WebVR API 2.0 is still under heavy churn.

This PR removes the WebVR changes that non-released 1.2 version introduced to support full WebVR 1.1 spec.

I pushed some GC fixes in a separate commit. See #17076 and servo/rust-mozjs#351


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Jul 5, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/vrdisplayevent.rs, components/script/dom/webidls/EventHandler.webidl, components/script/dom/navigator.rs, components/script/dom/macros.rs, components/script/dom/vrframedata.rs and 10 more
  • @KiChjang: components/script/dom/vrdisplayevent.rs, components/script/dom/webidls/EventHandler.webidl, components/script/dom/navigator.rs, components/script/dom/macros.rs, components/script/dom/vrframedata.rs and 10 more
@highfive
Copy link

highfive commented Jul 5, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
@KiChjang
Copy link
Member

KiChjang commented Jul 5, 2017

Is there a link to the specs you mentioned?

@MortimerGoro
Copy link
Contributor Author

MortimerGoro commented Jul 5, 2017

The link is not available anymore: https://github.com/w3c/webvr/pulls?q=is%3Aopen+is%3Apr+milestone%3A1.2

The changes were:

  • Use navigator.vr.getDisplays instead of navigator.getVRDisplays()
  • Use addEventListeners from VRDisplay objects instead of window.addEventListener
@@ -200,7 +200,7 @@ impl VR {

fn notify_display_event(&self, display: &VRDisplay, event: &WebVRDisplayEvent) {
let event = VRDisplayEvent::new_from_webvr(&self.global(), &display, &event);
event.upcast::<Event>().fire(self.upcast());
event.upcast::<Event>().fire(self.global().as_window().upcast::<EventTarget>());

This comment has been minimized.

@jdm

jdm Jul 5, 2017

Member

It should be possible to do self.global().upcast::<EventTarget>().

@@ -467,7 +484,7 @@ impl VRDisplay {
fn notify_event(&self, event: &WebVRDisplayEvent) {
let root = Root::from_ref(&*self);
let event = VRDisplayEvent::new_from_webvr(&self.global(), &root, &event);
event.upcast::<Event>().fire(self.upcast());
event.upcast::<Event>().fire(self.global().as_window().upcast::<EventTarget>());

This comment has been minimized.

@jdm

jdm Jul 5, 2017

Member

self.global().upcast::.

@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://w3c.github.io/webvr/#interface-navigator
[Pref="dom.webvr.enabled"]
[NoInterfaceObject]
interface VR: EventTarget {

This comment has been minimized.

@jdm

jdm Jul 5, 2017

Member

Let's remove the parent interface, as well as from the source implementation.

@MortimerGoro MortimerGoro force-pushed the MortimerGoro:webvr_11 branch from 9eae0cf to e936eac Jul 5, 2017
@jdm
Copy link
Member

jdm commented Jul 6, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2017

📌 Commit e936eac has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2017

Testing commit e936eac with merge ddd3a15...

bors-servo added a commit that referenced this pull request Jul 6, 2017
WebVR 1.1 spec compatibility

<!-- Please describe your changes on the following line: -->

Servo WebVR implementation started when WebVR spec 1.2 was about to be released. 1.2 API included some minor breaking changes from spec 1.1 in order to improve the support of the API in WebWorkers.

But eventually the WebVR  committee decided not to release 1.2 and make it a major version number with a lot more changes. WebVR API 2.0 is still under heavy churn.

This PR removes the WebVR changes that non-released 1.2 version introduced to support full WebVR 1.1 spec.

I pushed some GC fixes in a separate commit. See #17076 and servo/rust-mozjs#351

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17608)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 6, 2017

@bors-servo bors-servo merged commit e936eac into servo:master Jul 6, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.