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

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

Issue 219573002: DevTools: follow up to r170453, linkifier binding fixed, annotateion added. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
« 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 WebInspector.DOMPresentationUtils.createSpansForNodeTitle = function(container, nodeTitle) 83 WebInspector.DOMPresentationUtils.createSpansForNodeTitle = function(container, nodeTitle)
84 { 84 {
85 var match = nodeTitle.match(/([^#.]+)(#[^.]+)?(\..*)?/); 85 var match = nodeTitle.match(/([^#.]+)(#[^.]+)?(\..*)?/);
86 container.createChild("span", "webkit-html-tag-name").textContent = match[1] ; 86 container.createChild("span", "webkit-html-tag-name").textContent = match[1] ;
87 if (match[2]) 87 if (match[2])
88 container.createChild("span", "webkit-html-attribute-value").textContent = match[2]; 88 container.createChild("span", "webkit-html-attribute-value").textContent = match[2];
89 if (match[3]) 89 if (match[3])
90 container.createChild("span", "webkit-html-attribute-name").textContent = match[3]; 90 container.createChild("span", "webkit-html-attribute-name").textContent = match[3];
91 } 91 }
92 92
93 /**
94 * @param {!WebInspector.DOMNode} node
95 */
93 WebInspector.DOMPresentationUtils.linkifyNodeReference = function(node) 96 WebInspector.DOMPresentationUtils.linkifyNodeReference = function(node)
94 { 97 {
95 var link = document.createElement("span"); 98 var link = document.createElement("span");
96 link.className = "node-link"; 99 link.className = "node-link";
97 WebInspector.DOMPresentationUtils.decorateNodeLabel(node, link); 100 WebInspector.DOMPresentationUtils.decorateNodeLabel(node, link);
98 101
99 link.addEventListener("click", node.reveal.bind(node), false); 102 link.addEventListener("click", node.reveal.bind(node), false);
100 link.addEventListener("mouseover", node.highlight.bind(node.id), false); 103 link.addEventListener("mouseover", node.highlight.bind(node, undefined, unde fined), false);
101 link.addEventListener("mouseout", node.domModel().hideDOMNodeHighlight.bind( node.domModel()), false); 104 link.addEventListener("mouseout", node.domModel().hideDOMNodeHighlight.bind( node.domModel()), false);
102 105
103 return link; 106 return link;
104 } 107 }
105 108
106 WebInspector.DOMPresentationUtils.linkifyNodeById = function(nodeId) 109 WebInspector.DOMPresentationUtils.linkifyNodeById = function(nodeId)
107 { 110 {
108 var node = WebInspector.domModel.nodeForId(nodeId); 111 var node = WebInspector.domModel.nodeForId(nodeId);
109 if (!node) 112 if (!node)
110 return document.createTextNode(WebInspector.UIString("<node>")); 113 return document.createTextNode(WebInspector.UIString("<node>"));
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 512
510 WebInspector.DOMNodePathStep.prototype = { 513 WebInspector.DOMNodePathStep.prototype = {
511 /** 514 /**
512 * @return {string} 515 * @return {string}
513 */ 516 */
514 toString: function() 517 toString: function()
515 { 518 {
516 return this.value; 519 return this.value;
517 } 520 }
518 } 521 }
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