| 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 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 _isValueSuggestion: function(word) | 2994 _isValueSuggestion: function(word) |
| 2995 { | 2995 { |
| 2996 if (!word) | 2996 if (!word) |
| 2997 return false; | 2997 return false; |
| 2998 word = word.toLowerCase(); | 2998 word = word.toLowerCase(); |
| 2999 return this._cssCompletions.keySet().hasOwnProperty(word); | 2999 return this._cssCompletions.keySet().hasOwnProperty(word); |
| 3000 }, | 3000 }, |
| 3001 | 3001 |
| 3002 /** | 3002 /** |
| 3003 * @param {!Element} proxyElement | 3003 * @param {!Element} proxyElement |
| 3004 * @param {string} text |
| 3005 * @param {number} cursorOffset |
| 3004 * @param {!Range} wordRange | 3006 * @param {!Range} wordRange |
| 3005 * @param {boolean} force | 3007 * @param {boolean} force |
| 3006 * @param {function(!Array.<string>, number=)} completionsReadyCallback | 3008 * @param {function(!Array.<string>, number=)} completionsReadyCallback |
| 3007 */ | 3009 */ |
| 3008 _buildPropertyCompletions: function(proxyElement, wordRange, force, completi
onsReadyCallback) | 3010 _buildPropertyCompletions: function(proxyElement, text, cursorOffset, wordRa
nge, force, completionsReadyCallback) |
| 3009 { | 3011 { |
| 3010 var prefix = wordRange.toString().toLowerCase(); | 3012 var prefix = wordRange.toString().toLowerCase(); |
| 3011 if (!prefix && !force && (this._isEditingName || proxyElement.textConten
t.length)) { | 3013 if (!prefix && !force && (this._isEditingName || proxyElement.textConten
t.length)) { |
| 3012 completionsReadyCallback([]); | 3014 completionsReadyCallback([]); |
| 3013 return; | 3015 return; |
| 3014 } | 3016 } |
| 3015 | 3017 |
| 3016 var results = this._cssCompletions.startsWith(prefix); | 3018 var results = this._cssCompletions.startsWith(prefix); |
| 3017 if (!this._isEditingName && !results.length && prefix.length > 1 && "!im
portant".startsWith(prefix)) | 3019 if (!this._isEditingName && !results.length && prefix.length > 1 && "!im
portant".startsWith(prefix)) |
| 3018 results.push("!important"); | 3020 results.push("!important"); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3237 | 3239 |
| 3238 /** | 3240 /** |
| 3239 * @override | 3241 * @override |
| 3240 * @return {?WebInspector.ToolbarItem} | 3242 * @return {?WebInspector.ToolbarItem} |
| 3241 */ | 3243 */ |
| 3242 item: function() | 3244 item: function() |
| 3243 { | 3245 { |
| 3244 return this._button; | 3246 return this._button; |
| 3245 } | 3247 } |
| 3246 } | 3248 } |
| OLD | NEW |