diff options
Diffstat (limited to 'WebCore/inspector/front-end/StylesSidebarPane.js')
-rw-r--r-- | WebCore/inspector/front-end/StylesSidebarPane.js | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js index eb5e012..c280fbb 100644 --- a/WebCore/inspector/front-end/StylesSidebarPane.js +++ b/WebCore/inspector/front-end/StylesSidebarPane.js @@ -409,10 +409,7 @@ WebInspector.StylesSidebarPane.prototype = { var separatorElement = document.createElement("div"); separatorElement.className = "styles-sidebar-separator"; if (styleRule.node) { - var link = document.createElement("a"); - link.href = ""; - link.addEventListener("mousedown", this._selectNode.bind(this, styleRule.node.id), false); - WebInspector.panels.elements.decorateNodeLabel(styleRule.node, link); + var link = WebInspector.panels.elements.linkifyNodeReference(styleRule.node); separatorElement.appendChild(document.createTextNode(WebInspector.UIString("Inherited from") + " ")); separatorElement.appendChild(link); } else if ("pseudoId" in styleRule) { @@ -454,12 +451,6 @@ WebInspector.StylesSidebarPane.prototype = { return sections; }, - _selectNode: function(nodeId, e) - { - WebInspector.updateFocusedNode(nodeId); - e.preventDefault(); - }, - _containsInherited: function(payload) { var properties = []; @@ -1289,7 +1280,7 @@ WebInspector.StylePropertyTreeElement.prototype = { if (WebInspector.isBeingEdited(this.listItemElement) || (this.treeOutline.section && !this.treeOutline.section.editable)) return; - var context = { expanded: this.expanded, hasChildren: this.hasChildren }; + var context = { expanded: this.expanded, hasChildren: this.hasChildren, keyDownListener: this.editingKeyDown.bind(this) }; // Lie about our children to prevent expanding on double click and to collapse shorthands. this.hasChildren = false; @@ -1297,7 +1288,7 @@ WebInspector.StylePropertyTreeElement.prototype = { if (!selectElement) selectElement = this.listItemElement; - this.listItemElement.handleKeyEvent = this.editingKeyDown.bind(this); + this.listItemElement.addEventListener("keydown", context.keyDownListener, false); WebInspector.startEditing(this.listItemElement, this.editingCommitted.bind(this), this.editingCancelled.bind(this), context); window.getSelection().setBaseAndExtent(selectElement, 0, selectElement, 1); @@ -1378,7 +1369,7 @@ WebInspector.StylePropertyTreeElement.prototype = { selection.removeAllRanges(); selection.addRange(finalSelectionRange); - event.handled = true; + event.preventDefault(); if (!this.originalCSSText) { // Remember the rule's original CSS text, so it can be restored @@ -1398,7 +1389,7 @@ WebInspector.StylePropertyTreeElement.prototype = { this.hasChildren = context.hasChildren; if (context.expanded) this.expand(); - delete this.listItemElement.handleKeyEvent; + this.listItemElement.removeEventListener("keydown", context.keyDownListener, false); delete this.originalCSSText; }, |