summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/fonts/font-family-rule-004a.xht
blob: 33657ab19b0101a61489b093fe702854c1aa64d7 (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
119
120
121
122
<!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-family - inherit as part of font-family name</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-family-prop" title="15.3 Font family: the 'font-family' property" />
  <link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-family-prop" title="3.1 Font family: the font-family 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="invalid" name="flags" />
  <meta content="This test verifies 9 font-family declarations with inherit and 2 font-family declarations with invalid identifiers." 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;
  }

  /*
  Newest font-family syntax in CSS 2.1:
  Value:
  [[<family-name> | <generic-family>] [, [<family-name>| <generic-family>]]* ] | inherit

  Brackets ([ ]) are for grouping.

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

  An asterisk (*) indicates that the preceding type, word, or group occurs zero or more times.

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

  div#firstTest {font-family: inherit, "CSSTest Fallback";}
  /* invalid: unquoted inherit is a reserved keyword and not a font-family name */

  div#secondTest {font-family: "CSSTest Fallback", inherit;}
  /* invalid: unquoted inherit is a reserved keyword and not a font-family name */

  div#thirdTest {font-family: inherit foo, "CSSTest Fallback";}
  /* valid in CSS 2.1: the 2 identifiers (inherit foo) form a font-family name */

  div#fourthTest {font-family: foo inherit, "CSSTest Fallback";}
  /* valid in CSS 2.1: the 2 identifiers (foo inherit) form a font-family name */

  div#fifthTest {font-family: \inherit foo, "CSSTest Fallback";}
  /* valid in CSS 2.1: the 2 identifiers (\inherit foo) form a font-family name */

  div#sixthTest {font-family: \foo inherit, "CSSTest Fallback";}
  /* valid in CSS 2.1: the 2 identifiers (\foo inherit) form a font-family name */

  div#seventhTest {font-family: "inherit" foo, "CSSTest Fallback";}
  /* invalid: it's either one string or 1+ identifiers */

  div#eighthTest {font-family: fooinherit, "CSSTest Fallback";}
  /* valid */

  div#ninthTest {font-family: inheritfoo, "CSSTest Fallback";}
  /* valid */

  div#tenthTest {font-family: --foo bar, "CSSTest Fallback";}
  /* invalid: an identifier can not start with 2 consecutive hyphens
  http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  */

  div#eleventhTest {font-family: bar --foo, "CSSTest Fallback";}
  /* invalid: an identifier can not start with 2 consecutive hyphens
  http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  */

  ]]></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 eleven "PASS" words below:</p>

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

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

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

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

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

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

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

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

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

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

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

 </body>
</html>