Changeset 263403 in webkit
- Timestamp:
- Jun 23, 2020 9:36:02 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r263399 r263403 1 2020-06-22 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Introducing XRLayer 4 https://bugs.webkit.org/show_bug.cgi?id=213462 5 6 Reviewed by Youenn Fablet. 7 8 * web-platform-tests/webxr/idlharness.https.window-expected.txt: Replace FAIL by PASS expectations 9 for XRLayer interface. 10 1 11 2020-06-23 Sergio Villar Senin <svillar@igalia.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window-expected.txt
r263265 r263403 154 154 PASS XRInputSourceArray interface: iterable<XRInputSource> 155 155 PASS XRInputSourceArray interface: attribute length 156 FAIL XRLayer interface: existence and properties of interface object assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 157 FAIL XRLayer interface object length assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 158 FAIL XRLayer interface object name assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 159 FAIL XRLayer interface: existence and properties of interface prototype object assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 160 FAIL XRLayer interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 161 FAIL XRLayer interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 162 FAIL XRWebGLLayer interface: existence and properties of interface object assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 156 PASS XRLayer interface: existence and properties of interface object 157 PASS XRLayer interface object length 158 PASS XRLayer interface object name 159 PASS XRLayer interface: existence and properties of interface prototype object 160 PASS XRLayer interface: existence and properties of interface prototype object's "constructor" property 161 PASS XRLayer interface: existence and properties of interface prototype object's @@unscopables property 162 PASS XRWebGLLayer interface: existence and properties of interface object 163 163 PASS XRWebGLLayer interface object length 164 164 PASS XRWebGLLayer interface object name 165 FAIL XRWebGLLayer interface: existence and properties of interface prototype object assert_own_property: self does not have own property "XRLayer" expected property "XRLayer" missing 165 PASS XRWebGLLayer interface: existence and properties of interface prototype object 166 166 PASS XRWebGLLayer interface: existence and properties of interface prototype object's "constructor" property 167 167 PASS XRWebGLLayer interface: existence and properties of interface prototype object's @@unscopables property -
trunk/Source/WebCore/CMakeLists.txt
r263381 r263403 1216 1216 Modules/webxr/WebXRInputSource.idl 1217 1217 Modules/webxr/WebXRInputSourceArray.idl 1218 Modules/webxr/WebXRLayer.idl 1218 1219 Modules/webxr/WebXRPose.idl 1219 1220 Modules/webxr/WebXRReferenceSpace.idl -
trunk/Source/WebCore/ChangeLog
r263400 r263403 1 2020-06-22 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Introducing XRLayer 4 https://bugs.webkit.org/show_bug.cgi?id=213462 5 6 Reviewed by Youenn Fablet. 7 8 The most recent drafts of the WebXR spec have added a new object called XRLayer which is the base class 9 of the already known XRWebGLLayer. The spec only defines the latter but future extensions might define 10 some other layer subclasses. 11 12 This patch fixes several checks in the IDL tests. 13 14 * CMakeLists.txt: Added new files. 15 * DerivedSources.make: Ditto. 16 * WebCore.xcodeproj/project.pbxproj: Ditto. 17 * Modules/webxr/WebXRLayer.cpp: Added. 18 (WebCore::WebXRLayer::WebXRLayer): 19 * Modules/webxr/WebXRLayer.h: Ditto. 20 * Modules/webxr/WebXRLayer.idl: Ditto. 21 * Modules/webxr/WebXRSession.h: Export scriptExecutionContext() so it could be used from the outside. 22 * Modules/webxr/WebXRWebGLLayer.cpp: 23 (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): Call the superclass. 24 * Modules/webxr/WebXRWebGLLayer.h: Inherit from WebXRLayer. 25 * Modules/webxr/WebXRWebGLLayer.idl: Ditto. 26 * Sources.txt: Added new files. 27 * bindings/js/WebCoreBuiltinNames.h: Added XRLayer. 28 * dom/EventTargetFactory.in: Ditto. 29 1 30 2020-06-23 Devin Rousso <drousso@apple.com> 2 31 -
trunk/Source/WebCore/DerivedSources.make
r263381 r263403 507 507 $(WebCore)/Modules/webxr/WebXRInputSourceArray.idl \ 508 508 $(WebCore)/Modules/webxr/WebXRInputSource.idl \ 509 $(WebCore)/Modules/webxr/WebXRLayer.idl \ 509 510 $(WebCore)/Modules/webxr/WebXRPose.idl \ 510 511 $(WebCore)/Modules/webxr/WebXRReferenceSpace.idl \ -
trunk/Source/WebCore/Modules/webxr/WebXRLayer.cpp
r263402 r263403 24 24 */ 25 25 26 #if defined(ENABLE_WEBGL2) && ENABLE_WEBGL2 27 typedef (WebGLRenderingContext or WebGL2RenderingContext) WebXRWebGLRenderingContext; 28 #else 29 typedef (WebGLRenderingContext) WebXRWebGLRenderingContext; 30 #endif 26 #include "config.h" 27 #include "WebXRLayer.h" 31 28 32 [ 33 EnabledAtRuntime=WebXR, 34 Conditional=WEBXR, 35 SecureContext, 36 Exposed=Window, 37 ImplementationLacksVTable, 38 InterfaceName=XRWebGLLayer 39 ] interface WebXRWebGLLayer { 40 [MayThrowException] constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); 29 #if ENABLE(WEBXR) 41 30 42 // Attributes 43 readonly attribute boolean antialias; 44 readonly attribute boolean ignoreDepthValues; 31 #include <wtf/IsoMallocInlines.h> 45 32 46 [SameObject] readonly attribute WebGLFramebuffer framebuffer; 47 readonly attribute unsigned long framebufferWidth; 48 readonly attribute unsigned long framebufferHeight; 33 namespace WebCore { 49 34 50 // Methods 51 WebXRViewport? getViewport(WebXRView view); 35 WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRLayer); 52 36 53 // Static Methods 54 static double getNativeFramebufferScaleFactor(WebXRSession session); 55 }; 37 WebXRLayer::WebXRLayer(ScriptExecutionContext* context) 38 : ContextDestructionObserver(context) 39 { 40 ASSERT(context); 41 } 42 43 WebXRLayer::~WebXRLayer() = default; 44 45 } // namespace WebCore 46 47 #endif // ENABLE(WEBXR) -
trunk/Source/WebCore/Modules/webxr/WebXRLayer.h
r263402 r263403 24 24 */ 25 25 26 #if defined(ENABLE_WEBGL2) && ENABLE_WEBGL2 27 typedef (WebGLRenderingContext or WebGL2RenderingContext) WebXRWebGLRenderingContext; 28 #else 29 typedef (WebGLRenderingContext) WebXRWebGLRenderingContext; 30 #endif 26 #pragma once 31 27 32 [ 33 EnabledAtRuntime=WebXR, 34 Conditional=WEBXR, 35 SecureContext, 36 Exposed=Window, 37 ImplementationLacksVTable, 38 InterfaceName=XRWebGLLayer 39 ] interface WebXRWebGLLayer { 40 [MayThrowException] constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); 28 #if ENABLE(WEBXR) 41 29 42 // Attributes 43 readonly attribute boolean antialias; 44 readonly attribute boolean ignoreDepthValues; 30 #include "ContextDestructionObserver.h" 31 #include "EventTarget.h" 32 #include <wtf/IsoMalloc.h> 33 #include <wtf/RefCounted.h> 45 34 46 [SameObject] readonly attribute WebGLFramebuffer framebuffer; 47 readonly attribute unsigned long framebufferWidth; 48 readonly attribute unsigned long framebufferHeight; 35 namespace WebCore { 49 36 50 // Methods 51 WebXRViewport? getViewport(WebXRView view); 37 class ScriptExecutionContext; 52 38 53 // Static Methods 54 static double getNativeFramebufferScaleFactor(WebXRSession session); 39 class WebXRLayer : public RefCounted<WebXRLayer>, public EventTargetWithInlineData, public ContextDestructionObserver { 40 WTF_MAKE_ISO_ALLOCATED(WebXRLayer); 41 public: 42 ~WebXRLayer(); 43 44 using RefCounted<WebXRLayer>::ref; 45 using RefCounted<WebXRLayer>::deref; 46 47 protected: 48 explicit WebXRLayer(ScriptExecutionContext*); 49 50 // EventTarget 51 ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); } 52 53 private: 54 // EventTarget 55 EventTargetInterface eventTargetInterface() const final { return WebXRLayerEventTargetInterfaceType; } 56 void refEventTarget() final { ref(); } 57 void derefEventTarget() final { deref(); } 55 58 }; 59 60 } // namespace WebCore 61 62 #endif // ENABLE(WEBXR) -
trunk/Source/WebCore/Modules/webxr/WebXRLayer.idl
r263402 r263403 24 24 */ 25 25 26 #if defined(ENABLE_WEBGL2) && ENABLE_WEBGL227 typedef (WebGLRenderingContext or WebGL2RenderingContext) WebXRWebGLRenderingContext;28 #else29 typedef (WebGLRenderingContext) WebXRWebGLRenderingContext;30 #endif31 32 26 [ 33 27 EnabledAtRuntime=WebXR, … … 35 29 SecureContext, 36 30 Exposed=Window, 37 ImplementationLacksVTable, 38 InterfaceName=XRWebGLLayer 39 ] interface WebXRWebGLLayer { 40 [MayThrowException] constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); 41 42 // Attributes 43 readonly attribute boolean antialias; 44 readonly attribute boolean ignoreDepthValues; 45 46 [SameObject] readonly attribute WebGLFramebuffer framebuffer; 47 readonly attribute unsigned long framebufferWidth; 48 readonly attribute unsigned long framebufferHeight; 49 50 // Methods 51 WebXRViewport? getViewport(WebXRView view); 52 53 // Static Methods 54 static double getNativeFramebufferScaleFactor(WebXRSession session); 31 InterfaceName=XRLayer, 32 ] interface WebXRLayer : EventTarget { 55 33 }; -
trunk/Source/WebCore/Modules/webxr/WebXRSession.h
r263346 r263403 77 77 void cancelAnimationFrame(unsigned callbackId); 78 78 79 // EventTarget. 80 ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); } 81 79 82 void end(EndPromise&&); 80 83 … … 88 91 // EventTarget 89 92 EventTargetInterface eventTargetInterface() const override { return WebXRSessionEventTargetInterfaceType; } 90 ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }91 93 void refEventTarget() override { ref(); } 92 94 void derefEventTarget() override { deref(); } -
trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp
r263346 r263403 39 39 #include "WebXRViewport.h" 40 40 #include "XRWebGLLayerInit.h" 41 #include <wtf/IsoMallocInlines.h> 41 42 #include <wtf/Scope.h> 42 43 43 44 namespace WebCore { 44 45 46 WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRWebGLLayer); 47 45 48 // https://immersive-web.github.io/webxr/#dom-xrwebgllayer-xrwebgllayer 46 ExceptionOr<Ref<WebXRWebGLLayer>> WebXRWebGLLayer::create( WebXRSession& session, WebXRRenderingContext&& context, const XRWebGLLayerInit& init)49 ExceptionOr<Ref<WebXRWebGLLayer>> WebXRWebGLLayer::create(Ref<WebXRSession>&& session, WebXRRenderingContext&& context, const XRWebGLLayerInit& init) 47 50 { 48 51 // 1. Let layer be a new XRWebGLLayer 49 52 // 2. If session’s ended value is true, throw an InvalidStateError and abort these steps. 50 if (session .ended())53 if (session->ended()) 51 54 return Exception { InvalidStateError }; 52 55 … … 60 63 return Exception { InvalidStateError }; 61 64 62 auto mode = session .mode();65 auto mode = session->mode(); 63 66 if ((mode == XRSessionMode::ImmersiveAr || mode == XRSessionMode::ImmersiveVr) && !baseContext->isXRCompatible()) 64 67 return Exception { InvalidStateError }; … … 70 73 // 8. Initialize layer’s composition disabled boolean as follows. (see constructor) 71 74 // 9. (see constructor except for the resources initialization step which is handled in the if block below) 72 auto layer = adoptRef(*new WebXRWebGLLayer( session, WTFMove(context), init));75 auto layer = adoptRef(*new WebXRWebGLLayer(WTFMove(session), WTFMove(context), init)); 73 76 74 77 if (layer->m_isCompositionDisabled) { … … 102 105 } 103 106 104 WebXRWebGLLayer::WebXRWebGLLayer(WebXRSession& session, WebXRRenderingContext&& context, const XRWebGLLayerInit& init) 105 : m_session(makeRef(session)) 107 WebXRWebGLLayer::WebXRWebGLLayer(Ref<WebXRSession>&& session, WebXRRenderingContext&& context, const XRWebGLLayerInit& init) 108 : WebXRLayer(session->scriptExecutionContext()) 109 , m_session(WTFMove(session)) 106 110 , m_context(WTFMove(context)) 107 111 { -
trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h
r263346 r263403 29 29 30 30 #include "ExceptionOr.h" 31 #include "WebXRLayer.h" 31 32 #include <wtf/IsoMalloc.h> 32 33 #include <wtf/Ref.h> 33 #include <wtf/RefCounted.h>34 34 #include <wtf/RefPtr.h> 35 35 #include <wtf/Variant.h> … … 48 48 struct XRWebGLLayerInit; 49 49 50 class WebXRWebGLLayer : public RefCounted<WebXRWebGLLayer> { 50 class WebXRWebGLLayer : public WebXRLayer { 51 WTF_MAKE_ISO_ALLOCATED(WebXRWebGLLayer); 51 52 public: 52 53 … … 58 59 >; 59 60 60 static ExceptionOr<Ref<WebXRWebGLLayer>> create( WebXRSession&, WebXRRenderingContext&&, const XRWebGLLayerInit&);61 static ExceptionOr<Ref<WebXRWebGLLayer>> create(Ref<WebXRSession>&&, WebXRRenderingContext&&, const XRWebGLLayerInit&); 61 62 ~WebXRWebGLLayer(); 62 63 … … 73 74 74 75 private: 75 WebXRWebGLLayer( WebXRSession&, WebXRRenderingContext&&, const XRWebGLLayerInit&);76 WebXRWebGLLayer(Ref<WebXRSession>&&, WebXRRenderingContext&&, const XRWebGLLayerInit&); 76 77 77 78 static IntSize computeNativeWebGLFramebufferResolution(); -
trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl
r263160 r263403 35 35 SecureContext, 36 36 Exposed=Window, 37 ImplementationLacksVTable, 37 JSGenerateToJSObject, 38 JSGenerateToNativeObject, 38 39 InterfaceName=XRWebGLLayer 39 ] interface WebXRWebGLLayer {40 ] interface WebXRWebGLLayer : WebXRLayer { 40 41 [MayThrowException] constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); 41 42 -
trunk/Source/WebCore/Sources.txt
r263381 r263403 425 425 Modules/webxr/WebXRInputSourceArray.cpp @no-unify 426 426 Modules/webxr/WebXRInputSource.cpp @no-unify 427 Modules/webxr/WebXRLayer.cpp @no-unify 427 428 Modules/webxr/WebXRPose.cpp @no-unify 428 429 Modules/webxr/WebXRReferenceSpace.cpp @no-unify … … 3641 3642 JSWebXRViewport.cpp 3642 3643 JSXRVisibilityState.cpp 3644 JSWebXRLayer.cpp 3643 3645 JSWebXRWebGLLayer.cpp 3644 3646 JSXRWebGLLayerInit.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r263381 r263403 4768 4768 E12DE7181E4B74A600F9ACCF /* GridTrackSizingAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = E12DE7161E4B748700F9ACCF /* GridTrackSizingAlgorithm.h */; }; 4769 4769 E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = E12EDB7A0B308A78002704B6 /* EventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4770 E12FDAFF24A0FD200070236E /* WebXRLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E12FDAFB24A0FD1C0070236E /* WebXRLayer.cpp */; }; 4771 E12FDB0024A0FD200070236E /* WebXRLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E12FDAFD24A0FD1E0070236E /* WebXRLayer.h */; }; 4770 4772 E134F5AB12EE343F004EC58D /* IntRectHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E134F5AA12EE343F004EC58D /* IntRectHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4771 4773 E139866415478474001E3F65 /* StyleResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E139866215478474001E3F65 /* StyleResolver.h */; }; … … 15201 15203 E12EDB7A0B308A78002704B6 /* EventTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTarget.h; sourceTree = "<group>"; }; 15202 15204 E12EDBE90B308E0B002704B6 /* EventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTarget.cpp; sourceTree = "<group>"; }; 15205 E12FDAFB24A0FD1C0070236E /* WebXRLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRLayer.cpp; sourceTree = "<group>"; }; 15206 E12FDAFD24A0FD1E0070236E /* WebXRLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRLayer.h; sourceTree = "<group>"; }; 15207 E12FDAFE24A0FD1F0070236E /* WebXRLayer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRLayer.idl; sourceTree = "<group>"; }; 15203 15208 E134F5AA12EE343F004EC58D /* IntRectHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntRectHash.h; sourceTree = "<group>"; }; 15204 15209 E139866115478474001E3F65 /* StyleResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleResolver.cpp; sourceTree = "<group>"; }; … … 27497 27502 E1EE8ADD2412B17000E794D6 /* WebXRInputSourceArray.h */, 27498 27503 E19490932434F16000416A99 /* WebXRInputSourceArray.idl */, 27504 E12FDAFB24A0FD1C0070236E /* WebXRLayer.cpp */, 27505 E12FDAFD24A0FD1E0070236E /* WebXRLayer.h */, 27506 E12FDAFE24A0FD1F0070236E /* WebXRLayer.idl */, 27499 27507 E1EE8AE52412B17000E794D6 /* WebXRPose.cpp */, 27500 27508 E1EE8AE12412B17000E794D6 /* WebXRPose.h */, … … 33827 33835 E1EE8BA82413196300E794D6 /* WebXRInputSource.h in Headers */, 33828 33836 E1EE8B862413191F00E794D6 /* WebXRInputSourceArray.h in Headers */, 33837 E12FDB0024A0FD200070236E /* WebXRLayer.h in Headers */, 33829 33838 E1EE8B882413191F00E794D6 /* WebXRPose.h in Headers */, 33830 33839 E1EE8BA62413196300E794D6 /* WebXRReferenceSpace.h in Headers */, … … 35111 35120 E1EE8BA12413196300E794D6 /* WebXRInputSource.cpp in Sources */, 35112 35121 E1EE8B8C2413191F00E794D6 /* WebXRInputSourceArray.cpp in Sources */, 35122 E12FDAFF24A0FD200070236E /* WebXRLayer.cpp in Sources */, 35113 35123 E1EE8B8B2413191F00E794D6 /* WebXRPose.cpp in Sources */, 35114 35124 E1EE8B7F2413191F00E794D6 /* WebXRReferenceSpace.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r263381 r263403 253 253 macro(XRInputSourceEvent) \ 254 254 macro(XRInputSourcesChangeEvent) \ 255 macro(XRLayer) \ 255 256 macro(XRPose) \ 256 257 macro(XRReferenceSpace) \ -
trunk/Source/WebCore/dom/EventTargetFactory.in
r263381 r263403 61 61 XMLHttpRequest 62 62 XMLHttpRequestUpload 63 WebXRLayer conditional=WEBXR 63 64 WebXRSession conditional=WEBXR 64 65 WebXRSpace conditional=WEBXR
Note: See TracChangeset
for help on using the changeset viewer.