2
* Copyright (C) 2011 Google Inc. All rights reserved.
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are
8
* * Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* * Redistributions in binary form must reproduce the above
11
* copyright notice, this list of conditions and the following disclaimer
12
* in the documentation and/or other materials provided with the
14
* * Neither the name of Google Inc. nor the names of its
15
* contributors may be used to endorse or promote products derived from
16
* this software without specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
WebInspector.CSSKeywordCompletions = {}
33
WebInspector.CSSKeywordCompletions.forProperty = function(propertyName)
35
var acceptedKeywords = ["initial"];
36
if (propertyName in WebInspector.CSSKeywordCompletions._propertyKeywordMap)
37
acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap[propertyName]);
38
if (propertyName in WebInspector.CSSKeywordCompletions._colorAwareProperties)
39
acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
40
if (propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties)
41
acceptedKeywords.push("inherit");
42
return new WebInspector.CSSCompletions(acceptedKeywords);
45
WebInspector.CSSKeywordCompletions.isColorAwareProperty = function(propertyName)
47
return WebInspector.CSSKeywordCompletions._colorAwareProperties[propertyName] === true;
50
WebInspector.CSSKeywordCompletions.colors = function()
52
if (!WebInspector.CSSKeywordCompletions._colorsKeySet)
53
WebInspector.CSSKeywordCompletions._colorsKeySet = WebInspector.CSSKeywordCompletions._colors.keySet();
54
return WebInspector.CSSKeywordCompletions._colorsKeySet;
57
// Taken from http://www.w3.org/TR/CSS21/propidx.html.
58
WebInspector.CSSKeywordCompletions.InheritedProperties = [
59
"azimuth", "border-collapse", "border-spacing", "caption-side", "color", "cursor", "direction", "elevation",
60
"empty-cells", "font-family", "font-size", "font-style", "font-variant", "font-weight", "font", "letter-spacing",
61
"line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "orphans", "pitch-range",
62
"pitch", "quotes", "richness", "speak-header", "speak-numeral", "speak-punctuation", "speak", "speech-rate", "stress",
63
"text-align", "text-indent", "text-transform", "text-shadow", "visibility", "voice-family", "volume", "white-space", "widows", "word-spacing"
66
WebInspector.CSSKeywordCompletions._colors = [
67
"aqua", "black", "blue", "fuchsia", "gray", "green", "lime", "maroon", "navy", "olive", "orange", "purple", "red",
68
"silver", "teal", "white", "yellow", "transparent", "currentcolor", "grey", "aliceblue", "antiquewhite",
69
"aquamarine", "azure", "beige", "bisque", "blanchedalmond", "blueviolet", "brown", "burlywood", "cadetblue",
70
"chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan",
71
"darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange",
72
"darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey",
73
"darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
74
"floralwhite", "forestgreen", "gainsboro", "ghostwhite", "gold", "goldenrod", "greenyellow", "honeydew", "hotpink",
75
"indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue",
76
"lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
77
"lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow",
78
"limegreen", "linen", "magenta", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen",
79
"mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
80
"mistyrose", "moccasin", "navajowhite", "oldlace", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen",
81
"paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "rosybrown",
82
"royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue",
83
"slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistle", "tomato", "turquoise", "violet",
84
"wheat", "whitesmoke", "yellowgreen"
87
WebInspector.CSSKeywordCompletions._colorAwareProperties = [
88
"background", "background-color", "background-image", "border", "border-color", "border-top", "border-right", "border-bottom",
89
"border-left", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color", "box-shadow", "color",
90
"fill", "outline", "outline-color", "stroke", "text-line-through", "text-line-through-color", "text-overline", "text-overline-color",
91
"text-shadow", "text-underline", "text-underline-color", "-webkit-box-shadow", "-webkit-text-emphasis", "-webkit-text-emphasis-color"
94
WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
99
"hidden", "visible", "collapse"
101
"background-repeat": [
102
"repeat", "repeat-x", "repeat-y", "no-repeat", "space", "round"
105
"none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
108
"list-item", "close-quote", "no-close-quote", "no-open-quote", "open-quote"
110
"list-style-image": [
114
"none", "left", "right", "both"
116
"text-underline-mode": [
117
"continuous", "skip-white-space"
120
"hidden", "auto", "visible", "overlay", "scroll"
123
"round", "miter", "bevel"
126
"baseline", "sub", "super"
128
"border-bottom-width": [
129
"medium", "thick", "thin"
132
"normal", "slow", "fast"
134
"margin-top-collapse": [
135
"collapse", "separate", "discard"
141
"horizontal", "vertical", "inline-axis", "block-axis"
144
"normal", "wider", "narrower", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed",
145
"semi-expanded", "expanded", "extra-expanded", "ultra-expanded"
147
"-webkit-color-correction": [
150
"text-underline-style": [
151
"none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
153
"text-overline-mode": [
154
"continuous", "skip-white-space"
156
"-webkit-background-composite": [
157
"highlight", "clear", "copy", "source-over", "source-in", "source-out", "source-atop", "destination-over",
158
"destination-in", "destination-out", "destination-atop", "xor", "plus-darker", "plus-lighter"
160
"border-left-width": [
161
"medium", "thick", "thin"
163
"-webkit-writing-mode": [
164
"lr", "rl", "tb", "lr-tb", "rl-tb", "tb-rl", "horizontal-tb", "vertical-rl", "vertical-lr", "horizontal-bt"
166
"text-line-through-mode": [
167
"continuous", "skip-white-space"
170
"collapse", "separate"
172
"page-break-inside": [
175
"border-top-width": [
176
"medium", "thick", "thin"
181
"text-line-through-style": [
182
"none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
185
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
188
"none", "copy", "auto", "crosshair", "default", "pointer", "move", "vertical-text", "cell", "context-menu",
189
"alias", "progress", "no-drop", "not-allowed", "-webkit-zoom-in", "-webkit-zoom-out", "e-resize", "ne-resize",
190
"nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "ew-resize", "ns-resize",
191
"nesw-resize", "nwse-resize", "col-resize", "row-resize", "text", "wait", "help", "all-scroll", "-webkit-grab",
195
"medium", "thick", "thin"
198
"a3", "a4", "a5", "b4", "b5", "landscape", "ledger", "legal", "letter", "portrait"
206
"marquee-direction": [
207
"left", "right", "auto", "reverse", "forwards", "backwards", "ahead", "up", "down"
209
"enable-background": [
213
"none", "left", "right"
216
"hidden", "auto", "visible", "overlay", "scroll"
218
"margin-bottom-collapse": [
219
"collapse", "separate", "discard"
222
"left", "right", "above", "below"
225
"hidden", "auto", "visible", "overlay", "scroll"
228
"auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"
231
"-webkit-auto", "left", "right", "center", "justify", "-webkit-left", "-webkit-right", "-webkit-center"
233
"list-style-position": [
239
"color-interpolation": [
242
"background-origin": [
243
"border-box", "content-box", "padding-box"
246
"normal", "break-word"
249
"normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"
251
"margin-before-collapse": [
252
"collapse", "separate", "discard"
254
"text-overline-width": [
255
"normal", "medium", "auto", "thick", "thin"
258
"none", "capitalize", "uppercase", "lowercase"
260
"border-right-style": [
261
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
263
"border-left-style": [
264
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
266
"-webkit-text-emphasis": [
267
"circle", "filled", "open", "dot", "double-circle", "triangle", "sesame"
270
"italic", "oblique", "normal"
273
"none", "normal", "spell-out", "digits", "literal-punctuation", "no-punctuation"
275
"text-line-through": [
276
"none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave", "continuous",
280
"auto", "optimizeSpeed", "optimizeQuality"
283
"none", "disc", "circle", "square", "decimal", "decimal-leading-zero", "arabic-indic", "binary", "bengali",
284
"cambodian", "khmer", "devanagari", "gujarati", "gurmukhi", "kannada", "lower-hexadecimal", "lao", "malayalam",
285
"mongolian", "myanmar", "octal", "oriya", "persian", "urdu", "telugu", "tibetan", "thai", "upper-hexadecimal",
286
"lower-roman", "upper-roman", "lower-greek", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "afar",
287
"ethiopic-halehame-aa-et", "ethiopic-halehame-aa-er", "amharic", "ethiopic-halehame-am-et", "amharic-abegede",
288
"ethiopic-abegede-am-et", "cjk-earthly-branch", "cjk-heavenly-stem", "ethiopic", "ethiopic-halehame-gez",
289
"ethiopic-abegede", "ethiopic-abegede-gez", "hangul-consonant", "hangul", "lower-norwegian", "oromo",
290
"ethiopic-halehame-om-et", "sidama", "ethiopic-halehame-sid-et", "somali", "ethiopic-halehame-so-et", "tigre",
291
"ethiopic-halehame-tig", "tigrinya-er", "ethiopic-halehame-ti-er", "tigrinya-er-abegede",
292
"ethiopic-abegede-ti-er", "tigrinya-et", "ethiopic-halehame-ti-et", "tigrinya-et-abegede",
293
"ethiopic-abegede-ti-et", "upper-greek", "upper-norwegian", "asterisks", "footnotes", "hebrew", "armenian",
294
"lower-armenian", "upper-armenian", "georgian", "cjk-ideographic", "hiragana", "katakana", "hiragana-iroha",
297
"-webkit-text-combine": [
301
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
304
"caption", "icon", "menu", "message-box", "small-caption", "-webkit-mini-control", "-webkit-small-control",
305
"-webkit-control", "status-bar", "italic", "oblique", "small-caps", "normal", "bold", "bolder", "lighter",
306
"100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium",
307
"large", "x-large", "xx-large", "-webkit-xxx-large", "smaller", "larger", "serif", "sans-serif", "cursive",
308
"fantasy", "monospace", "-webkit-body", "-webkit-pictograph"
310
"dominant-baseline": [
311
"middle", "auto", "central", "text-before-edge", "text-after-edge", "ideographic", "alphabetic", "hanging",
312
"mathematical", "use-script", "no-change", "reset-size"
315
"none", "inline", "block", "list-item", "run-in", "compact", "inline-block", "table", "inline-table",
316
"table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group",
317
"table-column", "table-cell", "table-caption", "-webkit-box", "-webkit-inline-box", "-wap-marquee"
319
"-webkit-text-emphasis-position": [
323
"auto", "optimizeSpeed", "optimizeQuality"
325
"alignment-baseline": [
326
"baseline", "middle", "auto", "before-edge", "after-edge", "central", "text-before-edge", "text-after-edge",
327
"ideographic", "alphabetic", "hanging", "mathematical"
330
"medium", "thick", "thin"
332
"text-line-through-width": [
333
"normal", "medium", "auto", "thick", "thin"
336
"baseline", "center", "stretch", "start", "end"
338
"border-right-width": [
339
"medium", "thick", "thin"
341
"border-top-style": [
342
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
353
"margin-after-collapse": [
354
"collapse", "separate", "discard"
356
"page-break-before": [
357
"left", "right", "auto", "always", "avoid"
360
"none", "auto", "manual"
366
"blink", "line-through", "overline", "underline"
369
"absolute", "fixed", "relative", "static"
372
"serif", "sans-serif", "cursive", "fantasy", "monospace", "-webkit-body", "-webkit-pictograph"
374
"text-overflow-mode": [
377
"border-bottom-style": [
378
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
381
"normal", "bidi-override", "embed"
395
"text-overline-style": [
396
"none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
405
"none", "all", "auto", "visible", "visiblepainted", "visiblefill", "visiblestroke", "painted", "fill", "stroke"
411
"border-box", "content-box", "padding-box"
413
"-webkit-font-smoothing": [
414
"none", "auto", "antialiased", "subpixel-antialiased"
417
"none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
420
"xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "-webkit-xxx-large", "smaller",
424
"small-caps", "normal"
427
"baseline", "middle", "sub", "super", "text-top", "text-bottom", "top", "bottom", "-webkit-baseline-middle"
430
"none", "scroll", "slide", "alternate"
433
"normal", "nowrap", "pre", "pre-line", "pre-wrap"
435
"text-underline-width": [
436
"normal", "medium", "auto", "thick", "thin"
441
"page-break-after": [
442
"left", "right", "auto", "always", "avoid"
450
"marquee-repetition": [
456
"-webkit-text-emphasis-style": [
457
"circle", "filled", "open", "dot", "double-circle", "triangle", "sesame"
459
"-webkit-transform": [
460
"scale", "scaleX", "scaleY", "scale3d", "rotate", "rotateX", "rotateY", "rotateZ", "rotate3d", "skew", "skewX", "skewY",
461
"translate", "translateX", "translateY", "translateZ", "translate3d", "matrix", "matrix3d", "perspective"