Issue metadata
Sign in to add a comment
|
SVG with #target from same domain scrolls page
Reported by
dawid.ci...@gmail.com,
Aug 25 2016
|
||||||||||||||||||||||||
Issue description
Chrome Version : 52.0.2743.116 (Official Build) m (32-bit)
URLs (if applicable) :
Other browsers tested:
Firefox: 43.0.1 OK
IE: 11 OK
What steps will reproduce the problem?
(1) Upload zip contents to a webserver.
(2) Open http://your.url.com/path/test_failure.html in Chrome
(3) Open http://your.url.com/path/test_success.html in Chrome
What is the expected result?
Window should not get scrolled with both pages.
What happens instead?
Window gets scrolled to the bottom of svg once it loads from the same web path as test_failue.html. Window does not get scrolled once the exact same svg loads from a different domain.
Please provide any additional information below. Attach a screenshot if
possible.
Problem only occurs if an svg:
(1) Is placed on page using the object tag.
(2) Has a #target defined in the url/data attribute.
(3) Is loaded from a different domain.
,
Aug 26 2016
Tested the same on mac 10.11.6 chrome version 52.0.2743.116 and canary - Window scrolled with both pages. But the same is observed with firefox browser as well. Seems this is not chrome specific issue. Could you please recheck and update the thread.
,
Aug 26 2016
Set up a few VMs and here's what I got: Firefox 37.0.1/OSX 10.6.8 OK Firefox 43.0.1/XPx86 OK Firefox 48.0.2/W7x86 OK Firefox 48.0.2/OS X 10.6.8 OK IE 9.0.8112.16421/W7x86 OK IE 10.0.9200.17.457/W7x86 OK IE 11.545.10586.0/W10x64 OK Safari 5.1.10/OSX 10.6.8 FAIL Could not make Firefox fail, can you specify which version exhibits the same incorrect behaviour on your Mac?
,
Aug 27 2016
Let me add why I think this is important: stylable SVG sprites. When you have two dozen icons on a page whose visual properties need to be animated, it's a lot better if they're contained in one single SVG download than have two-dozen-minus-one requests fly over the wire from a perf standpoint. (See here: https://www.sitepoint.com/use-svg-image-sprites/ for more info.)
,
Aug 29 2016
,
Aug 29 2016
Waiting on tkonchada to respond to comment #3. If the bug is real, mark as Untriaged and un-assign owner. I can see why this is important, and my guess is that we are triggering auto-scroll based on history. That is, trying to get you to the same place you were the last time you viewed the content. This may be extremely hard to fix for all use cases because we can't know if the SVG in question is primary content or a re-used sprite.
,
Aug 29 2016
Thanks for looking into this. The way I see it is that no browser other than WebKit-based ones seem to try to get you to the same place in case of svg content. I can think of few cases where this would be the expected behaviour, but then my knowledge and real-world experience with this stuff is surely not nearly as comprehensive as yours.
,
Aug 29 2016
It's not so much about history, as about trying to scroll to the anchor ('#circle'), we then "propagate" this scroll - at least up to the closest ancestor same-origin "frame" (which is presumably why test_success.html works.)
I think we could quite trivially not scroll (at all) if the document is an SVG document. Or stop the propagation at the frame-boundary.
I guess you wouldn't be using <object> for this (it'll be quite heavyweight for any non-trivial amount of sprites) if :target worked properly in <img> and background-image =/ (see issue 549590)
,
Aug 30 2016
You are correct in saying it's about anchors and not scroll history. The main reason I we hoped to use <object> instead of <img> was the ability to style and animate the insides from the parent document, which AFAIK is only possible with <object> and <svg>.
,
Aug 30 2016
It's possible to animate (and style, within strict limits) in <img>, but it can't do so in response to input for instance.
,
Sep 27 2016
Hm, as far as I could tell no styling was possible in <img>. What I had to resort to was server-side svg inlining for small images and client-side injection for bigger ones wherever the client wanted any sort of styling done.
,
Dec 30 2016
dawid.ciecierski@, Could you please let us know if this is still an issue with latest stable version 55.0.2883.87
,
Dec 30 2016
It is, the incorrect scrolling behaviour is still present in 55.0.2883.87 (64-bit) on Windows 10 Pro.
,
Jan 3 2017
I agree that disabling auto-scroll within SVG is the way to go.
,
Apr 12 2017
,
Oct 4 2017
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by dawid.ci...@gmail.com
, Aug 25 20161.4 KB
1.4 KB Download