When the cached value was not an accessor, it was simply ignored.
This is the value we really want, so we can just return it.
Shows up to 5x improvements on some benchmarks,
and 1.4x in general js-benchmarks.
(cherry picked from commit 77a46ab1b8d13f35b11a7bd08459752912dca1bf)
Async functions whose promise is never resolved were leaking, since they
had a strong root JS::Handle on themselves.
This doesn't appear to actually be necessary, since the wrapper will be
kept alive as long as it's reachable (and if it's not reachable, nobody
is going to resolve/reject the promise either).
This fixes the vast majority of leaks on Speedometer, bringing memory
usage at the end of a full run from ~12 GiB to ~3 GiB.
(cherry picked from commit b6a5b7e18626ce0dee11a25bb0d51d2e84d3c057)
This fixes an issue where a badly-timed garbage collection could swallow
a static field initializer.
Caught by running test262 in GC-on-every-allocation mode.
(cherry picked from commit 10724a7cb346e57b0b97e4bd54c13c5c604dbf9c)
We were miscalculating the length of the buffer in pointer-sized chunks,
which is what the conservative root scan cares about.
This could cause some values to be prematurely garbage-collected.
(cherry picked from commit 2fb3b6c542db3a86cbd1aa7e34d470e34c485372)
This should fix (at least) the last two remaining WPT test failures in
FileAPI/unicode.html.
(cherry picked from commit 55f0dc823ff266aeb29fd6f7d47d5e7f89a50ee6)
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)
The 'x' unit is the same as 'dppx', but was previously not considered
when parsing resolutions.
(cherry picked from commit 7ed08a401f5d3242d8c0354467e0af827bb6b0ce)
The main culprit for the following WPT test failure is that we
weren't using the HTML namespace for XHTML docs unless one was
explicitly provided.
(cherry picked from commit 6a5bca1302161a84d95313bef1481d9a8a56702c)
The IPCs to request a page's text, layout tree, etc. are currently all
synchronous. This can result in a deadlock when WebContent also makes
a synchronous IPC call, as both ends will be waiting on each other.
This replaces the page info IPCs with a single, asynchronous IPC. This
new IPC is promise-based, much like our screenshot IPC.
(cherry picked from commit 3332230cef8091f94f5c30e1f1984c1038cd4a1d)
This was added in 9d03ea6f74 for LibWeb/DumpLayoutTree/main.cpp.
That utility was moved to LibViewView in #14018 and then deleted
in #18879 after #17836 moved that functionality to headless-browser.
No behavior change.
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)
The DOM spec gets overridden by both the SVG2 and MathML core specs in
that unknown elements should not inherit DOM::Element, but
SVG::SVGElement and MathML::MathMLElement respectively.
(cherry picked from commit 76e638b4ca10a91983877d6f6e7f037c1a720965)
This avoids an "Invalid argument (errno=22)" error
on systems with lower hard limits.
(cherry picked from commit c97af00355159b0dac9019b885af7c6016e75dc7)
This also makes `Utf8View::trim` significantly faster, since most
strings start and end with ASCII.
(cherry picked from commit 7f3269fb025051c3eb2794b15e785b85b0ce37f3)
Reading the RFC9111 spec makes it clear that the stored response was
not intended to be cloned. This is because there is a "clone response"
operation that is used in other places, but never for stored responses.
(cherry picked from commit afe74afa9e61569d35797d6ada5d54f0c22da412)
Responses returned from `http_network_or_cache_fetch` were copied
directly from the cache, which is incorrect, since revalidation may
later modify the response, or even invalidate it, such as when the
`Access-Control-Allow-Origin` header is changed.
This fixes WPT test [wpt/cors/304.htm](http://wpt.live/cors/304.htm)
(cherry picked from commit c7a51ed297ebd0dcb200d8dc1ba3918880c56a55)
When aspect-ratio is degenerate (e.g. 0/1 or 1/0) we should
fallback to the same behaviour as `aspect-ratio: auto` according to spec
This commit explicitly handles this case and fixes five WPT test in
css/css-sizing/aspect-ratio (zero-or-infinity-[006-010])
(cherry picked from commit c6f77f4818a03411c14d9e60b743a7541a8280f6)