script: Load and rasterize favicons before passing them to the embedder (#38949)

Currently the embedding API only provides the embedder with the URL for
a favicon. This is not great, for multiple reasons:
* Loading the icon should happen according to the fetch spec which is
not easy for the embedder to recreate (consider CSP, timing information
etc)
* Rasterizing a svg favicon is not trivial

With this change, servo fetches and rasterizes the icon to a bitmap
which is then passed to the embedder.

Testing: I'm not sure how I can write tests for the embedding api. I've
tested the correctness manually using
https://github.com/servo/servo/pull/36680.
Prepares for https://github.com/servo/servo/pull/36680

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-08-27 16:28:42 +02:00 committed by GitHub
parent a5d890c13a
commit dcd25072d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 373 additions and 159 deletions

View file

@ -1,4 +0,0 @@
[icon-blocked.sub.html]
expected: TIMEOUT
[Test that spv event is fired]
expected: NOTRUN

View file

@ -1,67 +1,6 @@
[element-link-icon.https.sub.html]
expected: TIMEOUT
[sec-fetch-site - Same origin no attributes]
expected: TIMEOUT
[sec-fetch-site - Cross-site no attributes]
expected: NOTRUN
[sec-fetch-site - Same site no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Origin -> Same-Site -> Same-Origin redirect no attributes]
expected: NOTRUN
[sec-fetch-site - Cross-Site -> Same Origin no attributes]
expected: NOTRUN
[sec-fetch-site - Cross-Site -> Same-Site no attributes]
expected: NOTRUN
[sec-fetch-site - Cross-Site -> Cross-Site no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Origin -> Same Origin no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Origin -> Same-Site no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Origin -> Cross-Site no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Site -> Same Origin no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Site -> Same-Site no attributes]
expected: NOTRUN
[sec-fetch-site - Same-Site -> Cross-Site no attributes]
expected: NOTRUN
[sec-fetch-mode no attributes]
expected: NOTRUN
[sec-fetch-mode attributes: crossorigin]
expected: NOTRUN
[sec-fetch-mode attributes: crossorigin=anonymous]
expected: NOTRUN
[sec-fetch-mode attributes: crossorigin=use-credentials]
expected: NOTRUN
[sec-fetch-dest no attributes]
expected: NOTRUN
[sec-fetch-user no attributes]
expected: NOTRUN
expected: FAIL
[sec-fetch-storage-access - Cross-site no attributes]
expected: NOTRUN
[sec-fetch-storage-access - Same site no attributes]
expected: NOTRUN
expected: FAIL

View file

@ -1,55 +1,6 @@
[element-link-icon.sub.html]
expected: TIMEOUT
[sec-fetch-site - Not sent to non-trustworthy same-origin destination no attributes]
expected: TIMEOUT
[sec-fetch-site - Not sent to non-trustworthy same-site destination no attributes]
expected: NOTRUN
[sec-fetch-site - Not sent to non-trustworthy cross-site destination no attributes]
expected: NOTRUN
[sec-fetch-mode - Not sent to non-trustworthy same-origin destination no attributes]
expected: NOTRUN
[sec-fetch-mode - Not sent to non-trustworthy same-site destination no attributes]
expected: NOTRUN
[sec-fetch-mode - Not sent to non-trustworthy cross-site destination no attributes]
expected: NOTRUN
[sec-fetch-dest - Not sent to non-trustworthy same-origin destination no attributes]
expected: NOTRUN
[sec-fetch-dest - Not sent to non-trustworthy same-site destination no attributes]
expected: NOTRUN
[sec-fetch-dest - Not sent to non-trustworthy cross-site destination no attributes]
expected: NOTRUN
[sec-fetch-user - Not sent to non-trustworthy same-origin destination no attributes]
expected: NOTRUN
[sec-fetch-user - Not sent to non-trustworthy same-site destination no attributes]
expected: NOTRUN
[sec-fetch-user - Not sent to non-trustworthy cross-site destination no attributes]
expected: NOTRUN
[sec-fetch-site - HTTPS downgrade (header not sent) no attributes]
expected: NOTRUN
expected: FAIL
[sec-fetch-site - HTTPS upgrade no attributes]
expected: NOTRUN
[sec-fetch-site - HTTPS downgrade-upgrade no attributes]
expected: NOTRUN
[sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination no attributes]
expected: NOTRUN
[sec-fetch-storage-access - Not sent to non-trustworthy same-site destination no attributes]
expected: NOTRUN
[sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination no attributes]
expected: NOTRUN
expected: FAIL