descriptor_database.js (3596B)
1 /* -*- tab-width: 4; indent-tabs-mode: nil; js-indent-level: 4 -*- */ 2 /* vim: set shiftwidth=4 tabstop=4 autoindent cindent noexpandtab: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 // Each property has the following fields: 8 // domProp: The name of the relevant member of CSSStyleProperties 9 // values: Strings that are values for the descriptor and should be accepted. 10 // invalid_values: Things that are not values for the descriptor and 11 // should be rejected. 12 13 var gCSSFontFaceDescriptors = { 14 "font-family": { 15 domProp: "fontFamily", 16 values: [ 17 '"serif"', 18 '"cursive"', 19 "seriff", 20 "Times New Roman", 21 "TimesRoman", 22 '"Times New Roman"', 23 ], 24 /* not clear that the generics are really invalid */ 25 invalid_values: [ 26 "sans-serif", 27 "Times New Roman, serif", 28 "'Times New Roman', serif", 29 "cursive", 30 "fantasy", 31 "Times )", 32 "Times !", 33 "Times ! foo", 34 "Times ! important", 35 ], 36 }, 37 "font-stretch": { 38 domProp: "fontStretch", 39 values: [ 40 "normal", 41 "ultra-condensed", 42 "extra-condensed", 43 "condensed", 44 "semi-condensed", 45 "semi-expanded", 46 "expanded", 47 "extra-expanded", 48 "ultra-expanded", 49 ], 50 invalid_values: ["wider", "narrower", "normal ! important", "normal )"], 51 }, 52 "font-style": { 53 domProp: "fontStyle", 54 values: ["normal", "italic", "oblique"], 55 invalid_values: [], 56 }, 57 "font-weight": { 58 domProp: "fontWeight", 59 values: [ 60 "normal", 61 "400", 62 "bold", 63 "100", 64 "200", 65 "300", 66 "500", 67 "600", 68 "700", 69 "800", 70 "900", 71 "107", 72 "399", 73 "401", 74 "699", 75 "710", 76 "calc(1001)", 77 "calc(100 + 1)", 78 "calc(1)", 79 "100.6", 80 "99", 81 "700 900", 82 "300.4 500.4", 83 "calc(200.4) calc(400.4)", 84 ], 85 invalid_values: ["bolder", "lighter", "1001", "0", "0 100", "100 1001"], 86 }, 87 src: { 88 domProp: null, 89 values: [ 90 "url(404.ttf)", 91 'url("404.eot")', 92 "url('404.otf')", 93 'url(404.ttf) format("truetype")', 94 "local(Times New Roman)", 95 "local('Times New Roman')", 96 'local("Times New Roman")', 97 'local("serif")', 98 "url(404.ttf) format(truetype)", 99 'url(404.ttf) format("truetype", "opentype"), url(\'404.eot\')', 100 'url(404.ttf) format("truetype", "unknown"), local(Times New Roman), url(\'404.eot\')', 101 ], 102 invalid_values: [ 103 'url(404.ttf) format("truetype" "opentype")', 104 'url(404.ttf) format("truetype",)', 105 'local("Times New" Roman)', 106 "local(serif)" /* is this valid? */, 107 "url(404.ttf) )", 108 "url(404.ttf) ) foo", 109 "url(404.ttf) ! important", 110 "url(404.ttf) ! hello", 111 'url(404.ttf) format("truetype", "opentype")', 112 ], 113 }, 114 "unicode-range": { 115 domProp: null, 116 values: [ 117 "U+0-10FFFF", 118 "U+3-7B3", 119 "U+3??", 120 "U+6A", 121 "U+3????", 122 "U+???", 123 "U+302-302", 124 "U+0-7,U+A-C", 125 "U+3??, U+500-513 ,U+612 , U+4????", 126 "U+1FFF,U+200-27F", 127 ], 128 invalid_values: [ 129 "U+1????-2????", 130 "U+0-7,A-C", 131 "U+100-17F,U+200-17F", 132 "U+100-17F,200-27F", 133 "U+6A!important", 134 "U+6A)", 135 ], 136 }, 137 "font-display": { 138 domProp: null, 139 values: ["auto", "block", "swap", "fallback", "optional"], 140 invalid_values: ["normal", "initial"], 141 }, 142 };