mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Import a bunch of /css/css-display tests from WPT
This commit is contained in:
committed by
Andreas Kling
parent
02268e9c60
commit
70695e4fce
Notes:
github-actions[bot]
2024-11-15 13:47:06 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/70695e4fce3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2356
@@ -0,0 +1,34 @@
|
||||
<!doctype html>
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1561283">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-display/#valdef-display-contents">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-display">
|
||||
<link rel="author" href="https://mozilla.org" title="Mozilla">
|
||||
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
|
||||
<link rel="author" href="mailto:obrufau@igalia.com" title="Oriol Brufau">
|
||||
<script src="../../resources/testharness.js"></script>
|
||||
<script src="../../resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
.grid { display: grid }
|
||||
</style>
|
||||
<div style="display: grid">
|
||||
<span id="grid-child">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function display(el) {
|
||||
return getComputedStyle(el).display;
|
||||
}
|
||||
test(function() {
|
||||
let child = document.getElementById("grid-child");
|
||||
let grandChild = child.firstElementChild;
|
||||
assert_equals(display(child), "block", "Grid child should get blockified");
|
||||
assert_equals(display(grandChild), "inline", "Grid grand-child should not get initially blockified");
|
||||
child.style.display = "contents";
|
||||
assert_equals(display(child), "contents", "No reason for it not to become display: contents");
|
||||
assert_equals(display(grandChild), "block", "Grid grand-child with display: contents parent should get blockified");
|
||||
child.style.display = "";
|
||||
assert_equals(display(child), "block", "Grid child should get blockified");
|
||||
assert_equals(display(grandChild), "inline", "Grid grand-child should get un-blockified when its parent's display stops being `contents`");
|
||||
}, "Dynamic changes to `display` causing blockification of children are handled correctly");
|
||||
</script>
|
||||
Reference in New Issue
Block a user