Commit Graph

8 Commits

Author SHA1 Message Date
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
a56b3f9862 LibWeb: Make NamedNodeMap GC-allocated 2022-09-06 00:27:09 +02:00
Linus Groh
40a70461a0 LibWeb: Replace GlobalObject with Realm in wrapper functions
Similar to create() in LibJS, wrap() et al. are on a low enough level to
warrant passing a Realm directly instead of relying on the current realm
from the VM, as a wrapper may need to be allocated while no JS is being
executed.
2022-08-23 13:58:30 +01:00
Luke Wilde
a718c62c01 LibWeb: Implement all "attributes" mutation records for MutationObserver 2022-07-11 22:35:08 +02:00
Timothy Flynn
6efbafa6e0 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2022-01-31 18:23:22 +00:00
Andreas Kling
7fc770cfac LibWeb: Make DOM::NamedNodeMap forward its ref count to DOM::Element
This allows JS to keep an element alive by retaining a reference to
element.attributes
2021-12-09 21:28:52 +01:00
Timothy Flynn
b67f6daf05 LibWeb: Weakly store NamedNodeMap's & Attribute's associated Element
This is similar to how Gecko avoids a reference cycle, where both the
NamedNodeMap and Attribute would otherwise store a strong reference to
their associated Element. Gecko manually clears stored raw references
when an Element is destroyed, whereas we use weak references to do so
automatically.

Attribute's ownerElement getter and setter are moved out of line to
avoid an #include cycle between Element and Attribute.
2021-10-18 09:58:52 +02:00
Timothy Flynn
2a3ac02ef1 LibWeb: Implement (most of) NamedNodeMap to store attributes 2021-10-17 13:51:10 +01:00