1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/test/descriptor_database.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,63 @@ 1.4 +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 1.5 +/* vim: set shiftwidth=4 tabstop=4 autoindent cindent noexpandtab: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +// Each property has the following fields: 1.11 +// domProp: The name of the relevant member of nsIDOM[NS]CSS2Properties 1.12 +// values: Strings that are values for the descriptor and should be accepted. 1.13 +// invalid_values: Things that are not values for the descriptor and 1.14 +// should be rejected. 1.15 + 1.16 +var gCSSFontFaceDescriptors = { 1.17 + "font-family": { 1.18 + domProp: "fontFamily", 1.19 + values: [ "\"serif\"", "\"cursive\"", "seriff", "Times New Roman", "TimesRoman", "\"Times New Roman\"" ], 1.20 + /* not clear that the generics are really invalid */ 1.21 + invalid_values: [ "sans-serif", "Times New Roman, serif", "'Times New Roman', serif", "cursive", "fantasy" ] 1.22 + }, 1.23 + "font-stretch": { 1.24 + domProp: "fontStretch", 1.25 + values: [ "normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded" ], 1.26 + invalid_values: [ "wider", "narrower" ] 1.27 + }, 1.28 + "font-style": { 1.29 + domProp: "fontStyle", 1.30 + values: [ "normal", "italic", "oblique" ], 1.31 + invalid_values: [] 1.32 + }, 1.33 + "font-weight": { 1.34 + domProp: "fontWeight", 1.35 + values: [ "normal", "400", "bold", "100", "200", "300", "500", "600", "700", "800", "900" ], 1.36 + invalid_values: [ "107", "399", "401", "699", "710", "bolder", "lighter" ] 1.37 + }, 1.38 + "src": { 1.39 + domProp: null, 1.40 + values: [ 1.41 + "url(404.ttf)", 1.42 + "url(\"404.eot\")", 1.43 + "url(\'404.otf\')", 1.44 + "url(404.ttf) format(\"truetype\")", 1.45 + "url(404.ttf) format(\"truetype\", \"opentype\")", 1.46 + "url(404.ttf) format(\"truetype\", \"opentype\"), url(\'404.eot\')", 1.47 + "local(Times New Roman)", 1.48 + "local(\'Times New Roman\')", 1.49 + "local(\"Times New Roman\")", 1.50 + "local(serif)", /* is this valid? */ 1.51 + "local(\"serif\")", 1.52 + "url(404.ttf) format(\"truetype\", \"unknown\"), local(Times New Roman), url(\'404.eot\')", 1.53 + ], 1.54 + invalid_values: [ 1.55 + "url(404.ttf) format(truetype)", 1.56 + "url(404.ttf) format(\"truetype\" \"opentype\")", 1.57 + "url(404.ttf) format(\"truetype\",)", 1.58 + "local(\"Times New\" Roman)", 1.59 + ] 1.60 + }, 1.61 + "unicode-range": { 1.62 + domProp: null, 1.63 + values: [ "U+0-10FFFF", "U+3-7B3", "U+3??", "U+6A", "U+3????", "U+???", "U+302-302", "U+0-7,U+A-C", "U+100-17F,U+200-17F", "U+3??, U+500-513 ,U+612 , U+4????", "U+1FFF,U+200-27F" ], 1.64 + invalid_values: [ "U+1????-2????", "U+0-7,A-C", "U+100-17F,200-17F" ] 1.65 + } 1.66 +}