Переглянути джерело

LibWeb: Add WebGLActiveInfo

Jelle Raaijmakers 8 місяців тому
батько
коміт
d63a979bde

+ 1 - 0
Libraries/LibWeb/CMakeLists.txt

@@ -777,6 +777,7 @@ set(SOURCES
     WebDriver/TimeoutsConfiguration.cpp
     WebDriver/TimeoutsConfiguration.cpp
     WebGL/EventNames.cpp
     WebGL/EventNames.cpp
     WebGL/OpenGLContext.cpp
     WebGL/OpenGLContext.cpp
+    WebGL/WebGLActiveInfo.cpp
     WebGL/WebGLBuffer.cpp
     WebGL/WebGLBuffer.cpp
     WebGL/WebGLContextAttributes.cpp
     WebGL/WebGLContextAttributes.cpp
     WebGL/WebGLContextEvent.cpp
     WebGL/WebGLContextEvent.cpp

+ 20 - 0
Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp

@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibWeb/WebGL/WebGLActiveInfo.h>
+
+namespace Web::WebGL {
+
+JS_DEFINE_ALLOCATOR(WebGLActiveInfo);
+
+WebGLActiveInfo::WebGLActiveInfo(JS::Realm& realm)
+    : Bindings::PlatformObject(realm)
+{
+}
+
+WebGLActiveInfo::~WebGLActiveInfo() = default;
+
+}

+ 24 - 0
Libraries/LibWeb/WebGL/WebGLActiveInfo.h

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibWeb/Bindings/PlatformObject.h>
+
+namespace Web::WebGL {
+
+class WebGLActiveInfo : public Bindings::PlatformObject {
+    WEB_PLATFORM_OBJECT(WebGLActiveInfo, Bindings::PlatformObject);
+    JS_DECLARE_ALLOCATOR(WebGLActiveInfo);
+
+public:
+    virtual ~WebGLActiveInfo();
+
+protected:
+    explicit WebGLActiveInfo(JS::Realm&);
+};
+
+}

+ 9 - 0
Libraries/LibWeb/WebGL/WebGLActiveInfo.idl

@@ -0,0 +1,9 @@
+#import <WebGL/Types.idl>
+
+// https://registry.khronos.org/webgl/specs/latest/1.0/#5.11
+[Exposed=(Window,Worker)]
+interface WebGLActiveInfo {
+    [FIXME] readonly attribute GLint size;
+    [FIXME] readonly attribute GLenum type;
+    [FIXME] readonly attribute DOMString name;
+};

+ 1 - 0
Libraries/LibWeb/idl_files.cmake

@@ -359,6 +359,7 @@ libweb_js_bindings(WebAudio/GainNode)
 libweb_js_bindings(WebAudio/OfflineAudioContext)
 libweb_js_bindings(WebAudio/OfflineAudioContext)
 libweb_js_bindings(WebAudio/OscillatorNode)
 libweb_js_bindings(WebAudio/OscillatorNode)
 libweb_js_bindings(WebAudio/PeriodicWave)
 libweb_js_bindings(WebAudio/PeriodicWave)
+libweb_js_bindings(WebGL/WebGLActiveInfo)
 libweb_js_bindings(WebGL/WebGLBuffer)
 libweb_js_bindings(WebGL/WebGLBuffer)
 libweb_js_bindings(WebGL/WebGLContextEvent)
 libweb_js_bindings(WebGL/WebGLContextEvent)
 libweb_js_bindings(WebGL/WebGLFramebuffer)
 libweb_js_bindings(WebGL/WebGLFramebuffer)

+ 1 - 0
Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni

@@ -371,6 +371,7 @@ standard_idl_files = [
   "//Userland/Libraries/LibWeb/WebAudio/OfflineAudioContext.idl",
   "//Userland/Libraries/LibWeb/WebAudio/OfflineAudioContext.idl",
   "//Userland/Libraries/LibWeb/WebAudio/OscillatorNode.idl",
   "//Userland/Libraries/LibWeb/WebAudio/OscillatorNode.idl",
   "//Userland/Libraries/LibWeb/WebAudio/PeriodicWave.idl",
   "//Userland/Libraries/LibWeb/WebAudio/PeriodicWave.idl",
+  "//Userland/Libraries/LibWeb/WebGL/WebGLActiveInfo.idl",
   "//Userland/Libraries/LibWeb/WebGL/WebGLBuffer.idl",
   "//Userland/Libraries/LibWeb/WebGL/WebGLBuffer.idl",
   "//Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.idl",
   "//Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.idl",
   "//Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl",
   "//Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl",

+ 1 - 0
Tests/LibWeb/Text/expected/all-window-properties.txt

@@ -390,6 +390,7 @@ VisualViewport
 WeakMap
 WeakMap
 WeakRef
 WeakRef
 WeakSet
 WeakSet
+WebGLActiveInfo
 WebGLBuffer
 WebGLBuffer
 WebGLContextEvent
 WebGLContextEvent
 WebGLFramebuffer
 WebGLFramebuffer