Commit 679d978c authored by timothy@apple.com's avatar timothy@apple.com

Fix jumping to a text position when showing a resource.

https://bugs.webkit.org/show_bug.cgi?id=127271

Reviewed by Joseph Pecoraro.

* UserInterface/FrameContentView.js:
(WebInspector.FrameContentView.prototype.showSourceCode): Just use showResponse's arguments
which already does the same logic to call revealPosition.
* UserInterface/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.prototype.restoreFromCookie): This was the bug.
lineNumber and columnNumber need honored here. They were only honored by FrameContentView.
* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype.showSourceCode): Use showContentViewForRepresentedObject
which also accepts a cookie and handles creating the content view for us.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7cadf18b
2014-01-20 Timothy Hatcher <timothy@apple.com>
Fix jumping to a text position when showing a resource.
https://bugs.webkit.org/show_bug.cgi?id=127271
Reviewed by Joseph Pecoraro.
* UserInterface/FrameContentView.js:
(WebInspector.FrameContentView.prototype.showSourceCode): Just use showResponse's arguments
which already does the same logic to call revealPosition.
* UserInterface/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.prototype.restoreFromCookie): This was the bug.
lineNumber and columnNumber need honored here. They were only honored by FrameContentView.
* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype.showSourceCode): Use showContentViewForRepresentedObject
which also accepts a cookie and handles creating the content view for us.
2014-01-16 Brian Burg <bburg@apple.com>
Web Inspector: add more context to Object.addEventListener assertions
......
......@@ -124,11 +124,7 @@ WebInspector.FrameContentView.prototype = {
if (!resourceContentView)
return null;
var responseContentView = resourceContentView.showResponse();
if (typeof responseContentView.revealPosition === "function")
responseContentView.revealPosition(positionToReveal, textRangeToSelect, forceUnformatted);
return resourceContentView;
return resourceContentView.showResponse(positionToReveal, textRangeToSelect, forceUnformatted);
},
showDOMTree: function(domNodeToSelect, preventFocusChange)
......
......@@ -149,8 +149,9 @@ WebInspector.ResourceClusterContentView.prototype = {
restoreFromCookie: function(cookie)
{
var viewIdentifier = cookie[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey];
this._showContentViewForIdentifier(viewIdentifier);
var contentView = this._showContentViewForIdentifier(cookie[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]);
if (typeof contentView.revealPosition === "function" && "lineNumber" in cookie && "columnNumber" in cookie)
contentView.revealPosition(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
},
showRequest: function()
......
......@@ -158,10 +158,8 @@ WebInspector.ResourceSidebarPanel.prototype = {
if (representedObject instanceof WebInspector.Resource && representedObject.isMainResource())
representedObject = representedObject.parentFrame;
var newContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(representedObject);
var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
WebInspector.contentBrowser.showContentView(newContentView, cookie);
WebInspector.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
},
showSourceCodeLocation: function(sourceCodeLocation)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment