Commit Graph

20 Commits

Author SHA1 Message Date
Matthew Olsson
31341b280a LibWeb: Add calls to JS_{DECLARE,DEFINE}_ALLOCATOR() 2024-04-09 09:13:06 +02:00
Shannon Booth
70e2f51674 LibWeb: Prefer GCPtr<T> over Optional<NonnullGCPtr<T>> 2024-04-07 18:01:05 +02:00
Aliaksandr Kalenik
39f74d3437 LibWeb: Bring HistoryHandlingBehavior up to date with the specification
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-03-28 15:34:52 +01:00
Shannon Booth
e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
Shannon Booth
9ce8189f21 Everywhere: Use unqualified AK::URL
Now possible in LibWeb now that there is no longer a Web::URL.
2024-02-25 08:54:31 +01:00
Andrew Kaster
a8091c009b LibWeb: Add assorted AOs related to populating the navigation API's SHEs 2024-01-19 11:47:59 +01:00
Andreas Kling
bfd354492e LibWeb: Put most LibWeb GC objects in type-specific heap blocks
With this change, we now have ~1200 CellAllocators across both LibJS and
LibWeb in a normal WebContent instance.

This gives us a minimum heap size of 4.7 MiB in the scenario where we
only have one cell allocated per type. Of course, in practice there will
be many more of each type, so the effective overhead is quite a bit
smaller than that in practice.

I left a few types unconverted to this mechanism because I got tired of
doing this. :^)
2023-11-19 22:00:48 +01:00
Andrew Kaster
0f8ae12d44 LibWeb: Implement fire a download request navigate event 2023-09-23 18:57:31 +02:00
Andrew Kaster
67bc3629a9 LibWeb: Implement fire a push/replace/reload navigate event 2023-09-23 18:57:31 +02:00
Andrew Kaster
5549371b52 LibWeb: Implement fire a traverse navigate event on Navigation 2023-09-23 18:57:31 +02:00
Andrew Kaster
3935105d0a LibWeb: Implement the inner navigate event firing algorithm
This algorithm is the meat of firing the NavigateEvent at navigation.
In order to implement it, we also need to add some getters/setters on
NavigateEvent. The implemetentation deviates from the spec in when
exactly the NavigateEvent is created. In following the pattern for other
events. we construct the event from the NavigateEventInit structure from
our native code. This makes the code a lot simpler than adding 10
getters to the NavigateEvent that are only ever used just after
construction. I'm not 100% conviced the promise resolution code is
correct, but we can add tests for that later :^).
2023-09-23 18:57:31 +02:00
Andrew Kaster
0650edc7d7 LibWeb: Implement Navigation AOs that are called during event firing
These Navigation API Method Tracker AOs are called by the inner navigate
event firing algorithm. Implement them beforehand to make the diff look
pretty :^).
2023-09-23 18:57:31 +02:00
Andrew Kaster
2a24dda44d LibWeb: Implement NavigateEvent AOs that are called during event firing
The potentially scroll/focus and finish AOs are called by the inner
navigate event firing algorithm. Implement them beforehand to make the
diff look pretty :^).
2023-09-23 18:57:31 +02:00
Andrew Kaster
f296382e1a LibWeb: Implement inform the navigation api about aborting navigation
This also requires implementing the abort the ongoing navigation AO on
Navigation, which will be used from other NavigateEvent AOs.
2023-09-22 19:45:11 -06:00
Andrew Kaster
cf1f14f58c LibWeb: Make to_history_handling_behavior conversion helper public
While we're here, assert that we're not doing this conversion when the
NavigationHistoryBehavior is still "auto", as the
HistoryHandlingBehavior enum is supposed to represent a "resolved"
behavior.
2023-08-29 09:39:57 +02:00
Andrew Kaster
b1f06e42ce LibWeb: Implement navigation.{traverseTo, back, forward}
The proper abstract operations on Navigable and TraversableNavigable are
not quite ready to call from Navigation. With this commit all of the
user-facing APIs of Navigation are in place, and the stage should be set
to implement the parts of the navigation and traversal AOs that need to
interact with the Navigation object.
2023-08-28 09:47:11 +02:00
Andrew Kaster
798a1b2751 LibWeb: Implement navigation.reload()
This has the same issue as navigate(), in that we currently cannot
guarantee that there is a valid navigable on every fully loaded
document.
2023-08-28 09:47:11 +02:00
Andrew Kaster
f8e5df7a99 LibWeb: Implement navigation.navigate()
The implementation is incomplete, because our Navigable::navigate
implementation is missing the navigationAPIState parameter. We also
don't have Navigables hooked up completely enough to guarantee that a
fully active document that is not being unloaded always has a Navigable.
2023-08-25 19:51:13 +02:00
Andrew Kaster
3dd3b2019d LibWeb: Add NavigationTransition, a transient property of Navigation
This property is useful for web content to determine whether an ongoing
navigation has settled or not.
2023-08-24 11:03:57 -06:00
Andrew Kaster
0c2f758067 LibWeb: Implement the start of the Navigation API
This API is how JavaScript can manipulate the new Navigable concepts
directly. We are still missing most of the interesting algorithms on
Navigation that do the actual navigation steps, and call into the
currently WIP navigable AOs.
2023-08-24 11:03:57 -06:00