https://bugs.webkit.org/show_bug.cgi?id=151866
Reviewed by Brian Burg.
Added source code location link to function popover header.
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
Create source code location link from response payload.
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193926
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-12-10 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: debugger popover should have source location link when showing function source
+ https://bugs.webkit.org/show_bug.cgi?id=151866
+
+ Reviewed by Brian Burg.
+
+ Added source code location link to function popover header.
+
+ * UserInterface/Views/SourceCodeTextEditor.js:
+ (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
+ Create source code location link from response payload.
+ (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction):
+
2015-12-10 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: [Meta] Unify z-index values in Inspector's CSS
2015-12-10 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: [Meta] Unify z-index values in Inspector's CSS
_showPopoverForFunction(data)
{
_showPopoverForFunction(data)
{
- var candidate = this.tokenTrackingController.candidate;
+ let candidate = this.tokenTrackingController.candidate;
function didGetDetails(error, response)
{
function didGetDetails(error, response)
{
if (candidate !== this.tokenTrackingController.candidate)
return;
if (candidate !== this.tokenTrackingController.candidate)
return;
- var wrapper = document.createElement("div");
- wrapper.className = "body formatted-function";
+ let wrapper = document.createElement("div");
+ wrapper.classList.add("body", "formatted-function");
wrapper.textContent = data.description;
wrapper.textContent = data.description;
- var content = document.createElement("div");
- content.className = "function";
+ let content = document.createElement("div");
+ content.classList.add("function");
+
+ let location = response.location;
+ let sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId);
+ let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber);
+ let functionSourceCodeLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation);
- var title = content.appendChild(document.createElement("div"));
- title.className = "title";
+ let title = content.appendChild(document.createElement("div"));
+ title.classList.add("title");
title.textContent = response.name || response.inferredName || response.displayName || WebInspector.UIString("(anonymous function)");
title.textContent = response.name || response.inferredName || response.displayName || WebInspector.UIString("(anonymous function)");
+ title.appendChild(functionSourceCodeLink);
content.appendChild(wrapper);
content.appendChild(wrapper);