mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
Tests: Add tests for loading images from an imported style sheet
We previously had no coverage for the situation of "relative-linking to an image in a style sheet which isn't in the same directory as the document".
This commit is contained in:
parent
aebbb008c1
commit
bf873a2d5b
Notes:
github-actions[bot]
2025-04-15 09:30:39 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/bf873a2d5bf Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4319
4 changed files with 41 additions and 0 deletions
3
Tests/LibWeb/Ref/data/checkerboard-background.css
Normal file
3
Tests/LibWeb/Ref/data/checkerboard-background.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
#checkerboard {
|
||||
background: url("2x2checkerboard.png");
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
#checkerboard {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url("../../data/2x2checkerboard.png");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
<!-- FIXME: Workaround to ensure CSS background-image is loaded before taking screenshot: https://github.com/LadybirdBrowser/ladybird/issues/3448 -->
|
||||
<img style="display:none" src="../../data/2x2checkerboard.png">
|
||||
<div id="checkerboard"></div>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="../../expected/css/images-load-relative-to-style-sheet-ref.html" />
|
||||
<style>
|
||||
@import url("../../data/checkerboard-background.css");
|
||||
#checkerboard {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
<!-- FIXME: Workaround to ensure CSS background-image is loaded before taking screenshot: https://github.com/LadybirdBrowser/ladybird/issues/3448 -->
|
||||
<img style="display:none" src="../../data/2x2checkerboard.png">
|
||||
<div id="checkerboard"></div>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="../../expected/css/images-load-relative-to-style-sheet-ref.html" />
|
||||
<link rel="stylesheet" href="../../data/checkerboard-background.css" />
|
||||
<style>
|
||||
#checkerboard {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
<!-- FIXME: Workaround to ensure CSS background-image is loaded before taking screenshot: https://github.com/LadybirdBrowser/ladybird/issues/3448 -->
|
||||
<img style="display:none" src="../../data/2x2checkerboard.png">
|
||||
<div id="checkerboard"></div>
|
Loading…
Add table
Reference in a new issue