Andreas Kling
cb15132146
LibWeb: Always allow scripting in workers for now
...
Workers don't have a document, so we can't ask them if scripting is
enabled or not. This is not the right long-term fix, but it fixes an
assertion when trying to query the missing responsible document of a
web worker.
2022-09-06 00:27:09 +02:00
Andreas Kling
e97cc671ea
LibWeb: Give web workers a (totally hacky) Window object
...
This is *not* according to spec, however we currently store prototypes
and constructors on Window, so the only way for objects in a worker
context to become fully formed is to make a Window.
Long-term we should clean this up and remove the worker window object,
but for now it allows workers to exist without asserting.
2022-09-06 00:27:09 +02:00
Andreas Kling
8f110e0fb1
LibWeb: Remove the NoInstanceWrapper extended IDL attribute
...
No interfaces require wrappers anymore, so we can just make this the
default mode.
2022-09-06 00:27:09 +02:00
Andreas Kling
1bd4ad8b6d
LibWeb: Remove now-unused Bindings::wrap()
2022-09-06 00:27:09 +02:00
Andreas Kling
9176a0de99
LibWeb: Stop using Bindings::wrap() in a bunch of places
...
wrap() is now basically a no-op so we should stop using it everywhere
and eventually remove it. This patch removes uses of wrap() in
non-generated code.
2022-09-06 00:27:09 +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
3768743a0a
LibWeb: Remove now-unused Bindings::Wrappable class
2022-09-06 00:27:09 +02:00
Andreas Kling
ac274eee72
LibWeb: Remove the NO_INSTANCE option now that all wrappers are gone
2022-09-06 00:27:09 +02:00
Andreas Kling
497ead37bc
LibWeb: Make DOMException GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
0e47754ac8
LibWeb: Make LocationObject a PlatformObject
2022-09-06 00:27:09 +02:00
Andreas Kling
2fe97fa8db
LibWeb: Make WorkerNavigator GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
9da72cdaba
LibWeb: Make WorkerLocation GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
25daa14a05
LibWeb: Make IntersectionObserver GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
fe9c5395d4
LibWeb: Make URL, URLSearchParams & URLSearchParamsIterator GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
0dc2c27fa3
LibWeb: Make ResizeObserver GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
915a240944
LibWeb: Make IdleDeadline GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
8f2a711132
LibWeb: Make Selection GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
be9d3860b9
LibWeb: Make Crypto GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
96f6c7fae5
LibWeb: Make Headers and HeadersIterator GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
647ac1bdba
LibWeb: Make Blob and File GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
018d236439
LibWeb: Make TextDecoder GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
7e508456a0
LibWeb: Make TextEncoder GC-allocated
2022-09-06 00:27:09 +02: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
a9cae56f8e
LibWeb: Remove unused HTML::Window::create_with_document()
2022-09-06 00:27:09 +02:00
Andreas Kling
7a9b8ced38
LibWeb: Make SubtleCrypto GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
2ac8e3db3a
LibWeb: Make Storage GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
d7c6298d8b
LibWeb: Use target's global object when creating focus/blur events
2022-09-06 00:27:09 +02:00
Andreas Kling
05dcf3b2f8
LibWeb: Don't allocate DOMStringMap in HTMLElement constructor
...
Allocations go in initialize().
2022-09-06 00:27:09 +02:00
Andreas Kling
b30e95eb27
LibWeb: Don't allocate NamedNodeMap in Element constructor
...
Allocations should happen in the initialize() virtual, so move it there.
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
a85542958c
LibWeb: Add some missing constructors to the Window object
2022-09-06 00:27:09 +02:00
Andreas Kling
dd9cd3050b
LibWeb: Use correct Window object when dispatching Document load event
2022-09-06 00:27:09 +02:00
Andreas Kling
1029ea4b32
LibWeb: Use correct relevant settings object in Document initialization
...
The code was not in line with the spec comment right above it.
2022-09-06 00:27:09 +02:00
Andreas Kling
5724a04553
LibWeb: Make StyleSheet mark its owner node
...
The garbage collector will take care of cycles.
2022-09-06 00:27:09 +02:00
Andreas Kling
36085676d2
LibWeb: Make CSSImportList mark its document
...
We don't need to use a WeakPtr here anymore, since the garbage collector
will resolve any cycles.
2022-09-06 00:27:09 +02:00
Andreas Kling
a835f313f7
LibWeb: Make Document::is_fully_active() more robust
...
We were missing a check for null browsing context container documents.
2022-09-06 00:27:09 +02:00
Andreas Kling
4901f69345
LibWeb: Don't capture raw ptr in Document::completely_finish_loading()
...
It's not safe to capture a raw pointer in a HTML task, as the garbage
collector doesn't have visibility into the task captures.
2022-09-06 00:27:09 +02:00
Andreas Kling
233208b640
LibWeb: Make XMLSerializer GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
6b7a1d13e9
LibWeb: Make TextMetrics GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
2704bcdaaa
LibWeb: Make Path2D GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
0d2fee351a
LibWeb: Make CanvasGradient GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
369dd42d67
LibWeb: Make ImageData GC-allocated
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
b8d485e6f0
LibWeb: Make AbortController GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
3905d54a9c
LibWeb: Make SVGLength and SVGAnimatedLength GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
16fbb91aa1
LibWeb: Make History GC-allocated
2022-09-06 00:27:09 +02:00
Andreas Kling
abfb73f2e7
LibWeb+LibJS: Let JS::Realm::HostDefined objects mark things during GC
...
This allows us to mark the HTML::Window from our window environment
settings object.
2022-09-06 00:27:09 +02:00
Andreas Kling
2ff7e37048
LibWeb: Make MessageChannel GC-allocated
2022-09-06 00:27:09 +02:00