mirror of
https://github.com/servo/servo
synced 2026-04-28 18:37:39 +02:00
70 lines
1.8 KiB
HTML
70 lines
1.8 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>CSS Test: inheritance of computed font-size across fonts</title>
|
|
|
|
<!--
|
|
Inspired by
|
|
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-001.htm
|
|
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-001.htm
|
|
-->
|
|
|
|
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
|
<link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#length-units">
|
|
<link rel="help" href="http://www.w3.org/TR/CSS21/fonts.html#font-size-props">
|
|
<link rel="match" href="reference/ref-filled-green-100px-square.htm">
|
|
|
|
<meta content="ahem" name="flags">
|
|
<meta content="ex unit is the 'x-height' of the relevant font. 'em' and 'ex' length values when defining 'font-size' property refer to the computed font size of the parent element." name="assert">
|
|
|
|
<style type="text/css">
|
|
div#overlapped-red
|
|
{
|
|
background-color: red;
|
|
height: 100px;
|
|
width: 100px;
|
|
}
|
|
|
|
div#grand-parent {font: 25px/1 Ahem;}
|
|
/*
|
|
To download Ahem font:
|
|
http://www.w3.org/Style/CSS/Test/Fonts/Ahem/
|
|
*/
|
|
|
|
div#parent {font-size: 5ex;}
|
|
/* The Ahem font has an x-height of 0.8em. */
|
|
|
|
div#overlapping-green
|
|
{
|
|
background-color: green;
|
|
bottom: 100px;
|
|
font-family: serif;
|
|
position: relative;
|
|
width: 100px;
|
|
}
|
|
|
|
/*
|
|
In this test, the inherited computed font-size of
|
|
div#overlapping-green should be 100px with a line box
|
|
height of 100px.
|
|
*/
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
|
|
|
<div id="overlapped-red"></div>
|
|
|
|
<div id="grand-parent">
|
|
<div id="parent">
|
|
<div id="overlapping-green"> </div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |