mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb/HTML: Support blob URLs in HTMLLinkElement
We are meant to apply the 'URL parser' here, which indicates that this should work with Blob URLs.
This commit is contained in:
parent
d967f56936
commit
ef793d8679
Notes:
github-actions[bot]
2025-01-21 10:50:40 +00:00
Author: https://github.com/shannonbooth
Commit: ef793d8679
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3330
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 31 additions and 1 deletions
27
Tests/LibWeb/Text/input/HTML/HTMLLinkElement-blob-url.html
Normal file
27
Tests/LibWeb/Text/input/HTML/HTMLLinkElement-blob-url.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script src="../include.js"></script>
|
||||
<div id="test-element">Test Element</div>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
const cssContent = `
|
||||
#test-element {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
`;
|
||||
const blob = new Blob([cssContent], { type: "text/css" });
|
||||
const blobURL = URL.createObjectURL(blob);
|
||||
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = blobURL;
|
||||
document.head.appendChild(link);
|
||||
|
||||
link.onload = () => {
|
||||
const testElement = document.getElementById('test-element');
|
||||
const computedStyle = window.getComputedStyle(testElement);
|
||||
println(computedStyle.color);
|
||||
println(computedStyle.fontWeight);
|
||||
done();
|
||||
};
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue