Bug 1871766: Fix WPT content-computed.html to not send actual image requests to examp...
commit16f4ceaf642ad1e5ee8bf2a1206a3cf409e9d26d
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 12 Jan 2024 09:03:34 +0000 (12 09:03 +0000)
committerDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 12 Jan 2024 09:03:34 +0000 (12 09:03 +0000)
tree4d54b4967b9026ebceb31925b7a0c3240b8b127a
parent18490dfee49c2973a4f22bf4f03e4b21ffc6c571
Bug 1871766: Fix WPT content-computed.html to not send actual image requests to example.com. r=layout-reviewers,emilio

This WPT puts CSS like the following on a test element:
    content: url("https://www.example.com/picture.svg")

That is effecively equivalent to inserting an element like the following:
    <img src="https://www.example.com/picture.svg">

In particular, it triggers an actual web request to example.com, in an attempt
to load the actual image. Firefox's test harness configuration detects this
remote network-request and insta-crashes instead of executing it, which is why
this test was flagged as crashing in Firefox.  Really, the test needs to be
fixed to avoid generating this image request entirely.

So, this patch adds `display:none` to the target element, which is sufficient
to prevent the browser from loading images for that element. (This change
doesn't impact the behavior that the test is actually trying to exercise, which
is just parsing, not image loading and rendering.)

As part of this, I'm updating Firefox's in-tree test-failure annotations from
a crash to a pile of subtest-failures, which are all due to
https://bugzilla.mozilla.org/show_bug.cgi?id=1281158

Differential Revision: https://phabricator.services.mozilla.com/D198341
testing/web-platform/meta/css/css-content/parsing/content-computed.html.ini
testing/web-platform/tests/css/css-content/parsing/content-computed.html