Changeset 61506 in webkit
- Timestamp:
- Jun 20, 2010 10:02:12 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r61505 r61506 1 2010-06-20 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: Should Autocomplete Style Properties 6 https://bugs.webkit.org/show_bug.cgi?id=38448 7 8 This Autocompletes style properties when in the console. 9 10 * inspector/front-end/InjectedScript.js: 11 (injectedScriptConstructor): 12 1 13 2010-06-20 Robert Hogan <robert@webkit.org> 2 14 -
trunk/WebCore/inspector/front-end/InjectedScript.js
r61317 r61506 231 231 } 232 232 233 // Automatically generate the list of CSS properties, and convert 234 // them to their JavaScript accessible form. 235 InjectedScript._hiddenStyleProperties = (function() { 236 var properties = []; 237 238 var keywords = window.getComputedStyle(document.documentElement); 239 for (var i = 0, len = keywords.length; i < len; ++i) { 240 // Strip leading hyphen from "-vendor" properties. 241 var property = keywords[i]; 242 if (property.charAt(0) === "-") 243 property = property.substring(1); 244 245 // Turn hypens points into camel case points. 246 properties[i] = property.replace(/\-./g, function(match) { 247 return match.charAt(1).toUpperCase(); 248 }); 249 } 250 251 return properties; 252 })(); 253 254 InjectedScript._addHiddenStyleProperties = function(resultSet) 255 { 256 var hiddenStyleProperties = InjectedScript._hiddenStyleProperties; 257 for (var i = 0, length = hiddenStyleProperties.length; i < length; ++i) 258 resultSet[hiddenStyleProperties[i]] = true; 259 } 260 233 261 InjectedScript.getCompletions = function(expression, includeInspectorCommandLineAPI, callFrameId) 234 262 { … … 254 282 expressionResult = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false); 255 283 } 256 if (typeof expressionResult == "object") 284 285 if (typeof expressionResult === "object") { 257 286 InjectedScript._populatePropertyNames(expressionResult, props); 287 if (expressionResult.constructor === inspectedWindow.document.documentElement.style.constructor) 288 InjectedScript._addHiddenStyleProperties(props); 289 } 258 290 259 291 if (includeInspectorCommandLineAPI) {
Note: See TracChangeset
for help on using the changeset viewer.