Changeset 92212 in webkit
- Timestamp:
- Aug 2, 2011 11:32:46 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92210 r92212 1 2011-08-02 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: SourceFrame should store saved scroll positions in View. 4 https://bugs.webkit.org/show_bug.cgi?id=65472 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/ResourcesPanel.js: 9 (WebInspector.FrameResourceTreeElement.prototype._recreateSourceView): 10 * inspector/front-end/ScriptsPanel.js: 11 (WebInspector.ScriptsPanel.prototype._sourceFileChanged): 12 * inspector/front-end/SourceFrame.js: 13 (WebInspector.SourceFrame.prototype.show): 14 (WebInspector.SourceFrame.prototype.hide): 15 (WebInspector.SourceFrame.prototype.get scrollLeft): 16 (WebInspector.SourceFrame.prototype.set scrollLeft): 17 (WebInspector.SourceFrame.prototype.get scrollTop): 18 (WebInspector.SourceFrame.prototype.set scrollTop): 19 * inspector/front-end/View.js: 20 (WebInspector.View.prototype._innerShow): 21 (WebInspector.View.prototype._innerHide): 22 (WebInspector.View.prototype.detach): 23 (WebInspector.View.prototype.storeScrollPositions): 24 (WebInspector.View.prototype.inheritScrollPositionsFromView): 25 (WebInspector.View.prototype.restoreScrollPositions): 26 1 27 2011-08-02 Jeff Miller <jeffm@apple.com> 2 28 -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r90555 r92212 1400 1400 1401 1401 var oldViewParentNode = oldView.visible ? oldView.element.parentNode : null; 1402 var scrollTop = oldView.scrollTop;1402 newView.inheritScrollPositionsFromView(oldView); 1403 1403 1404 1404 this._sourceView.detach(); … … 1407 1407 if (oldViewParentNode) 1408 1408 newView.show(oldViewParentNode); 1409 if (scrollTop)1410 newView.scrollTop = scrollTop;1411 1409 1412 1410 return newView; -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r92185 r92212 653 653 654 654 var newSourceFrame = this._createSourceFrame(sourceFileId) 655 newSourceFrame. scrollTop = oldSourceFrame.scrollTop;655 newSourceFrame.inheritScrollPositionsFromView(oldSourceFrame); 656 656 this.visibleView = newSourceFrame; 657 657 }, -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r91749 r92212 84 84 85 85 this._ensureContentLoaded(); 86 87 if (this.loaded) { 88 if (this._scrollTop) 89 this._textViewer.scrollTop = this._scrollTop; 90 if (this._scrollLeft) 91 this._textViewer.scrollLeft = this._scrollLeft; 92 } 86 87 this.restoreScrollPositions(); 88 93 89 // Resize after setting the initial scroll positions to avoid unnecessary rendering work. 94 90 this._textViewer.resize(); … … 99 95 WebInspector.View.prototype.hide.call(this); 100 96 101 if (this.loaded) { 102 this._scrollTop = this._textViewer.scrollTop; 103 this._scrollLeft = this._textViewer.scrollLeft; 97 if (this.loaded) 104 98 this._textViewer.freeCachedElements(); 105 }106 99 107 100 this._textViewer.hide(); … … 169 162 }, 170 163 164 get scrollLeft() 165 { 166 return this.loaded ? this._textViewer.scrollLeft : 0; 167 }, 168 169 set scrollLeft(scrollLeft) 170 { 171 if (this.loaded) 172 this._textViewer.scrollLeft = scrollLeft; 173 }, 174 171 175 get scrollTop() 172 176 { 173 return this.loaded ? this._textViewer.scrollTop : this._scrollTop;177 return this.loaded ? this._textViewer.scrollTop : 0; 174 178 }, 175 179 176 180 set scrollTop(scrollTop) 177 181 { 178 this._scrollTop = scrollTop;179 182 if (this.loaded) 180 183 this._textViewer.scrollTop = scrollTop; -
trunk/Source/WebCore/inspector/front-end/View.js
r91359 r92212 51 51 { 52 52 this.element.addStyleClass("visible"); 53 this.restoreScrollPositions(); 53 54 }, 54 55 … … 67 68 _innerHide: function() 68 69 { 70 this.storeScrollPositions(); 69 71 this.element.removeStyleClass("visible"); 70 72 }, … … 80 82 if (this.element.parentNode) 81 83 this.element.parentNode.removeChild(this.element); 84 }, 85 86 storeScrollPositions: function() 87 { 88 this._scrollLeft = this.scrollLeft; 89 this._scrollTop = this.scrollTop; 90 }, 91 92 inheritScrollPositionsFromView: function(view) 93 { 94 this._scrollLeft = view._scrollLeft; 95 this._scrollTop = view._scrollTop; 96 }, 97 98 restoreScrollPositions: function() 99 { 100 this.scrollLeft = this._scrollLeft; 101 this.scrollTop = this._scrollTop; 82 102 } 83 103 }
Note: See TracChangeset
for help on using the changeset viewer.