Skip to content
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

Switching tabs in the nightly build resets scroll position #12061

Open
hannni opened this issue Jul 1, 2016 · 5 comments
Open

Switching tabs in the nightly build resets scroll position #12061

hannni opened this issue Jul 1, 2016 · 5 comments

Comments

@hannni
Copy link

@hannni hannni commented Jul 1, 2016

When scrolling down on a webpage, switching to another tab and back the scroll position is reset and back at the top of the site.

The expected behaviour is Servo to keep track of the scrolling position.

@metajack
Copy link
Contributor

@metajack metajack commented Jul 1, 2016

If we can get an outline of the solution posted by @glennw or someone, I think this might be an E-Easy candidate. We're probably just not storing this, or not sending it.

@jdm
Copy link
Member

@jdm jdm commented Jul 1, 2016

If it's just switching tabs rather than moving through history, I think those are unrelated.

@cbrewster
Copy link
Member

@cbrewster cbrewster commented Jul 1, 2016

@jdm ahh good catch, yes theses are unrelated.

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Jul 18, 2016

Test case:

<style>
  iframe {
    display: block;
    width: 300px;
    height: 300px;
  }
  iframe.off {
    visibility: hidden;
  }
</style>

<button onclick="toggleVisibility()">Click after scrolling</button>

<iframe src="http://news.ycombinator.com"></iframe>

<script>
  function toggleVisibility() {
    var f = document.querySelector("iframe");
    f.classList.toggle("off");
    setTimeout(function() {
      f.classList.toggle("off");
    }, 0);
  }
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.