Summary: | Web Inspector: draft implementation of source mapping listeners. | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Pavel Podivilov <podivilov> | ||||||||||||||
Component: | Web Inspector (Deprecated) | Assignee: | Pavel Podivilov <podivilov> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | apavlov, bweinstein, dglazkov, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, webkit.review.bot, yurys | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||
Hardware: | All | ||||||||||||||||
OS: | All | ||||||||||||||||
Attachments: |
|
Description
Pavel Podivilov
2011-08-03 05:31:58 PDT
Created attachment 102768 [details]
Patch
Comment on attachment 102768 [details] Patch Attachment 102768 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9304015 New failing tests: http/tests/inspector-enabled/console-clear-arguments-on-frame-remove.html Created attachment 102783 [details]
Patch
Comment on attachment 102783 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=102783&action=review > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:125 > + this._sourceMappingListeners.push(listener); Nit: You could do addEventListener(sourceId, listener) followed by a dispatchEvent(this.sourceId)... > Source/WebCore/inspector/front-end/ScriptsPanel.js:572 > + model.addSourceMappingListener(url, null, formatAnchor); Could we test anchor update? > Source/WebCore/inspector/front-end/inspector.js:1323 > +WebInspector._linkifyLocation = function(url, oneBasedLineNumber, oneBasedColumnNumber, classes, tooltipText, preferredPanel) Call sites should probably do WebInspector.debuggerPresentationModel.linkifyLocation(location), where location is raw 'script' location. > Source/WebCore/inspector/front-end/inspector.js:1325 > + if (preferredPanel === "scripts" && !WebInspector.debuggerModel.scriptsForURL(url).length) Either this code or WebInspector._showAnchorLocation should fall back to "resources". Created attachment 102902 [details]
Patch
(In reply to comment #4) > (From update of attachment 102783 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=102783&action=review > > > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:125 > > + this._sourceMappingListeners.push(listener); > > Nit: You could do addEventListener(sourceId, listener) followed by a dispatchEvent(this.sourceId)... Unfortunately, sourceId isn't a good id since there may be several scripts linked to one RawSourceCode instance. > > > Source/WebCore/inspector/front-end/ScriptsPanel.js:572 > > + model.addSourceMappingListener(url, null, formatAnchor); > > Could we test anchor update? It is tested by testConsoleMessagesForFormattedScripts in script-formatter.html. > > > Source/WebCore/inspector/front-end/inspector.js:1323 > > +WebInspector._linkifyLocation = function(url, oneBasedLineNumber, oneBasedColumnNumber, classes, tooltipText, preferredPanel) > > Call sites should probably do WebInspector.debuggerPresentationModel.linkifyLocation(location), where location is raw 'script' location. Done. > > > Source/WebCore/inspector/front-end/inspector.js:1325 > > + if (preferredPanel === "scripts" && !WebInspector.debuggerModel.scriptsForURL(url).length) > > Either this code or WebInspector._showAnchorLocation should fall back to "resources". Not all anchors are created by linkifyResourceAsNode, some of them don't have preferred_panel attribute. Code in WebInspector._showAnchorLocation is needed for such anchors. Comment on attachment 102902 [details] Patch Attachment 102902 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9303457 New failing tests: http/tests/inspector/console-resource-errors.html http/tests/inspector/console-xhr-logging.html Created attachment 102905 [details]
Patch
Created attachment 102909 [details]
Patch
Created attachment 102910 [details]
Patch
Comment on attachment 102910 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=102910&action=review > Source/WebCore/inspector/front-end/EventListenersSidebarPane.js:240 > + var url = this.eventListener.location.scriptId; Please add yet another FIXME on the location structure + use of column. > Source/WebCore/inspector/front-end/ProfileDataGridTree.js:101 > + var urlElement = WebInspector.debuggerPresentationModel.linkifyLocation(this.profileNode.url, lineNumber, 0, "profile-node-file"); Do you know what url is? > Source/WebCore/inspector/front-end/TimelinePanel.js:1128 > + return this._linkifyLocation(this.stackTrace[0].url, this.stackTrace[0].lineNumber, this.stackTrace[0].columnNumber); Extract method receiving ConsoleCallFrame Committed r92598: <http://trac.webkit.org/changeset/92598> |