Commit Graph

16 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
376427380e LibWeb: Make NavigationParams be GC-allocated
Fixes GC-leak caused by using JS::Handle for navigable.
2024-04-22 17:10:11 +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
dc0f7c4c54 LibWeb: Align NavigationParams and the creation AOs to the spec
And remove assorted spec FIXMEs along the way. Also align
populate_session_history_entry_document to the spec, with a bonus spec
bug to be filed.

This involves creating a new NonFetchSchemeNavigationParams spec, and
having the associated AOs take a Variant rather than Optional to
accomodate the fact that this extra struct could be returned by the
algorithm. We don't actually *do* anything with these params, but the
scaffolding is there now, with less TODOs.
2023-09-22 19:45:11 -06:00
Andrew Kaster
d97b09693e LibWeb: Convert SandboxingFlagSet into a enum class
Instead of having a nested enum within a struct, use the macro
AK_ENUM_BITWISE_OPERATORS to add all the convienent has_flag free
functions and such for ease of use.
2023-08-29 09:39:57 +02:00
Aliaksandr Kalenik
a27a30898c LibWeb: Add fetch_controller property in HTML::NavigationParams 2023-05-03 09:39:49 +02:00
Aliaksandr Kalenik
38a2d5ead3 LibWeb: Add navigable property in NavigationParams 2023-05-03 09:39:49 +02:00
Aliaksandr Kalenik
0c919718ae LibWeb: Change id to be optional in HTML::NavigationParams 2023-05-03 09:39:49 +02:00
Aliaksandr Kalenik
9f691b7fe4 LibWeb: Convert navigationId from DeprecatedString to String 2023-04-24 07:55:20 +02:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
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-12-06 08:54:33 +01:00
Linus Groh
b1968b8bed LibWeb: Make Fetch::Infrastructure::{Request,Response,HeaderList} GC'd
This is the way.

On a more serious note, there's no reason to keep adding ref-counted
classes to LibWeb now that the majority of classes is GC'd - it only
adds the risk of discovering some cycle down the line, and forces us to
use handles as we can't visit().
2022-10-30 11:30:23 +00:00
Andreas Kling
83c5ff57d8 LibWeb: Make BrowsingContext GC-allocated
(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-20 15:16:23 +02:00
Linus Groh
1c12f5c31d LibWeb: Make Fetch::Infrastructure::{Request,Response} ref-counted
With the addition of the 'fetch params' struct, the single ownership
model we had so far falls apart completely.

Additionally, this works nicely for FilteredResponse's internal response
instead of risking a dangling reference.

Replacing the public constructor with a create() function also found a
few instances of a Request being stack-allocated!
2022-10-05 09:14:49 +01:00
Andreas Kling
5a500827b8 LibWeb: Move HistoryHandlingBehavior enum to its own header
This avoids a header cycle in a subsequent patch.
2022-09-20 10:32:12 +02:00
Andreas Kling
0781bdb23e LibWeb: Add HTML::NavigationParams 2022-08-05 12:46:39 +02:00