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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 2697603006: DevTools: Fix an exception on adding watch expression. (Closed)
Patch Set: Created 3 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
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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 } 1279 }
1280 1280
1281 if (!this.editable || this._isSASSStyle()) 1281 if (!this.editable || this._isSASSStyle())
1282 return; 1282 return;
1283 1283
1284 var config = new UI.InplaceEditor.Config( 1284 var config = new UI.InplaceEditor.Config(
1285 this._editingMediaCommitted.bind(this, media), this._editingMediaCancell ed.bind(this, element), undefined, 1285 this._editingMediaCommitted.bind(this, media), this._editingMediaCancell ed.bind(this, element), undefined,
1286 this._editingMediaBlurHandler.bind(this)); 1286 this._editingMediaBlurHandler.bind(this));
1287 UI.InplaceEditor.startEditing(element, config); 1287 UI.InplaceEditor.startEditing(element, config);
1288 1288
1289 element.getComponentSelection().setBaseAndExtent(element, 0, element, 1); 1289 element.getComponentSelection().selectAllChildren(element);
1290 this._parentPane.setEditingStyle(true); 1290 this._parentPane.setEditingStyle(true);
1291 var parentMediaElement = element.enclosingNodeOrSelfWithClass('media'); 1291 var parentMediaElement = element.enclosingNodeOrSelfWithClass('media');
1292 parentMediaElement.classList.add('editing-media'); 1292 parentMediaElement.classList.add('editing-media');
1293 1293
1294 event.consume(true); 1294 event.consume(true);
1295 } 1295 }
1296 1296
1297 /** 1297 /**
1298 * @param {!Element} element 1298 * @param {!Element} element
1299 */ 1299 */
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 if (UI.isBeingEdited(element)) 1410 if (UI.isBeingEdited(element))
1411 return; 1411 return;
1412 1412
1413 element.scrollIntoViewIfNeeded(false); 1413 element.scrollIntoViewIfNeeded(false);
1414 element.textContent = element.textContent; // Reset selector marks in group . 1414 element.textContent = element.textContent; // Reset selector marks in group .
1415 1415
1416 var config = 1416 var config =
1417 new UI.InplaceEditor.Config(this.editingSelectorCommitted.bind(this), th is.editingSelectorCancelled.bind(this)); 1417 new UI.InplaceEditor.Config(this.editingSelectorCommitted.bind(this), th is.editingSelectorCancelled.bind(this));
1418 UI.InplaceEditor.startEditing(this._selectorElement, config); 1418 UI.InplaceEditor.startEditing(this._selectorElement, config);
1419 1419
1420 element.getComponentSelection().setBaseAndExtent(element, 0, element, 1); 1420 element.getComponentSelection().selectAllChildren(element);
1421 this._parentPane.setEditingStyle(true); 1421 this._parentPane.setEditingStyle(true);
1422 if (element.classList.contains('simple-selector')) 1422 if (element.classList.contains('simple-selector'))
1423 this._navigateToSelectorSource(0, false); 1423 this._navigateToSelectorSource(0, false);
1424 } 1424 }
1425 1425
1426 /** 1426 /**
1427 * @param {string} moveDirection 1427 * @param {string} moveDirection
1428 */ 1428 */
1429 _moveEditorFromSelector(moveDirection) { 1429 _moveEditorFromSelector(moveDirection) {
1430 this._markSelectorMatches(); 1430 this._markSelectorMatches();
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 this._prompt.on(UI.TextPrompt.TextChangedEvent, this._applyFreeFlowStyleTe xtEdit.bind(this)); 2362 this._prompt.on(UI.TextPrompt.TextChangedEvent, this._applyFreeFlowStyleTe xtEdit.bind(this));
2363 2363
2364 var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurLis tener.bind(this, context)); 2364 var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurLis tener.bind(this, context));
2365 this._navigateToSource(selectElement, true); 2365 this._navigateToSource(selectElement, true);
2366 2366
2367 proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind( this, context), false); 2367 proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind( this, context), false);
2368 proxyElement.addEventListener('keypress', this._editingNameValueKeyPress.bin d(this, context), false); 2368 proxyElement.addEventListener('keypress', this._editingNameValueKeyPress.bin d(this, context), false);
2369 if (isEditingName) 2369 if (isEditingName)
2370 proxyElement.addEventListener('paste', pasteHandler.bind(this, context), f alse); 2370 proxyElement.addEventListener('paste', pasteHandler.bind(this, context), f alse);
2371 2371
2372 selectElement.getComponentSelection().setBaseAndExtent( 2372 selectElement.getComponentSelection().selectAllChildren(selectElement);
2373 selectElement, 0, selectElement, selectElement.firstChild ? 1 : 0);
2374 } 2373 }
2375 2374
2376 /** 2375 /**
2377 * @param {!Elements.StylePropertyTreeElement.Context} context 2376 * @param {!Elements.StylePropertyTreeElement.Context} context
2378 * @param {!Event} event 2377 * @param {!Event} event
2379 */ 2378 */
2380 _editingNameValueKeyDown(context, event) { 2379 _editingNameValueKeyDown(context, event) {
2381 if (event.handled) 2380 if (event.handled)
2382 return; 2381 return;
2383 2382
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
3081 } 3080 }
3082 3081
3083 /** 3082 /**
3084 * @override 3083 * @override
3085 * @return {!UI.ToolbarItem} 3084 * @return {!UI.ToolbarItem}
3086 */ 3085 */
3087 item() { 3086 item() {
3088 return this._button; 3087 return this._button;
3089 } 3088 }
3090 }; 3089 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698