Commit Graph

2421 Commits

Author SHA1 Message Date
Tim Ledbetter
fc395716e9 LibWeb: Return NonnullGCPtr<DOMTokenList> from relList getters 2024-05-18 11:03:49 +02:00
Tim Ledbetter
51fc30a191 LibWeb: Implement the HTMLLinkElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter
fc4e0cf10e LibWeb: Implement the HTMLFormElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter
0a3e1846f0 LibWeb: Implement the HTMLAreaElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter
b7fd39c2e6 LibWeb: Implement the HTMLAnchorElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter
63246577d2 LibWeb: Use correct type for MessageEventInit.ports
This didn't work previously because the IDL generator used the
incorrect type for some types of sequences within dictionaries.
2024-05-16 08:04:01 +02:00
Tim Ledbetter
763b7f0e0c LibWeb: Implement the HTMLOptionElement.form attribute
This returns the parent form of a HTMLOptionElement or null if the
element has no parent form.
2024-05-16 08:03:13 +02:00
Tim Ledbetter
fe7df98d7d LibWeb: Use correct IDL definition for CanvasImageData methods
It is now possible to pass an optional `ImageDataSettings` object to
the `CanvasImageData.createImageData()` and
`CanvasImageData.getImageData()` methods.
2024-05-16 08:02:59 +02:00
Andrew Kaster
8872008958 LibWeb: Use correct JS_CELL name for WorkerEnvironmentSettingsObject 2024-05-16 08:02:43 +02:00
Andrew Kaster
60b3436ea3 LibWeb: Support loading FontFaces constructed with binary data 2024-05-14 12:31:10 -06:00
Andreas Kling
59cb7994c6 LibWeb: Use memcpy() in CanvasRenderingContext2D.getImageData()
Instead of copying the image data pixel-by-pixel, we can memcpy full
scanlines at a time.

This knocks a 4% item down to <1% in profiles of Another World JS.
2024-05-13 17:29:37 +02:00
Shannon Booth
89a536b57a LibWeb: Remove resolved FIXME about putting HTMLALlCollection in HTML NS
This was an unfortunate artifact from development. I originally added
this class in the DOM namespace alongside HTMLCollection until I
realized it was defined by the HTML spec instead. To remind myself to
move it over to the HTML namespace, I left this comment. It was moved
to the correct namespace before upstreaming to the main repo, but I
forgot to remove this comment!
2024-05-12 07:28:09 +01:00
Andreas Kling
ae11a4de1c LibJS: Remove unused target field from Completion
This shrinks Completion by 16 bytes, which has non-trivial impact
on performance.
2024-05-10 15:03:24 +00:00
Andrew Kaster
e10721f1b5 LibWeb: Add stub implementation of FontFaceSet and Document.fonts
This is now enough for duolingo to load and use its fallback fonts.
2024-05-08 10:39:16 +02:00
Jamie Mansfield
987198782c LibWeb/Fetch: Use "json" destination
See:
- https://github.com/SerenityOS/serenity/commit/da8d0d8
- https://github.com/whatwg/fetch/commit/49bff76
- https://github.com/whatwg/html/commit/37659e9
2024-05-07 17:27:37 -06:00
Jamie Mansfield
e2f242a552 LibWeb/Fetch: Implement "fetch destination from module type" AO
See:
- https://github.com/whatwg/html/commit/37659e9
2024-05-07 17:27:37 -06:00
Shannon Booth
e5d03e382e LibWeb: Add AO for "normalize non-finite values"
We had implemented this in two different ways. Add an AO to to align the
implementations.
2024-05-07 17:21:52 -06:00
Tim Ledbetter
23473d64ca LibWeb: Make HTMLSlotElement::assigned_{elements,nodes} methods const 2024-05-07 16:45:28 -06:00
Tim Ledbetter
398bf10b92 LibWeb: Use TraversalDecision for multi level Node traversal methods
This adds the `SkipChildrenAndContinue` option, where traversal
continues but child nodes are not included.
2024-05-07 16:45:28 -06:00
Tim Ledbetter
c57d395a48 LibWeb: Use IterationDecision in single level Node iteration methods
`Node::for_each_child()` and `Node::for_each_child_of_type()` callbacks
now return an `IterationDecision`, which allows us to break early if
required.
2024-05-07 16:45:28 -06:00
MacDue
23d8d217ed LibWeb: Ignore setting zero, negative, or non-finite CRC2D.lineWidths
This is part of the spec but was missed. This fixes a crash on:
https://www.kevs3d.co.uk/dev/phoria/test1d.html
2024-05-06 17:33:04 +02:00
Andreas Kling
493a04d5fe LibJS: Add PropertyLookupPhase enum to distinguish Object [[Get]] calls
We can now tell the difference between an own property access and a
subsequent (automatic) prototype chain access.

This will be used to implement caching of prototype chain accesses.
2024-05-04 21:42:59 +02:00
Andreas Kling
3945e1a82a LibJS: Make JS::Cell a Weakable
This makes things easier downstream of Cell, and is preparation for
using weak pointers in prototype chain property caches.
2024-05-04 21:42:59 +02:00
Timothy Flynn
2d4d16ac37 LibWeb: Remove exceptional return types from infallible stream IDL 2024-04-30 08:14:12 +02:00
Shannon Booth
bad44f8fc9 LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h
This was resulting in a whole lot of rebuilding whenever a new IDL
interface was added.

Instead, just directly include the prototype in every C++ file which
needs it. While we only really need a forward declaration in each cpp
file; including the full prototype header (which itself only includes
LibJS/Object.h, which is already transitively brought in by
PlatformObject) - it seems like a small price to pay compared to what
feels like a full rebuild of LibWeb whenever a new IDL file is added.

Given all of these includes are only needed for the ::initialize
method, there is probably a smart way of avoiding this problem
altogether. I've considered both using some macro trickery or generating
these functions somehow instead.
2024-04-27 18:29:35 -04:00
Aliaksandr Kalenik
b1205f0aa1 LibWeb: Skip unnecessary sample corner and blit corner commands
Before this change we were recording and executing sample/blit commands
for each painting phase, even if there are no painting commands
in-between sample and blit that produce result visible on a canvas.

This change adds an optimization pass that goes through recorded
painting commands list and marks sample and blit commands that could
be skipped.

Reduces sample and blit corners executing from 17% to 8% on Discord.
2024-04-27 21:06:16 +02:00
Shannon Booth
d27b70ae24 LibWeb: Add HTML event 'complete' 2024-04-27 07:11:02 +02:00
Timothy Flynn
1ffda6a805 LibWeb: Propagate OOM in Body::fully_read() through its error callback
Fetched bodies can be on the order of gigabytes, so rather than crashing
when we hit OOM here, we can simply invoke the error callback with a DOM
exception. We use "UnknownError" here as the spec directly supports this
for OOM errors:

    UnknownError: The operation failed for an unknown transient reason
                  (e.g. out of memory).

This is still an ad-hoc implementation. We should be using streams, and
we do have the AOs available to do so. But they need to be massaged to
be compatible with callers of Body::fully_read. And once we do use
streams, this function will become infallible - so making it infallible
here is at least a step in the right direction.
2024-04-27 07:08:14 +02:00
Timothy Flynn
c79f46fe6f LibWeb: Remove OOM propagation from Fetch::Infrastructure::Headers 2024-04-27 07:08:14 +02:00
Andreas Kling
ff9ae5ff40 LibWeb: Bring document & browsing context creation in line with spec
We had drifted away from the spec steps a little bit here. This patch
brings us back in line and knocks off some FIXMEs in the process.
2024-04-26 20:01:58 +02:00
Andreas Kling
a5c62b953f LibWeb: Take care of some FIXMEs in auxiliary browsing context creation 2024-04-26 20:01:58 +02:00
Andreas Kling
0ebfc0a4c4 LibWeb: Move event handling & cursor from BrowsingContext to Navigable
This was a long standing FIXME since the introduction of navigables.
2024-04-26 20:01:58 +02:00
Andreas Kling
9cd4a65071 LibWeb: Move TraversableNavigable::m_page up to Navigable
This will allow anyone who has a Navigable to reach the Page.
2024-04-26 20:01:58 +02:00
Timothy Flynn
13422b5116 LibWeb: Remove OOM error propagation from HTMLMediaElement (and friends) 2024-04-26 12:21:57 -04:00
Timothy Flynn
dd16ea87c3 LibWeb: Make HTMLMediaElement::set_decoder_error infallible
This used to propagate an OOM error, but that was removed, and this
method can no longer throw.
2024-04-26 12:21:57 -04:00
MINAqwq
7c54a32870 LibWeb: Set decoder error when decoding fails 2024-04-26 11:48:48 -04:00
Andreas Kling
a4625e3943 LibWeb: Only react to link element attribute changes when BC connected
Link elements that aren't "browsing-context connected" should not
trigger a resource fetch when their attributes change.

This fixes an issue where we'd waste time by loading every style sheet
twice! :^)
2024-04-26 10:40:43 +02:00
Timothy Flynn
f6407276f7 LibWeb: Stop the video decoder thread when the video element is GC'd
Otherwise, the thread will continue to run and access the media data
buffer, which will have been freed.

The test here is a bit strange, but the issue would only consistently
repro after several GC runs.
2024-04-26 09:49:11 +02:00
Timothy Flynn
f13ccb9a61 LibWeb: Add missing call to Base::finalize() in HTMLMediaElement 2024-04-26 09:49:11 +02:00
Aliaksandr Kalenik
988c8451d4 LibWeb: Skip HTMLLinkElement resource fetching for documents without BC
Fixes crashing after following steps:
1. Open https://github.com/SerenityOS/serenity
2. Click on "Pull requests" tab

The problem was `navigable` null pointer dereferencing in
`decode_favicon()`. But navigable is null because the document was
created by `parseFromString()` DOMParser API.

With this change we skip fetching initiated by HTMLLinkElement if
document does not have a browsing context:
- Favicon is not displayed for such documents so no need to fetch.
- Stylesheets fetching won't affect such document because style or
  layout does not run for them.
2024-04-25 09:31:01 +02:00
Andreas Kling
4c921e17b7 LibWeb: Allocate dataset lazily for HTML/SVG/MathML elements
Most elements never need a dataset object, so we can avoid creating lots
of objects by making them lazy.
2024-04-25 09:30:30 +02:00
Timothy Flynn
ec492a1a08 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-18 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Base/*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -not \( -path "./Ports/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")

There are a couple of weird cases where clang-format now thinks that a
pointer access in an initializer list, e.g. `m_member(ptr->foo)`, is a
lambda return statement, and it puts spaces around the `->`.
2024-04-24 16:50:01 -04:00
Andreas Kling
f60d82eb85 LibWeb: Make HTML::Environment a GC-allocated type
The only subclass was already GC-allocated, so let's hoist the JS::Cell
inheritance up one level. This ends up simplifying a bit of rather
dubious looking code where we were previously slicing ESOs.
2024-04-24 17:04:43 +02:00
Bastiaan van der Plaat
7fa45c5fdf LibWeb: Add map element areas property 2024-04-24 15:23:45 +02:00
Bastiaan van der Plaat
3e507102ea LibWeb: Add datalist element options property 2024-04-24 15:23:45 +02:00
Aliaksandr Kalenik
55154b6c68 LibWeb: Use SafeFunction for completion steps in "populate SHE"
...to visit GC-allocated objects captured by this callback.
2024-04-24 10:22:29 +02:00
Aliaksandr Kalenik
64ad536dbb LibWeb: Create HeapFunction for after_document_populated
...to make it visited by SafeFunction callback of deferred_invoke().

Fixes use-after-free ASAN error that happens if you try to reload the
page.
2024-04-24 10:22:29 +02:00
Andrew Kaster
651e78fedb LibWeb: Convert callers of ImageCodecPlugin to the async API
The HTMLLinkElement caller is a bit hairy, so we shove an await() in
there temporarily. This is sure to cause fun times for anyone debugging
task/microtask execution order.
2024-04-23 12:32:04 -06:00
Andreas Kling
184368285c LibWeb: Fix GC leaks in Fetch::Infrastructure::Body::fully_read()
By making this function accept the success and error steps as
HeapFunction rather than SafeFunction, we break a bunch of strong
GC cycles.
2024-04-23 12:50:40 +02:00
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
Andreas Kling
8e56367092 LibWeb: Allow moving StyleSheets between documents without falling apart
We have to unregister link element stylesheets from the old document's
StyleSheetList when moving them into a new document.

This makes it possible to load GitHub contributor graphs. :^)
2024-04-22 06:43:05 +02:00
Andreas Kling
d94a6d8873 LibWeb: Avoid creating tons of temporary FlyStrings in HTMLParser 2024-04-21 19:32:49 +02:00
Andreas Kling
990f8e10a5 LibWeb: Avoid redundant UTF-8 validation in HTML tokenizer 2024-04-21 19:32:49 +02:00
Aliaksandr Kalenik
3c33e1eba9 LibWeb: Make ChangingNavigableContinuationState be GC-allocated
This struct is captured by `after_document_populated` callback so making
it be GC-allocated results in more understandable GC-graph.
2024-04-21 16:44:05 +02:00
Aliaksandr Kalenik
2f345c4ab5 LibWeb: Use HeapFunction for update_document callback 2024-04-21 16:44:05 +02:00
Aliaksandr Kalenik
3b3816e683 LibWeb: Remove changing_navigable_continuation capture in callback
Capturing a struct that owns bunch of JS::Handle makes it very hard to
understand what keeps these handles alive in the GC-graph.

Instead let's capture only members of a struct used in the callback.
2024-04-21 16:44:05 +02:00
Andreas Kling
4db1712f90 LibJS+LibWeb: Make Console, ConsoleClient & subclasses GC-allocated
These objects had confusing ownership semantics. Let's just throw them
all on the GC heap and stop worrying about it.
2024-04-21 09:12:25 +02:00
Kenneth Myhra
a3661fd7f2 LibWeb: Let queue_global_task() take a JS::HeapFunction
Changes the signature of queue_global_task() from AK:Function to
JS::HeapFunction to be more clear to the user of the function that this
is what it uses internally.
2024-04-20 18:11:01 +02:00
Aliaksandr Kalenik
d3cfe35fbd LibWeb: Do not destroy document until whole subtree completed unloading
Fixes crashing when "unload" event handler tries to access active
document that has already been destroyed.
2024-04-20 10:22:14 +02:00
Andrew Kaster
5e1d678bae Ladybird+Userland: Remove use of unnecessary fd passing socket concept
Now that LibIPC is using SCM_RIGHTS properly, we can go back to only
having one socket laying around when needing to transfer fds to peers.
2024-04-19 16:38:55 -04:00
Andrew Kaster
cb87725ec8 LibIPC+LibWeb: Transfer IPC::Files using sendmsg/recvmsg directly
This refactor eliminates the need for a second "fd passing socket" on
Lagom, as it uses SCM_RIGHTS in the expected fashion, to send fds along
with the data of our Unix socket message.
2024-04-19 16:38:55 -04:00
Andrew Kaster
6d4ba21832 LibIPC+Userland: Make IPC::File always own its file descriptor
Add factory functions to distinguish between when the owner of the File
wants to transfer ownership to the new IPC object (adopt) or to send a
copy of the same fd to the IPC peer (clone).

This behavior is more intuitive than the previous behavior. Previously,
an IPC::File would default to a shallow clone of the file descriptor,
only *actually* calling dup(2) for the fd when encoding or it into an
IPC MessageBuffer. Now the dup(2) for the fd is explicit in the clone_fd
factory function.
2024-04-19 06:34:07 -04:00
Andrew Kaster
26ce8ad40f LibWeb: Stop leaking socket fds when sending them over IPC
The implicit constructor for IPC::File does not take ownership of the
file, which is surprising.
2024-04-19 06:34:07 -04:00
PGHales
ded344aa2c LibWeb/DOM: Rename link_color to normal_link_color 2024-04-19 10:58:45 +02:00
Aliaksandr Kalenik
d876f32e5d LibWeb: Skip creating a navigable for <object> not connected to document
Navigation should not run for <object> element until it is inserted into
a document. Spec deoes not seem to explicitely say that, but that
matches other browsers behavior.

Fixes hanging after reloading in Acid3 test.
2024-04-18 08:09:51 +00:00
Aliaksandr Kalenik
68440ed02d LibWeb: Destroy associated navigable when <object> is removed from DOM 2024-04-18 08:09:51 +00:00
Andreas Kling
1cb5385a29 LibCore: Stop obsessing about tiny OOMs in Core::Timer
Work towards #20405
2024-04-17 07:16:52 +02:00
Tim Ledbetter
4a3497e9cd LibWeb: Support loading alternative style sheets
Alternative style sheets are now fetched and are applied to the
document if they are explicitly enabled by removing the disabled
attribute.
2024-04-17 07:12:44 +02:00
Aliaksandr Kalenik
890da021c4 LibWeb: Abort ongoing navigation before firing next navigation event
I haven't found this being mentioned in the current spec, but that is
what chromium (atm the only other Navigation API implementer) does.

Fixes crashing when location.hash is changed subsequently more than once
using JS.
2024-04-16 19:51:56 +02:00
Aliaksandr Kalenik
9f4b922f1c LibWeb: Look into nested session histories to find max history step
Fixes bug when "navigate forward" button in UI is disabled after
performing following steps:
1. Load page with an iframe (top step = 0, iframe step = 0)
2. Navigate iframe to different document (top step = 0, iframe step = 1)
3. Navigate back from browser UI (top step = 0, iframe step = 0)

No test because change is only observable from browser UI.
2024-04-16 05:59:19 -07:00
Aliaksandr Kalenik
768b1455d6 LibWeb: Run <object> fallback steps if data type is not supported
Progress on fixing regressed Acid2.
2024-04-16 13:47:38 +02:00
Tim Ledbetter
d5cddd4696 LibWeb: Unset stylesheet properties when removing from a StyleSheetList
Previously, the parent CSS stylesheet, owner node and owner CSS rule
properties were not unset when removing a sheet from a StyleSheetList.

This change moves the methods for adding and removing sheets to and
from a StyleSheetList, directly into the StyleSheetList class and
ensures they are called as required by the CSSOM specification.
2024-04-16 07:41:33 +02:00
Andreas Kling
53d0dd4a2e LibJS+LibWeb: Use new Cell::Visitor helpers to avoid manual iteration 2024-04-16 07:40:01 +02:00
Andreas Kling
c08ba8ac4c LibWeb: Fix new ImageData(width, height) when width != height 2024-04-15 11:27:34 +02:00
Andreas Kling
134c4b6335 LibWeb: Fix CRC2D.getImageData() when width != height
We were mistakenly using the width as both width and height when getting
ImageData from a 2D canvas.
2024-04-15 11:27:34 +02:00
Jamie Mansfield
e487f70bbf LibWeb: Support "importmap" scripts 2024-04-15 10:11:54 +02:00
Aliaksandr Kalenik
ccb363c443 LibWeb: Add hashchange event support 2024-04-15 01:02:51 -07:00
Aliaksandr Kalenik
efefd44a9f LibWeb: Navigate to changed url in Location::set_hash()
This step assumes copyURL is modified in place, while
`URL::Parser::basic_parse()` returns it as a result.

> 6. Basic URL parse input, with copyURL as url and fragment state as
  state override.

So copyURL has to be reassigned to navigate to new url on step 8:

> 8. Location-object navigate this to copyURL.
2024-04-15 01:02:51 -07:00
Timothy Flynn
9c608b46fd LibWeb+LibWebView+WebContent: Remove now-unused history change IPC 2024-04-14 18:53:58 -07:00
Andreas Kling
7f0920b0e9 LibWeb: Implement HTMLScriptElement.async 2024-04-14 22:08:22 +02:00
Andreas Kling
4cc972a8ae LibWeb: Stub out HTMLElement.outerText 2024-04-14 22:08:22 +02:00
Andreas Kling
e610346fab LibWeb: Minimally implement HTMLElement.inert and HTMLElement.accessKey
This commit adds attribute reflection but nothing else.
2024-04-14 22:08:22 +02:00
Andreas Kling
afea8ccd43 LibWeb: Stub out HTMLElement.accessKeyLabel 2024-04-14 22:08:22 +02:00
Kenneth Myhra
d5c7959c45 LibWeb: Let queue_a_microtask() take a JS::HeapFunction
This changes the signature of queue_a_microtask() from AK:Function to
JS::HeapFunction to be more clear to the user of the functions that this
is what is used internally.
2024-04-14 17:22:26 +02:00
Aliaksandr Kalenik
c96fc902ff LibWeb+LibWebView+WebContent: Add did_change_url() IPC call 2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
a8cf1aca7c LibWeb: Rename did_update_url() to did_history_api_push_or_replace()
The previous name was extremely misleading, because the call is used for
pushing or replacing new session history entry on chrome side instead of
only changing URL.
2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
461184d964 LibWeb+LibWebView+WebContent: Add did_update_navigation_buttons_state()
It is going to be used to communicate whether it is possible to navigate
back or forward after session history stored on browser side will no
longer be used to driver navigation.
2024-04-14 02:42:53 -07:00
Tim Ledbetter
88f3145f8a LibWeb: Add methods to Window that must do nothing
This change adds the `captureEvents()` and `releaseEvents()` methods to
the window object. These methods are obsolete, but are still included
in the HTML specification, which says they must do nothing.
2024-04-14 10:45:43 +02:00
Aliaksandr Kalenik
91377f3ab9 LibWeb: Fix always hanging Navigable::reload()
See spec issue https://github.com/whatwg/html/issues/9869

Previous attempt on fixing reload had to be reverted because it broke
Soundcloud and GitHub, but this change does not seem to introduce new
crashes.
2024-04-13 09:19:00 -07:00
Aliaksandr Kalenik
9d69563da4 LibWeb: Revert blocking of task by source in EventLoop
This reverts commit 664611bae4.

It seems like the HTML spec has been misinterpreted and this text:
"... Note that in this setup, the processing model still enforces that
the user agent would never process events from any one task source out
of order."

does not mean we can't interrupt execution of task by a task with the
same task source. It just says they should be processed in the order
they were added.

Fixes hanging while navigating from PR list to PR page on GitHub.
2024-04-13 12:07:33 +02:00
Shannon Booth
51a52a867c LibWeb: Use "current high resolution time" AO where relevant
And updating some spec comments to latest spec where it is not relevant.
2024-04-12 09:08:46 +02:00
Shannon Booth
144e53a209 LibWeb: Stub out Navigator.maxTouchPoints 2024-04-12 09:08:46 +02:00
Aliaksandr Kalenik
ee3dd7977d LibWeb: Add popstate event support
It is going to be useful in writing tests for History API.
2024-04-11 21:25:06 +02:00
Timothy Flynn
0ffc338406 LibWeb: Support dimension attributes on HTMLVideoElement 2024-04-11 18:41:57 +02:00
Timothy Flynn
4b1abcf61d LibWeb: Generalize support for dimension attributes
Rather than each element which supports dimension attributes needing to
implement parsing the attributes and setting the appropriate style, we
can generalize this functionality. This will also make each element more
closely resemble the spec text, as we will be effectively declaring, for
example, "The img element supports dimension attributes" in code.
2024-04-11 18:41:57 +02:00
Aliaksandr Kalenik
a73bf1607f LibWeb: Mark initial about:blank as ready to run scripts after creation
This matches how other browsers behave.

Fixes https://github.com/SerenityOS/serenity/issues/23892
2024-04-11 18:41:20 +02:00
Aliaksandr Kalenik
649f70db65 LibWeb+WebContent: Initialise JS console from Document::initialize()
Before this change JS console was initialise from
activate_history_entry() which is too late for about:blank documents
that are ready to run scripts immediately after creation.
2024-04-11 18:41:20 +02:00
Aliaksandr Kalenik
939a8e9393 LibWeb: Reload navigable only if delta=0 in History::go() 2024-04-11 09:40:45 +02:00
Aliaksandr Kalenik
d86ad2fcfa LibWeb: Process all task source while waiting for document population
"apply the history step" initiated by reloading or back/forward
navigation might require doing fetching while populating a document,
so it is not possible to restrict spin_until() to process only
NavigationAndTraversal task source.

"apply the history step" initiated by synchronous navigation keeps
processing only NavigationAndTraversal task source because it will
never have to populate a document. Another reason to keep synchronous
navigation blocking other task sources is that we crash if active SHE
changes in the middle of "apply the history step" initiated by sync
navigation. The new test is added to makes sure we don't regress that.
2024-04-11 09:40:45 +02:00
Aliaksandr Kalenik
600ecdd5f7 LibWeb: Separate spin_until() into multiple steps in apply history step
Now "apply history step" waits for all document population tasks to
complete before doing subsequent steps.
2024-04-11 09:40:45 +02:00