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 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 var wordSuffixRange = selectionRange.startContainer.rangeOfWord(selectio
nRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.el
ement, "forward"); | 1957 var wordSuffixRange = selectionRange.startContainer.rangeOfWord(selectio
nRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.el
ement, "forward"); |
1958 if (!wordSuffixRange.toString()) | 1958 if (!wordSuffixRange.toString()) |
1959 return; | 1959 return; |
1960 selection.removeAllRanges(); | 1960 selection.removeAllRanges(); |
1961 selection.addRange(wordSuffixRange); | 1961 selection.addRange(wordSuffixRange); |
1962 }, | 1962 }, |
1963 | 1963 |
1964 _buildPropertyCompletions: function(wordRange, bestMatchOnly, completionsRea
dyCallback) | 1964 _buildPropertyCompletions: function(wordRange, bestMatchOnly, completionsRea
dyCallback) |
1965 { | 1965 { |
1966 var prefix = wordRange.toString().toLowerCase(); | 1966 var prefix = wordRange.toString().toLowerCase(); |
| 1967 if (!prefix && bestMatchOnly) |
| 1968 return; |
| 1969 |
1967 var results; | 1970 var results; |
1968 if (bestMatchOnly) { | 1971 if (bestMatchOnly) { |
1969 results = []; | 1972 results = []; |
1970 var firstMatch = this._cssCompletions.firstStartsWith(prefix); | 1973 var firstMatch = this._cssCompletions.firstStartsWith(prefix); |
1971 if (firstMatch) | 1974 if (firstMatch) |
1972 results.push(firstMatch); | 1975 results.push(firstMatch); |
1973 return completionsReadyCallback(results); | 1976 return completionsReadyCallback(results); |
1974 } | 1977 } |
1975 | 1978 |
1976 results = this._cssCompletions.startsWith(prefix); | 1979 results = this._cssCompletions.startsWith(prefix); |
1977 if (results) | 1980 if (results) |
1978 completionsReadyCallback(results); | 1981 completionsReadyCallback(results); |
1979 } | 1982 } |
1980 } | 1983 } |
1981 | 1984 |
1982 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype.__proto__ = WebInspec
tor.TextPrompt.prototype; | 1985 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype.__proto__ = WebInspec
tor.TextPrompt.prototype; |
OLD | NEW |