Commit graph

64323 commits

Author SHA1 Message Date
implicitfield
a3fc110ea8 Meta: Use the same disk size for genext2fs as for everything else
INODE_COUNT gets modified after it has been initially used to compute
DISK_SIZE_BYTES, so the approach introduced in caefb208 didn't actually
work as intended.
2024-12-02 10:24:36 -05:00
Sönke Holz
c385e8beb1 EFIPrekernel: Don't depend on install_libc_headers
This target was removed in 175f9dc5c3, but the dependency on it wasn't
removed from faeb9ff521 before PR #24995 was merged.
This should make everything build again.
2024-12-01 13:53:02 +01:00
Sönke Holz
faeb9ff521 EFIPrekernel: Add basic skeleton 2024-12-01 13:20:45 +01:00
Sönke Holz
9e306b858a Kernel: Add Kernel_shared_object as a BYPRODUCT of the POST_BUILD step 2024-12-01 13:20:45 +01:00
Sönke Holz
e02bebfcd4 Kernel: Generate Kernel_shared_object on all architectures
This file will be linked to the EFIPrekernel.
2024-12-01 13:20:45 +01:00
Sönke Holz
ccf7533b45 EFIPrekernel: Make dbgln usable
This simply makes dbgln use the EFI Simple Text Output Protocol.
2024-12-01 13:20:45 +01:00
Sönke Holz
ef79054505 EFIPrekernel: Add basic kmalloc implementation 2024-12-01 13:20:45 +01:00
Sönke Holz
9d6cd9b992 EFIPrekernel: Add linker script 2024-12-01 13:20:45 +01:00
Sönke Holz
f5540e1f81 Prekernel: Make the UBSan print_location stub halt on all architectures 2024-12-01 13:20:45 +01:00
Sönke Holz
220e6d8f3d Meta: Don't use the gtk,gl=on display backend with NVIDIA graphics
This is quite a crude check and may lead to false positives. But it's
better than having a black screen on systems with NVIDIA graphics.
2024-11-30 17:37:28 -05:00
Ninad Sachania
5175a014f0 Utilities/shot: Display rulers when selecting a region 2024-11-30 21:50:03 +01:00
Jelle Raaijmakers
ccda8d1e28 LibWeb: Implement indexed property support for HTML::Storage
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)
2024-11-29 23:02:23 -05:00
Timothy Flynn
091e832b48 LibIPC: Pass AK::Duration by value over IPC
AK::Duration is simply an integer, and does not need to be passed by
reference.

(cherry picked from commit 6ce473af72ba666a8bae80a7f7691d233bdd2a43)
2024-11-29 20:25:45 -05:00
stasoid
eb60c2eea1 LibWeb/Layout: Account for box-sizing in table width/height calculations
Fixes #1726

Fixes
wpt/css/CSS2/abspos/abspos-containing-block-initial-004c.xht
wpt/css/CSS2/abspos/abspos-containing-block-initial-004d.xht
wpt/css/CSS2/abspos/abspos-containing-block-initial-005b.xht
wpt/css/CSS2/abspos/abspos-containing-block-initial-005d.xht

(cherry picked from commit a90b7026fb8939a773a6c5339364ea1a7d508fde)
2024-11-29 20:25:25 -05:00
Tim Ledbetter
0b198ecb54 LibWeb: Ignore negative values when setting HTMLProgressElement.max
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)
2024-11-29 20:25:25 -05:00
Tim Ledbetter
b62904770f LibWeb: Limit HTMLTextAreaElement attributes to allowed values
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)
2024-11-29 20:25:25 -05:00
Tim Ledbetter
02bcc9302f LibWeb: Limit HTMLMarqueeElement attributes to allowed values
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)
2024-11-29 20:25:25 -05:00
Tim Ledbetter
d094fc8351 IDLGenerators: Set reflected unsigned long value according to spec
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)
2024-11-29 20:25:25 -05:00
Hermes Junior
921d76d48a LibWeb: Make javascript mime matching spec compliant
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)
2024-11-29 20:25:25 -05:00
Aliaksandr Kalenik
ff456de493 LibWeb: Fix "input" events being dispatched twice when cancelled
(cherry picked from commit 648fac7215e1841e3714d4c72c7aee75152da522)
2024-11-29 20:25:25 -05:00
Ninad Sachania
cb99ab912b Utilities/cut: Show error instead of crashing for invalid UTF-8 lines 2024-11-29 16:35:10 -05:00
Andreas Kling
073b3b992d AK: Make String::number() infallible
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!)
2024-11-29 16:03:30 -05:00
Gingeh
fa5b2e8661 LibWeb: Compute mimetype when loading a document
computed type != supplied type

(cherry picked from commit 47992f7b39a69cbb927d281cdfd3e818af068bde)
2024-11-29 15:05:55 -05:00
implicitfield
d9eaaee6e0 CI: Check filesystem consistency after running tests 2024-11-29 10:59:24 -05:00
implicitfield
caefb208f0 Meta: Stop requesting 128-byte inodes when creating the root filesystem
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.
2024-11-29 10:59:24 -05:00
implicitfield
0e368bb71a Kernel/Ext2FS: Add full support for large inodes
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.
2024-11-29 10:59:24 -05:00
implicitfield
2a205768b6 Kernel/Ext2FS: Backport a missing large inode member 2024-11-29 10:59:24 -05:00
implicitfield
e7baffaba0 Ext2FS: Serialize timestamps as signed offsets
The header would have you believe these are unsigned, but they should
really be treated as signed.
2024-11-29 10:59:24 -05:00
Andreas Kling
a8e73f3d9f LibWeb: Remove unnecessary use of TRY_OR_THROW_OOM in XMLHttpRequest
(cherry picked from commit 279d229f71b52e1fd91100a74aa314c90db968da)
2024-11-28 22:42:14 -05:00
Andreas Kling
3b60d2af5b LibWeb: Make XMLHttpRequests functions related to MimeType infallible
(cherry picked from commit fa1c5a3e85e5d479b3ce4975b06b271a67df0be5)
2024-11-28 22:42:14 -05:00
Andreas Kling
e85f364f52 LibWeb: Make MimeSniff::Resource::sniff() infallible
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)
2024-11-28 22:42:14 -05:00
Andreas Kling
cf0516b616 LibWeb: Make MimeSniff::MimeType::parse() infallible
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)
2024-11-28 22:42:14 -05:00
Andreas Kling
d8c9ff6c09 LibWeb: Make more MimeSniff::MimeType APIs infallible
(cherry picked from commit 88e7688940ceae92263b410dfb1722311ae27aee)
2024-11-28 22:42:14 -05:00
Andreas Kling
d4abeba027 LibWeb: Make MimeSniff::MimeType::create() infallible
(cherry picked from commit 9a8db40a239e3641bba138d6ec6c564c0cc0e2c5)
2024-11-28 22:42:14 -05:00
Nico Weber
1948dbaaf1 Meta: Add UIEvents/InputTypes.cpp to the GN build 2024-11-28 21:31:42 -05:00
Timothy Flynn
1c4996ff34 LibWeb: Move some classes from the DOM namespace to the HTML namespace
The following classes are in the HTML spec and thus belong in the HTML
namespace:

* BeforeUnloadEvent
* HTMLFormControlsCollection
* RadioNodeList

(cherry picked from commit 13b7355ec10c21be90df997c66022e246c57656d)
2024-11-28 21:31:42 -05:00
Aliaksandr Kalenik
e0cc97d2a9 LibWeb: Stub InputEvent.getTargetRanges()
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)
2024-11-28 21:31:42 -05:00
Aliaksandr Kalenik
647bfd63a5 LibWeb: Implement dispatching of "beforeinput" event
(cherry picked from commit 63f502ab0acb8da9fd0db16924df938758110447)
2024-11-28 21:31:42 -05:00
Aliaksandr Kalenik
f613fb9921 LibWeb: Implement dispatching of "input" event
(cherry picked from commit 0de61b0f65ee472d3cf4853b108eb1f9501e6275)
2024-11-28 21:31:42 -05:00
Aliaksandr Kalenik
a1d17acb7c LibWeb: Put cursor in last text node when contenteditable is focused
With this change we match behavior of other engines a bit more closer.

(cherry picked from commit d88e6bee5d14d05cd34bfd13926c6399326ac042)
2024-11-28 21:31:42 -05:00
Andreas Kling
3fe7d96fa7 LibWeb: Support Document.onvisibilitychange
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)
2024-11-28 21:31:42 -05:00
Andreas Kling
a5e6fd3b5f LibWeb: Support Document.onreadystatechange
This is just a standard IDL event attribute handler.

Fixes at least one WPT test:
https://wpt.live/html/dom/documents/resource-metadata-management/document-readyState.html

(cherry picked from commit 26be8f865ab6bba8e1b2f9f071c0949bcfaca512)
2024-11-28 21:31:42 -05:00
Timothy Flynn
849a3a531f LibWeb: Wait for the iframe load before completing the beforeunload test
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)
2024-11-28 21:31:42 -05:00
Andreas Kling
04474ef84a LibWeb: Bail from various navigable operations when no active window
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)
2024-11-28 21:31:42 -05:00
Ninad Sachania
2f3ad5ca28 LibCore: Make get_salt() fallible so we get an error instead of crashing 2024-11-28 20:08:33 -05:00
Nico Weber
61ebfdab56 Meta: Remove Ladybird dep on LibGUI in GN build
Ladybird's cmake dependency on LibGUI was removed in #21782, and
LibWeb's in #24526. This updates the GN build to match.
2024-11-28 20:07:48 -05:00
Nico Weber
50b7fff178 Meta: Add HTML/NavigationObserver.cpp, WebDriver/HeapTimer.cpp to GN 2024-11-28 18:58:55 -05:00
Timothy Flynn
dda405e652 UI/Qt: Execute dialogs opened from the page asynchronously
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)
2024-11-28 18:58:55 -05:00
Timothy Flynn
5fe499b493 LibWeb+WebContent+WebDriver: Asynchronously wait for dialog dismissal
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)
2024-11-28 18:58:55 -05:00
Timothy Flynn
ace8231970 WebContent+WebDriver: Asynchronously wait for navigations to complete
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)
2024-11-28 18:58:55 -05:00