Commit graph

63510 commits

Author SHA1 Message Date
sideshowbarker
8ce5f6257b Tests: Add some colorful pass/fail emoji to a test case
This change adds green and red pass/fail emoji indicators to an in-tree
test — to make it easier to manually scan through the test results and
quickly see which cases are passing, and which are failing.

(cherry picked from commit 6f5d0de5e780f10c63d168bb1d29c69a963376ac)
2024-11-09 16:08:01 -05:00
Jamie Mansfield
25d3e1fe74 LibWeb: Implement AbstractWorker
This effectively implements Worker.onerror, and in future
SharedWorker.onerror.

(cherry picked from commit 3440d2b843331fca7392d29ea1b776935d1310de)
2024-11-09 16:08:01 -05:00
Timothy Flynn
4afa0a1973 LibJS: Use the IteratorStepValue AO in Iterator prototypes
This is an editorial change in the Iterator Helpers proposal. See:
https://github.com/tc39/proposal-iterator-helpers/commit/b4ccc31

(cherry picked from commit e782947a03d00f08fcfb16d4164c9edcd9155caf)
2024-11-09 16:08:01 -05:00
Timothy Flynn
464a0b9756 LibJS: Change generator state enum casing in IteratorHelperPrototype
This is an editorial change in the Iterator Helpers proposal. See:
https://github.com/tc39/proposal-iterator-helpers/commit/f1427ec

(cherry picked from commit 48bef246a0720ae4610b6f9c5dcd42eb8c5b448d)
2024-11-09 16:08:01 -05:00
Jamie Mansfield
ee8de58b98 LibWeb/HTML: Implement DataTransferItem.webkitGetAsEntry()
(cherry picked from commit 2e9aec984cc3c75f10ea3e6f50ea2ed34f4bd2b6)
2024-11-09 16:08:01 -05:00
Jamie Mansfield
722e144eba LibWeb/EntriesAPI: Implement FileSystemEntry
(cherry picked from commit 169163b0023302ae3a0762d875e7b7840cfcb687)
2024-11-09 16:08:01 -05:00
Khaled Lakehal
71a01c8122 LibWeb: Add setter implementation for location.search
This commit implements the setter for `location.search`, allowing
updates to the query string of the URL.

(cherry picked from commit 514a2a1757b10b9b4ff020237c84f70ba5a79c4b)
2024-11-09 16:08:01 -05:00
Thomas Klausner
e81705c9a5 LibGfx: Fix build on NetBSD
NetBSD provides its own popcount() function.

(cherry picked from commit c99674c6ac362508838efbc0ef58a9dfe8779890)
2024-11-09 16:08:01 -05:00
Ninad Sachania
272bc8a803 Utilities/fortune: Fix typo 2024-11-09 12:30:43 -05:00
Ninad Sachania
837012d650 Utilities/json: Add option to control colorized output 2024-11-09 12:30:12 -05:00
Jamie Mansfield
b20a9496f5 LibWeb: Implement ServiceWorkerContainer.onmessageerror
(cherry picked from commit f1098b4226bde9e574995a63eb3580be537d563d)
2024-11-09 12:29:58 -05:00
Jamie Mansfield
02d9f6186a LibWeb: Implement ServiceWorkerContainer.onmessage
(cherry picked from commit 4b1273cbde387b8f10d488ad90512ecb76b567cc)
2024-11-09 12:29:58 -05:00
Ninad Sachania
dd59e908a3 Utilities/json: Make variable unsigned to prevent negative values 2024-11-09 07:33:37 -05:00
Shannon Booth
125dfd9849 LibWeb: Use HeapFunction directly in SessionHistoryTraversalQueue
This allows us to use HeapFunction all of the way down, allowing us
to remove the Handle usage in after_session_callback for
create_new_child_navigable.

(cherry picked from commit fc83653f3c7a650229d2be3eef0f1738a9395db9)
2024-11-09 07:30:40 -05:00
Shannon Booth
41e497d8f7 LibWeb: Port populate_session_history_entry_document to HeapFunction
...For the completion steps. This is quite nice, as we can simply
capture this in the heap function where it is used instead of
needing to establish a new root.

Note that with these changes, to represent 'an empty algorithm', we now
use a null HeapFunction and do not invoke the steps.

(cherry picked from commit b6d2ab23322ebc6d667276257220c401fe025617)
2024-11-09 07:30:40 -05:00
Shannon Booth
74e0101cb1 LibWeb: Convert create_new_child_navigable to HeapFunction
(cherry picked from commit 3a7ccf8c25e56be550b66dda1d9d154e720c72e1)
2024-11-09 07:30:40 -05:00
Shannon Booth
72738891cb LibWeb: Port HTMLImageElement BatchingDispatcher to HeapFunction
(cherry picked from commit b86ddac11a747f45902aa575cde155818ffcfafb)
2024-11-09 07:30:40 -05:00
Shannon Booth
5777e4d2cb LibWeb: Port ReadLoopReadRequest to JS::HeapFunction
(cherry picked from commit a622abde776bbb2e3059c1ae6acde3ef78cfcca3)
2024-11-09 07:30:40 -05:00
Shannon Booth
bdb21f3279 LibJS: Use HeapFunction for IteratorHelper
(cherry picked from commit 87d964b2f5e3bb10e05fc7b12d13e153d0ba8b1e)
2024-11-09 07:30:40 -05:00
Colin Reeder
3b03c98e03 LibWeb: Fix handling of SSEs split across chunks
(cherry picked from commit 347928b9508df8f8effe92c372bd72873c4ba2aa)
2024-11-09 07:30:40 -05:00
Shannon Booth
85e0c80061 LibWeb: Sort URLSearchParams using UTF-16 code units
We were previously sorting using code points which could give the wrong
result for certain inputs.

Fixes the last two failing tests on:

https://wpt.live/url/urlsearchparams-sort.any.html
(cherry picked from commit d56da8cf9a0298d3e6e3ee8984f60d4a3217183b)
2024-11-09 07:30:40 -05:00
Shannon Booth
4a8e46090a LibWeb: Strip trailing spaces from opaque URL path on query change
This was added in https://github.com/whatwg/url/commit/fdaa0e5a
to fix a case where roundtrips could fail. We had already partially
implemented these steps - but it seems this was missed in the update of
URLSearchParams.

Fixes the last failing WPT test for:

https://wpt.live/url/urlsearchparams-delete.any.html
(cherry picked from commit cff3e78a1472a4cf49f0f8121d78c90a3483525d)
2024-11-09 07:30:40 -05:00
Tim Ledbetter
943f47fa97 LibWeb: Implement the setter for location.protocol
(cherry picked from commit 1365289d984c32ca7bc076b7892dd56041ab26e2)
2024-11-09 07:30:40 -05:00
Tim Ledbetter
892c6c0439 LibWeb: Return empty string if object element data URL is invalid
(cherry picked from commit c61262684b51864618de99f8b302567c932455be)
2024-11-09 07:30:40 -05:00
Tim Ledbetter
760fea7ffa LibWeb: Return empty string if image element currentSrc URL is invalid
(cherry picked from commit 4f7a4d9c578429b156f4dab78f4f8b0601be9f39)
2024-11-09 07:30:40 -05:00
Jelle Raaijmakers
fe5fa25f47 LibWeb: Implement the "fire a focus event" spec
We weren't setting the focus event's composed flag and view field
correctly.

(cherry picked from commit 124779a376a6951029f81bda980452440a6c6edf)
2024-11-09 07:30:40 -05:00
Jamie Mansfield
89d7ae75b2 LibWeb/SVG: Implement default_tab_index_value for a element
Another FIXME bites the dust :^)

(cherry picked from commit 9c4e80a3eca8329e5fd9e9fe75eac816b5666069)
2024-11-09 07:30:40 -05:00
Shannon Booth
1afda6b82a LibURL+LibWeb: Pass a mutable reference URL to URL parser
If given, the spec expects the input URL to be manipulated on the fly
as it is being parsed, and may ignore any errors thrown by the URL
parser.

Previously, we were not exactly following the specs assumption here
which resulted in us needed to make awkward copies of the URL in these
situations.

For most cases this is not an issue. But it does cause problems for
situations where URL parsing would result in a failure (which is
ignored by the caller), and the URL is _partially_ updated
while parsing.

Such a situation can occur when setting the host of an href alongside a
port number which is not valid. It is expected that this situation will
result in the host being updates - but not the port number.

Adjust the URL parser API so that it mutates the URL given (if any), and
adjust the callers accordingly.

Fixes two tests on https://wpt.live/url/url-setters-a-area.window.html

(cherry picked from commit ff71d8f2c97441bff5975c117a7e7c8820e33e44)
2024-11-09 07:30:40 -05:00
Colin Reeder
b2e5dd2458 LibWeb: Update stylesheet media value when changing link media attribute
(cherry picked from commit 00f75648e56f1077f5e18d8fca04da57afa93195)
2024-11-09 07:30:40 -05:00
Colin Reeder
04a1bb42c3 LibWeb: Avoid calling matches before evaluate
(cherry picked from commit b92abe5c266d0c57aa4f1aa5990d9354ad5b9109)
2024-11-09 07:30:40 -05:00
Tim Ledbetter
51854c4ffd LibWeb: Resolve HTMLFormElement.action relative to document base URL
Rather than returning a relative URL, an absolutized URL is now
returned relative to the document base URL

(cherry picked from commit 48e5d28ec985aeaee565d06a625a0d664b6975d3)
2024-11-09 07:29:52 -05:00
Tim Ledbetter
ec91831999 LibWeb: Implement HTMLInputElement.formAction
(cherry picked from commit 33c62be7f96eec887d8f65552bbd61439b09a346)
2024-11-09 07:29:52 -05:00
Tim Ledbetter
42d17fb875 LibWeb: Return document URL if formAction attribute is missing or empty
This change also ensures that relative URLs are resolved relative to
the document's base URL.

(cherry picked from commit c25dda767eb43d1620602ccc2c955bc56ef1745b)
2024-11-09 07:29:52 -05:00
Jamie Mansfield
d511b366a3 LibWeb: MathMLElement includes ElementCSSInlineStyle
(cherry picked from commit 0fab3d3b62705eab9fabfe0552d4fa40c7073478)
2024-11-09 07:29:52 -05:00
sideshowbarker
e466a2b966 Tests: Add an in-tree test for ARIA attribute reflection
This is a straightforward port to our test harness of the WPT test at
https://wpt.fyi/results/html/dom/aria-attribute-reflection.html

(cherry picked from commit a924e8747a49c9e9d0c5a6a1f48285b7ac042b49)
2024-11-09 07:29:52 -05:00
sideshowbarker
76e1dd296a LibWeb: Make aria-relevant and ariaRelevant reflect
This change makes the aria-relevant content attribute the ariaRelevant
IDL/DOM attribute get reflected — which makes the Ladybird behavior
interoperable with the implemented behavior in other existing engines.

Otherwise, without this change, Ladybird fails the relevant test case in
https://wpt.fyi/results/html/dom/aria-attribute-reflection.html — which
other existing engines all pass.

(cherry picked from commit e86711a5b778a6dd6dc8149827d096ab6a95c336)
2024-11-09 07:29:52 -05:00
Jamie Mansfield
3b1d615320 LibWeb: Implement WorkerNavigator.mediaCapabilities
(cherry picked from commit 936ca720b469899c63c410ed2570a65291843f19)
2024-11-09 07:29:52 -05:00
Jamie Mansfield
4d9f68df8b LibWeb: Implement Navigator.mediaCapabilities
This is enough to stop Crunchyroll showing an unsupported browser
modal :^)

(cherry picked from commit f08946bcd255ccc28ae77ddc69c8e24e37a8a7c9)
2024-11-09 07:29:52 -05:00
Jamie Mansfield
89e76f4ea6 LibWeb: Stub MediaCapabilities IDL interface
(cherry picked from commit 4c5a1763546a0ce71703fb89a7f89c968a7ac12f)
2024-11-09 07:29:52 -05:00
Timothy Flynn
2222b9f958 LibWebView: Properly handle new lines inside styled view-source elements
When we want to inject a CSS counter for a line, we need to be sure to
handle if we had previously opened a styled span for the current source
substring. For example, if we see a new line in the middle of a comment,
we will have previously opened the following tag:

    <span class="comment">

So when injecting a new line and the <span class="line"> element (for
CSS counters), we need to close the previous span and insert a newly
opened tag to continue using the style.

(cherry picked from commit f1395a2c3859fce1daddb385582433c072ebf052)
2024-11-09 07:29:52 -05:00
Johan Dahlin
dad0b13791 HTMLImageElement: Improve decoding stub
Add an enum and warn when setting to sync/async.

(cherry picked from commit 977e77bd4a0cb5b7441e30b29532a4fc45bfcaf0)
2024-11-09 07:29:52 -05:00
HolonProduction
d4b75e6ab8 LibWeb: Update Selection.collapse algorithm
(cherry picked from commit 94230acf287a9c2b613549a052e6209953d7a202)
2024-11-09 07:29:52 -05:00
Colin Reeder
322ee168aa LibWeb: Add background color to input fields
(cherry picked from commit 45e4ab69d6a2043a095abe7296f9de4bbd456eaa)
2024-11-09 07:29:52 -05:00
sideshowbarker
a6017b9116 LibWeb: Make “create an event” set the event’s isTrusted to true
This change ensures that when then the code corresponding to the “create
an event” operation at https://dom.spec.whatwg.org/#concept-event-create
is called, the event’s isTrusted is set to true — as the spec requires.

That causes the failures for the following WPT tests to pass:

- https://wpt.fyi/results/html/semantics/forms/the-input-element/checkbox.html?run_id=5080423051034624
- https://wpt.fyi/results/html/semantics/interactive-elements/the-dialog-element/dialog-close.html?run_id=5080423051034624

…and there are likely a number of similar WPT tests that hit this same
code path which this commit will cause to be changed to passes.

Otherwise, without this change, the “create event” implementation
doesn’t conform to the spec requirements – nor behave interoperably with
other existing engines — and those WPT test would continue to fail.

This change also ensures that isTrusted continues to be set to false for
synthetic events.

(cherry picked from commit 1975640e31c50e9d20b0d307cbe67df4dcb8e36a)
2024-11-09 07:29:52 -05:00
Andreas Kling
c4a11363dc LibJS: Fix mix-up when re-exporting an imported symbol with a new name
This makes https://cling.com/ load, and more of the animated elements
on https://shopify.com/ start appearing.

(cherry picked from commit 0f9444fa06031e7d8e3c1ad36e701090e0b17ec1)
2024-11-09 07:29:52 -05:00
Khaled Lakehal
5de05eba65 LibWeb: Add scope attribute to HTMLTableCellElement
(cherry picked from commit d1bea9c2a4f6bfc9382f7cd1362f6ac7f64a8152)
2024-11-09 07:29:52 -05:00
Sam Atkins
fb1b93daba Tests/LibWeb: Correct typo in "overflow: visible"
The test happened to pass anyway because `visible` is the default value.

(cherry picked from commit 9f9ec45a3177cc776fb5bf6adce313b6d6942467)
2024-11-09 07:29:52 -05:00
Khaled Lakehal
1cd439b158 LibWeb: Set document type to HTML for text and media documents
This update fixes an issue where the document type was incorrectly set
to XML instead of HTML when initializing text and media documents.

(cherry picked from commit 2565757c7a705758bdd2ddc7ac3f7314a1773ed0)
2024-11-09 07:29:52 -05:00
Andreas Kling
0e13e00d6a LibJS: Use the system native page size as the HeapBlock::block_size
Before this change, we were hard-coding 4 KiB. This meant that systems
with a 16 KiB native page size were wasting 12 KiB per HeapBlock on
nothing, leading to worse locality and more mmap/madvise churn.

We now query the system page size on startup and use that as the
HeapBlock size.

The only downside here is that some of the pointer math for finding the
base of a HeapBlock now has to use a runtime computed value instead of a
compile time constant. But that's a small price to pay for what we get.

(cherry picked from commit a6bf253602702c052453d5ccb45a40d8fbb368ba)
2024-11-09 07:29:52 -05:00
Jelle Raaijmakers
eb7b733325 LibWeb: Compare start container to parent in Text.splitText()
Tiny mistake in the implementation of the spec; fixes 16 FAILs in the
WPT `/dom/ranges/Range-mutations-splitText.html` tests.

(cherry picked from commit dee81f354531c2e49be34279ca31ccc7ad9cbcca)
2024-11-09 07:29:52 -05:00