text-align-match-parent-03

CSS Text: text-align: match-parent

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
dom
Assertion
Text checks that an element whose text-align property is changed to match-parent aligns correctly

Source

 1 <!DOCTYPE html>
 2 <html class="reftest-wait"><head>
 3     <meta charset="utf-8">
 4     <title>CSS Text: text-align: match-parent</title>
 5     <link href="mailto:smontagu@mozilla.com" rel="author" title="Simon Montagu">
 6     <link href="http://www.w3.org/TR/css-text-3/#text-align-property" rel="help">
 7     <meta content="dom" name="flags">
 8     <meta content="Text checks that an element whose
 9       text-align property is changed to match-parent aligns correctly" name="assert">
10      <link href="reference/text-align-match-parent-ref.htm" rel="match">
11     <style type="text/css">
12 div.start  { text-align: start; }
13 div.end    { text-align: end; }
14 div.left   { text-align: left; }
15 div.right  { text-align: right; }
16 div.center { text-align: center; }
17 div.match  { text-align: match-parent; }
18     </style>
19    <script type="text/javascript">
20 function changeChildAlign()
21 {
22   for (child = 0; child < 16; ++child) {
23      var childDiv = document.getElementById("d" + child);
24      childDiv.className = "match";
25    }
26 
27   document.documentElement.removeAttribute("class");
28 }
29    </script>
30   </head>
31   <body onload="changeChildAlign()">
32    <div>Test passes if each line that says "Left" is aligned left and
33    each line that says "Right" is aligned right</div>
34    <div class="start" dir="ltr"><div class="center" dir="ltr" id="d0">Left</div></div>
35    <div class="start" dir="ltr"><div class="center" dir="rtl" id="d1">Left</div></div>
36    <div class="start" dir="rtl"><div class="center" dir="ltr" id="d2">Right</div></div>
37    <div class="start" dir="rtl"><div class="center" dir="rtl" id="d3">Right</div></div>
38    <div class="end" dir="ltr"><div class="center" dir="ltr" id="d4">Right</div></div>
39    <div class="end" dir="ltr"><div class="center" dir="rtl" id="d5">Right</div></div>
40    <div class="end" dir="rtl"><div class="center" dir="ltr" id="d6">Left</div></div>
41    <div class="end" dir="rtl"><div class="center" dir="rtl" id="d7">Left</div></div>
42    <div class="left" dir="ltr"><div class="center" dir="ltr" id="d8">Left</div></div>
43    <div class="left" dir="ltr"><div class="center" dir="rtl" id="d9">Left</div></div>
44    <div class="left" dir="rtl"><div class="center" dir="ltr" id="d10">Left</div></div>
45    <div class="left" dir="rtl"><div class="center" dir="rtl" id="d11">Left</div></div>
46    <div class="right" dir="ltr"><div class="center" dir="ltr" id="d12">Right</div></div>
47    <div class="right" dir="ltr"><div class="center" dir="rtl" id="d13">Right</div></div>
48    <div class="right" dir="rtl"><div class="center" dir="ltr" id="d14">Right</div></div>
49    <div class="right" dir="rtl"><div class="center" dir="rtl" id="d15">Right</div></div>
50  
51 
52 </body></html>