1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00
ladybird/Tests/LibWeb/Text/input/css/white-space.html
Callum Law 94f5a51820 LibWeb: Convert white-space CSS property to shorthand
This exposed a few bugs which caused the following tests to behave
incorrectly:
- `tab-size-text-wrap.html`: This previously relied on a bug where we
  incorrectly treated `white-space: pre` as allowing text wrapping. The
  fix here is to implement the text-wrap CSS shorthand property.

- `execCommand-preserveWhitespace.html`: We don't correctly serialize
  shorthand properties. This is covered by an existing FIXME in
  `CSSStyleProperties::serialized()`

- `white-space-shorthand.html`: The last 5 subtests here fail as we
  don't correctly handle shorthand properties in
  `CSSStyleProperties::remove_property()`. This is covered by an
  existing FIXME in said function.
2025-05-29 12:04:28 +02:00

25 lines
No EOL
792 B
HTML

<!DOCTYPE html>
<style>
#disjoint-trim-values {
white-space: discard-inner preserve discard-after;
}
#duplicate-trim-values {
white-space: discard-inner discard-inner;
}
#collapse-values-after-trim {
white-space: discard-inner preserve;
}
</style>
<div id="disjoint-trim-values"></div>
<div id="duplicate-trim-values"></div>
<div id="collapse-values-after-trim"></div>
<script src="../include.js"></script>
<script>
test(() => {
println(getComputedStyle(document.getElementById("disjoint-trim-values")).whiteSpace);
println(getComputedStyle(document.getElementById("duplicate-trim-values")).whiteSpace);
println(getComputedStyle(document.getElementById("collapse-values-after-trim")).whiteSpace);
});
</script>