Commit Graph

30 Commits

Author SHA1 Message Date
Nico Weber
2abe62adfa LibWeb: Don't divide by 0 in DOMMatrix::invert_self()
We'd only check is_invertible() after calling inverse(), which would
do a divide-by-0 for non-invertible matrices.

Less ambitious version of #18593.
2023-05-04 15:39:34 +02:00
Luke Wilde
4c3f1481ea LibWeb: Remove FIXME for existing [Default] object toJSON()functions 2023-03-23 21:00:43 +00:00
Linus Groh
11b40dbcf5 LibWeb/WebIDL: Store SimpleException message as a String{,View} variant 2023-03-03 19:50:36 +00:00
Luke Wilde
54f58e2662 LibWeb: Restore proper functionality of legacy platform objects
With the GC heap conversion, the functionality of legacy platform
objects was broken. This is because the generated implementation of one
of them was used for all of them, removing functionality such as
deletion.

This re-adds all functionality, where questions such as "does the
object support indexed properties?" is instead answered by virtual
functions instead of by the IDL generator checking the presence of
certain keywords/attributes.
2023-02-28 12:36:14 +01:00
Luke Wilde
a90667e79c LibWeb: Add initial implementation of DOMMatrix(ReadOnly)
This is currently missing a lot of functions and initialisation from a
<transform-list> string, but is enough for Ruffle.
2023-02-27 20:55:09 +01:00
Kenneth Myhra
07db02cd2c LibWeb: Make factory method of Geometry::DOMRectReadOnly fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
ec0049441c LibWeb: Make factory methods of Geometry::DOMRect fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
9b190b9509 LibWeb: Make factory method of Geometry::DOMRectList fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
4de5dc7a86 LibWeb: Make factory method of Geometry::DOMPointReadOnly fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
530ec85c4a LibWeb: Make factory method of Geometry::DOMPoint fallible 2023-02-22 09:55:33 +01:00
Timothy Flynn
b75b7f0c0d LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate
Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
2023-01-29 00:02:45 +00:00
Timothy Flynn
2692db8699 LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
2023-01-29 00:02:45 +00:00
Timothy Flynn
af75493883 LibWeb: Move passing of Web object prototypes out of constructors 2023-01-10 16:08:14 +01:00
Timothy Flynn
834202aeb9 LibWeb: Move setting of Web object prototypes to initialize()
This needs to happen before prototype/constructor intitialization can be
made lazy. Otherwise, GC could run during the C++ constructor and try to
collect the object currently being created.
2023-01-10 16:08:14 +01:00
Linus Groh
22089436ed LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr 2022-12-15 06:56:37 -05:00
Andrew Kaster
67ceba2e6a LibWeb: Add Exposed attribute and IDL spec links where missing
The intent is to use these to autogenerate prototype declarations for
Window and WorkerGlobalScope classes.

And the spec links are just nice to have :^)
2022-10-09 10:14:57 +02:00
Sam Atkins
ab19c5fab8 LibWeb: Implement DOMPoint/DOMPointReadOnly.fromPoint() 2022-10-06 21:45:07 +01:00
Sam Atkins
8a78679152 LibWeb: Correct types in DOMPoint IDL files, and add FIXMEs
Also, the `w` parameters for the constructor default to 1, not 0.
2022-10-06 21:45:07 +01:00
Andrew Kaster
56b381aac0 LibWeb: Cleanup unecessary uses and includes of HTML::Window
The big global refactor left some stragglers behind for atomicity.

Clean up the rest, and remove a ton of includes of LibWeb/HTML/Window.h
2022-10-01 21:05:32 +01:00
Andrew Kaster
320dddde6a LibWeb: Remove unecessary dependence on Window from SVG classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct SCG classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
62a8c26b73 LibWeb: Remove unecessary dependence on Window from Geometry classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Geometry 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
Andreas Kling
57db2529cf LibWeb: Make DOMRect, DOMRectReadOnly and DOMRectList GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
44415af428 LibWeb: Make DOMPoint and DOMPointReadOnly 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
e883777a18 LibWeb: Add barebones implementation of DOMPoint and DOMPointReadOnly 2022-07-12 23:12:11 +02:00
Ali Mohammad Pur
a59800b4a0 LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
DerpyCrabs
2f828231c4 LibWeb: Implement Geometry::DOMRectList
Implement DOMRectList that is used as a return type of
getClientRects functions on Element and Range.
2022-02-12 22:43:10 +01:00
Andreas Kling
3c0b55c284 LibWeb: Add DOMRectReadOnly and make DOMRect inherit from it
This matches the class hierarchy of the CSS Geometry Interfaces Module.
2021-10-08 23:00:49 +02:00
Andreas Kling
43d378940f LibWeb: Add DOMRect and Element.getBoundingClientRect()
This marks our entry into the Web::Geometry namespace, based on the
"Geometry" spec at https://drafts.fxtf.org/geometry/
2021-09-27 01:01:29 +02:00