summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/fonts/font-052.xht
blob: 454a7cd60fe1d49176d20a6cc3ba4d44314fa505 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!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: font shorthand - reserved keywords</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com" />
  <link rel="help" href="http://www.w3.org/TR/CSS21/fonts.html#font-shorthand" title="15.8 Shorthand font property: the 'font' property" />
  <link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-prop" title="3.7 Shorthand font property: the font property" />
  <link rel="bookmark" href="http://lists.w3.org/Archives/Public/www-style/2012May/0878.html" title="Re: [css2.1][css3-fonts] keywords in unquoted font family names" />

  <meta content="This test verifies different valid and invalid font shorthand declarations involving reserved keywords (caption, inherit)." name="assert" />

  <style type="text/css"><![CDATA[
  p
  {
  font-size: 1.5em;
  font-family: serif;
  }

  span#verify1 {font-family: "CSSTest Verify";}

  div#verify {font-size: 1.5em;}

  div
  {
  font-size: 2.5em;
  line-height: 1.5;
  }

  /*
  font shorthand syntax in CSS 2.1:

  Value:  	[ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit

  Brackets ([ ]) are for grouping.

  A double bar (||) separates two or more options: one or more of them must occur, in any order.

  A question mark (?) indicates that the preceding type, word, or group is optional.

  A bar (|) separates two or more alternatives: exactly one of them must occur.

  Section 1.4.2.1 Value
  http://www.w3.org/TR/CSS21/about.html#value-defs
  */

  div#firstTest {font: 40px \inherit foo, "CSSTest Fallback";}
  /* valid: there can be a font whose name is "inherit foo" */

  div#secondTest {font: 40px foo \inherit, "CSSTest Fallback";}
  /* valid: there can be a font whose name is "foo inherit" */

  div#thirdTest {font: caption;}
  /* valid: caption is the reserved keyword for the system font */

  div#fourthTest {font: medium caption, "CSSTest Fallback";}
  /* valid: there can be a font whose name is "caption";
  "medium" is the font-size */

  div#fifthTest {font: caption foo, "CSSTest Fallback";}
  /* invalid: there could be a font whose name is "caption foo"
  but then the font shorthand declaration would have no font-size */

  div#sixthTest {font: caption, foo, "CSSTest Fallback";}
  /* invalid */

  div#seventhTest {font: medium caption, inherit, "CSSTest Fallback";}
  /* invalid */

  /*
  font shorthand syntax in CSS 2.1:

  Value:  	[ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit

  Brackets ([ ]) are for grouping.

  A double bar (||) separates two or more options: one or more of them must occur, in any order.

  A question mark (?) indicates that the preceding type, word, or group is optional.

  A bar (|) separates two or more alternatives: exactly one of them must occur.

  Section 1.4.2.1 Value
  http://www.w3.org/TR/CSS21/about.html#value-defs
  */

  ]]></style>

 </head>

 <body>

  <p><a href="http://www.w3.org/Style/CSS/Test/Fonts/">Test fonts</a> must be installed for this test: <span id="verify1">FAIL</span></p>

  <div id="verify">User agent's default font must be set to be "CSSTest FamilyName": 5678</div>

  <p>Test passes if there are exactly seven "PASS" words below:</p>

  <div id="firstTest">1234</div>

  <div id="secondTest">1234</div>

  <div id="thirdTest">PASS</div>

  <div id="fourthTest">1234</div>

  <div id="fifthTest">5678</div>

  <div id="sixthTest">5678</div>

  <div id="seventhTest">5678</div>

 </body>
</html>