Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/normal-flow-overconstrained-vrl-004.xht

Issue 2707203005: Import csswg-test@ed79f8614481e97d61f17f41b65448c211d27c6f (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd">
2
3 <html xmlns="http://www.w3.org/1999/xhtml">
4
5 <head>
6
7 <title>CSS Writing Modes Test: non-replaced block in normal flow with 'directi on: rtl' in vertical-rl (overconstrained)</title>
8
9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserB ugsSection/css21testsuite/" />
10 <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#logical-direc tion-layout" title="7.4 Flow-Relative Mappings" />
11 <link rel="match" href="abs-pos-non-replaced-vrl-012-ref.xht" />
12
13 <meta name="flags" content="ahem image" />
14 <meta name="assert" content="This test checks that when an inline dimension of a non-replaced block in normal flow is over-constrained, the inline-end margin is dropped and recalculated so that the equation involving inline-size is balanc ed; such equation takes under account the inline's direction (ltr or rtl). In th is test, the inline-end margin (physical margin-top) is recalculated." />
15
16 <!--
17 "
18 the margin that is dropped when a box’s inline dimension is over-constrained i s the end margin as determined by the writing mode of the containing block.
19 "
20 7.4 Flow-Relative Mappings
21 http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
22
23 "
24 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-righ t' + 'border-right-width' + 'margin-right' = width of containing block
25
26 If all of the above have a computed value other than 'auto', the values are sa id to be "over-constrained" and one of the used values will have to be different from its computed value. If the 'direction' property of the containing block ha s the value 'ltr', the specified value of 'margin-right' is ignored and the valu e is calculated so as to make the equality true. If the value of 'direction' is 'rtl', this happens to 'margin-left' instead.
27 "
28 CSS 2.1, section 10.3.3 Block-level, non-replaced elements in normal flow
29 http://www.w3.org/TR/CSS21/visudet.html#blockwidth
30 -->
31
32 <meta name="DC.date.created" content="2015-10-16T09:54:03+11:00" scheme="W3CDT F" />
33 <meta name="DC.date.modified" content="2017-02-18T09:54:03+11:00" scheme="W3CD TF" />
34
35 <style type="text/css"><![CDATA[
36 html
37 {
38 writing-mode: vertical-rl;
39 }
40
41 body#containing-block
42 {
43 background-image: url("support/bg-red-3col-2row-320x320.png");
44 background-position: -152px 8px;
45 /* first value represents the horizontal position and the second represent s the vertical position */
46
47 /*
48 8px (body's margin-left)
49 -
50 80px (4th column width)
51 -
52 80px (3rd column width)
53 ========
54 -152px
55 */
56 background-repeat: no-repeat;
57 direction: rtl;
58 height: 320px;
59 margin: 8px;
60 }
61
62 p
63 {
64 direction: ltr;
65 margin-left: 16px;
66 margin-right: 16px;
67 }
68
69 div
70 {
71 background-color: green;
72 margin-top: 160px;
73 border-top: green solid 20px;
74 padding-top: 20px;
75 height: 0px;
76 padding-bottom: 20px;
77 border-bottom: green solid 20px;
78 margin-bottom: 160px;
79
80 margin-right: 96px; /* 80px + 16px necessary so that we can reuse an alrea dy created and available reference file */
81 width: 80px;
82 }
83
84 /*
85 "
86 Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to t he horizontal dimension in horizontal writing modes instead apply to the vertica l dimension in vertical writing modes.
87 "
88 7.1 Principles of Layout in Vertical Writing Modes
89 http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
90
91 So here, *-top and *-bottom properties are input into the §10.3.3 algorithms whe re *-top properties refer to *-left properties in the layout rules and where *-b ottom properties refer to *-right properties in the layout rules.
92
93 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' = height of containing block
94
95 So:
96
97 160px : margin-top
98 +
99 20px : border-top-width
100 +
101 20px : padding-top
102 +
103 0px : height
104 +
105 20px : padding-bottom
106 +
107 20px : border-bottom-width
108 +
109 160px : margin-bottom
110 ========================
111 400px : while the height of containing block of div is 320px
112
113 So, here, the specified value of 'margin-top' is ignored and the value is calcul ated so as to make the equality true
114
115 (solve) : margin-top
116 +
117 20px : border-top-width
118 +
119 20px : padding-top
120 +
121 0px : height
122 +
123 20px : padding-bottom
124 +
125 20px : border-bottom-width
126 +
127 160px : margin-bottom
128 ========================
129 320px : height of containing block
130
131 And so computed margin-top value must be 80px .
132 */
133
134 ]]></style>
135
136 </head>
137
138 <body id="containing-block">
139
140 <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="3 6" alt="Image download support must be enabled" /></p>
141 <!--
142 The image says:
143 Test passes if there is a filled
144 green square and <strong>no red</strong>.
145 -->
146
147 <div></div>
148
149 </body>
150 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698