multicol-count-computed-003

column-rule and overflow inside (complex test)

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
ahem
Assertion
This test checks that if one of 2 adjacent column boxes (2nd and 3rd colum box in this test) does not have any content, then the column rule separating those should not be drawn. In this test, the 3rd colum box should have no inline content. This test also checks that inline content in the normal flow that extends into a column gap should be clipped in the middle of the column gap. So, in this test, inline content in 1st column box should be partially clipped and overlapped partially by 1st column-rule.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Multi-column Layout Test: column-rule and overflow inside (complex test)</title>
 5   <link rel="author" title="Opera Software ASA" href="http://www.opera.com/">
 6   <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2013-07-29 -->
 7   <link rel="help" href="http://www.w3.org/TR/css3-multicol/#the-number-and-width-of-columns" title="3. The number and width of columns">
 8   <link rel="match" href="reference/multicol-count-computed-003-ref.htm">
 9   <meta name="flags" content="ahem">
10   <meta name="assert" content="This test checks that if one of 2 adjacent column boxes (2nd and 3rd colum box in this test) does not have any content, then the column rule separating those should not be drawn. In this test, the 3rd colum box should have no inline content. This test also checks that inline content in the normal flow that extends into a column gap should be clipped in the middle of the column gap. So, in this test, inline content in 1st column box should be partially clipped and overlapped partially by 1st column-rule.">
11   <style type="text/css">
12   div
13   {
14   background: yellow;
15   border: gray solid 1em;
16   color: black;
17   font: 1.25em/1 Ahem;
18   orphans: 1;
19   widows: 1;
20   width: 13em;
21 
22   column-count: 3;
23   column-gap: 5em;
24   column-rule-color: blue;
25   column-rule-style: solid;
26   column-rule-width: 1.5em;
27   }
28 
29   /*
30   (11)  if (column-width = auto) and (column-count != auto) then
31   (12)    N := column-count;
32   (13)    W := max(0, (available-width - ((N - 1) * column-gap)) / N);
33   (14)  exit;
34 
35   So, the used column-count in this test is 3.
36 
37   W := max(0, (available-width - ((N - 1) * column-gap)) / N);
38   W == max(0, (13em - ((3 - 1) * 5em)) / 3);
39   W == max(0, (13em - (2 * 5em)) / 3);
40   W == max(0, (13em - (10em)) / 3);
41   W == max(0, (3em) / 3);
42   W == max(0, 1em);
43   W == 1em;
44 
45   So, the used column-width in this test is 1em.
46   */
47 
48   #pink {color: pink;}
49   #orange {color: orange;}
50   #purple {color: purple;}
51   #gray {color: gray;}
52 
53   /*
54   Since
55   "
56   Content in the normal flow that extends into
57   column gaps (e.g., long words or images) is
58   clipped in the middle of the column gap.
59   "
60   http://www.w3.org/TR/css3-multicol/#overflow-inside-multicol-elements
61   this causes the right-half (0.5em) of the 'K' glyph to
62   be overlapped by the right-half (0.75em) of the 1st blue column-rule.
63   Same thing should happen to the 'N' glyph of 'ORAN'.
64 
65   Because no inline content should be rendered into the
66   3rd column box, this causes the 2nd column rule not
67   been rendered because
68   "
69   Column rules are only drawn between two columns that
70   both have content.
71   "
72   http://www.w3.org/TR/css3-multicol/#column-gaps-and-rules
73   */
74   </style>
75  </head>
76 
77  <body>
78 
79   <div>
80 	<span id="pink">PINK</span>
81 	<span id="orange">ORAN</span>
82 	<span id="purple">PURP</span>
83 	<span id="gray">GRAY</span>
84   </div>
85 
86  </body>
87 </html>