summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-text/white-space/white-space-intrinsic-size-018.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-text/white-space/white-space-intrinsic-size-018.html')
-rw-r--r--testing/web-platform/tests/css/css-text/white-space/white-space-intrinsic-size-018.html89
1 files changed, 89 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-text/white-space/white-space-intrinsic-size-018.html b/testing/web-platform/tests/css/css-text/white-space/white-space-intrinsic-size-018.html
new file mode 100644
index 0000000000..707e19adc0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/white-space/white-space-intrinsic-size-018.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+
+ <meta charset="UTF-8">
+
+ <title>CSS Text Test: max-content sizing and 'white-space: pre'</title>
+
+ <link rel="author" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
+ <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
+ <link rel="help" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+ <link rel="help" href="https://www.w3.org/TR/css-text-3/#white-space-phase-2">
+ <link rel="help" href="https://www.w3.org/TR/css-sizing-3/#auto-box-sizes">
+ <link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+
+ <meta name="fuzzy" content="maxDifference=0-1; totalPixels=0-4400">
+ <meta content="When 'white-space' is 'pre', preserved white spaces at the beginning and at the end of the line affect the intrinsic max-content size." name="assert">
+
+ <style>
+ div#wrapper
+ {
+ color: transparent;
+ /*
+ so that background colors can
+ shine through the A, G, M, Z glyphs
+ */
+ font-family: Ahem;
+ font-size: 25px;
+ line-height: 1;
+ width: 7em;
+ /*
+ 'width: 7em' gives more inline-size
+ than needed or required by each
+ overlapping-test-green <div>s.
+ If an implementation goes wrong
+ and makes one of
+ overlapping-test-green <div>s
+ wider than 4em, then we will see
+ red.
+ */
+ }
+
+ div#overlapped-reference-red
+ {
+ background-color: red;
+ height: 4em;
+ position: absolute;
+ width: 4em;
+ z-index: -1;
+ }
+
+ div.overlapping-test-green
+ {
+ background: linear-gradient(to right, green 4em, red 3em);
+ /*
+ If one of the overlapping-test-green <div>s become wider
+ than 4em, then we will see the part beyond 4em of this
+ linear-gradient background which is red.
+ https://www.w3.org/TR/css-images-3/#linear-gradients
+ */
+ float: left;
+ /*
+ [
+ max-content inline size:
+ The box's "ideal" size in the inline axis. Usually
+ the narrowest inline size it could take while fitting
+ around its contents if none of the soft wrap
+ opportunities within the box were taken.
+ ]
+ https://www.w3.org/TR/css-sizing-3/#max-content-inline-size
+ */
+ white-space: pre;
+ }
+ </style>
+
+ <p>Test passes if there is a filled green square and <strong>no red</strong>.
+
+ <div id="wrapper">
+
+ <div id="overlapped-reference-red"></div>
+
+ <div class="overlapping-test-green">A </div>
+
+ <div class="overlapping-test-green"> G </div>
+
+ <div class="overlapping-test-green"> M </div>
+
+ <div class="overlapping-test-green"> Z</div>
+
+ </div>