OLD | NEW |
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 WebInspector.DOMPresentationUtils.linkifyNodeReference = function(node) | 93 WebInspector.DOMPresentationUtils.linkifyNodeReference = function(node) |
94 { | 94 { |
95 var link = document.createElement("span"); | 95 var link = document.createElement("span"); |
96 link.className = "node-link"; | 96 link.className = "node-link"; |
97 WebInspector.DOMPresentationUtils.decorateNodeLabel(node, link); | 97 WebInspector.DOMPresentationUtils.decorateNodeLabel(node, link); |
98 | 98 |
99 link.addEventListener("click", WebInspector.domModel.inspectElement.bind(Web
Inspector.domModel, node.id), false); | 99 link.addEventListener("click", node.reveal.bind(node), false); |
100 link.addEventListener("mouseover", WebInspector.domModel.highlightDOMNode.bi
nd(WebInspector.domModel, node.id, "", undefined), false); | 100 link.addEventListener("mouseover", node.highlight.bind(node.id), false); |
101 link.addEventListener("mouseout", WebInspector.domModel.hideDOMNodeHighlight
.bind(WebInspector.domModel), false); | 101 link.addEventListener("mouseout", node.domModel().hideDOMNodeHighlight.bind(
node.domModel()), false); |
102 | 102 |
103 return link; | 103 return link; |
104 } | 104 } |
105 | 105 |
106 WebInspector.DOMPresentationUtils.linkifyNodeById = function(nodeId) | 106 WebInspector.DOMPresentationUtils.linkifyNodeById = function(nodeId) |
107 { | 107 { |
108 var node = WebInspector.domModel.nodeForId(nodeId); | 108 var node = WebInspector.domModel.nodeForId(nodeId); |
109 if (!node) | 109 if (!node) |
110 return document.createTextNode(WebInspector.UIString("<node>")); | 110 return document.createTextNode(WebInspector.UIString("<node>")); |
111 return WebInspector.DOMPresentationUtils.linkifyNodeReference(node); | 111 return WebInspector.DOMPresentationUtils.linkifyNodeReference(node); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 509 |
510 WebInspector.DOMNodePathStep.prototype = { | 510 WebInspector.DOMNodePathStep.prototype = { |
511 /** | 511 /** |
512 * @return {string} | 512 * @return {string} |
513 */ | 513 */ |
514 toString: function() | 514 toString: function() |
515 { | 515 { |
516 return this.value; | 516 return this.value; |
517 } | 517 } |
518 } | 518 } |
OLD | NEW |