Bug 41620 - Web Inspector: preserve scroll positions in source frame when switching between panes.
Summary: Web Inspector: preserve scroll positions in source frame when switching betwe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 09:41 PDT by Pavel Feldman
Modified: 2010-07-05 11:04 PDT (History)
9 users (show)

See Also:


Attachments
[PATCH] Proposed fix. (2.89 KB, patch)
2010-07-05 09:46 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-07-05 09:41:45 PDT
Patch to follow.
Comment 1 Pavel Feldman 2010-07-05 09:46:09 PDT
Created attachment 60549 [details]
[PATCH] Proposed fix.
Comment 2 Joseph Pecoraro 2010-07-05 10:38:32 PDT
Comment on attachment 60549 [details]
[PATCH] Proposed fix.

> +++ b/WebCore/inspector/front-end/SourceFrame.js
> +        if (visible) {
> +            if (this._textViewer && this._scrollTop)
> +                this._textViewer.element.scrollTop = this._scrollTop;
> +            if (this._textViewer && this._scrollLeft)
> +                this._textViewer.element.scrollLeft = this._scrollLeft;
> +        } else {

You could have prevented a duplicate check by doing an if (this._textViewer)
block like you already do in the else.

>              this._hidePopup();
> -            if (this._textViewer)
> +            if (this._textViewer) {
> +                this._scrollTop = this._textViewer.element.scrollTop;
> +                this._scrollLeft = this._textViewer.element.scrollLeft;
>                  this._textViewer.freeCachedElements();
> +            }

There is a call to this._createViewerIfNeeded above this if/else. I
think that would have created a viewer in this case so that this
check wouldn't be necessary, but I think its good to be safe.


Thanks!
Comment 3 WebKit Commit Bot 2010-07-05 11:04:41 PDT
Comment on attachment 60549 [details]
[PATCH] Proposed fix.

Clearing flags on attachment: 60549

Committed r62496: <http://trac.webkit.org/changeset/62496>
Comment 4 WebKit Commit Bot 2010-07-05 11:04:46 PDT
All reviewed patches have been landed.  Closing bug.