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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |