Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: Source/devtools/front_end/sdk/CSSMetadata.js

Issue 343343003: DevTools: [Styles] Add "px" suffix to numbers on arrow up/down (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nikita Vasilyev. All rights reserved. 2 * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
3 * Copyright (C) 2010 Joseph Pecoraro. All rights reserved. 3 * Copyright (C) 2010 Joseph Pecoraro. All rights reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 /** 82 /**
83 * @return {!Object.<string, boolean>} 83 * @return {!Object.<string, boolean>}
84 */ 84 */
85 WebInspector.CSSMetadata.colors = function() 85 WebInspector.CSSMetadata.colors = function()
86 { 86 {
87 if (!WebInspector.CSSMetadata._colorsKeySet) 87 if (!WebInspector.CSSMetadata._colorsKeySet)
88 WebInspector.CSSMetadata._colorsKeySet = WebInspector.CSSMetadata._color s.keySet(); 88 WebInspector.CSSMetadata._colorsKeySet = WebInspector.CSSMetadata._color s.keySet();
89 return WebInspector.CSSMetadata._colorsKeySet; 89 return WebInspector.CSSMetadata._colorsKeySet;
90 } 90 }
91 91
92 /**
93 * @param {string} propertyName
94 * @return {boolean}
95 */
96 WebInspector.CSSMetadata.isLengthProperty = function(propertyName)
97 {
98 if (!WebInspector.CSSMetadata._distancePropertiesKeySet)
99 WebInspector.CSSMetadata._distancePropertiesKeySet = WebInspector.CSSMet adata._distanceProperties.keySet();
100 return WebInspector.CSSMetadata._distancePropertiesKeySet[propertyName] || p ropertyName.startsWith("margin") || propertyName.startsWith("padding") || proper tyName.indexOf("width") !== -1 || propertyName.indexOf("height") !== -1;
101 }
102
92 // Taken from http://www.w3.org/TR/CSS21/propidx.html. 103 // Taken from http://www.w3.org/TR/CSS21/propidx.html.
93 WebInspector.CSSMetadata.InheritedProperties = [ 104 WebInspector.CSSMetadata.InheritedProperties = [
94 "azimuth", "border-collapse", "border-spacing", "caption-side", "color", "cu rsor", "direction", "elevation", 105 "azimuth", "border-collapse", "border-spacing", "caption-side", "color", "cu rsor", "direction", "elevation",
95 "empty-cells", "font-family", "font-size", "font-style", "font-variant", "fo nt-weight", "font", "letter-spacing", 106 "empty-cells", "font-family", "font-size", "font-style", "font-variant", "fo nt-weight", "font", "letter-spacing",
96 "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "orphans", "pitch-range", 107 "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "orphans", "pitch-range",
97 "pitch", "quotes", "resize", "richness", "speak-header", "speak-numeral", "s peak-punctuation", "speak", "speech-rate", "stress", 108 "pitch", "quotes", "resize", "richness", "speak-header", "speak-numeral", "s peak-punctuation", "speak", "speech-rate", "stress",
98 "text-align", "text-indent", "text-transform", "text-shadow", "visibility", "voice-family", "volume", "white-space", "widows", 109 "text-align", "text-indent", "text-transform", "text-shadow", "visibility", "voice-family", "volume", "white-space", "widows",
99 "word-spacing", "zoom" 110 "word-spacing", "zoom"
100 ].keySet(); 111 ].keySet();
101 112
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslat egrey", "lightsteelblue", "lightyellow", 155 "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslat egrey", "lightsteelblue", "lightyellow",
145 "limegreen", "linen", "magenta", "mediumaquamarine", "mediumblue", "mediumor chid", "mediumpurple", "mediumseagreen", 156 "limegreen", "linen", "magenta", "mediumaquamarine", "mediumblue", "mediumor chid", "mediumpurple", "mediumseagreen",
146 "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred" , "midnightblue", "mintcream", 157 "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred" , "midnightblue", "mintcream",
147 "mistyrose", "moccasin", "navajowhite", "oldlace", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen", 158 "mistyrose", "moccasin", "navajowhite", "oldlace", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen",
148 "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "rosybrown", 159 "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "rosybrown",
149 "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue", 160 "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue",
150 "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistl e", "tomato", "turquoise", "violet", 161 "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistl e", "tomato", "turquoise", "violet",
151 "wheat", "whitesmoke", "yellowgreen" 162 "wheat", "whitesmoke", "yellowgreen"
152 ]; 163 ];
153 164
165 WebInspector.CSSMetadata._distanceProperties = [
166 'background-position', 'border-spacing', 'bottom', 'font-size', 'height', 'l eft', 'letter-spacing', 'line-height', 'max-height', 'max-width', 'min-height',
167 'min-width', 'right', 'text-indent', 'top', 'width', 'word-spacing'
168 ];
169
154 WebInspector.CSSMetadata._colorAwareProperties = [ 170 WebInspector.CSSMetadata._colorAwareProperties = [
155 "background", "background-color", "background-image", "border", "border-colo r", "border-top", "border-right", "border-bottom", 171 "background", "background-color", "background-image", "border", "border-colo r", "border-top", "border-right", "border-bottom",
156 "border-left", "border-top-color", "border-right-color", "border-bottom-colo r", "border-left-color", "box-shadow", "color", 172 "border-left", "border-top-color", "border-right-color", "border-bottom-colo r", "border-left-color", "box-shadow", "color",
157 "fill", "outline", "outline-color", "stroke", "text-line-through-color", "te xt-overline-color", 173 "fill", "outline", "outline-color", "stroke", "text-line-through-color", "te xt-overline-color",
158 "text-shadow", "text-underline-color", "-webkit-box-shadow", "-webkit-column -rule-color", 174 "text-shadow", "text-underline-color", "-webkit-box-shadow", "-webkit-column -rule-color",
159 "-webkit-text-decoration-color", "-webkit-text-emphasis", "-webkit-text-emph asis-color" 175 "-webkit-text-decoration-color", "-webkit-text-emphasis", "-webkit-text-emph asis-color"
160 ].keySet(); 176 ].keySet();
161 177
162 WebInspector.CSSMetadata._propertyDataMap = { 178 WebInspector.CSSMetadata._propertyDataMap = {
163 "table-layout": { values: [ 179 "table-layout": { values: [
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 * @param {string} longhand 1020 * @param {string} longhand
1005 * @return {?Array.<string>} 1021 * @return {?Array.<string>}
1006 */ 1022 */
1007 shorthands: function(longhand) 1023 shorthands: function(longhand)
1008 { 1024 {
1009 return this._shorthands[longhand]; 1025 return this._shorthands[longhand];
1010 } 1026 }
1011 } 1027 }
1012 1028
1013 WebInspector.CSSMetadata.initializeWithSupportedProperties([]); 1029 WebInspector.CSSMetadata.initializeWithSupportedProperties([]);
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698