8000 Fix Webview scroll position Preserving by mjbvz · Pull Request #21531 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Webview scroll position Preserving #21531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2017

Conversation

mjbvz
Copy link
Collaborator
@mjbvz mjbvz commented Feb 28, 2017

Bug
A regression since 1.9 caused the scroll preserve behavior of webviews to stop working in certain cases. There appears to be a race condition where newFrame.contentDocument.body does not exist when the scroll preserve code is called

Fix
Instead of using a timeout, update the scroll position when DOMContentLoaded is fired from the webview window

Fixes #21491

**Bug**
Some regression since 1.9 caused the scroll preserve behavior of webviews to stop working in certain cases. There appears to be a race condition where `newFrame.contentDocument.body` does not exist when the scroll update code is called

**Fix**
Instead of using a timeout, update the scroll position when `DOMContentLoaded` is fired from the webview window

Fixes microsoft#21491
@mention-bot
Copy link

@mjbvz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jrieken and @bpasero to be potential reviewers.

@mjbvz mjbvz self-assigned this Feb 28, 2017
@mjbvz mjbvz requested a review from alexdima February 28, 2017 01:59
@mjbvz
Copy link
Collaborator Author
mjbvz commented Feb 28, 2017

I'm still testing to make sure all cases are handled. If everything looks good, I'll take this change into master. @alexandrudima and @kieferrm, any thoughts on also cherry picking this into 1.10?

@mjbvz mjbvz merged commit b67a45d into microsoft:master Feb 28, 2017
@mjbvz mjbvz deleted the fix-webiew-scroll-preserve branch March 1, 2017 01:19
mjbvz added a commit that referenced this pull request Mar 1, 2017
**Bug**
Some regression since 1.9 caused the scroll preserve behavior of webviews to stop working in certain cases. There appears to be a race condition where `newFrame.contentDocument.body` does not exist when the scroll update code is called

**Fix**
Instead of using a timeout, update the scroll position when `DOMContentLoaded` is fired from the webview window

Fixes #21491
@mjbvz mjbvz added this to the March 2017 milestone Mar 1, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown preview scrolls to top when "scroll-lock" is turned off
3 participants
0