Commit Graph

28 Commits

Author SHA1 Message Date
Jelle Raaijmakers
ae82b14e59 LibGL+LibWeb: Remove WebGL-specific API from GLContext
The OpenGL API has ways to retrieve these values, so let's make sure to
implement them. :^)
2022-12-25 15:48:59 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Andrew Kaster
beb3519a49 LibWeb: Remove unecessary dependence on Window from WebGL and WebSocket
These classes only needed Window to get at its realm. Pass a realm
directly to construct WebGL and WebSocket classes.
2022-10-01 21:05:32 +01:00
Linus Groh
4270ede7c4 LibWeb: Remove WRAPPER_HACK() macro
We no longer access Bindings::FooWrapper anywhere for a Foo platform
object, so these can be removed :^)
2022-09-21 21:12:24 +01:00
Andrew Kaster
8ed5ed3ec0 LibGL: Make GL::create_context fallible
Propagate errors in places that are already set up to handle them, like
WebGLRenderingContext and the Tubes demo, and convert other callers
to using MUST.
2022-09-16 15:32:38 +02:00
Hendiadyoin1
5bd34f115e LibWeb: Add some missing includes 2022-09-13 20:55:21 +02:00
Andreas Kling
45425de849 LibWeb: Use the WRAPPER_HACK() macro instead of hand-coding wrap()
This macro will soon go away, but let's start by replacing all the
hand-coded versions of wrap() with this macro that expands to the same
exact thing.
2022-09-06 00:27:09 +02:00
Andreas Kling
39660a8680 LibWeb: Remove now-unused Bindings::Wrapper class 2022-09-06 00:27:09 +02:00
Andreas Kling
ffad902c07 LibWeb: Use cached_web_prototype() as much as possible
Unlike ensure_web_prototype<T>(), the cached version doesn't require the
prototype type to be fully formed, so we can use it without including
the FooPrototype.h header. It's also a bit less verbose. :^)
2022-09-06 00:27:09 +02:00
Andreas Kling
4452b5ca09 LibWeb: Make 2D and 3D canvas rendering contexts GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00
Andreas Kling
7c3db526b0 LibWeb: Make DOM::Event and all its subclasses GC-allocated 2022-09-06 00:27:09 +02:00
Linus Groh
7b990c27a1 LibWeb: Replace GlobalObject with VM in remaining AOs [Part 4/4] 2022-08-23 13:58:30 +01:00
Linus Groh
a022e548b8 LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]
This is where the fun begins. :^)
2022-08-23 13:58:30 +01:00
Linus Groh
f3117d46dc LibJS: Remove GlobalObject from VM::throw_completion()
This is a continuation of the previous five commits.

A first big step into the direction of no longer having to pass a realm
(or currently, a global object) trough layers upon layers of AOs!
Unlike the create() APIs we can safely assume that this is only ever
called when a running execution context and therefore current realm
exists. If not, you can always manually allocate the Error and put it in
a Completion :^)

In the spec, throw exceptions implicitly use the current realm's
intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
2022-08-23 13:58:30 +01:00
Sam Atkins
8fd83b56d5 LibWeb: Use "unrestricted float/double" where we should in IDL 2022-08-14 11:30:40 +02:00
Andreas Kling
f1576160d7 LibWeb: Don't crash when failing to create WebGL context on non-Serenity
This makes Ladybird stop panicking on websites that try to use WebGL.
2022-07-12 15:55:43 +02:00
Luke Wilde
50642f85ac LibWeb/WebGL: Add WebGLRenderingContextBase.canvas 2022-06-27 22:54:41 +01:00
Luke Wilde
0ec8a19a34 LibWeb/WebGL: Forward the render context ref count to HTMLCanvasElement
This allows HTMLCanvasElement and WebGL rendering contexts to share
their lifetime, as JS allows them to arbitrarily access them at any
time and WebGLRCB.canvas expects a non-null return value.
2022-06-27 22:54:41 +01:00
Luke Wilde
0805911a93 LibWeb/WebGL: Implement WebGLRenderingContextBase.depthRange() 2022-06-13 21:45:27 +01:00
Luke Wilde
d9ef228c76 LibWeb/WebGL: Implement WebGLRenderingContextBase.lineWidth() 2022-06-13 21:45:27 +01:00
Luke Wilde
a6617e1096 LibWeb/WebGL: Implement error handling and getError() 2022-06-13 21:45:27 +01:00
Luke Wilde
528c7bea03 LibWeb/WebGL: Add WebGLRenderingContextBase.isContextLost() 2022-06-13 21:45:27 +01:00
Luke Wilde
39a212b54f LibWeb/WebGL: Add a bunch of simple forwarding functions
This collection of functions simply check if the context is still
alive, then forward the call to the GL context.
2022-06-13 21:45:27 +01:00
Luke Wilde
aa77c26b60 LibWeb/WebGL: Add extensions APIs to WebGLRenderingContextBase
These currently return nothing, as we don't currently support any WebGL
extensions.
2022-06-13 21:45:27 +01:00
Luke Wilde
076c9772a4 LibWeb: Add ability to present LibGL framebuffer and add clearing 2022-06-13 21:45:27 +01:00
Luke Wilde
58f882200c LibWeb: Add the ability to retrieve a WebGL context from getContext 2022-06-13 21:45:27 +01:00
Luke Wilde
b0c2aee2e4 LibWeb: Introduce the WebGL namespace and add WebGLContextEvent 2022-06-13 21:45:27 +01:00