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

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

Issue 2707203005: Import csswg-test@ed79f8614481e97d61f17f41b65448c211d27c6f (Closed)
Patch Set: Created 3 years, 9 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-lr (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-vlr-013-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-lr;
39 }
40
41 body#containing-block
42 {
43 background-image: url("support/bg-red-3col-2row-320x320.png");
44 background-position: 198px 8px;
45 /* first value represents the horizontal position and the second represent s the vertical position */
46
47 /*
48 16px (p's margin-left)
49 +
50 246px (img's width)
51 +
52 16px (p's margin-right)
53 ========
54 278px
55 -
56 80px (1 column of 80px)
57 ========
58 198px
59 */
60 background-repeat: no-repeat;
61 direction: rtl;
62 height: 320px;
63 margin: 8px;
64 }
65
66 p
67 {
68 direction: ltr;
69 margin-left: 16px;
70 margin-right: 16px;
71 }
72
73 div
74 {
75 background-color: green;
76 margin-top: 160px;
77 border-top: green solid 20px;
78 padding-top: 20px;
79 height: 0px;
80 padding-bottom: 20px;
81 border-bottom: green solid 20px;
82 margin-bottom: 160px;
83
84 margin-left: 96px; /* 80px + 16px necessary so that we can reuse an alread y created and available reference file */
85 width: 80px;
86 }
87
88 /*
89 "
90 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.
91 "
92 7.1 Principles of Layout in Vertical Writing Modes
93 http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
94
95 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.
96
97 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' = height of containing block
98
99 So:
100
101 160px : margin-top
102 +
103 20px : border-top-width
104 +
105 20px : padding-top
106 +
107 0px : height
108 +
109 20px : padding-bottom
110 +
111 20px : border-bottom-width
112 +
113 160px : margin-bottom
114 ========================
115 400px : while the height of containing block of div is 320px
116
117 So, here, the specified value of 'margin-top' is ignored and the value is calcul ated so as to make the equality true
118
119 (solve) : margin-top
120 +
121 20px : border-top-width
122 +
123 20px : padding-top
124 +
125 0px : height
126 +
127 20px : padding-bottom
128 +
129 20px : border-bottom-width
130 +
131 160px : margin-bottom
132 ========================
133 320px : height of containing block
134
135 And so computed margin-top value must be 80px .
136 */
137
138 ]]></style>
139
140 </head>
141
142 <body id="containing-block">
143
144 <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="3 6" alt="Image download support must be enabled" /></p>
145 <!--
146 The image says:
147 Test passes if there is a filled
148 green square and <strong>no red</strong>.
149 -->
150
151 <div></div>
152
153 </body>
154 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698