We only supported named properties on Storage, and as a result
`localStorage[0]` would be disconnected from the Storage's backing map.
Fixes at least 20 subtests in WPT in /webstorage.
(cherry picked from commit 4c189166f4f721211ff9b693f306f65033d70ac1)
When attempting to set `HTMLProgressElement.max` to a value not greater
than 0, we were previously setting the value to 1. We now retain the
previous value.
(cherry picked from commit 99f8972928dc855540d11639fd08779219f602c1)
If `HTMLTextAreaElement.rows` or `HTMLTextAreaElement.cols`
is set to a value larger than 2147483647, then it should be set to its
default value.
(cherry picked from commit 7fe3bf07e20b21c7db676a344453e1ee2ecce943)
If `HTMLMarqueeElemnt.scrollAmount` or `HTMLMarqueeElemnt.scrollDelay`
is set to a value larger than 2147483647, then it should be set to its
default value.
(cherry picked from commit a8719a706b077c6b32af302df7d201560fbe9dd1)
Setting an unsigned long attribute with IDL to a value outside the
range 0 to 2147483647, the value should be set to the default value.
(cherry picked from commit e5c99b475aba6a2a4a957f2adc8398a1693aade6)
When mime essence matching, the spec only asks for a string comparison
ignoring ascii case. The whitespace trimming and parsing of the mime
produces unexpected and wrong results.
Fixes tests on WPT html/semantics/scripting-1/the-script-element :^)
(cherry picked from commit cdd78be2d33d29a0a959ad7a2b2dc22fbaaa2c81)
This API will always succeed in creating a String representing the
provided number in base-10.
(cherry picked from commit dd419b5a8df3b9a32478c4a8f0ea9f70334214cd;
amended to update the rest of the system. No conflicts though!)
We now have full support for large inodes, so we don't need to rely on
the deprecated 128-byte inodes anymore. Note that genext2fs doesn't
support large inodes, so we have to account for that when using that
utility.
128-byte inodes are more-or-less deprecated since they store timestamps
as unsigned 32-bit integer offsets from the UNIX epoch. Large inodes, on
the other hand, contain records that may specify a different epoch, and
are thus less susceptible to overflows. These very same records also
have the capability to store timestamps with nanosecond precision, which
this commit adds full support for as well.
Everyone was already using this API as if it were infallible anyway.
(cherry picked from commit 600cb5ccbaba019954f17c7d317ba6fe54a24117;
amended to fix another conflict in StyleComputer.cpp due to serenity
still not having the third commit of LadybirdBrowser/ladybird#1278)
It already returns an empty Optional for failures, so there's no need to
wrap it in an ErrorOr as well.
(cherry picked from commit 5c20bc2afc23b04ccd8037d414592e4ee841a053;
amended to fix conflict in StyleComputer.cpp due to serenity not having
the third commit of LadybirdBrowser/ladybird#1278)
The following classes are in the HTML spec and thus belong in the HTML
namespace:
* BeforeUnloadEvent
* HTMLFormControlsCollection
* RadioNodeList
(cherry picked from commit 13b7355ec10c21be90df997c66022e246c57656d)
We need this, because https://www.slatejs.org/ that is used by Discord
checks this function to decide whether a browser has "beforeinput" event
support.
(cherry picked from commit 3e8b2454fbcb80891b902ef725dd9549f8880233)
We don't have a way to trigger this from a test, but the fix is so
simple that we might as well get it in. :^)
(cherry picked from commit 274411db9756a9dffe44e21b4da09c7808e9f465)
This test caused some flakiness due to the about:blank load it triggers.
It causes headless-browser to receive a load event for about:blank. If
we have moved onto the next test before that event arrived, that test
would ultimately time out, as its own load will have been dropped while
the about:blank load is still ongoing.
This patch makes us wait for that iframe load event before completing
the test.
We may want to consider never sending subframe load events to the UI
process as well. We really only care about top-level page loads in the
receivers of that event.
(cherry picked from commit be9071834eb0c836ccd821adaa0134820e3f6297)
If we end up in a situation where the navigable no longer has an active
window, we can't perform navigation or many other navigable operations.
These are all ad-hoc, since the navigables spec is basically all written
as if there's always an active window. Unfortunately, the active window
comes from the active document's browsing context, which is a nullable
concept even in the spec, so we do need to deal with null here.
This removes all the locally reproducible crashes when running WPT over
the legacy Japanese encoding directory on my computer.
Yes, this is a bit of a monkey patch, but it should be harmless since
we're (as I understand it) dealing with navigables that are still
hanging around with related tasks queued on them. Once all these tasks
have been completed, the navigables will go away anyway.
(cherry picked from commit aae191aa33c88edba97f872707a5d0f9705cb0aa)
Invoking exec() entirely blocks the UI application's main thread. Qt
explicitly recommends against this. In practice, it seems prevents some
IPC messages from being handled by the UI until the dialog is closed by
the user.
Instead, use open() (which is non-blocking) and set up a signal handler
to deal with the result.
(cherry picked from commit ea9abe26e1c40c0d2e96007bf7d69afb49a7052a)
There was a timing issue here where WebDriver would dismiss a dialog,
and then invoke another endpoint before the dialog was actually closed.
This is because the dismissal first has to hop over to the UI process to
close the graphical dialog, which then asynchronously informs WebContent
of the result. It's not until WebContent receives that result that the
dialog is considered closed, thus those subsequent endpoints would abort
due a dialog being "open".
We now wait for dialogs to be fully closed before returning from the
dismissal endpoints.
(cherry picked from commit 0722a3b1c091adbafc056686ebedbf5c2db84207)
Similar to commit c2cf65adac78912883996153fb608dafe389b6e0, we should
avoid spinning the event loop from the WebContent-side of the WebDriver
connection. This can result in deadlocks if another component in LibWeb
also spins the event loop.
The AO to await navigations has two event loop spinners - waiting for
the navigation to complete and for the document to reach the target
readiness state. We now use NavigationObserver and DocumentObserver to
be notified when these conditions are met. And we use the same async IPC
mechanism as script execution to notify the WebDriver process when all
conditions are met (or timed out).
(cherry picked from commit bf0bc62654803565a6f39ade63d9172cc48c085a)
This contains a hook to be notified when a navigable navigation is
complete, to be used by WebDriver.
(cherry picked from commit 74ef9dc3936d678fdf811bb3c1b39a6ffba2b106)
Some callers (namely WebDriver) will want to stop receiving updates from
the DocumentObserver.
(cherry picked from commit 247307a2a28e92b20a57d127eed73a093dd4e3d3)