This will be used by the inspector, for showing style sheet contents.
Identifying a specific style sheet is a bit tricky. Depending on where
it came from, a style sheet may have a URL, it might be associated with
a DOM element, both, or neither. This varied information is wrapped in
a new StyleSheetIdentifier struct.
(cherry picked from commit 51a426cc0562d12a6e8f7d1d1a38f9ecac77072a)
The spec text had changed for the value of `<link>`'s location, so I've
updated that.
(cherry picked from commit 4e18fce3a586651894844c7ef0a06c774ce9eb2c)
I originally believed that this could never receive a null URL and the
spec was inaccurate, but it seems like it can indeed.
I don't have a distilled test, but this makes logging in with GitHub
work on https://v0.dev/
(cherry picked from commit 1a4b0ded1f802fdcc3ef9b919b5749b086471fc2;
amended to also cherry-pick LadybirdBrowser/ladybird#2358)
When we check whether navigationParams is null, we should check if it is
`NullWithError`, since `NullWithError` is equivalent to `Empty`, but is
used for error messages.
(cherry picked from commit 219cb04865fc02bfc05d39f048dd2a778714b7e1)
Now that the global object correctly sets the property, we don't need
to do it here.
(cherry picked from commit 711faa8280ac4147f68ed778ad67047428329c67)
The insertion steps for iframes were following an old version of the
spec, where it was checking if the iframe was "in a document tree",
which doesn't cross shadow root boundaries. The spec has since been
updated to check the shadow including root instead.
This is now needed for Cloudflare Turnstile iframe widgets to appear,
as they are now inserted into a shadow root.
(cherry picked from commit 4dd14d812f73377cb1efa5a8e8a114912a90b5af)
This would previously crash because it depended on a specific order for
evaluating function arguments, which is undefined.
(cherry picked from commit 27b1d94e04386fd46c2c9148b9555c841595e2d3)
This was previously negated due to a misread of
https://url.spec.whatwg.org/#concept-url-equals. This change fixes a
bunch of WPT crashes such as
"/html/browsers/history/the-history-interface/001".
(cherry picked from commit f1cab5de7a071fe76eae10d36603f6cf34fa989e)
This change ensures that the value sanitization algorithm is run and
the text cursor is set to the correct position when the type attribute
of an input is changed.
(cherry picked from commit 1b74104c17726018788034f2ad66201889ce6225)
Previously, the value sanitization algorithm would not trim whitespace
for inputs of type URL or email, if they didn't also contain any
newlines.
(cherry picked from commit c4b82318f41ecc0a3e24fe5c8ca0a3f02816c3b1)
The `[[GetOwnProperty]]` internal method invocation in
`OrdinarySetWithOwnDescriptor` was being invocated again with the same
parameters in the `[[DefineOwnProperty]]` internal method that is also
later called in `OrdinarySetWithOwnDescriptor`.
The `PlatformObject.[[DefineOwnProperty]]` has similair logic.
This change adds an optional parameter to the `[[DefineOwnProperty]]`
internal method so the results of the previous `[[GetOwnProperty]]`
internal method invocation can be re-used.
(cherry picked from commit 69f96122b6150c22d1e8dc848c097cead2d2ae3f)
This corresponds to this spec change:
https://github.com/whatwg/html/pull/10705
(We don't implement showPopover() yet.)
(cherry picked from commit 00e613c7df7ac26ba28e11d172207c045d35a542)
Otherwise, it looks a bit awkward where the cursor position does not
update while the selection is elsewhere.
Note that this requires passing along the raw selection positions from
`set the selection range` to the elements. Otherwise, consider what will
happen if we set the selection start and end to the same value. By going
through the API accessor, we hit the case where the start and end are
the same value, and return the document cursor position. This would mean
the cursor position would not be updated.
The test changes here more closely match what Firefox produces now. It
is not a 100% match; the `select event fired` test case isn't right. The
problem is the event fires for the input element, but we most recently
focused the textarea element. Thus, when we retrieve the selection from
the input element, we return the document's cursor position, which is
actually in the textarea element. The fix will ultimately be to fully
implement the following:
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-textarea/input-cursor
That is, each input / textarea element should separately track its own
text cursor position.
(cherry picked from commit fd289deb44e0fc26f54a133c637c136bf0716cd5)
The cols and rows attributes are limited to only positive numbers with
fallback. The cols IDL attribute's default value is 20. The rows IDL
attribute's default value is 2.
The default value was returned only for the negative number. I added an
additional check for the case when the attribute is 0 to match the
specification.
(cherry picked from commit 205155a7abb9b9754cd0917901cfc04d86291820)
If we don't reject the Promise, it lasts forever,
so rejecting non implemented Promises is essential,
to not timeout in e.g. WPT tests
(cherry picked from commit aab5a9e944f8b1c1a9de321047556bbcaa282a56)
Previously, any message logged to the console within a worker with a
log level greater than trace was printed twice.
(cherry picked from commit d0008ae5e0100984f3188c32a67008a03c05bea8)
Which fixes the following WPT test from failing due to issues stemming
from all of the windows which have been opened.
https://wpt.live/url/failure.html
This will give us 1205 new subtests passing in WPT.
(cherry picked from commit f2134dc1e960cb1d0c743b375509fe165885ddbe)
Aligning with a spec update, fixing 195 tests for:
https://wpt.live/url/failure.html
(cherry picked from commit ea971792b5da5f10cadb4f88f49c9722d88b32f6)