OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2110 | 2110 |
2111 this._expandElement = document.createElement("span"); | 2111 this._expandElement = document.createElement("span"); |
2112 this._expandElement.className = "expand-element"; | 2112 this._expandElement.className = "expand-element"; |
2113 | 2113 |
2114 var valueElement = document.createElement("span"); | 2114 var valueElement = document.createElement("span"); |
2115 valueElement.className = "value"; | 2115 valueElement.className = "value"; |
2116 this.valueElement = valueElement; | 2116 this.valueElement = valueElement; |
2117 | 2117 |
2118 /** | 2118 /** |
2119 * @param {!RegExp} regex | 2119 * @param {!RegExp} regex |
| 2120 * @param {function(string):!Node} processor |
| 2121 * @param {?function(string):!Node} nextProcessor |
| 2122 * @param {string} valueText |
2120 * @return {!DocumentFragment} | 2123 * @return {!DocumentFragment} |
2121 */ | 2124 */ |
2122 function processValue(regex, processor, nextProcessor, valueText) | 2125 function processValue(regex, processor, nextProcessor, valueText) |
2123 { | 2126 { |
2124 var container = document.createDocumentFragment(); | 2127 var container = document.createDocumentFragment(); |
2125 | 2128 |
2126 var items = valueText.replace(regex, "\0$1\0").split("\0"); | 2129 var items = valueText.replace(regex, "\0$1\0").split("\0"); |
2127 for (var i = 0; i < items.length; ++i) { | 2130 for (var i = 0; i < items.length; ++i) { |
2128 if ((i % 2) === 0) { | 2131 if ((i % 2) === 0) { |
2129 if (nextProcessor) | 2132 if (nextProcessor) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2202 _updateFilter: function() | 2205 _updateFilter: function() |
2203 { | 2206 { |
2204 var regEx = this.parentPane().filterRegex(); | 2207 var regEx = this.parentPane().filterRegex(); |
2205 this.listItemElement.classList.toggle("filter-match", !!regEx && (regEx.
test(this.property.name) || regEx.test(this.property.value))); | 2208 this.listItemElement.classList.toggle("filter-match", !!regEx && (regEx.
test(this.property.name) || regEx.test(this.property.value))); |
2206 }, | 2209 }, |
2207 | 2210 |
2208 /** | 2211 /** |
2209 * @param {!Element} nameElement | 2212 * @param {!Element} nameElement |
2210 * @param {!Element} valueElement | 2213 * @param {!Element} valueElement |
2211 * @param {string} text | 2214 * @param {string} text |
| 2215 * @return {!Node} |
2212 */ | 2216 */ |
2213 _processColor: function(nameElement, valueElement, text) | 2217 _processColor: function(nameElement, valueElement, text) |
2214 { | 2218 { |
2215 var color = WebInspector.Color.parse(text); | 2219 var color = WebInspector.Color.parse(text); |
2216 | 2220 |
2217 // We can be called with valid non-color values of |text| (like 'none' f
rom border style) | 2221 // We can be called with valid non-color values of |text| (like 'none' f
rom border style) |
2218 if (!color) | 2222 if (!color) |
2219 return document.createTextNode(text); | 2223 return document.createTextNode(text); |
2220 | 2224 |
2221 var format = WebInspector.StylesSidebarPane._colorFormat(color); | 2225 var format = WebInspector.StylesSidebarPane._colorFormat(color); |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3313 return; | 3317 return; |
3314 } | 3318 } |
3315 | 3319 |
3316 var results = this._cssCompletions.startsWith(prefix); | 3320 var results = this._cssCompletions.startsWith(prefix); |
3317 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 3321 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
3318 completionsReadyCallback(results, selectedIndex); | 3322 completionsReadyCallback(results, selectedIndex); |
3319 }, | 3323 }, |
3320 | 3324 |
3321 __proto__: WebInspector.TextPrompt.prototype | 3325 __proto__: WebInspector.TextPrompt.prototype |
3322 } | 3326 } |
OLD | NEW |