mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-16 08:02:52 +00:00
For example, in the following abbreviated test HTML: <span>some text</span> <script>println("whf")</script> We would have to craft the expectation file to include the "some text" segment, usually with some leading whitespace. This is a bit annoying, and makes it difficult to manually craft expectation files. So instead of comparing the expectation against the entire DOM inner text, we now send the inner text of just the <pre> element containing the test output when we invoke `internals.signalTextTestIsDone`.
19 lines
976 B
HTML
19 lines
976 B
HTML
<!doctype html><style>
|
|
img {
|
|
border: 1px solid black;
|
|
width: 30px;
|
|
height: 30px;
|
|
}
|
|
/* This element will not be visible in the viewport */
|
|
#notInViewport {
|
|
position: relative;
|
|
top: -1000px;
|
|
}
|
|
</style><body><img id="notInViewport" loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAUElEQVRo3u3PQQ0AMAgEsGP+xeEIVOxB0jpodSaXvRwnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg8N8ChgACTxD8p8QAAAAASUVORK5CYII="><img id="inViewport" loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAUElEQVRo3u3PQQ0AMAgEsGP+xeEIVOxB0jpodSaXvRwnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg8N8ChgACTxD8p8QAAAAASUVORK5CYII=">
|
|
<script>
|
|
const inViewport = document.getElementById("inViewport");
|
|
inViewport.addEventListener("load", function() {
|
|
document.body.innerHTML = "PASS";
|
|
internals.signalTextTestIsDone(document.body.innerText);
|
|
});
|
|
</script>
|