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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 else | 151 else |
152 description = WebInspector.UIString("%d \xd7 %d pixels (Natural:
%d \xd7 %d pixels)", offsetWidth, offsetHeight, naturalWidth, naturalHeight); | 152 description = WebInspector.UIString("%d \xd7 %d pixels (Natural:
%d \xd7 %d pixels)", offsetWidth, offsetHeight, naturalWidth, naturalHeight); |
153 } | 153 } |
154 | 154 |
155 container.createChild("tr").createChild("td", "image-container").appendC
hild(imageElement); | 155 container.createChild("tr").createChild("td", "image-container").appendC
hild(imageElement); |
156 if (description) | 156 if (description) |
157 container.createChild("tr").createChild("td").createChild("span", "d
escription").textContent = description; | 157 container.createChild("tr").createChild("td").createChild("span", "d
escription").textContent = description; |
158 userCallback(container); | 158 userCallback(container); |
159 } | 159 } |
160 } | 160 } |
| 161 |
| 162 /** |
| 163 * @param {!WebInspector.DOMNode} node |
| 164 * @param {boolean=} justSelector |
| 165 * @return {string} |
| 166 */ |
| 167 WebInspector.DOMPresentationUtils.appropriateSelectorFor = function(node, justSe
lector) |
| 168 { |
| 169 var lowerCaseName = node.localName() || node.nodeName().toLowerCase(); |
| 170 |
| 171 var id = node.getAttribute("id"); |
| 172 if (id) { |
| 173 var selector = "#" + id; |
| 174 return (justSelector ? selector : lowerCaseName + selector); |
| 175 } |
| 176 |
| 177 var className = node.getAttribute("class"); |
| 178 if (className) { |
| 179 var selector = "." + className.trim().replace(/\s+/g, "."); |
| 180 return (justSelector ? selector : lowerCaseName + selector); |
| 181 } |
| 182 |
| 183 if (lowerCaseName === "input" && node.getAttribute("type")) |
| 184 return lowerCaseName + "[type=\"" + node.getAttribute("type") + "\"]"; |
| 185 |
| 186 return lowerCaseName; |
| 187 } |
OLD | NEW |