Changeset 51156 in webkit
- Timestamp:
- Nov 18, 2009 4:52:47 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51155 r51156 1 2009-11-18 Patrick Mueller <Patrick_Mueller@us.ibm.com> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector - remember last script displayed in Scripts panel 6 https://bugs.webkit.org/show_bug.cgi?id=27552 7 8 Manual test added 9 10 * inspector/front-end/ScriptsPanel.js: 11 (WebInspector.ScriptsPanel.prototype.showScript): 12 (WebInspector.ScriptsPanel.prototype.showResource): 13 (WebInspector.ScriptsPanel.prototype._showScriptOrResource): 14 (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu): 15 (WebInspector.ScriptsPanel.prototype._callFrameSelected): 16 (WebInspector.ScriptsPanel.prototype._goBack): 17 (WebInspector.ScriptsPanel.prototype._goForward): 18 * manual-tests/inspector/remember-last-script.html: Added. 19 1 20 2009-11-18 Shinichiro Hamaji <hamaji@chromium.org> 2 21 -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r50880 r51156 502 502 showScript: function(script, line) 503 503 { 504 this._showScriptOrResource(script, line, true);504 this._showScriptOrResource(script, {line: line, shouldHighlightLine: true}); 505 505 }, 506 506 507 507 showResource: function(resource, line) 508 508 { 509 this._showScriptOrResource(resource, line, true);509 this._showScriptOrResource(resource, {line: line, shouldHighlightLine: true}); 510 510 }, 511 511 … … 575 575 }, 576 576 577 _showScriptOrResource: function(scriptOrResource, line, shouldHighlightLine, fromBackForwardAction) 578 { 577 _showScriptOrResource: function(scriptOrResource, options) 578 { 579 // options = {line:, shouldHighlightLine:, fromBackForwardAction:, initialLoad:} 580 if (!options) 581 options = {}; 582 579 583 if (!scriptOrResource) 580 584 return; … … 602 606 return; 603 607 604 if (!fromBackForwardAction) { 608 var url = scriptOrResource.url || scriptOrResource.sourceURL; 609 if (url && !options.initialLoad) 610 InspectorController.setSetting("LastViewedScriptFile", url); 611 612 if (!options.fromBackForwardAction) { 605 613 var oldIndex = this._currentBackForwardIndex; 606 614 if (oldIndex >= 0) … … 623 631 this.visibleView = view; 624 632 625 if ( line) {633 if (options.line) { 626 634 if (view.revealLine) 627 view.revealLine( line);628 if (view.highlightLine && shouldHighlightLine)629 view.highlightLine( line);635 view.revealLine(options.line); 636 if (view.highlightLine && options.shouldHighlightLine) 637 view.highlightLine(options.line); 630 638 } 631 639 … … 643 651 console.assert(option); 644 652 } else { 645 var url = scriptOrResource.url;646 653 var script = this._scriptsForURLsInFilesSelect[url]; 647 654 if (script) … … 700 707 // This will happen for the first item added to the menu. 701 708 if (select.options[select.selectedIndex] === option) 702 this._showScriptOrResource(option.representedObject); 709 this._showScriptOrResource(option.representedObject, {initialLoad: true}); 710 else { 711 // if not first item, check to see if this was the last viewed 712 var url = option.representedObject.url || option.representedObject.sourceURL; 713 var lastURL = InspectorController.setting("LastViewedScriptFile"); 714 if (url && url === lastURL) 715 this._showScriptOrResource(option.representedObject, {initialLoad: true}); 716 } 703 717 }, 704 718 … … 723 737 724 738 var scriptOrResource = this._sourceIDMap[currentFrame.sourceID]; 725 this._showScriptOrResource(scriptOrResource, currentFrame.line);739 this._showScriptOrResource(scriptOrResource, {line: currentFrame.line}); 726 740 727 741 this._executionSourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource); … … 842 856 } 843 857 844 this._showScriptOrResource(this._backForwardList[--this._currentBackForwardIndex], null, false, true);858 this._showScriptOrResource(this._backForwardList[--this._currentBackForwardIndex], {fromBackForwardAction: true}); 845 859 this._updateBackAndForwardButtons(); 846 860 }, … … 853 867 } 854 868 855 this._showScriptOrResource(this._backForwardList[++this._currentBackForwardIndex], null, false, true);869 this._showScriptOrResource(this._backForwardList[++this._currentBackForwardIndex], {fromBackForwardAction: true}); 856 870 this._updateBackAndForwardButtons(); 857 871 },
Note: See TracChangeset
for help on using the changeset viewer.