Commit Graph

3 Commits

Author SHA1 Message Date
Shannon Booth
ba79535d94 Tests/LibWeb: Support absolute paths for WPT files in HTTP test server
Imported WPT tests often load resources using canonical absolute paths,
for example:

/html/browsers/windows/resources/message-parent.html

Our usual strategy is to rewrite such URLs to relative paths during
import so they resolve from the importing test HTML file (which also
allows for loading this HTML as a file://).

That works for same-origin relative loading with the echo server, but it
breaks down when a test constructs a cross-origin URL from an absolute
path, for example:

get_host_info().REMOTE_ORIGIN + "/some/wpt/path.html"

In that case the resource still needs to be fetched at its canonical
absolute path, so rewriting it relative to the importing document is no
longer sufficient.

Update the HTTP test server so /static/ continues to serve from the
general test root, other non-echo requests are served from the imported
WPT tree, and dynamically registered echo responses live under /echo/
to avoid path conflicts.
2026-03-23 22:32:43 +01:00
Jelle Raaijmakers
94bc00248f Tests: Fix flaky load-event-delayed-by-*-background-image tests
These tests set up a delayed echo endpoint using a synchronous XHR to
http://127.0.0.1:PORT/echo, but the page itself is served from
http://localhost:PORT. This cross-origin request triggers a CORS
preflight, which intermittently fails with a NetworkError. There's
already a FIXME in place to get rid of the spin_until() that caused this
to happen.

Use a relative URL instead, since the page is already served from the
echo server.

Fixes #8564
2026-03-22 13:42:09 +01:00
Jelle Raaijmakers
7fed3f9801 LibWeb: Start fetching CSS image resources before document load event
Both Chromium and Gecko delay the document's load event for CSS image
resource requests (background-image, mask-image, etc). We now start
fetching CSS image resources as soon as their stylesheet is associated
with a document, rather than deferring until layout. This is done by
collecting ImageStyleValues during stylesheet parsing and initiating
their fetches when the stylesheet is added to the document.

Fixes #3448
2026-03-21 10:29:54 +01:00