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

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

Issue 571653002: DevTools: [SSP] consume event if it inserts a new property (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: keeping it on the safe side Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 { 1592 {
1593 var willCauseCancelEditing = this._willCauseCancelEditing; 1593 var willCauseCancelEditing = this._willCauseCancelEditing;
1594 delete this._willCauseCancelEditing; 1594 delete this._willCauseCancelEditing;
1595 return willCauseCancelEditing; 1595 return willCauseCancelEditing;
1596 }, 1596 },
1597 1597
1598 _handleSelectorContainerClick: function(event) 1598 _handleSelectorContainerClick: function(event)
1599 { 1599 {
1600 if (this._checkWillCancelEditing() || !this.editable) 1600 if (this._checkWillCancelEditing() || !this.editable)
1601 return; 1601 return;
1602 if (event.target === this._selectorContainer) 1602 if (event.target === this._selectorContainer) {
1603 this.addNewBlankProperty(0).startEditing(); 1603 this.addNewBlankProperty(0).startEditing();
1604 event.consume(true);
1605 }
1604 }, 1606 },
1605 1607
1606 /** 1608 /**
1607 * @param {number=} index 1609 * @param {number=} index
1608 * @return {!WebInspector.StylePropertyTreeElement} 1610 * @return {!WebInspector.StylePropertyTreeElement}
1609 */ 1611 */
1610 addNewBlankProperty: function(index) 1612 addNewBlankProperty: function(index)
1611 { 1613 {
1612 var style = this.styleRule.style; 1614 var style = this.styleRule.style;
1613 var property = style.newBlankProperty(index); 1615 var property = style.newBlankProperty(index);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 1692
1691 if (this._checkWillCancelEditing()) 1693 if (this._checkWillCancelEditing())
1692 return; 1694 return;
1693 1695
1694 if (event.target.classList.contains("header") || this.element.classList. contains("read-only") || event.target.enclosingNodeOrSelfWithClass("media")) { 1696 if (event.target.classList.contains("header") || this.element.classList. contains("read-only") || event.target.enclosingNodeOrSelfWithClass("media")) {
1695 event.consume(); 1697 event.consume();
1696 return; 1698 return;
1697 } 1699 }
1698 this.expand(); 1700 this.expand();
1699 this.addNewBlankProperty().startEditing(); 1701 this.addNewBlankProperty().startEditing();
1702 event.consume(true)
1700 }, 1703 },
1701 1704
1702 _handleSelectorClick: function(event) 1705 _handleSelectorClick: function(event)
1703 { 1706 {
1704 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && this.navi gable && event.target.classList.contains("simple-selector")) { 1707 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && this.navi gable && event.target.classList.contains("simple-selector")) {
1705 var index = event.target._selectorIndex; 1708 var index = event.target._selectorIndex;
1706 var target = this._parentPane._target; 1709 var target = this._parentPane._target;
1707 var rawLocation = new WebInspector.CSSLocation(target, this.rule.sty leSheetId, this.rule.sourceURL, this.rule.lineNumberInSource(index), this.rule.c olumnNumberInSource(index)); 1710 var rawLocation = new WebInspector.CSSLocation(target, this.rule.sty leSheetId, this.rule.sourceURL, this.rule.lineNumberInSource(index), this.rule.c olumnNumberInSource(index));
1708 var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILoc ation(rawLocation); 1711 var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILoc ation(rawLocation);
1709 WebInspector.Revealer.reveal(uiLocation); 1712 WebInspector.Revealer.reveal(uiLocation);
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
3517 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase( ))) { 3520 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase( ))) {
3518 for (var i = 0; i < results.length; ++i) 3521 for (var i = 0; i < results.length; ++i)
3519 results[i] = results[i].toUpperCase(); 3522 results[i] = results[i].toUpperCase();
3520 } 3523 }
3521 var selectedIndex = this._cssCompletions.mostUsedOf(results); 3524 var selectedIndex = this._cssCompletions.mostUsedOf(results);
3522 completionsReadyCallback(results, selectedIndex); 3525 completionsReadyCallback(results, selectedIndex);
3523 }, 3526 },
3524 3527
3525 __proto__: WebInspector.TextPrompt.prototype 3528 __proto__: WebInspector.TextPrompt.prototype
3526 } 3529 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698