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,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