quirk.css (3124B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 @namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */ 6 7 /* Quirk: make orphaned LIs have inside bullet (b=1049) */ 8 9 /* force inside position for orphaned lis */ 10 li { 11 list-style-position: inside; 12 } 13 14 /* restore outside position for lists inside LIs */ 15 li :is(dir, menu, ol, ul) { 16 list-style-position: outside; 17 } 18 19 /* undo previous two rules for properly nested lists */ 20 :is(dir, menu, ol, ul) :is(dir, menu, ol, ul, li) { 21 list-style-position: unset; 22 } 23 24 /* Quirk: ensure that we get proper padding if the very first 25 * node in an LI is another UL or OL. This is an ugly way to 26 * fix the problem, because it extends the LI up into what 27 * would otherwise appear to be the ULs space. (b=38832) */ 28 29 /* Note: this fix will fail once we implement marker box 30 * alignment correctly. */ 31 li > ul:-moz-first-node, 32 li > ol:-moz-first-node { 33 padding-block-start: 1em; 34 } 35 36 table { 37 text-align: start; 38 white-space: normal; /* compatible with IE & spec */ 39 line-height: normal; 40 41 /* Quirk: cut off all font inheritance in tables except for family. */ 42 font-size: initial; 43 font-weight: initial; 44 font-style: initial; 45 font-variant: initial; 46 } 47 48 /* Quirk: collapse top margin of BODY and TD and bottom margin of TD */ 49 50 /* 51 * While it may seem simpler to use :-moz-first-node and :-moz-last-node without 52 * tags, it's slower, since we have to do the :-moz-first-node or :-moz-last-node 53 * check on every single element in the document. If we list all the 54 * element names for which the UA stylesheet specifies a margin, the 55 * selectors will be hashed in the selector maps and things will be much more 56 * efficient. 57 */ 58 :is(body, td, th) > :is(p, dl, blockquote, h1, h2, h3, h4, h5, h6, listing, plaintext, xmp, pre, ul, menu, dir, ol):-moz-first-node { 59 margin-block-start: 0; 60 } 61 62 td > p:-moz-last-node, 63 th > p:-moz-last-node { 64 margin-block-end: 0; 65 } 66 67 /* Similar as above, but for empty elements 68 * collapse the bottom or top margins of empty elements 69 * - see bug 97361 70 */ 71 :is(body, td, th) > :is(p, dl, blockquote, h1, h2, h3, h4, h5, h6, listing, plaintext, xmp, pre, ul, menu, dir, ol):-moz-only-whitespace:-moz-first-node { 72 margin-block-end: 0; 73 } 74 75 :is(td, th) > :is(p, dl, blockquote, h1, h2, h3, h4, h5, h6, listing, plaintext, xmp, pre, ul, menu, dir, ol):-moz-only-whitespace:-moz-last-node { 76 margin-block-start: 0; 77 } 78 79 /* Quirk: Make floated images have a margin (b=58899) */ 80 img[align="left"] { 81 margin-right: 3px; 82 } 83 84 img[align="right"] { 85 margin-left: 3px; 86 } 87 88 /* 89 * Quirk: Use border-box box sizing for text inputs, password inputs, and 90 * textareas. (b=184478 on why we use content-box sizing in standards mode) 91 */ 92 93 /* Note that all other <input>s already use border-box 94 sizing, so we're ok with this selector */ 95 input:not([type="image"]), 96 textarea { 97 box-sizing: border-box; 98 } 99 100 /* Quirk: give form margin for compat (b=41806) */ 101 form { 102 margin-block-end: 1em; 103 }