| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 container.createChild("tr").createChild("td").createChild("span", "d
escription").textContent = description; | 211 container.createChild("tr").createChild("td").createChild("span", "d
escription").textContent = description; |
| 212 if (imageURL !== originalImageURL) | 212 if (imageURL !== originalImageURL) |
| 213 container.createChild("tr").createChild("td").createChild("span", "d
escription").textContent = String.sprintf("currentSrc: %s", imageURL.trimMiddle(
100)); | 213 container.createChild("tr").createChild("td").createChild("span", "d
escription").textContent = String.sprintf("currentSrc: %s", imageURL.trimMiddle(
100)); |
| 214 userCallback(container); | 214 userCallback(container); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 | 217 |
| 218 /** | 218 /** |
| 219 * @param {!WebInspector.Target} target | 219 * @param {!WebInspector.Target} target |
| 220 * @param {!WebInspector.Linkifier} linkifier | 220 * @param {!WebInspector.Linkifier} linkifier |
| 221 * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace | 221 * @param {!RuntimeAgent.StackTrace=} stackTrace |
| 222 * @param {!ConsoleAgent.AsyncStackTrace=} asyncStackTrace | |
| 223 * @return {!Element} | 222 * @return {!Element} |
| 224 */ | 223 */ |
| 225 WebInspector.DOMPresentationUtils.buildStackTracePreviewContents = function(targ
et, linkifier, stackTrace, asyncStackTrace) | 224 WebInspector.DOMPresentationUtils.buildStackTracePreviewContents = function(targ
et, linkifier, stackTrace) |
| 226 { | 225 { |
| 227 var element = createElement("span"); | 226 var element = createElement("span"); |
| 228 element.style.display = "inline-block"; | 227 element.style.display = "inline-block"; |
| 229 var shadowRoot = WebInspector.createShadowRootWithCoreStyles(element, "compo
nents/domUtils.css"); | 228 var shadowRoot = WebInspector.createShadowRootWithCoreStyles(element, "compo
nents/domUtils.css"); |
| 230 var contentElement = shadowRoot.createChild("table", "stack-preview-containe
r"); | 229 var contentElement = shadowRoot.createChild("table", "stack-preview-containe
r"); |
| 231 | 230 |
| 232 /** | 231 /** |
| 233 * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace | 232 * @param {!RuntimeAgent.StackTrace} stackTrace |
| 234 */ | 233 */ |
| 235 function appendStackTrace(stackTrace) | 234 function appendStackTrace(stackTrace) |
| 236 { | 235 { |
| 237 for (var stackFrame of stackTrace) { | 236 for (var stackFrame of stackTrace.callFrames) { |
| 238 var row = createElement("tr"); | 237 var row = createElement("tr"); |
| 239 row.createChild("td", "function-name").textContent = WebInspector.be
autifyFunctionName(stackFrame.functionName); | 238 row.createChild("td", "function-name").textContent = WebInspector.be
autifyFunctionName(stackFrame.functionName); |
| 240 row.createChild("td").textContent = " @ "; | 239 row.createChild("td").textContent = " @ "; |
| 241 row.createChild("td").appendChild(linkifier.linkifyConsoleCallFrame(
target, stackFrame)); | 240 row.createChild("td").appendChild(linkifier.linkifyConsoleCallFrame(
target, stackFrame)); |
| 242 contentElement.appendChild(row); | 241 contentElement.appendChild(row); |
| 243 } | 242 } |
| 244 } | 243 } |
| 245 | 244 |
| 246 if (stackTrace) | 245 if (!stackTrace) |
| 247 appendStackTrace(stackTrace); | 246 return element; |
| 248 | 247 |
| 248 appendStackTrace(stackTrace); |
| 249 |
| 250 var asyncStackTrace = stackTrace.parent; |
| 249 while (asyncStackTrace) { | 251 while (asyncStackTrace) { |
| 250 var callFrames = asyncStackTrace.callFrames; | 252 if (!asyncStackTrace.callFrames.length) |
| 251 if (!callFrames || !callFrames.length) | 253 continue; |
| 252 break; | |
| 253 var row = contentElement.createChild("tr"); | 254 var row = contentElement.createChild("tr"); |
| 254 row.createChild("td", "stack-preview-async-description").textContent = W
ebInspector.asyncStackTraceLabel(asyncStackTrace.description); | 255 row.createChild("td", "stack-preview-async-description").textContent = W
ebInspector.asyncStackTraceLabel(asyncStackTrace.description); |
| 255 row.createChild("td"); | 256 row.createChild("td"); |
| 256 row.createChild("td"); | 257 row.createChild("td"); |
| 257 appendStackTrace(callFrames); | 258 appendStackTrace(asyncStackTrace); |
| 258 asyncStackTrace = asyncStackTrace.asyncStackTrace; | 259 asyncStackTrace = asyncStackTrace.parent; |
| 259 } | 260 } |
| 260 | 261 |
| 261 return element; | 262 return element; |
| 262 } | 263 } |
| 263 | 264 |
| 264 /** | 265 /** |
| 265 * @param {!WebInspector.DOMNode} node | 266 * @param {!WebInspector.DOMNode} node |
| 266 * @param {boolean=} justSelector | 267 * @param {boolean=} justSelector |
| 267 * @return {string} | 268 * @return {string} |
| 268 */ | 269 */ |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 /** | 651 /** |
| 651 * @override | 652 * @override |
| 652 * @param {!WebInspector.DOMNode} node | 653 * @param {!WebInspector.DOMNode} node |
| 653 * @return {?{title: string, color: string}} | 654 * @return {?{title: string, color: string}} |
| 654 */ | 655 */ |
| 655 decorate: function(node) | 656 decorate: function(node) |
| 656 { | 657 { |
| 657 return { title: this._title, color: this._color }; | 658 return { title: this._title, color: this._color }; |
| 658 } | 659 } |
| 659 } | 660 } |
| OLD | NEW |