mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Tests/LibWeb: Move assets used by multiple test types into Assets/
Having to go through multiple levels of .. is not ideal, but less odd than reaching into another test type's data files.
This commit is contained in:
parent
57ba720fb1
commit
08253d6aee
Notes:
github-actions[bot]
2024-11-05 16:45:25 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/08253d6aee0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2175 Reviewed-by: https://github.com/gmta ✅
25 changed files with 27 additions and 27 deletions
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
|
@ -4,4 +4,4 @@
|
||||||
aspect-ratio: auto 2/1;
|
aspect-ratio: auto 2/1;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style><div></div><img src="120.png"/>
|
</style><div></div><img src="../../Assets/120.png"/>
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
aspect-ratio: auto;
|
aspect-ratio: auto;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style><div></div><img src="120.png"/>
|
</style><div></div><img src="../../Assets/120.png"/>
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
width: 200px;
|
width: 200px;
|
||||||
aspect-ratio: 0/1;
|
aspect-ratio: 0/1;
|
||||||
}
|
}
|
||||||
</style><img src="120.png"/>
|
</style><img src="../../Assets/120.png"/>
|
|
@ -4,4 +4,4 @@
|
||||||
aspect-ratio: 2/1;
|
aspect-ratio: 2/1;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style><div></div><img src="120.png"/>
|
</style><div></div><img src="../../Assets/120.png"/>
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<body><img src="../120.png">
|
<body><img src="../../../Assets/120.png">
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
img { max-width: 50px; }
|
img { max-width: 50px; }
|
||||||
</style><body><img src="../120.png">
|
</style><body><img src="../../../Assets/120.png">
|
|
@ -3,6 +3,6 @@
|
||||||
.max { height: max-content; }
|
.max { height: max-content; }
|
||||||
.fit { height: fit-content; }
|
.fit { height: fit-content; }
|
||||||
</style>
|
</style>
|
||||||
<img class="min" src="120.png" width="120" height="60" />
|
<img class="min" src="../../Assets/120.png" width="120" height="60" />
|
||||||
<img class="max" src="120.png" width="120" height="60" />
|
<img class="max" src="../../Assets/120.png" width="120" height="60" />
|
||||||
<img class="fit" src="120.png" width="120" height="60" />
|
<img class="fit" src="../../Assets/120.png" width="120" height="60" />
|
||||||
|
|
|
@ -10,4 +10,4 @@ img {
|
||||||
.with-width {
|
.with-width {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
</style><img class="with-height" src="120.png"><img class="with-width" src="120.png">
|
</style><img class="with-height" src="../../Assets/120.png"><img class="with-width" src="../../Assets/120.png">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><style>
|
<!DOCTYPE html><style>
|
||||||
body { width: max-content; }
|
body { width: max-content; }
|
||||||
img { max-width: 100%; }
|
img { max-width: 100%; }
|
||||||
</style><body><div><img src="120.png">
|
</style><body><div><img src="../../Assets/120.png">
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><style>
|
<!DOCTYPE html><style>
|
||||||
body { width: min-content; }
|
body { width: min-content; }
|
||||||
img { max-width: 100%; }
|
img { max-width: 100%; }
|
||||||
</style><body><img src="120.png">
|
</style><body><img src="../../Assets/120.png">
|
|
@ -1,4 +1,4 @@
|
||||||
<input type="image" src="120.png" value="120.png" width="120" height="120" />
|
<input type="image" src="../../Assets/120.png" value="120.png" width="120" height="120" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
let input = document.querySelector("input");
|
let input = document.querySelector("input");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<form>
|
<form>
|
||||||
<input type="image" src="120.png" alt="Image not found" width="48" height="48">
|
<input type="image" src="../../Assets/120.png" alt="Image not found" width="48" height="48">
|
||||||
<input type="image" src="120.png" alt="Image not found" width="64" height="64">
|
<input type="image" src="../../Assets/120.png" alt="Image not found" width="64" height="64">
|
||||||
<input type="image" src="120.png" alt="Image not found" width="128" height="256">
|
<input type="image" src="../../Assets/120.png" alt="Image not found" width="128" height="256">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(max-width: 600px)" srcset="120.png">
|
<source media="(max-width: 600px)" srcset="../../Assets/120.png">
|
||||||
<img src="400.png">
|
<img src="400.png">
|
||||||
</picture>
|
</picture>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'HashFont';
|
font-family: 'HashFont';
|
||||||
src: url('assets/HashSans.woff');
|
src: url('../Assets/HashSans.woff');
|
||||||
unicode-range: U+0;
|
unicode-range: U+0;
|
||||||
}
|
}
|
||||||
</style><div class="test">hello friends
|
</style><div class="test">hello friends
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'HashFont';
|
font-family: 'HashFont';
|
||||||
src: url('../assets/HashSans.woff');
|
src: url('../../Assets/HashSans.woff');
|
||||||
}
|
}
|
||||||
|
|
||||||
.hash-font {
|
.hash-font {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'HashFont';
|
font-family: 'HashFont';
|
||||||
src: url('assets/HashSans.woff');
|
src: url('../Assets/HashSans.woff');
|
||||||
unicode-range: U+0;
|
unicode-range: U+0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'HashFont';
|
font-family: 'HashFont';
|
||||||
src: url('assets/HashSans.woff');
|
src: url('../Assets/HashSans.woff');
|
||||||
unicode-range: U+0041; /* Only letter 'A' */
|
unicode-range: U+0041; /* Only letter 'A' */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<dialog id="dialog" open>
|
<dialog id="dialog" open>
|
||||||
<form id="form" method="dialog">
|
<form id="form" method="dialog">
|
||||||
<input value="well hello friends!" />
|
<input value="well hello friends!" />
|
||||||
<input id="image" type="image" src="../../../Layout/input/120.png" />
|
<input id="image" type="image" src="../../../Assets/120.png" />
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
<script src="../include.js"></script>
|
<script src="../include.js"></script>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
println(`zeroBytesFace.family: ${zeroBytesFace.family}`); // "Empty Font"
|
println(`zeroBytesFace.family: ${zeroBytesFace.family}`); // "Empty Font"
|
||||||
});
|
});
|
||||||
|
|
||||||
const fontData = await fetch("../../../Ref/assets/HashSans.woff").then(
|
const fontData = await fetch("../../../Assets/HashSans.woff").then(
|
||||||
response => response.arrayBuffer(),
|
response => response.arrayBuffer(),
|
||||||
(reason) => {
|
(reason) => {
|
||||||
println(`FAILED to fetch font from local file ${reason}`);
|
println(`FAILED to fetch font from local file ${reason}`);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// FIXME: Surely there's a better way to get this font URL
|
// FIXME: Surely there's a better way to get this font URL
|
||||||
let fontUrl = new URL(location.href);
|
let fontUrl = new URL(location.href);
|
||||||
fontUrl.search = "";
|
fontUrl.search = "";
|
||||||
fontUrl += "/../../../../Ref/assets/HashSans.woff";
|
fontUrl += "/../../../../Assets/HashSans.woff";
|
||||||
|
|
||||||
const hashSans = new FontFace("Hash Sans", `url(${fontUrl})`);
|
const hashSans = new FontFace("Hash Sans", `url(${fontUrl})`);
|
||||||
println(`hashSans.family: ${hashSans.family}`);
|
println(`hashSans.family: ${hashSans.family}`);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
asyncTest(async done => {
|
asyncTest(async done => {
|
||||||
const fontFaceSet = document.fonts;
|
const fontFaceSet = document.fonts;
|
||||||
|
|
||||||
const fontFace = new FontFace("Hash Sans", "url(../../../../Ref/assets/HashSans.woff)");
|
const fontFace = new FontFace("Hash Sans", "url(../../../../Assets/HashSans.woff)");
|
||||||
fontFaceSet.add(fontFace);
|
fontFaceSet.add(fontFace);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<script>
|
<script>
|
||||||
test(() => {
|
test(() => {
|
||||||
const fontFaceSet = document.fonts;
|
const fontFaceSet = document.fonts;
|
||||||
const fontFace = new FontFace("Hash Sans", 'url(../../../../Ref/assets/HashSans.woff)');
|
const fontFace = new FontFace("Hash Sans", 'url(../../../../Assets/HashSans.woff)');
|
||||||
|
|
||||||
println("-- Empty FontFaceSet --");
|
println("-- Empty FontFaceSet --");
|
||||||
println(`fontFaceSet.size: ${fontFaceSet.size}`);
|
println(`fontFaceSet.size: ${fontFaceSet.size}`);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script src="./include.js"></script>
|
<script src="./include.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const SOURCES = ["../../Layout/input/120.png", "file:///i-do-no-exist-i-swear.png"];
|
const SOURCES = ["../../Assets/120.png", "file:///i-do-no-exist-i-swear.png"];
|
||||||
|
|
||||||
const runTest = source => {
|
const runTest = source => {
|
||||||
let input = document.createElement("input");
|
let input = document.createElement("input");
|
||||||
|
|
Loading…
Reference in a new issue