Chromium Code Reviews| 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 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2314 this._editingCommitted(text, context, moveDirection); | 2314 this._editingCommitted(text, context, moveDirection); |
| 2315 } | 2315 } |
| 2316 | 2316 |
| 2317 this._originalPropertyText = this.property.propertyText; | 2317 this._originalPropertyText = this.property.propertyText; |
| 2318 | 2318 |
| 2319 this._parentPane.setEditingStyle(true); | 2319 this._parentPane.setEditingStyle(true); |
| 2320 if (selectElement.parentElement) | 2320 if (selectElement.parentElement) |
| 2321 selectElement.parentElement.scrollIntoViewIfNeeded(false); | 2321 selectElement.parentElement.scrollIntoViewIfNeeded(false); |
| 2322 | 2322 |
| 2323 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdit.bi nd(this) : undefined; | 2323 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdit.bi nd(this) : undefined; |
| 2324 var cssCompletions = isEditingName ? SDK.cssMetadata().allProperties() : | 2324 var cssCompletions = []; |
| 2325 SDK.cssMetadata().propertyValues(this.n ameElement.textContent); | 2325 if (isEditingName) { |
| 2326 cssCompletions = SDK.cssMetadata().allProperties(); | |
| 2327 cssCompletions = | |
| 2328 cssCompletions.filter(property => SDK.cssMetadata().isSVGProperty(prop erty) === this.node().isSVGNode()); | |
|
PhistucK
2016/12/13 08:43:51
Ouch! This seems very unnecessarily unfriendly to
| |
| 2329 } else { | |
| 2330 cssCompletions = SDK.cssMetadata().propertyValues(this.nameElement.textCon tent); | |
| 2331 } | |
| 2332 | |
| 2326 this._prompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(cssCompletio ns, this, isEditingName); | 2333 this._prompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(cssCompletio ns, this, isEditingName); |
| 2327 this._prompt.setAutocompletionTimeout(0); | 2334 this._prompt.setAutocompletionTimeout(0); |
| 2328 if (applyItemCallback) { | 2335 if (applyItemCallback) { |
| 2329 this._prompt.addEventListener(UI.TextPrompt.Events.ItemApplied, applyItemC allback, this); | 2336 this._prompt.addEventListener(UI.TextPrompt.Events.ItemApplied, applyItemC allback, this); |
| 2330 this._prompt.addEventListener(UI.TextPrompt.Events.ItemAccepted, applyItem Callback, this); | 2337 this._prompt.addEventListener(UI.TextPrompt.Events.ItemAccepted, applyItem Callback, this); |
| 2331 } | 2338 } |
| 2332 var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurLis tener.bind(this, context)); | 2339 var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurLis tener.bind(this, context)); |
| 2333 this._navigateToSource(selectElement, true); | 2340 this._navigateToSource(selectElement, true); |
| 2334 | 2341 |
| 2335 proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind( this, context), false); | 2342 proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind( this, context), false); |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3046 } | 3053 } |
| 3047 | 3054 |
| 3048 /** | 3055 /** |
| 3049 * @override | 3056 * @override |
| 3050 * @return {!UI.ToolbarItem} | 3057 * @return {!UI.ToolbarItem} |
| 3051 */ | 3058 */ |
| 3052 item() { | 3059 item() { |
| 3053 return this._button; | 3060 return this._button; |
| 3054 } | 3061 } |
| 3055 }; | 3062 }; |
| OLD | NEW |