summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Document.h
AgeCommit message (Collapse)Author
2023-02-18LibWeb: Make factory methods of DOM::Document fallibleKenneth Myhra
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
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-18LibWeb: Convert the Location object to IDLLinus Groh
This includes: - Moving it from Bindings/ to HTML/ - Renaming it from LocationObject to Location - Removing the manual definitions of the constructor and prototype - Removing special handling of the Location interface from the bindings generator - Converting the JS_DEFINE_NATIVE_FUNCTIONs to regular functions returning DeprecatedString instead of PrimitiveString - Adding missing (no-op) setters for the various attributes, which are expected to exist by the bindings generator
2023-01-10LibWeb: Move setting of Web object prototypes to initialize()Timothy Flynn
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-09AK+Everywhere: Rename FlyString to DeprecatedFlyStringTimothy Flynn
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so let's rename it to A) match the name of DeprecatedString, B) write a new FlyString class that is tied to String.
2023-01-07LibWeb: Add Functionality to Dump to Accessibility TreeJonah
This will be used to display the accessibility tree in the inspector.
2022-12-14LibWeb: Add Document.createProcessingInstruction()Andreas Kling
These nodes don't really do anything interesting yet, but let's allow creating them. :^)
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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-11-21LibWeb: Remove unused should_invalidate_styles_on_attribute_changes()Baitinq
This getter and setter were previously labelled as a "hack" and used to disable style invalidation on attribute changes during the HTML parsing phase (as it caused big sites's loading to be slow). These functions are currently not used, so they can be removed:^)
2022-11-15LibWeb: Implement document.open(string, string, string)Idan Horowitz
2022-11-07LibWeb: Start implementing the Element scroll attributesLuke Wilde
These are required for hit testing the document in Google Docs. If they aren't defined, the Google Docs hit test code will add undefined to certain values, causing them to turn into NaN. This causes NaNs to propagate through their hit test code, which eventually makes it infinitely loop.
2022-11-07LibWeb: Stub Document.queryCommandSupportedLuke Wilde
2022-11-05LibWeb: Cache the first <base href> (in tree order) in DocumentAndreas Kling
When parsing relative URLs, we have to check the first <base href> in tree order (if one is available). This was getting *very* costly on large DOMs with many relative urls. This patch avoids all that repeated traversal by letting Document cache the first <base href> and invalidating the cache whenever a <base> element is added/removed/edited in the DOM. The browser was stuck doing this for a *very* long time when loading the ECMA-262 spec, and this removes that problem entirely.
2022-11-03LibWeb: Make it obvious that DOM::Document makes a copy of its sourceTimothy Flynn
2022-11-03LibWeb: Fully implement the fragment serializing algorithmTimothy Flynn
Rather than assuming the node's node document is an HTML document, handle XML documents as well.
2022-10-29LibWeb: Update "appropriate template contents owner document" AOAndreas Kling
This was moved from HTMLTemplateElement to Document at some point, so let's match the spec and move it here too.
2022-10-20LibWeb: Make the layout tree GC-allocatedAndreas Kling
This removes a set of complex reference cycles between DOM, layout tree and browsing context. It also makes lifetimes much easier to reason about, as the DOM and layout trees are now free to keep each other alive.
2022-10-20LibWeb: Make BrowsingContext GC-allocatedAndreas Kling
(And BrowsingContextGroup had to come along for the ride as well.) This solves a number of nasty reference cycles between browsing contexts, history items, and their documents.
2022-10-20LibWeb: Make the HTMLParser GC-allocatedAndreas Kling
This prevents a reference cycle between a HTMLParser opened via document.open() and the document. It was one of many things keeping some documents alive indefinitely.
2022-10-20LibWeb: Tear down old layout tree when new document becomes activeAndreas Kling
When a new document becomes the active document of a browsing context, we now notify the old document, allowing it to tear down its layout tree. In the future, there might be more cleanups we'd like to do here.
2022-10-11LibWeb: Add spec link for DOM::Document::m_selectionAndreas Kling
2022-10-10LibWeb: Make Window.getSelection() forward to Document.getSelection()Andreas Kling
(And have document create the Selection object on demand.)
2022-10-01LibWeb: Cleanup unecessary uses and includes of HTML::WindowAndrew Kaster
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-01LibWeb: Remove unecessary dependence on Window from DOM and WebIDLAndrew Kaster
These classes only needed Window to get at its realm. Pass a realm directly to construct DOM and WebIDL classes. This change importantly removes the guarantee that a Document will always have a non-null Window object. Only Documents created by a BrowsingContext will have a non-null Window object. Documents created by for example, DocumentFragment, will not have a Window (soon). This incremental commit leaves some workarounds in place to keep other parts of the code building.
2022-09-25LibWeb: Move ExceptionOr from DOM/ to WebIDL/Linus Groh
This is a concept fully defined in the Web IDL spec and doesn't belong in the DOM directory/namespace - not even DOMException, despite the name :^)
2022-09-21LibWeb: Remove WRAPPER_HACK() macroLinus Groh
We no longer access Bindings::FooWrapper anywhere for a Foo platform object, so these can be removed :^)
2022-09-21LibWeb: Flesh out most of the "unload" algorithm for documentsAndreas Kling
Yet another small steps towards spec-compliant document lifecycles.
2022-09-21LibWeb: Save begin/end timestamps for load and DOMContentLoaded eventsAndreas Kling
2022-09-21LibWeb: Add load/unload timing structures to DocumentAndreas Kling
We don't populate these with information just yet, but we will soon!
2022-09-20LibWeb: Implement Document/BrowsingContext hookup according to specAndreas Kling
We now implement the browsing context's "set active document" algorithm from the spec, as well as the "discard" algorithm for browsing contexts and documents.
2022-09-20LibWeb+WebContent+Browser: Plumb visibility state from GUI to web pagesAndreas Kling
OOPWV now reacts to show/hide events and informs LibWeb about the state change. This makes visibilitychange events fire when switching tabs. :^)
2022-09-20LibWeb: Keep more of the navigation parameters in DocumentAndreas Kling
2022-09-20LibWeb: Flesh out "document visibility" state a bit moreAndreas Kling
We can now "update the visibility state", which also causes `visibilitychange` events to fire on the document. This still needs GUI integration work at the BrowsingContext level.
2022-09-20LibWeb: Set the document "completely loaded time" when appropriateAndreas Kling
2022-09-18LibWeb: Implement basic support for Document.allAndreas Kling
The finer details are missing here, but the basic API is up.
2022-09-18LibWeb: Make Document vend the same HTMLCollections every timeAndreas Kling
2022-09-17LibWeb: Implement basic "scroll" events at the document levelAndreas Kling
2022-09-17LibWeb: Add "scripts to execute in order as soon as possible"Andreas Kling
Previously, we had accidentally conflated this set with the similar-but-distinct "scripts to execute as soon as possible".
2022-09-17LibWeb: Make Document.createElement() lowercase HTML local namesAndreas Kling
Bring createElement() a little bit closer to spec-compliance.
2022-09-15LibWeb: Implement document.domain getterLuke Wilde
The document.domain setter is currently stubbed as that is a doozy to implement, given how much restrictions there are in place to try and prevent use of it and potential multi-process implications. This was the only thing preventing us from being able to start displaying ads delivered via Google Syndication.
2022-09-07LibWeb+WebContent: Add abstraction layer for event loop and timersAndreas Kling
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now goes through a Web::Platform abstraction layer instead. This will allow us to plug in Qt's event loop (and QTimer) over in Ladybird, to avoid having to deal with multiple event loops.
2022-09-06LibWeb: Make DOMException GC-allocatedAndreas Kling
2022-09-06LibWeb: Make History GC-allocatedAndreas Kling
2022-09-06LibWeb: Make HTMLCollection and subclasses GC-allocatedAndreas Kling
2022-09-06LibWeb: Remove Document::interpreter()Andreas Kling
Nobody needs this anymore, so we can finally remove it. :^)
2022-09-06LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocatedAndreas Kling
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-06LibWeb: Make AbstractRange and subclasses GC-allocatedAndreas Kling
2022-09-06LibWeb: Make DOM::Event and all its subclasses GC-allocatedAndreas Kling
2022-09-06LibWeb: Make TreeWalker GC-allocatedAndreas Kling