[WebVR] Add IDLs and stubs
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Sep 2017 11:17:27 +0000 (11:17 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Sep 2017 11:17:27 +0000 (11:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174202

Reviewed by Dean Jackson.

Source/WebCore:

Adding the complete set of IDLs for the WebVR 1.1 spec including the interface stubs which
currently do nothing.

Tests: webvr/webvr-disabled.html
       webvr/webvr-enabled.html

* CMakeLists.txt:
* DerivedSources.make:
* Modules/webvr/DOMWindowWebVR.idl: Added.
* Modules/webvr/GamepadWebVR.cpp: Added.
(WebCore::GamepadWebVR::GamepadWebVR):
(WebCore::GamepadWebVR::~GamepadWebVR):
(WebCore::GamepadWebVR::displayId):
* Modules/webvr/GamepadWebVR.h: Added.
* Modules/webvr/GamepadWebVR.idl: Added.
* Modules/webvr/NavigatorWebVR.cpp: Added.
(WebCore::NavigatorWebVR::getVRDisplays):
(WebCore::NavigatorWebVR::activeVRDisplays):
(WebCore::NavigatorWebVR::vrEnabled):
* Modules/webvr/NavigatorWebVR.h: Added.
* Modules/webvr/NavigatorWebVR.idl: Added.
* Modules/webvr/VRDisplay.cpp: Added.
(WebCore::VRDisplay::create):
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::isConnected const):
(WebCore::VRDisplay::isPresenting const):
(WebCore::VRDisplay::capabilities const):
(WebCore::VRDisplay::stageParameters const):
(WebCore::VRDisplay::getEyeParameters const):
(WebCore::VRDisplay::displayId const):
(WebCore::VRDisplay::displayName const):
(WebCore::VRDisplay::getFrameData const):
(WebCore::VRDisplay::getPose const):
(WebCore::VRDisplay::resetPose):
(WebCore::VRDisplay::depthNear const):
(WebCore::VRDisplay::setDepthNear):
(WebCore::VRDisplay::depthFar const):
(WebCore::VRDisplay::setDepthFar):
(WebCore::VRDisplay::requestAnimationFrame):
(WebCore::VRDisplay::cancelAnimationFrame):
(WebCore::VRDisplay::requestPresent):
(WebCore::VRDisplay::exitPresent):
(WebCore::VRDisplay::getLayers const):
(WebCore::VRDisplay::submitFrame):
(WebCore::VRDisplay::hasPendingActivity const):
(WebCore::VRDisplay::activeDOMObjectName const):
(WebCore::VRDisplay::canSuspendForDocumentSuspension const):
(WebCore::VRDisplay::stop):
* Modules/webvr/VRDisplay.h: Added.
* Modules/webvr/VRDisplay.idl: Added.
* Modules/webvr/VRDisplayCapabilities.cpp: Added.
(WebCore::VRDisplayCapabilities::hasPosition const):
(WebCore::VRDisplayCapabilities::hasOrientation const):
(WebCore::VRDisplayCapabilities::hasExternalDisplay const):
(WebCore::VRDisplayCapabilities::canPresent const):
(WebCore::VRDisplayCapabilities::maxLayer const):
* Modules/webvr/VRDisplayCapabilities.h: Added.
(WebCore::VRDisplayCapabilities::create):
* Modules/webvr/VRDisplayCapabilities.idl: Added.
* Modules/webvr/VRDisplayEvent.cpp: Added.
(WebCore::VRDisplayEvent::VRDisplayEvent):
(WebCore::VRDisplayEvent::display const):
(WebCore::VRDisplayEvent::reason const):
(WebCore::VRDisplayEvent::eventInterface const):
* Modules/webvr/VRDisplayEvent.h: Added.
* Modules/webvr/VRDisplayEvent.idl: Added.
* Modules/webvr/VRDisplayEventReason.h: Added.
* Modules/webvr/VRDisplayEventReason.idl: Added.
* Modules/webvr/VREye.h: Added.
* Modules/webvr/VREye.idl: Added.
* Modules/webvr/VREyeParameters.cpp: Added.
(WebCore::VREyeParameters::VREyeParameters):
(WebCore::VREyeParameters::offset const):
(WebCore::VREyeParameters::fieldOfView const):
(WebCore::VREyeParameters::renderWidth const):
(WebCore::VREyeParameters::renderHeight const):
* Modules/webvr/VREyeParameters.h: Added.
(WebCore::VREyeParameters::create):
* Modules/webvr/VREyeParameters.idl: Added.
* Modules/webvr/VRFieldOfView.cpp: Added.
(WebCore::VRFieldOfView::upDegrees const):
(WebCore::VRFieldOfView::rightDegrees const):
(WebCore::VRFieldOfView::downDegrees const):
(WebCore::VRFieldOfView::leftDegrees const):
* Modules/webvr/VRFieldOfView.h: Added.
(WebCore::VRFieldOfView::create):
* Modules/webvr/VRFieldOfView.idl: Added.
* Modules/webvr/VRFrameData.cpp: Added.
(WebCore::VRFrameData::VRFrameData):
(WebCore::VRFrameData::timestamp const):
(WebCore::VRFrameData::leftProjectionMatrix const):
(WebCore::VRFrameData::leftViewMatrix const):
(WebCore::VRFrameData::rightProjectionMatrix const):
(WebCore::VRFrameData::rightViewMatrix const):
(WebCore::VRFrameData::pose const):
* Modules/webvr/VRFrameData.h: Added.
(WebCore::VRFrameData::create):
* Modules/webvr/VRFrameData.idl: Added.
* Modules/webvr/VRLayerInit.h: Added.
* Modules/webvr/VRLayerInit.idl: Added.
* Modules/webvr/VRPose.cpp: Added.
(WebCore::VRPose::position const):
(WebCore::VRPose::linearVelocity const):
(WebCore::VRPose::linearAcceleration const):
(WebCore::VRPose::orientation const):
(WebCore::VRPose::angularVelocity const):
(WebCore::VRPose::angularAcceleration const):
* Modules/webvr/VRPose.h: Added.
(WebCore::VRPose::create):
* Modules/webvr/VRPose.idl: Added.
* Modules/webvr/VRStageParameters.cpp: Added.
(WebCore::VRStageParameters::sittingToStandingTransform const):
(WebCore::VRStageParameters::sizeX const):
(WebCore::VRStageParameters::sizeZ const):
* Modules/webvr/VRStageParameters.h: Added.
(WebCore::VRStageParameters::create):
* Modules/webvr/VRStageParameters.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* features.json:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebVREnabled):
(WebCore::RuntimeEnabledFeatures::webVREnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebVREnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit:

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

New tests to verify that WebVR is properly enabled/disabled at runtime.

* webvr/webvr-disabled-expected.txt: Added.
* webvr/webvr-disabled.html: Added.
* webvr/webvr-enabled-expected.txt: Added.
* webvr/webvr-enabled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221966 268f45cc-cd09-0410-ab3c-d52691b4dbfc

58 files changed:
LayoutTests/ChangeLog
LayoutTests/webvr/webvr-disabled-expected.txt [new file with mode: 0644]
LayoutTests/webvr/webvr-disabled.html [new file with mode: 0644]
LayoutTests/webvr/webvr-enabled-expected.txt [new file with mode: 0644]
LayoutTests/webvr/webvr-enabled.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/webvr/DOMWindowWebVR.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/GamepadWebVR.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/GamepadWebVR.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/GamepadWebVR.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/NavigatorWebVR.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/NavigatorWebVR.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/NavigatorWebVR.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplay.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplay.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplay.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayCapabilities.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayCapabilities.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayCapabilities.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayEvent.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayEventReason.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRDisplayEventReason.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VREye.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VREye.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VREyeParameters.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VREyeParameters.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VREyeParameters.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRFieldOfView.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRFieldOfView.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRFieldOfView.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRFrameData.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRFrameData.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRFrameData.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRLayerInit.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRLayerInit.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRPose.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRPose.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRPose.idl [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRStageParameters.cpp [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRStageParameters.h [new file with mode: 0644]
Source/WebCore/Modules/webvr/VRStageParameters.idl [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/EventTargetFactory.in
Source/WebCore/features.json
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferencesDefinitions.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 88710d5..d59ccc0 100644 (file)
@@ -1,3 +1,17 @@
+2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebVR] Add IDLs and stubs
+        https://bugs.webkit.org/show_bug.cgi?id=174202
+
+        Reviewed by Dean Jackson.
+
+        New tests to verify that WebVR is properly enabled/disabled at runtime.
+
+        * webvr/webvr-disabled-expected.txt: Added.
+        * webvr/webvr-disabled.html: Added.
+        * webvr/webvr-enabled-expected.txt: Added.
+        * webvr/webvr-enabled.html: Added.
+
 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
 
         Update the type of the texture argument to framebufferTextureLayer().
diff --git a/LayoutTests/webvr/webvr-disabled-expected.txt b/LayoutTests/webvr/webvr-disabled-expected.txt
new file mode 100644 (file)
index 0000000..dd5ed54
--- /dev/null
@@ -0,0 +1,2 @@
+PASS undefined is undefined.
+
diff --git a/LayoutTests/webvr/webvr-disabled.html b/LayoutTests/webvr/webvr-disabled.html
new file mode 100644 (file)
index 0000000..4556a9c
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<script src="../resources/js-test-pre.js"></script>
+<script>
+if (window.testRunner)
+    window.testRunner.dumpAsText();
+
+if (window.internals)
+    window.internals.settings.setWebVREnabled(false);
+
+function runTest() {
+    if (!window.testRunner)
+        return;
+
+    shouldBeUndefined(navigator.getVRDisplays);
+}
+
+window.addEventListener("load", runTest, false);
+</script>
diff --git a/LayoutTests/webvr/webvr-enabled-expected.txt b/LayoutTests/webvr/webvr-enabled-expected.txt
new file mode 100644 (file)
index 0000000..2ea38bd
--- /dev/null
@@ -0,0 +1,4 @@
+PASS function getVRDisplays() {
+    [native code]
+} is defined.
+
diff --git a/LayoutTests/webvr/webvr-enabled.html b/LayoutTests/webvr/webvr-enabled.html
new file mode 100644 (file)
index 0000000..69d4254
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../resources/js-test-pre.js"></script>
+
+<script>
+if (window.testRunner)
+    window.testRunner.dumpAsText();
+
+if (window.internals)
+    window.internals.settings.setWebVREnabled(true);
+
+function runTest() {
+    if (!window.testRunner)
+        return;
+
+    shouldBeDefined(navigator.getVRDisplays);
+}
+
+window.addEventListener("load", runTest, false);
+</script>
index d5b3b41..1cb7e7b 100644 (file)
@@ -42,6 +42,7 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/Modules/webdatabase"
     "${WEBCORE_DIR}/Modules/webdriver"
     "${WEBCORE_DIR}/Modules/websockets"
+    "${WEBCORE_DIR}/Modules/webvr"
     "${WEBCORE_DIR}/accessibility"
     "${WEBCORE_DIR}/animation"
     "${WEBCORE_DIR}/bindings"
@@ -169,6 +170,7 @@ set(WebCore_IDL_INCLUDES
     Modules/webaudio
     Modules/webdatabase
     Modules/websockets
+    Modules/webvr
 
     bindings/js
 
@@ -375,6 +377,21 @@ set(WebCore_NON_SVG_IDL_FILES
     Modules/websockets/CloseEvent.idl
     Modules/websockets/WebSocket.idl
 
+    Modules/webvr/DOMWindowWebVR.idl
+    Modules/webvr/GamepadWebVR.idl
+    Modules/webvr/NavigatorWebVR.idl
+    Modules/webvr/VRDisplay.idl
+    Modules/webvr/VRDisplayCapabilities.idl
+    Modules/webvr/VRDisplayEvent.idl
+    Modules/webvr/VRDisplayEventReason.idl
+    Modules/webvr/VREye.idl
+    Modules/webvr/VREyeParameters.idl
+    Modules/webvr/VRFieldOfView.idl
+    Modules/webvr/VRFrameData.idl
+    Modules/webvr/VRLayerInit.idl
+    Modules/webvr/VRPose.idl
+    Modules/webvr/VRStageParameters.idl
+
     animation/Animatable.idl
     animation/AnimationEffect.idl
     animation/AnimationTimeline.idl
@@ -1173,6 +1190,17 @@ set(WebCore_SOURCES
     Modules/websockets/WebSocketHandshake.cpp
     Modules/websockets/WorkerThreadableWebSocketChannel.cpp
 
+    Modules/webvr/GamepadWebVR.cpp
+    Modules/webvr/NavigatorWebVR.cpp
+    Modules/webvr/VRDisplay.cpp
+    Modules/webvr/VRDisplayCapabilities.cpp
+    Modules/webvr/VRDisplayEvent.cpp
+    Modules/webvr/VREyeParameters.cpp
+    Modules/webvr/VRFieldOfView.cpp
+    Modules/webvr/VRFrameData.cpp
+    Modules/webvr/VRPose.cpp
+    Modules/webvr/VRStageParameters.cpp
+
     accessibility/AXObjectCache.cpp
     accessibility/AccessibilityARIAGrid.cpp
     accessibility/AccessibilityARIAGridCell.cpp
index 4f444fe..94de056 100644 (file)
@@ -1,3 +1,142 @@
+2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebVR] Add IDLs and stubs
+        https://bugs.webkit.org/show_bug.cgi?id=174202
+
+        Reviewed by Dean Jackson.
+
+        Adding the complete set of IDLs for the WebVR 1.1 spec including the interface stubs which
+        currently do nothing.
+
+        Tests: webvr/webvr-disabled.html
+               webvr/webvr-enabled.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Modules/webvr/DOMWindowWebVR.idl: Added.
+        * Modules/webvr/GamepadWebVR.cpp: Added.
+        (WebCore::GamepadWebVR::GamepadWebVR):
+        (WebCore::GamepadWebVR::~GamepadWebVR):
+        (WebCore::GamepadWebVR::displayId):
+        * Modules/webvr/GamepadWebVR.h: Added.
+        * Modules/webvr/GamepadWebVR.idl: Added.
+        * Modules/webvr/NavigatorWebVR.cpp: Added.
+        (WebCore::NavigatorWebVR::getVRDisplays):
+        (WebCore::NavigatorWebVR::activeVRDisplays):
+        (WebCore::NavigatorWebVR::vrEnabled):
+        * Modules/webvr/NavigatorWebVR.h: Added.
+        * Modules/webvr/NavigatorWebVR.idl: Added.
+        * Modules/webvr/VRDisplay.cpp: Added.
+        (WebCore::VRDisplay::create):
+        (WebCore::VRDisplay::VRDisplay):
+        (WebCore::VRDisplay::isConnected const):
+        (WebCore::VRDisplay::isPresenting const):
+        (WebCore::VRDisplay::capabilities const):
+        (WebCore::VRDisplay::stageParameters const):
+        (WebCore::VRDisplay::getEyeParameters const):
+        (WebCore::VRDisplay::displayId const):
+        (WebCore::VRDisplay::displayName const):
+        (WebCore::VRDisplay::getFrameData const):
+        (WebCore::VRDisplay::getPose const):
+        (WebCore::VRDisplay::resetPose):
+        (WebCore::VRDisplay::depthNear const):
+        (WebCore::VRDisplay::setDepthNear):
+        (WebCore::VRDisplay::depthFar const):
+        (WebCore::VRDisplay::setDepthFar):
+        (WebCore::VRDisplay::requestAnimationFrame):
+        (WebCore::VRDisplay::cancelAnimationFrame):
+        (WebCore::VRDisplay::requestPresent):
+        (WebCore::VRDisplay::exitPresent):
+        (WebCore::VRDisplay::getLayers const):
+        (WebCore::VRDisplay::submitFrame):
+        (WebCore::VRDisplay::hasPendingActivity const):
+        (WebCore::VRDisplay::activeDOMObjectName const):
+        (WebCore::VRDisplay::canSuspendForDocumentSuspension const):
+        (WebCore::VRDisplay::stop):
+        * Modules/webvr/VRDisplay.h: Added.
+        * Modules/webvr/VRDisplay.idl: Added.
+        * Modules/webvr/VRDisplayCapabilities.cpp: Added.
+        (WebCore::VRDisplayCapabilities::hasPosition const):
+        (WebCore::VRDisplayCapabilities::hasOrientation const):
+        (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
+        (WebCore::VRDisplayCapabilities::canPresent const):
+        (WebCore::VRDisplayCapabilities::maxLayer const):
+        * Modules/webvr/VRDisplayCapabilities.h: Added.
+        (WebCore::VRDisplayCapabilities::create):
+        * Modules/webvr/VRDisplayCapabilities.idl: Added.
+        * Modules/webvr/VRDisplayEvent.cpp: Added.
+        (WebCore::VRDisplayEvent::VRDisplayEvent):
+        (WebCore::VRDisplayEvent::display const):
+        (WebCore::VRDisplayEvent::reason const):
+        (WebCore::VRDisplayEvent::eventInterface const):
+        * Modules/webvr/VRDisplayEvent.h: Added.
+        * Modules/webvr/VRDisplayEvent.idl: Added.
+        * Modules/webvr/VRDisplayEventReason.h: Added.
+        * Modules/webvr/VRDisplayEventReason.idl: Added.
+        * Modules/webvr/VREye.h: Added.
+        * Modules/webvr/VREye.idl: Added.
+        * Modules/webvr/VREyeParameters.cpp: Added.
+        (WebCore::VREyeParameters::VREyeParameters):
+        (WebCore::VREyeParameters::offset const):
+        (WebCore::VREyeParameters::fieldOfView const):
+        (WebCore::VREyeParameters::renderWidth const):
+        (WebCore::VREyeParameters::renderHeight const):
+        * Modules/webvr/VREyeParameters.h: Added.
+        (WebCore::VREyeParameters::create):
+        * Modules/webvr/VREyeParameters.idl: Added.
+        * Modules/webvr/VRFieldOfView.cpp: Added.
+        (WebCore::VRFieldOfView::upDegrees const):
+        (WebCore::VRFieldOfView::rightDegrees const):
+        (WebCore::VRFieldOfView::downDegrees const):
+        (WebCore::VRFieldOfView::leftDegrees const):
+        * Modules/webvr/VRFieldOfView.h: Added.
+        (WebCore::VRFieldOfView::create):
+        * Modules/webvr/VRFieldOfView.idl: Added.
+        * Modules/webvr/VRFrameData.cpp: Added.
+        (WebCore::VRFrameData::VRFrameData):
+        (WebCore::VRFrameData::timestamp const):
+        (WebCore::VRFrameData::leftProjectionMatrix const):
+        (WebCore::VRFrameData::leftViewMatrix const):
+        (WebCore::VRFrameData::rightProjectionMatrix const):
+        (WebCore::VRFrameData::rightViewMatrix const):
+        (WebCore::VRFrameData::pose const):
+        * Modules/webvr/VRFrameData.h: Added.
+        (WebCore::VRFrameData::create):
+        * Modules/webvr/VRFrameData.idl: Added.
+        * Modules/webvr/VRLayerInit.h: Added.
+        * Modules/webvr/VRLayerInit.idl: Added.
+        * Modules/webvr/VRPose.cpp: Added.
+        (WebCore::VRPose::position const):
+        (WebCore::VRPose::linearVelocity const):
+        (WebCore::VRPose::linearAcceleration const):
+        (WebCore::VRPose::orientation const):
+        (WebCore::VRPose::angularVelocity const):
+        (WebCore::VRPose::angularAcceleration const):
+        * Modules/webvr/VRPose.h: Added.
+        (WebCore::VRPose::create):
+        * Modules/webvr/VRPose.idl: Added.
+        * Modules/webvr/VRStageParameters.cpp: Added.
+        (WebCore::VRStageParameters::sittingToStandingTransform const):
+        (WebCore::VRStageParameters::sizeX const):
+        (WebCore::VRStageParameters::sizeZ const):
+        * Modules/webvr/VRStageParameters.h: Added.
+        (WebCore::VRStageParameters::create):
+        * Modules/webvr/VRStageParameters.idl: Added.
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.h:
+        * dom/EventNames.in:
+        * dom/EventTargetFactory.in:
+        * features.json:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebVREnabled):
+        (WebCore::RuntimeEnabledFeatures::webVREnabled const):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setWebVREnabled):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
 
         Update the type of the texture argument to framebufferTextureLayer().
index db00c34..fc14cfd 100644 (file)
@@ -55,6 +55,7 @@ VPATH = \
     $(WebCore)/Modules/webdatabase \
     $(WebCore)/Modules/webdriver \
     $(WebCore)/Modules/websockets \
+    $(WebCore)/Modules/webvr \
     $(WebCore)/animation \
     $(WebCore)/bindings/js \
     $(WebCore)/crypto \
@@ -321,6 +322,20 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/webdriver/NavigatorWebDriver.idl \
     $(WebCore)/Modules/websockets/CloseEvent.idl \
     $(WebCore)/Modules/websockets/WebSocket.idl \
+    $(WebCore)/Modules/webvr/DOMWindowWebVR.idl \
+    $(WebCore)/Modules/webvr/GamepadWebVR.idl \
+    $(WebCore)/Modules/webvr/NavigatorWebVR.idl \
+    $(WebCore)/Modules/webvr/VRDisplay.idl \
+    $(WebCore)/Modules/webvr/VRDisplayCapabilities.idl \
+    $(WebCore)/Modules/webvr/VRDisplayEvent.idl \
+    $(WebCore)/Modules/webvr/VRDisplayEventReason.idl \
+    $(WebCore)/Modules/webvr/VREye.idl \
+    $(WebCore)/Modules/webvr/VREyeParameters.idl \
+    $(WebCore)/Modules/webvr/VRFieldOfView.idl \
+    $(WebCore)/Modules/webvr/VRFrameData.idl \
+    $(WebCore)/Modules/webvr/VRLayerInit.idl \
+    $(WebCore)/Modules/webvr/VRPose.idl \
+    $(WebCore)/Modules/webvr/VRStageParameters.idl \
     $(WebCore)/animation/Animatable.idl \
     $(WebCore)/animation/AnimationEffect.idl \
     $(WebCore)/animation/AnimationTimeline.idl \
diff --git a/Source/WebCore/Modules/webvr/DOMWindowWebVR.idl b/Source/WebCore/Modules/webvr/DOMWindowWebVR.idl
new file mode 100644 (file)
index 0000000..d23c46d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebVR,
+] partial interface DOMWindow {
+    attribute EventHandler onvrdisplayconnect;
+    attribute EventHandler onvrdisplaydisconnect;
+    attribute EventHandler onvrdisplayactivate;
+    attribute EventHandler onvrdisplaydeactivate;
+    attribute EventHandler onvrdisplayblur;
+    attribute EventHandler onvrdisplayfocus;
+    attribute EventHandler onvrdisplaypresentchange;
+};
diff --git a/Source/WebCore/Modules/webvr/GamepadWebVR.cpp b/Source/WebCore/Modules/webvr/GamepadWebVR.cpp
new file mode 100644 (file)
index 0000000..b30a002
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GamepadWebVR.h"
+
+#if ENABLE(GAMEPAD)
+
+#include "Gamepad.h"
+
+namespace WebCore {
+
+GamepadWebVR::GamepadWebVR()
+{
+}
+
+GamepadWebVR::~GamepadWebVR()
+{
+}
+
+unsigned GamepadWebVR::displayId(const Gamepad&)
+{
+    return 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(GAMEPAD)
diff --git a/Source/WebCore/Modules/webvr/GamepadWebVR.h b/Source/WebCore/Modules/webvr/GamepadWebVR.h
new file mode 100644 (file)
index 0000000..d620915
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(GAMEPAD)
+
+#include "Supplementable.h"
+
+namespace WebCore {
+
+class Gamepad;
+
+class GamepadWebVR final : public Supplement<Gamepad> {
+public:
+    GamepadWebVR();
+    virtual ~GamepadWebVR();
+
+    static unsigned displayId(const Gamepad&);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(GAMEPAD)
diff --git a/Source/WebCore/Modules/webvr/GamepadWebVR.idl b/Source/WebCore/Modules/webvr/GamepadWebVR.idl
new file mode 100644 (file)
index 0000000..ab0b109
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebVR,
+    Conditional=GAMEPAD,
+] partial interface Gamepad {
+    readonly attribute unsigned long displayId;
+};
diff --git a/Source/WebCore/Modules/webvr/NavigatorWebVR.cpp b/Source/WebCore/Modules/webvr/NavigatorWebVR.cpp
new file mode 100644 (file)
index 0000000..ecb5411
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigatorWebVR.h"
+
+#include "VRDisplay.h"
+
+namespace WebCore {
+
+void NavigatorWebVR::getVRDisplays(Navigator&, Ref<DeferredPromise>&&)
+{
+}
+
+const Vector<RefPtr<VRDisplay>>& NavigatorWebVR::activeVRDisplays(Navigator&)
+{
+    static auto mockVector = makeNeverDestroyed(Vector<RefPtr<VRDisplay>> { });
+    return mockVector;
+}
+
+bool NavigatorWebVR::vrEnabled(Navigator&)
+{
+    return false;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/NavigatorWebVR.h b/Source/WebCore/Modules/webvr/NavigatorWebVR.h
new file mode 100644 (file)
index 0000000..fe15769
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "JSDOMPromiseDeferred.h"
+#include "Supplementable.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class Navigator;
+class Page;
+class VRDisplay;
+
+class NavigatorWebVR final : public Supplement<Page> {
+public:
+    static void getVRDisplays(Navigator&, Ref<DeferredPromise>&&);
+    static const Vector<RefPtr<VRDisplay>>& activeVRDisplays(Navigator&);
+    static bool vrEnabled(Navigator&);
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/NavigatorWebVR.idl b/Source/WebCore/Modules/webvr/NavigatorWebVR.idl
new file mode 100644 (file)
index 0000000..e550477
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebVR,
+] partial interface Navigator {
+    Promise<sequence<VRDisplay>> getVRDisplays();
+    readonly attribute FrozenArray<VRDisplay> activeVRDisplays;
+};
diff --git a/Source/WebCore/Modules/webvr/VRDisplay.cpp b/Source/WebCore/Modules/webvr/VRDisplay.cpp
new file mode 100644 (file)
index 0000000..3a5270a
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "VRDisplay.h"
+
+#include "VRDisplayCapabilities.h"
+#include "VREyeParameters.h"
+#include "VRLayerInit.h"
+#include "VRPose.h"
+
+namespace WebCore {
+
+Ref<VRDisplay> VRDisplay::create(ScriptExecutionContext& context)
+{
+    auto display = adoptRef(*new VRDisplay(context));
+    display->suspendIfNeeded();
+    return display;
+}
+
+VRDisplay::VRDisplay(ScriptExecutionContext& context)
+    : ActiveDOMObject(&context)
+    , m_capabilities(VRDisplayCapabilities::create())
+    , m_eyeParameters(VREyeParameters::create())
+{
+}
+
+VRDisplay::~VRDisplay() = default;
+
+bool VRDisplay::isConnected() const
+{
+    return false;
+}
+
+bool VRDisplay::isPresenting() const
+{
+    return false;
+}
+
+const VRDisplayCapabilities& VRDisplay::capabilities() const
+{
+    return m_capabilities;
+}
+
+VRStageParameters* VRDisplay::stageParameters() const
+{
+    return nullptr;
+}
+
+const VREyeParameters& VRDisplay::getEyeParameters(VREye) const
+{
+    return m_eyeParameters;
+}
+
+unsigned VRDisplay::displayId() const
+{
+    return 0;
+}
+
+const String& VRDisplay::displayName() const
+{
+    return emptyString();
+}
+
+bool VRDisplay::getFrameData(VRFrameData&) const
+{
+    return false;
+}
+
+Ref<VRPose> VRDisplay::getPose() const
+{
+    return VRPose::create();
+}
+
+void VRDisplay::resetPose()
+{
+}
+
+double VRDisplay::depthNear() const
+{
+    return 0;
+}
+
+void VRDisplay::setDepthNear(double)
+{
+}
+
+double VRDisplay::depthFar() const
+{
+    return 0;
+}
+
+void VRDisplay::setDepthFar(double)
+{
+}
+
+long VRDisplay::requestAnimationFrame(Ref<RequestAnimationFrameCallback>&&)
+{
+    return 0;
+}
+
+void VRDisplay::cancelAnimationFrame(unsigned)
+{
+}
+
+void VRDisplay::requestPresent(const Vector<VRLayerInit>&, Ref<DeferredPromise>&&)
+{
+}
+
+void VRDisplay::exitPresent(Ref<DeferredPromise>&&)
+{
+}
+
+const Vector<VRLayerInit>& VRDisplay::getLayers() const
+{
+    static auto mockLayers = makeNeverDestroyed(Vector<VRLayerInit> { });
+    return mockLayers;
+}
+
+void VRDisplay::submitFrame()
+{
+}
+
+bool VRDisplay::hasPendingActivity() const
+{
+    return false;
+}
+
+const char* VRDisplay::activeDOMObjectName() const
+{
+    return "VRDisplay";
+}
+
+bool VRDisplay::canSuspendForDocumentSuspension() const
+{
+    return false;
+}
+
+void VRDisplay::stop()
+{
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplay.h b/Source/WebCore/Modules/webvr/VRDisplay.h
new file mode 100644 (file)
index 0000000..a8529c7
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+#include "JSDOMPromiseDeferred.h"
+#include "VREye.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class RequestAnimationFrameCallback;
+class VRDisplayCapabilities;
+class VREyeParameters;
+class VRFrameData;
+class VRPose;
+class VRStageParameters;
+struct VRLayerInit;
+
+class VRDisplay : public RefCounted<VRDisplay>, public EventTargetWithInlineData, public ActiveDOMObject {
+public:
+    static Ref<VRDisplay> create(ScriptExecutionContext&);
+
+    virtual ~VRDisplay();
+
+    using RefCounted<VRDisplay>::ref;
+    using RefCounted<VRDisplay>::deref;
+
+    bool isConnected() const;
+    bool isPresenting() const;
+
+    const VRDisplayCapabilities& capabilities() const;
+    VRStageParameters* stageParameters() const;
+
+    const VREyeParameters& getEyeParameters(VREye) const;
+
+    unsigned displayId() const;
+    const String& displayName() const;
+
+    bool getFrameData(VRFrameData&) const;
+
+    Ref<VRPose> getPose() const;
+    void resetPose();
+
+    double depthNear() const;
+    void setDepthNear(double);
+    double depthFar() const;
+    void setDepthFar(double);
+
+    long requestAnimationFrame(Ref<RequestAnimationFrameCallback>&&);
+    void cancelAnimationFrame(unsigned);
+
+    void requestPresent(const Vector<VRLayerInit>&, Ref<DeferredPromise>&&);
+    void exitPresent(Ref<DeferredPromise>&&);
+
+    const Vector<VRLayerInit>& getLayers() const;
+
+    void submitFrame();
+
+private:
+    VRDisplay(ScriptExecutionContext&);
+
+    // EventTarget
+    EventTargetInterface eventTargetInterface() const override { return VRDisplayEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
+    void refEventTarget() override { ref(); }
+    void derefEventTarget() override { deref(); }
+
+    // ActiveDOMObject
+    bool hasPendingActivity() const override;
+    const char* activeDOMObjectName() const override;
+    bool canSuspendForDocumentSuspension() const override;
+    void stop() override;
+
+    Ref<VRDisplayCapabilities> m_capabilities;
+    Ref<VREyeParameters> m_eyeParameters;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplay.idl b/Source/WebCore/Modules/webvr/VRDisplay.idl
new file mode 100644 (file)
index 0000000..9735dbf
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebVR,
+] interface VRDisplay : EventTarget {
+    readonly attribute boolean isConnected;
+    readonly attribute boolean isPresenting;
+
+    readonly attribute VRDisplayCapabilities capabilities; // FIXME: [SameObject]
+
+    readonly attribute VRStageParameters? stageParameters;
+
+    VREyeParameters getEyeParameters(VREye whichEye);
+
+    readonly attribute unsigned long displayId;
+
+    readonly attribute DOMString displayName;
+
+    boolean getFrameData(VRFrameData frameData);
+
+    [NewObject] VRPose getPose();
+
+    void resetPose();
+
+    attribute double depthNear;
+    attribute double depthFar;
+
+    // RequestAnimationFrameCallback equates to FrameRequestCallback.
+    long requestAnimationFrame(RequestAnimationFrameCallback callback);
+    void cancelAnimationFrame(unsigned long handle);
+
+    Promise<void> requestPresent(sequence<VRLayerInit> layers);
+
+    Promise<void> exitPresent();
+
+    sequence<VRLayerInit> getLayers();
+
+    void submitFrame();
+};
diff --git a/Source/WebCore/Modules/webvr/VRDisplayCapabilities.cpp b/Source/WebCore/Modules/webvr/VRDisplayCapabilities.cpp
new file mode 100644 (file)
index 0000000..48847c8
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "VRDisplayCapabilities.h"
+
+namespace WebCore {
+
+VRDisplayCapabilities::VRDisplayCapabilities() = default;
+
+bool VRDisplayCapabilities::hasPosition() const
+{
+    return false;
+}
+
+bool VRDisplayCapabilities::hasOrientation() const
+{
+    return false;
+}
+
+bool VRDisplayCapabilities::hasExternalDisplay() const
+{
+    return false;
+}
+
+bool VRDisplayCapabilities::canPresent() const
+{
+    return false;
+}
+
+unsigned VRDisplayCapabilities::maxLayer() const
+{
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplayCapabilities.h b/Source/WebCore/Modules/webvr/VRDisplayCapabilities.h
new file mode 100644 (file)
index 0000000..5838149
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class VRDisplayCapabilities : public RefCounted<VRDisplayCapabilities> {
+public:
+    static Ref<VRDisplayCapabilities> create()
+    {
+        return adoptRef(*new VRDisplayCapabilities);
+    }
+
+    bool hasPosition() const;
+    bool hasOrientation() const;
+    bool hasExternalDisplay() const;
+    bool canPresent() const;
+    unsigned maxLayer() const;
+
+private:
+    VRDisplayCapabilities();
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplayCapabilities.idl b/Source/WebCore/Modules/webvr/VRDisplayCapabilities.idl
new file mode 100644 (file)
index 0000000..97bed0c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebVR,
+    ImplementationLacksVTable
+] interface VRDisplayCapabilities {
+    readonly attribute boolean hasPosition;
+    readonly attribute boolean hasOrientation;
+    readonly attribute boolean hasExternalDisplay;
+    readonly attribute boolean canPresent;
+    readonly attribute unsigned long maxLayer;
+};
diff --git a/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp b/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp
new file mode 100644 (file)
index 0000000..920d7a0
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "VRDisplayEvent.h"
+
+#include "VRDisplay.h"
+
+namespace WebCore {
+
+VRDisplayEvent::VRDisplayEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
+{
+}
+
+VRDisplayEvent::~VRDisplayEvent() = default;
+
+RefPtr<VRDisplay> VRDisplayEvent::display() const
+{
+    return nullptr;
+}
+
+VRDisplayEventReason VRDisplayEvent::reason() const
+{
+    return VRDisplayEventReason::Mounted;
+}
+
+EventInterface VRDisplayEvent::eventInterface() const
+{
+    return VRDisplayEventInterfaceType;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplayEvent.h b/Source/WebCore/Modules/webvr/VRDisplayEvent.h
new file mode 100644 (file)
index 0000000..59299ca
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include "Event.h"
+#include "VRDisplayEventReason.h"
+
+namespace WebCore {
+
+class VRDisplay;
+
+class VRDisplayEvent final : public Event {
+public:
+    struct Init : EventInit {
+        RefPtr<VRDisplay> display;
+        VRDisplayEventReason reason;
+    };
+
+    static Ref<VRDisplayEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
+    {
+        return adoptRef(*new VRDisplayEvent(type, initializer, isTrusted));
+    }
+
+    virtual ~VRDisplayEvent();
+
+    RefPtr<VRDisplay> display() const;
+    VRDisplayEventReason reason() const;
+
+private:
+    VRDisplayEvent(const AtomicString&, const Init&, IsTrusted);
+
+    // Event
+    EventInterface eventInterface() const override;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplayEvent.idl b/Source/WebCore/Modules/webvr/VRDisplayEvent.idl
new file mode 100644 (file)
index 0000000..9eb70be
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebVR,
+] dictionary VRDisplayEventInit : EventInit {
+    required VRDisplay display;
+    VRDisplayEventReason reason;
+};
+
+[
+    EnabledAtRuntime=WebVR,
+    Constructor(DOMString type, VRDisplayEventInit eventInitDict)
+] interface VRDisplayEvent : Event {
+    readonly attribute VRDisplay display;
+    readonly attribute VRDisplayEventReason? reason;
+};
diff --git a/Source/WebCore/Modules/webvr/VRDisplayEventReason.h b/Source/WebCore/Modules/webvr/VRDisplayEventReason.h
new file mode 100644 (file)
index 0000000..7b0336b
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+namespace WebCore {
+
+enum class VRDisplayEventReason {
+    Mounted,
+    Navigation,
+    Requested,
+    Unmounted
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRDisplayEventReason.idl b/Source/WebCore/Modules/webvr/VRDisplayEventReason.idl
new file mode 100644 (file)
index 0000000..0b84039
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+[
+    EnabledAtRuntime=WebVR,
+] enum VRDisplayEventReason {
+    "mounted",
+    "navigation",
+    "requested",
+    "unmounted"
+};
diff --git a/Source/WebCore/Modules/webvr/VREye.h b/Source/WebCore/Modules/webvr/VREye.h
new file mode 100644 (file)
index 0000000..482bb7f
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+namespace WebCore {
+
+enum class VREye {
+    Left,
+    Right
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VREye.idl b/Source/WebCore/Modules/webvr/VREye.idl
new file mode 100644 (file)
index 0000000..1d4ef06
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+[
+    EnabledAtRuntime=WebVR,
+] enum VREye {
+    "left",
+    "right"
+};
diff --git a/Source/WebCore/Modules/webvr/VREyeParameters.cpp b/Source/WebCore/Modules/webvr/VREyeParameters.cpp
new file mode 100644 (file)
index 0000000..817c308
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "VREyeParameters.h"
+
+#include "VRFieldOfView.h"
+
+namespace WebCore {
+
+VREyeParameters::VREyeParameters()
+    : m_fieldOfView(VRFieldOfView::create())
+{
+}
+
+VREyeParameters::~VREyeParameters() = default;
+
+Float32Array* VREyeParameters::offset() const
+{
+    return nullptr;
+}
+
+const VRFieldOfView& VREyeParameters::fieldOfView() const
+{
+    return m_fieldOfView;
+}
+
+unsigned VREyeParameters::renderWidth() const
+{
+    return 0;
+}
+
+unsigned VREyeParameters::renderHeight() const
+{
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VREyeParameters.h b/Source/WebCore/Modules/webvr/VREyeParameters.h
new file mode 100644 (file)
index 0000000..1ee121e
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include <runtime/Float32Array.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class VRFieldOfView;
+
+class VREyeParameters : public RefCounted<VREyeParameters> {
+public:
+    static Ref<VREyeParameters> create()
+    {
+        return adoptRef(*new VREyeParameters);
+    }
+    ~VREyeParameters();
+
+    Float32Array* offset() const;
+
+    const VRFieldOfView& fieldOfView() const;
+
+    unsigned renderWidth() const;
+    unsigned renderHeight() const;
+
+private:
+    VREyeParameters();
+
+    Ref<VRFieldOfView> m_fieldOfView;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VREyeParameters.idl b/Source/WebCore/Modules/webvr/VREyeParameters.idl
new file mode 100644 (file)
index 0000000..cde955a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+[
+    EnabledAtRuntime=WebVR,
+    ImplementationLacksVTable
+] interface VREyeParameters {
+    readonly attribute Float32Array offset;
+
+    readonly attribute VRFieldOfView fieldOfView; // FIXME: [SameObject]
+
+    readonly attribute unsigned long renderWidth;
+    readonly attribute unsigned long renderHeight;
+};
diff --git a/Source/WebCore/Modules/webvr/VRFieldOfView.cpp b/Source/WebCore/Modules/webvr/VRFieldOfView.cpp
new file mode 100644 (file)
index 0000000..ffc7373
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "VRFieldOfView.h"
+
+namespace WebCore {
+
+VRFieldOfView::VRFieldOfView() = default;
+
+double VRFieldOfView::upDegrees() const
+{
+    return 0;
+}
+
+double VRFieldOfView::rightDegrees() const
+{
+    return 0;
+}
+
+double VRFieldOfView::downDegrees() const
+{
+    return 0;
+}
+
+double VRFieldOfView::leftDegrees() const
+{
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRFieldOfView.h b/Source/WebCore/Modules/webvr/VRFieldOfView.h
new file mode 100644 (file)
index 0000000..77c2a76
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class VRFieldOfView : public RefCounted<VRFieldOfView> {
+public:
+    static Ref<VRFieldOfView> create()
+    {
+        return adoptRef(*new VRFieldOfView);
+    }
+
+    double upDegrees() const;
+    double rightDegrees() const;
+    double downDegrees() const;
+    double leftDegrees() const;
+
+private:
+    VRFieldOfView();
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRFieldOfView.idl b/Source/WebCore/Modules/webvr/VRFieldOfView.idl
new file mode 100644 (file)
index 0000000..cf4470e
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+[
+    EnabledAtRuntime=WebVR,
+    ImplementationLacksVTable
+] interface VRFieldOfView {
+    readonly attribute double upDegrees;
+    readonly attribute double rightDegrees;
+    readonly attribute double downDegrees;
+    readonly attribute double leftDegrees;
+};
diff --git a/Source/WebCore/Modules/webvr/VRFrameData.cpp b/Source/WebCore/Modules/webvr/VRFrameData.cpp
new file mode 100644 (file)
index 0000000..5b849bf
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "VRFrameData.h"
+
+#include "VRPose.h"
+
+namespace WebCore {
+
+VRFrameData::VRFrameData()
+    : m_pose(VRPose::create())
+{
+}
+
+double VRFrameData::timestamp() const
+{
+    return 0;
+}
+
+Float32Array* VRFrameData::leftProjectionMatrix() const
+{
+    return nullptr;
+}
+
+Float32Array* VRFrameData::leftViewMatrix() const
+{
+    return nullptr;
+}
+
+Float32Array* VRFrameData::rightProjectionMatrix() const
+{
+    return nullptr;
+}
+
+Float32Array* VRFrameData::rightViewMatrix() const
+{
+    return nullptr;
+}
+
+const VRPose& VRFrameData::pose() const
+{
+    return m_pose;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRFrameData.h b/Source/WebCore/Modules/webvr/VRFrameData.h
new file mode 100644 (file)
index 0000000..f2c2a10
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include <runtime/Float32Array.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class VRPose;
+
+class VRFrameData : public RefCounted<VRFrameData> {
+public:
+    static Ref<VRFrameData> create()
+    {
+        return adoptRef(*new VRFrameData);
+    }
+
+    double timestamp() const;
+
+    Float32Array* leftProjectionMatrix() const;
+    Float32Array* leftViewMatrix() const;
+
+    Float32Array* rightProjectionMatrix() const;
+    Float32Array* rightViewMatrix() const;
+
+    const VRPose& pose() const;
+
+private:
+    VRFrameData();
+
+    Ref<VRPose> m_pose;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRFrameData.idl b/Source/WebCore/Modules/webvr/VRFrameData.idl
new file mode 100644 (file)
index 0000000..64a4bd2
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+typedef double DOMHighResTimeStamp;
+
+[
+    EnabledAtRuntime=WebVR,
+    ImplementationLacksVTable,
+    Constructor
+] interface VRFrameData {
+    readonly attribute DOMHighResTimeStamp timestamp;
+
+    readonly attribute Float32Array leftProjectionMatrix;
+    readonly attribute Float32Array leftViewMatrix;
+
+    readonly attribute Float32Array rightProjectionMatrix;
+    readonly attribute Float32Array rightViewMatrix;
+
+    readonly attribute VRPose pose;
+};
diff --git a/Source/WebCore/Modules/webvr/VRLayerInit.h b/Source/WebCore/Modules/webvr/VRLayerInit.h
new file mode 100644 (file)
index 0000000..833313f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include "HTMLCanvasElement.h"
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+struct VRLayerInit {
+    RefPtr<HTMLCanvasElement> source;
+    Vector<float> leftBounds;
+    Vector<float> rightBounds;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRLayerInit.idl b/Source/WebCore/Modules/webvr/VRLayerInit.idl
new file mode 100644 (file)
index 0000000..3be7d68
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// FIXME: typedef (HTMLCanvasElement or OffscreenCanvas) VRSource;
+typedef HTMLCanvasElement VRSource;
+
+[
+    EnabledAtRuntime=WebVR,
+    JSGenerateToJSObject
+] dictionary VRLayerInit {
+    VRSource? source = null;
+
+    sequence<float> leftBounds = [ ];
+    sequence<float> rightBounds = [ ];
+};
diff --git a/Source/WebCore/Modules/webvr/VRPose.cpp b/Source/WebCore/Modules/webvr/VRPose.cpp
new file mode 100644 (file)
index 0000000..3dc15ed
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "VRPose.h"
+
+namespace WebCore {
+
+VRPose::VRPose() = default;
+
+Float32Array* VRPose::position() const
+{
+    return nullptr;
+}
+
+Float32Array* VRPose::linearVelocity() const
+{
+    return nullptr;
+}
+
+Float32Array* VRPose::linearAcceleration() const
+{
+    return nullptr;
+}
+
+Float32Array* VRPose::orientation() const
+{
+    return nullptr;
+}
+
+Float32Array* VRPose::angularVelocity() const
+{
+    return nullptr;
+}
+
+Float32Array* VRPose::angularAcceleration() const
+{
+    return nullptr;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRPose.h b/Source/WebCore/Modules/webvr/VRPose.h
new file mode 100644 (file)
index 0000000..ae96c2b
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include <runtime/Float32Array.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class VRPose : public RefCounted<VRPose> {
+public:
+    static Ref<VRPose> create()
+    {
+        return adoptRef(*new VRPose);
+    }
+
+    Float32Array* position() const;
+    Float32Array* linearVelocity() const;
+    Float32Array* linearAcceleration() const;
+
+    Float32Array* orientation() const;
+    Float32Array* angularVelocity() const;
+    Float32Array* angularAcceleration() const;
+
+private:
+    VRPose();
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRPose.idl b/Source/WebCore/Modules/webvr/VRPose.idl
new file mode 100644 (file)
index 0000000..cb5a0be
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+[
+    ImplementationLacksVTable
+] interface VRPose {
+    readonly attribute Float32Array? position;
+    readonly attribute Float32Array? linearVelocity;
+    readonly attribute Float32Array? linearAcceleration;
+
+    readonly attribute Float32Array? orientation;
+    readonly attribute Float32Array? angularVelocity;
+    readonly attribute Float32Array? angularAcceleration;
+};
diff --git a/Source/WebCore/Modules/webvr/VRStageParameters.cpp b/Source/WebCore/Modules/webvr/VRStageParameters.cpp
new file mode 100644 (file)
index 0000000..77191d0
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "VRStageParameters.h"
+
+namespace WebCore {
+
+VRStageParameters::VRStageParameters() = default;
+
+Float32Array* VRStageParameters::sittingToStandingTransform() const
+{
+    return nullptr;
+}
+
+float VRStageParameters::sizeX() const
+{
+    return 0;
+}
+
+float VRStageParameters::sizeZ() const
+{
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRStageParameters.h b/Source/WebCore/Modules/webvr/VRStageParameters.h
new file mode 100644 (file)
index 0000000..38fc96f
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#pragma once
+
+#include <runtime/Float32Array.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class VRStageParameters : public RefCounted<VRStageParameters> {
+public:
+    static Ref<VRStageParameters> create()
+    {
+        return adoptRef(*new VRStageParameters);
+    }
+
+    Float32Array* sittingToStandingTransform() const;
+
+    float sizeX() const;
+    float sizeZ() const;
+
+private:
+    VRStageParameters();
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/Modules/webvr/VRStageParameters.idl b/Source/WebCore/Modules/webvr/VRStageParameters.idl
new file mode 100644 (file)
index 0000000..23731e7
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+[
+    EnabledAtRuntime=WebVR,
+    ImplementationLacksVTable
+] interface VRStageParameters {
+    readonly attribute Float32Array sittingToStandingTransform;
+
+    readonly attribute float sizeX;
+    readonly attribute float sizeZ;
+};
index 30d02ec..d006ebf 100644 (file)
                2DAF343C1EA7E0F100382CD3 /* ConstantPropertyMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF343A1EA7E0F100382CD3 /* ConstantPropertyMap.cpp */; };
                2DAF343D1EA7E0F100382CD3 /* ConstantPropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAF343B1EA7E0F100382CD3 /* ConstantPropertyMap.h */; };
                2DD5A7271EBEE47D009BA597 /* CompositionUnderline.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD5A7261EBEE47D009BA597 /* CompositionUnderline.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               2DDE1CD21F5747B700D1A365 /* GamepadWebVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CAE1F5747A300D1A365 /* GamepadWebVR.cpp */; };
+               2DDE1CD31F5747BA00D1A365 /* NavigatorWebVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CB11F5747A300D1A365 /* NavigatorWebVR.cpp */; };
+               2DDE1CD41F5747BD00D1A365 /* VRDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CB41F5747A300D1A365 /* VRDisplay.cpp */; };
+               2DDE1CD51F5747C100D1A365 /* VRDisplayCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CB71F5747A300D1A365 /* VRDisplayCapabilities.cpp */; };
+               2DDE1CD61F5747C400D1A365 /* VRDisplayEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CBA1F5747A300D1A365 /* VRDisplayEvent.cpp */; };
+               2DDE1CD71F5747C800D1A365 /* VREyeParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CC11F5747A300D1A365 /* VREyeParameters.cpp */; };
+               2DDE1CD81F5747CB00D1A365 /* VRFieldOfView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CC41F5747A300D1A365 /* VRFieldOfView.cpp */; };
+               2DDE1CD91F5747CD00D1A365 /* VRFrameData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CC71F5747A300D1A365 /* VRFrameData.cpp */; };
+               2DDE1CDA1F5747D100D1A365 /* VRPose.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CCC1F5747A300D1A365 /* VRPose.cpp */; };
+               2DDE1CDB1F5747D400D1A365 /* VRStageParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CCF1F5747A300D1A365 /* VRStageParameters.cpp */; };
+               2DDE1CE11F574AD600D1A365 /* JSVRDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CDD1F574AAB00D1A365 /* JSVRDisplay.cpp */; };
+               2DDE1CE21F574AE300D1A365 /* JSVRFieldOfView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CDF1F574AD100D1A365 /* JSVRFieldOfView.cpp */; };
+               2DDE1CE31F574AE500D1A365 /* JSVRFieldOfView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CE01F574AD100D1A365 /* JSVRFieldOfView.h */; };
+               2DDE1CE41F574AE900D1A365 /* JSVRDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CDE1F574AAB00D1A365 /* JSVRDisplay.h */; };
+               2DDE1CF71F574C0400D1A365 /* JSVRDisplayCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CE51F574BFF00D1A365 /* JSVRDisplayCapabilities.cpp */; };
+               2DDE1CF81F574C3900D1A365 /* JSVRDisplayCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CE61F574BFF00D1A365 /* JSVRDisplayCapabilities.h */; };
+               2DDE1CF91F574C3C00D1A365 /* JSVRDisplayEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CE71F574BFF00D1A365 /* JSVRDisplayEvent.cpp */; };
+               2DDE1CFA1F574C3E00D1A365 /* JSVRDisplayEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CE81F574BFF00D1A365 /* JSVRDisplayEvent.h */; };
+               2DDE1CFB1F574CEC00D1A365 /* JSVRDisplayEventReason.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CE91F574BFF00D1A365 /* JSVRDisplayEventReason.cpp */; };
+               2DDE1CFC1F574CEE00D1A365 /* JSVRDisplayEventReason.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CEA1F574BFF00D1A365 /* JSVRDisplayEventReason.h */; };
+               2DDE1CFD1F574CF100D1A365 /* JSVREye.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CEB1F574BFF00D1A365 /* JSVREye.cpp */; };
+               2DDE1CFE1F574CF300D1A365 /* JSVREye.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CEC1F574BFF00D1A365 /* JSVREye.h */; };
+               2DDE1CFF1F574CF500D1A365 /* JSVREyeParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CED1F574BFF00D1A365 /* JSVREyeParameters.cpp */; };
+               2DDE1D001F574CF700D1A365 /* JSVREyeParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CEE1F574BFF00D1A365 /* JSVREyeParameters.h */; };
+               2DDE1D011F574CFD00D1A365 /* JSVRFrameData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CEF1F574BFF00D1A365 /* JSVRFrameData.cpp */; };
+               2DDE1D021F574D0000D1A365 /* JSVRFrameData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CF01F574BFF00D1A365 /* JSVRFrameData.h */; };
+               2DDE1D031F574D0200D1A365 /* JSVRLayerInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CF11F574BFF00D1A365 /* JSVRLayerInit.cpp */; };
+               2DDE1D041F574D0500D1A365 /* JSVRLayerInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CF21F574BFF00D1A365 /* JSVRLayerInit.h */; };
+               2DDE1D051F574D0700D1A365 /* JSVRPose.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CF31F574BFF00D1A365 /* JSVRPose.cpp */; };
+               2DDE1D061F574D0A00D1A365 /* JSVRPose.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CF41F574BFF00D1A365 /* JSVRPose.h */; };
+               2DDE1D071F574D0C00D1A365 /* JSVRStageParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE1CF51F574BFF00D1A365 /* JSVRStageParameters.cpp */; };
+               2DDE1D081F574D0E00D1A365 /* JSVRStageParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE1CF61F574BFF00D1A365 /* JSVRStageParameters.h */; };
                2DE70023192FE82A00B0975C /* DisplayRefreshMonitorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */; };
                2DF512CD1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DF512CB1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp */; };
                2DF512CE1D873E47001D6780 /* ReplaceRangeWithTextCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF512CC1D873E47001D6780 /* ReplaceRangeWithTextCommand.h */; };
                2DAF343A1EA7E0F100382CD3 /* ConstantPropertyMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantPropertyMap.cpp; sourceTree = "<group>"; };
                2DAF343B1EA7E0F100382CD3 /* ConstantPropertyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantPropertyMap.h; sourceTree = "<group>"; };
                2DD5A7261EBEE47D009BA597 /* CompositionUnderline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompositionUnderline.h; sourceTree = "<group>"; };
+               2DDE1CAD1F5747A300D1A365 /* DOMWindowWebVR.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowWebVR.idl; sourceTree = "<group>"; };
+               2DDE1CAE1F5747A300D1A365 /* GamepadWebVR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GamepadWebVR.cpp; sourceTree = "<group>"; };
+               2DDE1CAF1F5747A300D1A365 /* GamepadWebVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GamepadWebVR.h; sourceTree = "<group>"; };
+               2DDE1CB01F5747A300D1A365 /* GamepadWebVR.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GamepadWebVR.idl; sourceTree = "<group>"; };
+               2DDE1CB11F5747A300D1A365 /* NavigatorWebVR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorWebVR.cpp; sourceTree = "<group>"; };
+               2DDE1CB21F5747A300D1A365 /* NavigatorWebVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorWebVR.h; sourceTree = "<group>"; };
+               2DDE1CB31F5747A300D1A365 /* NavigatorWebVR.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorWebVR.idl; sourceTree = "<group>"; };
+               2DDE1CB41F5747A300D1A365 /* VRDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRDisplay.cpp; sourceTree = "<group>"; };
+               2DDE1CB51F5747A300D1A365 /* VRDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRDisplay.h; sourceTree = "<group>"; };
+               2DDE1CB61F5747A300D1A365 /* VRDisplay.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRDisplay.idl; sourceTree = "<group>"; };
+               2DDE1CB71F5747A300D1A365 /* VRDisplayCapabilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRDisplayCapabilities.cpp; sourceTree = "<group>"; };
+               2DDE1CB81F5747A300D1A365 /* VRDisplayCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRDisplayCapabilities.h; sourceTree = "<group>"; };
+               2DDE1CB91F5747A300D1A365 /* VRDisplayCapabilities.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRDisplayCapabilities.idl; sourceTree = "<group>"; };
+               2DDE1CBA1F5747A300D1A365 /* VRDisplayEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRDisplayEvent.cpp; sourceTree = "<group>"; };
+               2DDE1CBB1F5747A300D1A365 /* VRDisplayEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRDisplayEvent.h; sourceTree = "<group>"; };
+               2DDE1CBC1F5747A300D1A365 /* VRDisplayEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRDisplayEvent.idl; sourceTree = "<group>"; };
+               2DDE1CBD1F5747A300D1A365 /* VRDisplayEventReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRDisplayEventReason.h; sourceTree = "<group>"; };
+               2DDE1CBE1F5747A300D1A365 /* VRDisplayEventReason.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRDisplayEventReason.idl; sourceTree = "<group>"; };
+               2DDE1CBF1F5747A300D1A365 /* VREye.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VREye.h; sourceTree = "<group>"; };
+               2DDE1CC01F5747A300D1A365 /* VREye.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VREye.idl; sourceTree = "<group>"; };
+               2DDE1CC11F5747A300D1A365 /* VREyeParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VREyeParameters.cpp; sourceTree = "<group>"; };
+               2DDE1CC21F5747A300D1A365 /* VREyeParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VREyeParameters.h; sourceTree = "<group>"; };
+               2DDE1CC31F5747A300D1A365 /* VREyeParameters.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VREyeParameters.idl; sourceTree = "<group>"; };
+               2DDE1CC41F5747A300D1A365 /* VRFieldOfView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRFieldOfView.cpp; sourceTree = "<group>"; };
+               2DDE1CC51F5747A300D1A365 /* VRFieldOfView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRFieldOfView.h; sourceTree = "<group>"; };
+               2DDE1CC61F5747A300D1A365 /* VRFieldOfView.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRFieldOfView.idl; sourceTree = "<group>"; };
+               2DDE1CC71F5747A300D1A365 /* VRFrameData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRFrameData.cpp; sourceTree = "<group>"; };
+               2DDE1CC81F5747A300D1A365 /* VRFrameData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRFrameData.h; sourceTree = "<group>"; };
+               2DDE1CC91F5747A300D1A365 /* VRFrameData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRFrameData.idl; sourceTree = "<group>"; };
+               2DDE1CCA1F5747A300D1A365 /* VRLayerInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRLayerInit.h; sourceTree = "<group>"; };
+               2DDE1CCB1F5747A300D1A365 /* VRLayerInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRLayerInit.idl; sourceTree = "<group>"; };
+               2DDE1CCC1F5747A300D1A365 /* VRPose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRPose.cpp; sourceTree = "<group>"; };
+               2DDE1CCD1F5747A300D1A365 /* VRPose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRPose.h; sourceTree = "<group>"; };
+               2DDE1CCE1F5747A300D1A365 /* VRPose.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRPose.idl; sourceTree = "<group>"; };
+               2DDE1CCF1F5747A300D1A365 /* VRStageParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VRStageParameters.cpp; sourceTree = "<group>"; };
+               2DDE1CD01F5747A300D1A365 /* VRStageParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRStageParameters.h; sourceTree = "<group>"; };
+               2DDE1CD11F5747A300D1A365 /* VRStageParameters.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VRStageParameters.idl; sourceTree = "<group>"; };
+               2DDE1CDD1F574AAB00D1A365 /* JSVRDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRDisplay.cpp; sourceTree = "<group>"; };
+               2DDE1CDE1F574AAB00D1A365 /* JSVRDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRDisplay.h; sourceTree = "<group>"; };
+               2DDE1CDF1F574AD100D1A365 /* JSVRFieldOfView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRFieldOfView.cpp; sourceTree = "<group>"; };
+               2DDE1CE01F574AD100D1A365 /* JSVRFieldOfView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRFieldOfView.h; sourceTree = "<group>"; };
+               2DDE1CE51F574BFF00D1A365 /* JSVRDisplayCapabilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRDisplayCapabilities.cpp; sourceTree = "<group>"; };
+               2DDE1CE61F574BFF00D1A365 /* JSVRDisplayCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRDisplayCapabilities.h; sourceTree = "<group>"; };
+               2DDE1CE71F574BFF00D1A365 /* JSVRDisplayEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRDisplayEvent.cpp; sourceTree = "<group>"; };
+               2DDE1CE81F574BFF00D1A365 /* JSVRDisplayEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRDisplayEvent.h; sourceTree = "<group>"; };
+               2DDE1CE91F574BFF00D1A365 /* JSVRDisplayEventReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRDisplayEventReason.cpp; sourceTree = "<group>"; };
+               2DDE1CEA1F574BFF00D1A365 /* JSVRDisplayEventReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRDisplayEventReason.h; sourceTree = "<group>"; };
+               2DDE1CEB1F574BFF00D1A365 /* JSVREye.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVREye.cpp; sourceTree = "<group>"; };
+               2DDE1CEC1F574BFF00D1A365 /* JSVREye.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVREye.h; sourceTree = "<group>"; };
+               2DDE1CED1F574BFF00D1A365 /* JSVREyeParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVREyeParameters.cpp; sourceTree = "<group>"; };
+               2DDE1CEE1F574BFF00D1A365 /* JSVREyeParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVREyeParameters.h; sourceTree = "<group>"; };
+               2DDE1CEF1F574BFF00D1A365 /* JSVRFrameData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRFrameData.cpp; sourceTree = "<group>"; };
+               2DDE1CF01F574BFF00D1A365 /* JSVRFrameData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRFrameData.h; sourceTree = "<group>"; };
+               2DDE1CF11F574BFF00D1A365 /* JSVRLayerInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRLayerInit.cpp; sourceTree = "<group>"; };
+               2DDE1CF21F574BFF00D1A365 /* JSVRLayerInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRLayerInit.h; sourceTree = "<group>"; };
+               2DDE1CF31F574BFF00D1A365 /* JSVRPose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRPose.cpp; sourceTree = "<group>"; };
+               2DDE1CF41F574BFF00D1A365 /* JSVRPose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRPose.h; sourceTree = "<group>"; };
+               2DDE1CF51F574BFF00D1A365 /* JSVRStageParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVRStageParameters.cpp; sourceTree = "<group>"; };
+               2DDE1CF61F574BFF00D1A365 /* JSVRStageParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVRStageParameters.h; sourceTree = "<group>"; };
                2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshMonitorMac.h; sourceTree = "<group>"; };
                2DF512CB1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceRangeWithTextCommand.cpp; sourceTree = "<group>"; };
                2DF512CC1D873E47001D6780 /* ReplaceRangeWithTextCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceRangeWithTextCommand.h; sourceTree = "<group>"; };
                                BC9854530CD3DA8F00069BC1 /* Traversal */,
                                FDA15E7B12B03E04003A583A /* WebAudio */,
                                5DA5E0F9102B950400088CF9 /* WebSockets */,
+                               2DDE1CDC1F574A5600D1A365 /* WebVR */,
                                BC9854430CD3D9D000069BC1 /* Window */,
                                A83B79220CCB00F0000B0825 /* XML */,
                                A83B790C0CCAFF83000B0825 /* XPath */,
                        path = mac;
                        sourceTree = "<group>";
                };
+               2DDE1CAB1F57475900D1A365 /* webvr */ = {
+                       isa = PBXGroup;
+                       children = (
+                               2DDE1CAD1F5747A300D1A365 /* DOMWindowWebVR.idl */,
+                               2DDE1CAE1F5747A300D1A365 /* GamepadWebVR.cpp */,
+                               2DDE1CAF1F5747A300D1A365 /* GamepadWebVR.h */,
+                               2DDE1CB01F5747A300D1A365 /* GamepadWebVR.idl */,
+                               2DDE1CB11F5747A300D1A365 /* NavigatorWebVR.cpp */,
+                               2DDE1CB21F5747A300D1A365 /* NavigatorWebVR.h */,
+                               2DDE1CB31F5747A300D1A365 /* NavigatorWebVR.idl */,
+                               2DDE1CB41F5747A300D1A365 /* VRDisplay.cpp */,
+                               2DDE1CB51F5747A300D1A365 /* VRDisplay.h */,
+                               2DDE1CB61F5747A300D1A365 /* VRDisplay.idl */,
+                               2DDE1CB71F5747A300D1A365 /* VRDisplayCapabilities.cpp */,
+                               2DDE1CB81F5747A300D1A365 /* VRDisplayCapabilities.h */,
+                               2DDE1CB91F5747A300D1A365 /* VRDisplayCapabilities.idl */,
+                               2DDE1CBA1F5747A300D1A365 /* VRDisplayEvent.cpp */,
+                               2DDE1CBB1F5747A300D1A365 /* VRDisplayEvent.h */,
+                               2DDE1CBC1F5747A300D1A365 /* VRDisplayEvent.idl */,
+                               2DDE1CBD1F5747A300D1A365 /* VRDisplayEventReason.h */,
+                               2DDE1CBE1F5747A300D1A365 /* VRDisplayEventReason.idl */,
+                               2DDE1CBF1F5747A300D1A365 /* VREye.h */,
+                               2DDE1CC01F5747A300D1A365 /* VREye.idl */,
+                               2DDE1CC11F5747A300D1A365 /* VREyeParameters.cpp */,
+                               2DDE1CC21F5747A300D1A365 /* VREyeParameters.h */,
+                               2DDE1CC31F5747A300D1A365 /* VREyeParameters.idl */,
+                               2DDE1CC41F5747A300D1A365 /* VRFieldOfView.cpp */,
+                               2DDE1CC51F5747A300D1A365 /* VRFieldOfView.h */,
+                               2DDE1CC61F5747A300D1A365 /* VRFieldOfView.idl */,
+                               2DDE1CC71F5747A300D1A365 /* VRFrameData.cpp */,
+                               2DDE1CC81F5747A300D1A365 /* VRFrameData.h */,
+                               2DDE1CC91F5747A300D1A365 /* VRFrameData.idl */,
+                               2DDE1CCA1F5747A300D1A365 /* VRLayerInit.h */,
+                               2DDE1CCB1F5747A300D1A365 /* VRLayerInit.idl */,
+                               2DDE1CCC1F5747A300D1A365 /* VRPose.cpp */,
+                               2DDE1CCD1F5747A300D1A365 /* VRPose.h */,
+                               2DDE1CCE1F5747A300D1A365 /* VRPose.idl */,
+                               2DDE1CCF1F5747A300D1A365 /* VRStageParameters.cpp */,
+                               2DDE1CD01F5747A300D1A365 /* VRStageParameters.h */,
+                               2DDE1CD11F5747A300D1A365 /* VRStageParameters.idl */,
+                       );
+                       path = webvr;
+                       sourceTree = "<group>";
+               };
+               2DDE1CDC1F574A5600D1A365 /* WebVR */ = {
+                       isa = PBXGroup;
+                       children = (
+                               2DDE1CDD1F574AAB00D1A365 /* JSVRDisplay.cpp */,
+                               2DDE1CDE1F574AAB00D1A365 /* JSVRDisplay.h */,
+                               2DDE1CE51F574BFF00D1A365 /* JSVRDisplayCapabilities.cpp */,
+                               2DDE1CE61F574BFF00D1A365 /* JSVRDisplayCapabilities.h */,
+                               2DDE1CE71F574BFF00D1A365 /* JSVRDisplayEvent.cpp */,
+                               2DDE1CE81F574BFF00D1A365 /* JSVRDisplayEvent.h */,
+                               2DDE1CE91F574BFF00D1A365 /* JSVRDisplayEventReason.cpp */,
+                               2DDE1CEA1F574BFF00D1A365 /* JSVRDisplayEventReason.h */,
+                               2DDE1CEB1F574BFF00D1A365 /* JSVREye.cpp */,
+                               2DDE1CEC1F574BFF00D1A365 /* JSVREye.h */,
+                               2DDE1CED1F574BFF00D1A365 /* JSVREyeParameters.cpp */,
+                               2DDE1CEE1F574BFF00D1A365 /* JSVREyeParameters.h */,
+                               2DDE1CDF1F574AD100D1A365 /* JSVRFieldOfView.cpp */,
+                               2DDE1CE01F574AD100D1A365 /* JSVRFieldOfView.h */,
+                               2DDE1CEF1F574BFF00D1A365 /* JSVRFrameData.cpp */,
+                               2DDE1CF01F574BFF00D1A365 /* JSVRFrameData.h */,
+                               2DDE1CF11F574BFF00D1A365 /* JSVRLayerInit.cpp */,
+                               2DDE1CF21F574BFF00D1A365 /* JSVRLayerInit.h */,
+                               2DDE1CF31F574BFF00D1A365 /* JSVRPose.cpp */,
+                               2DDE1CF41F574BFF00D1A365 /* JSVRPose.h */,
+                               2DDE1CF51F574BFF00D1A365 /* JSVRStageParameters.cpp */,
+                               2DDE1CF61F574BFF00D1A365 /* JSVRStageParameters.h */,
+                       );
+                       name = WebVR;
+                       sourceTree = "<group>";
+               };
                2E4346310F546A6800B0F1BA /* workers */ = {
                        isa = PBXGroup;
                        children = (
                                97BC69D51505F054001B74AC /* webdatabase */,
                                996E59DA1DF00D45006612B9 /* webdriver */,
                                97AABCF714FA09B5007457AE /* websockets */,
+                               2DDE1CAB1F57475900D1A365 /* webvr */,
                        );
                        path = Modules;
                        sourceTree = "<group>";
                                15C77093100D3CA8005BA267 /* JSValidityState.h in Headers */,
                                BE8EF04B171C9014009B48C3 /* JSVideoTrack.h in Headers */,
                                BE8EF04D171C9014009B48C3 /* JSVideoTrackList.h in Headers */,
+                               2DDE1CE41F574AE900D1A365 /* JSVRDisplay.h in Headers */,
+                               2DDE1CF81F574C3900D1A365 /* JSVRDisplayCapabilities.h in Headers */,
+                               2DDE1CFA1F574C3E00D1A365 /* JSVRDisplayEvent.h in Headers */,
+                               2DDE1CFC1F574CEE00D1A365 /* JSVRDisplayEventReason.h in Headers */,
+                               2DDE1CFE1F574CF300D1A365 /* JSVREye.h in Headers */,
+                               2DDE1D001F574CF700D1A365 /* JSVREyeParameters.h in Headers */,
+                               2DDE1CE31F574AE500D1A365 /* JSVRFieldOfView.h in Headers */,
+                               2DDE1D021F574D0000D1A365 /* JSVRFrameData.h in Headers */,
+                               2DDE1D041F574D0500D1A365 /* JSVRLayerInit.h in Headers */,
+                               2DDE1D061F574D0A00D1A365 /* JSVRPose.h in Headers */,
+                               2DDE1D081F574D0E00D1A365 /* JSVRStageParameters.h in Headers */,
                                BE20508218A460C30080647E /* JSVTTCue.h in Headers */,
                                7AF9B20D18CFB5F400C64BEF /* JSVTTRegion.h in Headers */,
                                7AF9B20F18CFB5F400C64BEF /* JSVTTRegionList.h in Headers */,
                                516C62201950D48700337E75 /* GamepadEvent.cpp in Sources */,
                                51A9D9E9195B931F001B2B5C /* GamepadManager.cpp in Sources */,
                                515BE1911D54F5FB00DD7C68 /* GamepadProvider.cpp in Sources */,
+                               2DDE1CD21F5747B700D1A365 /* GamepadWebVR.cpp in Sources */,
                                1432E8490C51493F00B1500F /* GCController.cpp in Sources */,
                                4FB390AD15EF61F3007AD51F /* GeneratedImage.cpp in Sources */,
                                830030F51B7D33B500ED3AAC /* GenericCachedHTMLCollection.cpp in Sources */,
                                BE8EF04C171C9014009B48C3 /* JSVideoTrackList.cpp in Sources */,
                                BE6DF70D171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp in Sources */,
                                9703E1BF15DC4E37001F24C8 /* JSVoidCallback.cpp in Sources */,
+                               2DDE1CE11F574AD600D1A365 /* JSVRDisplay.cpp in Sources */,
+                               2DDE1CF71F574C0400D1A365 /* JSVRDisplayCapabilities.cpp in Sources */,
+                               2DDE1CF91F574C3C00D1A365 /* JSVRDisplayEvent.cpp in Sources */,
+                               2DDE1CFB1F574CEC00D1A365 /* JSVRDisplayEventReason.cpp in Sources */,
+                               2DDE1CFD1F574CF100D1A365 /* JSVREye.cpp in Sources */,
+                               2DDE1CFF1F574CF500D1A365 /* JSVREyeParameters.cpp in Sources */,
+                               2DDE1CE21F574AE300D1A365 /* JSVRFieldOfView.cpp in Sources */,
+                               2DDE1D011F574CFD00D1A365 /* JSVRFrameData.cpp in Sources */,
+                               2DDE1D031F574D0200D1A365 /* JSVRLayerInit.cpp in Sources */,
+                               2DDE1D051F574D0700D1A365 /* JSVRPose.cpp in Sources */,
+                               2DDE1D071F574D0C00D1A365 /* JSVRStageParameters.cpp in Sources */,
                                BE20508118A460BC0080647E /* JSVTTCue.cpp in Sources */,
                                7AF9B20C18CFB5F400C64BEF /* JSVTTRegion.cpp in Sources */,
                                7AF9B20E18CFB5F400C64BEF /* JSVTTRegionList.cpp in Sources */,
                                9711460314EF009A00674FD9 /* NavigatorGeolocation.cpp in Sources */,
                                5EA725D51ACABD5700EAD17B /* NavigatorMediaDevices.cpp in Sources */,
                                996E59DE1DF01285006612B9 /* NavigatorWebDriver.cpp in Sources */,
+                               2DDE1CD31F5747BA00D1A365 /* NavigatorWebVR.cpp in Sources */,
                                5D874F130D161D3200796C3B /* NetscapePlugInStreamLoader.cpp in Sources */,
                                A19D934A1AA11B1E00B46C24 /* NetworkExtensionContentFilter.mm in Sources */,
                                5C9B860C1C21E3C900110F36 /* NetworkLoadMetrics.mm in Sources */,
                                93309E1D099E64920056E581 /* VisibleUnits.cpp in Sources */,
                                419BC2DE1685329900D64D6D /* VisitedLinkState.cpp in Sources */,
                                1AF4CEEC18BC3C1B00BC2D34 /* VisitedLinkStore.cpp in Sources */,
+                               2DDE1CD41F5747BD00D1A365 /* VRDisplay.cpp in Sources */,
+                               2DDE1CD51F5747C100D1A365 /* VRDisplayCapabilities.cpp in Sources */,
+                               2DDE1CD61F5747C400D1A365 /* VRDisplayEvent.cpp in Sources */,
+                               2DDE1CD71F5747C800D1A365 /* VREyeParameters.cpp in Sources */,
+                               2DDE1CD81F5747CB00D1A365 /* VRFieldOfView.cpp in Sources */,
+                               2DDE1CD91F5747CD00D1A365 /* VRFrameData.cpp in Sources */,
+                               2DDE1CDA1F5747D100D1A365 /* VRPose.cpp in Sources */,
+                               2DDE1CDB1F5747D400D1A365 /* VRStageParameters.cpp in Sources */,
                                BE20507918A458680080647E /* VTTCue.cpp in Sources */,
                                7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
                                7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
index c5dea39..6f081f8 100644 (file)
@@ -126,6 +126,13 @@ namespace WebCore {
     macro(ServiceWorkerRegistration) \
     macro(ShadowRoot) \
     macro(StaticRange) \
+    macro(VRDisplay) \
+    macro(VRDisplayCapabilities) \
+    macro(VRDisplayEvent) \
+    macro(VREyeParameters) \
+    macro(VRFieldOfView) \
+    macro(VRFrameData) \
+    macro(VRStageParameters) \
     macro(WebGL2RenderingContext) \
     macro(WebGLVertexArrayObject) \
     macro(WebGPUBuffer) \
@@ -205,6 +212,13 @@ namespace WebCore {
     macro(makeThisTypeError) \
     macro(matchingElementInFlatTree) \
     macro(mediaStreamTrackConstraints) \
+    macro(onvrdisplayactivate) \
+    macro(onvrdisplayblur) \
+    macro(onvrdisplayconnect) \
+    macro(onvrdisplaydeactivate) \
+    macro(onvrdisplaydisconnect) \
+    macro(onvrdisplayfocus) \
+    macro(onvrdisplaypresentchange) \
     macro(opener) \
     macro(operations) \
     macro(ownerReadableStream) \
index 9bfb1dd..afd0987 100644 (file)
@@ -252,6 +252,13 @@ namespace WebCore {
     macro(versionchange) \
     macro(visibilitychange) \
     macro(volumechange) \
+    macro(vrdisplayactivate) \
+    macro(vrdisplayblur) \
+    macro(vrdisplayconnect) \
+    macro(vrdisplaydeactivate) \
+    macro(vrdisplaydisconnect) \
+    macro(vrdisplayfocus) \
+    macro(vrdisplaypresentchange) \
     macro(waiting) \
     macro(waitingforkey) \
     macro(webglcontextchanged) \
index f751934..78f78de 100644 (file)
@@ -70,3 +70,4 @@ GamepadEvent conditional=GAMEPAD
 OverconstrainedErrorEvent conditional=MEDIA_STREAM
 MediaEncryptedEvent conditional=ENCRYPTED_MEDIA
 MediaKeyMessageEvent conditional=ENCRYPTED_MEDIA
+VRDisplayEvent
index 73009c2..02f0000 100644 (file)
@@ -38,6 +38,7 @@ SpeechSynthesisUtterance conditional=SPEECH_SYNTHESIS
 TextTrack conditional=VIDEO_TRACK
 TextTrackCue conditional=VIDEO_TRACK
 TextTrackList conditional=VIDEO_TRACK
+VRDisplay
 VideoTrackList conditional=VIDEO_TRACK
 WebKitMediaKeySession conditional=LEGACY_ENCRYPTED_MEDIA
 WebKitNamedFlow
index b89bc86..9e82fc5 100644 (file)
             "twitter": "@jonathandavis",
             "email": "web-evangelist@apple.com"
         }
+    },
+    {
+        "name": "WebVR",
+        "status": {
+            "status": "In Development",
+            "enabled-by-default": false
+        },
+        "url": "https://w3c.github.io/webvr/spec/1.1/",
+        "keywords": ["WebVR, VR"],
+        "category": "html",
+        "description": "A JavaScript API providing access to VR devices to allow developers to build comfortable VR experiences.",
+        "contact": {
+            "name": "Sergio Villar Senin",
+            "twitter": "@svillarsenin",
+            "email": "svillar@igalia.com"
+        }
     }
     ],
 
index 5fa4d29..cbf5fcb 100644 (file)
@@ -221,6 +221,9 @@ public:
     void setInspectorAdditionsEnabled(bool isEnabled) { m_inspectorAdditionsEnabled = isEnabled; }
     bool inspectorAdditionsEnabled() const { return m_inspectorAdditionsEnabled; }
 
+    void setWebVREnabled(bool isEnabled) { m_webVREnabled = isEnabled; }
+    bool webVREnabled() const { return m_webVREnabled; }
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -340,6 +343,7 @@ private:
 #endif
 
     bool m_inspectorAdditionsEnabled { false };
+    bool m_webVREnabled { false };
 
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
index 4bf1d0e..99b993a 100644 (file)
@@ -205,6 +205,7 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
 #if ENABLE(WEBGPU)
     RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(m_webGPUEnabled);
 #endif
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(m_webVREnabled);
 
 #if USE(AUDIO_SESSION)
     Settings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
@@ -731,6 +732,11 @@ void InternalSettings::setWebGPUEnabled(bool enabled)
 #endif
 }
 
+void InternalSettings::setWebVREnabled(bool enabled)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(enabled);
+}
+
 ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
 {
     if (!m_page)
index e474260..01aa688 100644 (file)
@@ -119,6 +119,7 @@ public:
     static void setCSSGridLayoutEnabled(bool);
     static void setWebGL2Enabled(bool);
     static void setWebGPUEnabled(bool);
+    static void setWebVREnabled(bool);
 
 private:
     explicit InternalSettings(Page*);
@@ -197,6 +198,7 @@ private:
         bool m_cssGridLayoutEnabled;
         bool m_webGL2Enabled;
         bool m_webGPUEnabled;
+        bool m_webVREnabled;
         
         bool m_shouldMockBoldSystemFontForAccessibility;
 #if USE(AUDIO_SESSION)
index b003ca6..07cab3e 100644 (file)
@@ -89,6 +89,7 @@ enum FrameFlatteningValue { "Disabled", "EnabledForNonFullScreenIFrames", "Fully
     void setCSSGridLayoutEnabled(boolean enabled);
     void setWebGL2Enabled(boolean enabled);
     void setWebGPUEnabled(boolean enabled);
+    void setWebVREnabled(boolean enabled);
 
     [MayThrowException] DOMString userInterfaceDirectionPolicy();
     [MayThrowException] void setUserInterfaceDirectionPolicy(DOMString policy);
index 2030d5b..523d564 100644 (file)
@@ -1,3 +1,14 @@
+2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebVR] Add IDLs and stubs
+        https://bugs.webkit.org/show_bug.cgi?id=174202
+
+        Reviewed by Dean Jackson.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
 
         Dragging & dropping a file creates an attachment element even when it's disabled
index c6621c7..f2e31ee 100644 (file)
     macro(LegacyEncryptedMediaAPIEnabled, legacyEncryptedMediaAPIEnabled, Bool, bool, DEFAULT_LEGACY_ENCRYPTED_MEDIA_API_ENABLED, "Enable Legacy EME API", "Enable legacy EME API") \
     macro(AllowMediaContentTypesRequiringHardwareSupportAsFallback, allowMediaContentTypesRequiringHardwareSupportAsFallback, Bool, bool, DEFAULT_ALLOW_MEDIA_CONTENT_TYPES_REQUIRING_HARDWARE_SUPPORT_AS_FALLBACK, "Allow Media Content Types Requirining Hardware As Fallback", "Allow Media Content Types Requirining Hardware As Fallback") \
     macro(InspectorAdditionsEnabled, inspectorAdditionsEnabled, Bool, bool, false, "Web Inspector Additions", "Enable additional page APIs used by the Web Inspector frontend page") \
+    macro(WebVREnabled, webVREnabled, Bool, bool, false, "WebVR", "WebVR Module support") \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
index 3fc3425..673550d 100644 (file)
@@ -3368,6 +3368,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     RuntimeEnabledFeatures::sharedFeatures().setCredentialManagementEnabled(store.getBoolValueForKey(WebPreferencesKey::credentialManagementEnabledKey()));
     RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(store.getBoolValueForKey(WebPreferencesKey::isSecureContextAttributeEnabledKey()));
     RuntimeEnabledFeatures::sharedFeatures().setDirectoryUploadEnabled(store.getBoolValueForKey(WebPreferencesKey::directoryUploadEnabledKey()));
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(store.getBoolValueForKey(WebPreferencesKey::webVREnabledKey()));
 
     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
     if (m_processSuppressionEnabled != processSuppressionEnabled) {