Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: Source/devtools/front_end/StylesSidebarPane.js

Issue 172593003: DevTools: [CSS] Add CSS.editRangeInStyleSheetText() to the protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 */ 173 */
174 _contextMenuEventFired: function(event) 174 _contextMenuEventFired: function(event)
175 { 175 {
176 // We start editing upon click -> default navigation to resources panel is not available 176 // We start editing upon click -> default navigation to resources panel is not available
177 // Hence we add a soft context menu for hrefs. 177 // Hence we add a soft context menu for hrefs.
178 var contextMenu = new WebInspector.ContextMenu(event); 178 var contextMenu = new WebInspector.ContextMenu(event);
179 contextMenu.appendApplicableItems(/** @type {!Node} */ (event.target)); 179 contextMenu.appendApplicableItems(/** @type {!Node} */ (event.target));
180 contextMenu.show(); 180 contextMenu.show();
181 }, 181 },
182 182
183 get _forcedPseudoClasses() 183 _forcedPseudoClasses: function()
apavlov 2014/02/21 14:37:55 how is this change related to your patch?
lushnikov 2014/02/21 14:57:35 that's a drive-by :)
lushnikov 2014/02/23 16:07:07 Removed this change from patch.
184 { 184 {
185 return this.node ? (this.node.getUserProperty("pseudoState") || undefine d) : undefined; 185 return this.node ? (this.node.getUserProperty("pseudoState") || undefine d) : undefined;
186 }, 186 },
187 187
188 _updateForcedPseudoStateInputs: function() 188 _updateForcedPseudoStateInputs: function()
189 { 189 {
190 if (!this.node) 190 if (!this.node)
191 return; 191 return;
192 192
193 var hasPseudoType = !!this.node.pseudoType(); 193 var hasPseudoType = !!this.node.pseudoType();
194 this._elementStateButton.enableStyleClass("hidden", hasPseudoType); 194 this._elementStateButton.enableStyleClass("hidden", hasPseudoType);
195 this._elementStatePane.enableStyleClass("expanded", !hasPseudoType && th is._elementStateButton.classList.contains("toggled")); 195 this._elementStatePane.enableStyleClass("expanded", !hasPseudoType && th is._elementStateButton.classList.contains("toggled"));
196 196
197 var nodePseudoState = this._forcedPseudoClasses; 197 var nodePseudoState = this._forcedPseudoClasses();
198 if (!nodePseudoState) 198 if (!nodePseudoState)
199 nodePseudoState = []; 199 nodePseudoState = [];
200 200
201 var inputs = this._elementStatePane.inputs; 201 var inputs = this._elementStatePane.inputs;
202 for (var i = 0; i < inputs.length; ++i) 202 for (var i = 0; i < inputs.length; ++i)
203 inputs[i].checked = nodePseudoState.indexOf(inputs[i].state) >= 0; 203 inputs[i].checked = nodePseudoState.indexOf(inputs[i].state) >= 0;
204 }, 204 },
205 205
206 /** 206 /**
207 * @param {?WebInspector.DOMNode} node 207 * @param {?WebInspector.DOMNode} node
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after
3028 return; 3028 return;
3029 } 3029 }
3030 3030
3031 var results = this._cssCompletions.startsWith(prefix); 3031 var results = this._cssCompletions.startsWith(prefix);
3032 var selectedIndex = this._cssCompletions.mostUsedOf(results); 3032 var selectedIndex = this._cssCompletions.mostUsedOf(results);
3033 completionsReadyCallback(results, selectedIndex); 3033 completionsReadyCallback(results, selectedIndex);
3034 }, 3034 },
3035 3035
3036 __proto__: WebInspector.TextPrompt.prototype 3036 __proto__: WebInspector.TextPrompt.prototype
3037 } 3037 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698