summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/normal-flow/inline-block-non-replaced-height-002.xht
blob: 60afcd00479cda1ed8b350c2a0f4eb9230bc976b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>CSS Test: Inline-block non-replaced elements' margin box is used for the height of the line box</title>
        <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
		<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-10-12 -->
        <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-root-margin" />
		<link rel="match" href="height-percentage-001-ref.xht" />

        <meta name="assert" content="Inline-block non-replaced elements use the margin box for sizing the height of the line box." />
        <style type="text/css">
            #div1
            {
                line-height: 0;
                position: relative;
            }
            #div2
            {
                background: blue;
            }

			/*
			The test relies and assumes that div#div2's
			computed height will be and should be
			equal to the its used line box height since it has
			only 1 inline-level element which is contributing to
			determine its line box height.
			*/

            #div2 div
            {
                display: inline-block;
                height: 0;
                margin: 0.5in 0;
            }
            div div
            {
                width: 1in;
            }
            #div3
            {
                background: orange;
                left: 1in;
                height: 1in;
                position: absolute;
                top: 0;
            }
        </style>
    </head>
    <body>
        <p>Test passes if the blue and orange squares have the <strong>same height</strong>.</p>
        <div id="div1">
            <div id="div2">
                <div></div>
            </div>
            <div id="div3"></div>
        </div>
    </body>
</html>