Commit Graph

21 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
2f5ff14984 LibWeb: Fix spec implementation mistakes in destroy_the_child_navigable
Fixes two places in child navigable destroy procedure where we used
content navigable instead of container's navigable.

With this change, iframe's nested histories are actually destroyed
along with the document that created them.
2023-10-19 16:54:17 -04:00
Ali Mohammad Pur
aeee98b3a1 AK+Everywhere: Remove the null state of DeprecatedString
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>

Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
2023-10-13 18:33:21 +03:30
Aliaksandr Kalenik
44f7d7406c LibWeb: Use struct to pass Navigable::navigate() params
Using structs makes the navigate() calls looks cleaner. No change
in behavior is intended.
2023-10-12 03:25:06 +02:00
Andrew Kaster
7e277797ad LibWeb: Add about base url to the various AOs that construct documents
And some assorted cleanup along the way. The browsing context and
document AOs in particular need re-alignment with the spec.
2023-09-22 19:45:11 -06:00
Aliaksandr Kalenik
9b16e5373d LibWeb: Process session history queue after initial iframe navigation
This is not in the spec, but we need to make sure that "apply the
history step" for initial navigation to about:blank in iframe is
applied before subsequent navigations. Otherwise, "set ongoing
navigation" call during "about:blank" traversal might abort subsequent
ongoing navigation which is not expected to happen.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
67f5c027fe LibWeb: Use saved navigable pointer in destroy_the_child_navigable
During the destruction of a navigable, we need to use the pointer to
the navigable that was saved at the beginning of the function. This
is because `Node::navigable()` will return a nullptr in subsequent
steps after the navigable's document becomes inactive.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
cf985afdcb LibWeb: Look for targetStepSHE in parent while creating child navigable
Reported issue in the spec https://github.com/whatwg/html/issues/9686
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
6942bdcfce LibWeb: Update top_level_browsing_context() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
912cf89727 LibWeb: Update HTMLIFrameElement to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
c437f16cc1 LibWeb: Early return navigation process if navigable has been destroyed
If a navigable has been destroyed during a navigation process, we
should early return from it. The introduced checks are not in
the spec because, as explained in
https://github.com/whatwg/html/issues/9690 the spec is not written
with such a level of detail.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
2445205e9d LibWeb: Align session history step application code with latest spec
Replaces direct "apply the history step" calls with new functions from
the spec:
- "update for navigable creation/destruction"
- "apply the push/replace history step"
- "apply the reload history step"
2023-09-15 18:27:17 +02:00
Shannon Booth
0f6782fae6 LibWeb: Rename Element::attribute to Element::deprecated_attribute
This should allow us to add a Element::attribute which returns an
Optional<String>. Eventually all callers should be ported to switch from
the DeprecatedString version, but in the meantime, this should allow us
to port some more IDL interfaces away from DeprecatedString.
2023-09-05 20:36:09 -04:00
Andrew Kaster
a565021147 LibWeb: De-duplicate definition of url_matches_about_blank
We don't need two static methods for this.
2023-08-29 09:39:57 +02:00
Aliaksandr Kalenik
b05bd889e1 LibWeb: Add missing navigable in NavigableContainer::visit_edges() 2023-08-14 17:46:46 +02:00
Aliaksandr Kalenik
08788072c1 LibWeb: Add SessionHistoryTraversalQueue 2023-08-14 17:46:46 +02:00
Shannon Booth
55a01e72ca AK: Port URL username/password from DeprecatedString to String
And for cases that just need to check whether the password/username is
empty, add a raw_{password,username} helper to avoid any allocation.
2023-08-13 15:03:53 -06:00
Shannon Booth
8751be09f9 AK: Serialize URL hosts with 'concept-host-serializer'
In order to follow spec text to achieve this, we need to change the
underlying representation of a host in AK::URL to deserialized format.
Before this, we were parsing the host and then immediately serializing
it again.

Making that change resulted in a whole bunch of fallout.

After this change, callers can access the serialized data through
this concept-host-serializer. The functional end result of this
change is that IPv6 hosts are now correctly serialized to be
surrounded with '[' and ']'.
2023-07-31 05:18:51 +02:00
Aliaksandr Kalenik
41f9dcd89b LibWeb: Implement "create a new child navigable" and supporting code
Implements https://html.spec.whatwg.org/multipage/document-sequences.html#create-a-new-child-navigable

Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-07-11 06:48:25 +02:00
Aliaksandr Kalenik
934cb601c2 LibWeb: Implement "destroy the child navigable" on navigable containers
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-06-23 17:24:32 +02:00
Aliaksandr Kalenik
d85bdd3ac5 LibWeb: Add API for finding NavigableContainer by content navigable
This is only needed because currently spec doesn't explicitly define
that navigable should have a pointer to associated container and when
this pointer should be set.
2023-06-23 16:20:29 +02:00
Andreas Kling
d8ccc2d54e LibWeb: Rename BrowsingContextContainer => NavigableContainer
The "browsing context container" concept in the HTML spec has been
replaced with "navigable container". Renaming this is the first step of
many towards implementing the new world.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-19 18:26:45 +02:00