Commit graph

12 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
2801ddfa76 LibWeb: Implement (naive) version of HTMLIFrameElement.contentWindow
This should really return the WindowProxy, but since we don't have the
infrastructure set up just yet, just return the window object itself
for now.
2022-08-05 12:42:46 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Idan Horowitz
f82d4d001d LibWeb: Implement getSVGDocument() for BrowsingContextContainer
Specifically HTMLIFrameElement and HTMLObjectElement. HTMLEmbedElement
will gain it automatically once it's also converted to inherit from
BrowsingContextContainer.
2022-03-24 21:37:49 +01:00
Timothy Flynn
f733385cc4 LibWeb: Move automatic browsing context creation to HTMLIFrameElement
We will soon have two DOM nodes which contain nested browsing contexts:
HTMLIFrameElement and HTMLObjectElement. Only HTMLIFrameElement should
have its nested context created automatically upon insertion, so move
the invocation of that logic to HTMLIFrameElement.
2022-03-24 03:35:11 +01:00
Andreas Kling
1e53cc3f5b LibWeb: Establish parent/child relationship between BrowsingContexts
When an iframe is inserted or removed from a document, we now take it in
and out of the BrowsingContext tree.
2022-03-09 18:14:24 +01:00
Andreas Kling
1b6ed558bb LibWeb: Move QualifiedName into the Web::DOM namespace 2022-02-19 14:45:59 +01:00
Linus Groh
c7f8c20f8b LibWeb: Omit origin check for content document in FrameBox::paint()
Once we paint, it's way too late for this check to happen anyway.

Additionally, the spec's steps for retrieving the content document
assume that both the browsing context's active document and the
container's node document are non-null, which evidently isn't always the
case here, as seen by crashes on the SerenityOS 2nd and 3rd birthday
pages (I'm not sure about the details though).

Fixes #12565.
2022-02-16 22:51:25 +00:00
Linus Groh
75dd4fbd16 LibWeb: Implement BCC's "content document" concept according to spec 2022-02-15 01:31:03 +01:00
Andreas Kling
108de5dea0 LibWeb: Stop sending "load" event twice to iframes
The "completely finish loading" algorithm (from the HTML spec) is
responsible for sending a "load" event to nested browsing context
containers (iframes).

This patch removes the old mechanism for sending "load" events, which we
had mistakenly kept around, causing two events to be sent instead of
one. :^)
2021-12-04 14:47:24 +01:00
Vyacheslav Pukhanov
3f006d81fe LibWeb: Add JSON serialization for nested browsing contexts
This changes allows for nested browser contexts to be embedded in the
serialized JSON of their container element (like `iframe`) and enables
their inspection in the DOM Inspector.
2021-11-24 19:07:48 +01:00
Luke
59cfc4a8db LibWeb: Rename "FrameHostElement" to "BrowsingContextContainer"
With the renaming of "Frame" to "BrowsingContext", this changes
"FrameHostElement" to "BrowsingContextContainer" to further
match the spec.

https://html.spec.whatwg.org/#browsing-context-container
2021-05-31 16:25:13 +02:00
Renamed from Userland/Libraries/LibWeb/HTML/FrameHostElement.h (Browse further)