summaryrefslogtreecommitdiffstats
path: root/layout/style/res/quirk.css
blob: ba9e6d4acee9762f08a870da8366ed800dded434 (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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */


/* Quirk: make orphaned LIs have inside bullet (b=1049) */

/* force inside position for orphaned lis */
li {
  list-style-position: inside;
}

/* restore outside position for lists inside LIs */
li ul, li ol, li dir, li menu {
  list-style-position: outside;
}

/* undo previous two rules for properly nested lists */
  ul ul,   ul ol,   ul dir,   ul menu,   ul li,
  ol ul,   ol ol,   ol dir,   ol menu,   ol li,
 dir ul,  dir ol,  dir dir,  dir menu,  dir li,
menu ul, menu ol, menu dir, menu menu, menu li {
  list-style-position: inherit;
}


/* Quirk: ensure that we get proper padding if the very first
 * node in an LI is another UL or OL. This is an ugly way to
 * fix the problem, because it extends the LI up into what
 * would otherwise appear to be the ULs space. (b=38832) */

/* Note: this fix will fail once we implement marker box
 * alignment correctly. */
li > ul:-moz-first-node,
li > ol:-moz-first-node {
  padding-block-start: 1em;
}


table {
  text-align: start;
  white-space: normal; /* compatible with IE & spec */
  line-height: normal;

  /* Quirk: cut off all font inheritance in tables except for family. */
  font-size: initial;
  font-weight: initial;
  font-style: initial;
  font-variant: initial;
}

/*
 * Make table borders gray for compatibility with what other browsers do
 * in all modes, rather than using the foreground color.
 */
table, td, th, tr, thead, tbody, tfoot, colgroup, col {
  border-color: gray;
}


/* Quirk: collapse top margin of BODY and TD and bottom margin of TD */

/*
 * While it may seem simpler to use :-moz-first-node and :-moz-last-node without
 * tags, it's slower, since we have to do the :-moz-first-node or :-moz-last-node
 * check on every single element in the document.  If we list all the
 * element names for which the UA stylesheet specifies a margin, the
 * selectors will be hashed in the RuleHash and things will be much more
 * efficient.
 */
body > p:-moz-first-node, td > p:-moz-first-node, th > p:-moz-first-node,
body > dl:-moz-first-node, td > dl:-moz-first-node, th > dl:-moz-first-node,
body > multicol:-moz-first-node, td > multicol:-moz-first-node, th > multicol:-moz-first-node,
body > blockquote:-moz-first-node, td > blockquote:-moz-first-node, th > blockquote:-moz-first-node,
body > h1:-moz-first-node, td > h1:-moz-first-node, th > h1:-moz-first-node,
body > h2:-moz-first-node, td > h2:-moz-first-node, th > h2:-moz-first-node,
body > h3:-moz-first-node, td > h3:-moz-first-node, th > h3:-moz-first-node,
body > h4:-moz-first-node, td > h4:-moz-first-node, th > h4:-moz-first-node,
body > h5:-moz-first-node, td > h5:-moz-first-node, th > h5:-moz-first-node,
body > h6:-moz-first-node, td > h6:-moz-first-node, th > h6:-moz-first-node,
body > listing:-moz-first-node, td > listing:-moz-first-node, th > listing:-moz-first-node,
body > plaintext:-moz-first-node, td > plaintext:-moz-first-node, th > plaintext:-moz-first-node,
body > xmp:-moz-first-node, td > xmp:-moz-first-node, th > xmp:-moz-first-node,
body > pre:-moz-first-node, td > pre:-moz-first-node, th > pre:-moz-first-node,
body > ul:-moz-first-node, td > ul:-moz-first-node, th > ul:-moz-first-node,
body > menu:-moz-first-node, td > menu:-moz-first-node, th > menu:-moz-first-node,
body > dir:-moz-first-node, td > dir:-moz-first-node, th > dir:-moz-first-node,
body > ol:-moz-first-node, td > ol:-moz-first-node, th > ol:-moz-first-node {
  margin-block-start: 0;
}

td > p:-moz-last-node, th > p:-moz-last-node {
  margin-block-end: 0;
}

/* Similar as above, but for empty elements
 *  collapse the bottom or top margins of empty elements
 *  - see bug 97361
 */
body > p:-moz-only-whitespace:-moz-first-node,
td > p:-moz-only-whitespace:-moz-first-node, th > p:-moz-only-whitespace:-moz-first-node,
body > dl:-moz-only-whitespace:-moz-first-node, td > dl:-moz-only-whitespace:-moz-first-node,
th > dl:-moz-only-whitespace:-moz-first-node, body > multicol:-moz-only-whitespace:-moz-first-node,
td > multicol:-moz-only-whitespace:-moz-first-node, th > multicol:-moz-only-whitespace:-moz-first-node,
body > blockquote:-moz-only-whitespace:-moz-first-node, td > blockquote:-moz-only-whitespace:-moz-first-node,
th > blockquote:-moz-only-whitespace:-moz-first-node, body > h1:-moz-only-whitespace:-moz-first-node,
td > h1:-moz-only-whitespace:-moz-first-node, th > h1:-moz-only-whitespace:-moz-first-node,
body > h2:-moz-only-whitespace:-moz-first-node, td > h2:-moz-only-whitespace:-moz-first-node,
th > h2:-moz-only-whitespace:-moz-first-node, body > h3:-moz-only-whitespace:-moz-first-node,
td > h3:-moz-only-whitespace:-moz-first-node, th > h3:-moz-only-whitespace:-moz-first-node,
body > h4:-moz-only-whitespace:-moz-first-node, td > h4:-moz-only-whitespace:-moz-first-node,
th > h4:-moz-only-whitespace:-moz-first-node, body > h5:-moz-only-whitespace:-moz-first-node,
td > h5:-moz-only-whitespace:-moz-first-node, th > h5:-moz-only-whitespace:-moz-first-node,
body > h6:-moz-only-whitespace:-moz-first-node, td > h6:-moz-only-whitespace:-moz-first-node,
th > h6:-moz-only-whitespace:-moz-first-node, body > listing:-moz-only-whitespace:-moz-first-node,
td > listing:-moz-only-whitespace:-moz-first-node, th > listing:-moz-only-whitespace:-moz-first-node,
body > plaintext:-moz-only-whitespace:-moz-first-node, td > plaintext:-moz-only-whitespace:-moz-first-node,
th > plaintext:-moz-only-whitespace:-moz-first-node, body > xmp:-moz-only-whitespace:-moz-first-node,
td > xmp:-moz-only-whitespace:-moz-first-node, th > xmp:-moz-only-whitespace:-moz-first-node,
body > pre:-moz-only-whitespace:-moz-first-node, td > pre:-moz-only-whitespace:-moz-first-node,
th > pre:-moz-only-whitespace:-moz-first-node, body > ul:-moz-only-whitespace:-moz-first-node,
td > ul:-moz-only-whitespace:-moz-first-node, th > ul:-moz-only-whitespace:-moz-first-node,
body > menu:-moz-only-whitespace:-moz-first-node, td > menu:-moz-only-whitespace:-moz-first-node,
th > menu:-moz-only-whitespace:-moz-first-node, body > dir:-moz-only-whitespace:-moz-first-node,
td > dir:-moz-only-whitespace:-moz-first-node, th > dir:-moz-only-whitespace:-moz-first-node,
body > ol:-moz-only-whitespace:-moz-first-node, td > ol:-moz-only-whitespace:-moz-first-node,
th > ol:-moz-only-whitespace:-moz-first-node {
  margin-block-end: 0;
}

td > p:-moz-only-whitespace:-moz-last-node, th > p:-moz-only-whitespace:-moz-last-node,
td > dl:-moz-only-whitespace:-moz-last-node, th > dl:-moz-only-whitespace:-moz-last-node,
td > multicol:-moz-only-whitespace:-moz-last-node, th > multicol:-moz-only-whitespace:-moz-last-node,
td > blockquote:-moz-only-whitespace:-moz-last-node, th > blockquote:-moz-only-whitespace:-moz-last-node,
td > h1:-moz-only-whitespace:-moz-last-node, th > h1:-moz-only-whitespace:-moz-last-node,
td > h2:-moz-only-whitespace:-moz-last-node, th > h2:-moz-only-whitespace:-moz-last-node,
td > h3:-moz-only-whitespace:-moz-last-node, th > h3:-moz-only-whitespace:-moz-last-node,
td > h4:-moz-only-whitespace:-moz-last-node, th > h4:-moz-only-whitespace:-moz-last-node,
td > h5:-moz-only-whitespace:-moz-last-node, th > h5:-moz-only-whitespace:-moz-last-node,
td > h6:-moz-only-whitespace:-moz-last-node, th > h6:-moz-only-whitespace:-moz-last-node,
td > listing:-moz-only-whitespace:-moz-last-node, th > listing:-moz-only-whitespace:-moz-last-node,
td > plaintext:-moz-only-whitespace:-moz-last-node, th > plaintext:-moz-only-whitespace:-moz-last-node,
td > xmp:-moz-only-whitespace:-moz-last-node, th > xmp:-moz-only-whitespace:-moz-last-node,
td > pre:-moz-only-whitespace:-moz-last-node, th > pre:-moz-only-whitespace:-moz-last-node,
td > ul:-moz-only-whitespace:-moz-last-node, th > ul:-moz-only-whitespace:-moz-last-node,
td > menu:-moz-only-whitespace:-moz-last-node, th > menu:-moz-only-whitespace:-moz-last-node,
td > dir:-moz-only-whitespace:-moz-last-node, th > dir:-moz-only-whitespace:-moz-last-node,
td > ol:-moz-only-whitespace:-moz-last-node, th > ol:-moz-only-whitespace:-moz-last-node {
  margin-block-start: 0;
}


/* Quirk: DD not in DL has text-indent instead of margin (b=5119) */

:not(dl) > dd {
  display: inline;
  margin: 0;
}

:not(dl) > dd:before {
  display: inline;
  white-space: pre;
  font-size: 1px;
  line-height: 0;
  content: "\A  ";
  margin-inline-end: 40px;
}


/* quirk to indent nested DL elements (b=8749) */

dl > dl {
  display: block;
  margin-inline-start: 40px;
}


/* Quirk: Make floated images have a margin  (b=58899) */
img[align=left]:dir(ltr), img[align=right]:dir(rtl) {
  margin-inline-end: 3px;
}

img[align=right]:dir(ltr), img[align=left]:dir(rtl) {
  margin-inline-start: 3px;
}

/*
 * Quirk: Use border-box box sizing for text inputs, password inputs, and
 * textareas.  (b=184478 on why we use content-box sizing in standards mode)
 */

/* Note that all other <input>s already use border-box
   sizing, so we're ok with this selector */
input:not([type=image]), textarea {
  box-sizing: border-box;
}

/* Quirk: give form margin for compat (b=41806) */
form {
  margin-block-end: 1em;
}