-
Notifications
You must be signed in to change notification settings - Fork 132
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
Decide what to do with zoom and pan #56
Comments
If it hasn't been implemented, I would prefer dropping it. The idea is not a bad one, but it would look very different if it were proposed today (maybe more similar to meta viewport). |
Agreed. |
Agree that as written now it should be dropped. Will take some effort to remove from the spec so we'll mark it as 'at risk' for now. |
There is support for the zoomAndPan property in Firefox though there's not much to the implementation given there's no native zooom and pan UI. The only use would be for some kind of zoom and pan add on or control to check the zoomAndPan state to see whether to disable itself. |
Instead of AFAIK, there is no way of listening to zoom level change(I am happy to be wrong). If developers are allowed to listen to zoom level change, then they can programmatically have detail control over svg. |
SVG 1.1 has https://www.w3.org/TR/SVG11/single-page.html#script-InterfaceSVGZoomEvent It has already been removed from SVG2 despite the fact that |
I am looking at implementing zoom and pan in my Android library. And I am deciding whether to base it on the
Perhaps there is some potential overlap here with the Maps for HTML Community Group efforts? |
Yes, zoom & pan is definitely necessary for map viewers. And I'm trying to focus those efforts on reusable ideas which can be shared with other web platform features. And all your points are definitely relevant, to that discussion, too. That's really a separate question from the very broken zoomAndPan attribute, but reopening this issue anyway because we need to follow up on at risk versus completely removed. |
We removed what little ZoomEvent processing we had already https://bugzilla.mozilla.org/show_bug.cgi?id=1314388 doesn't seem like anyone noticed. |
Hmm... I just ran some tests and browser support is better than I was expecting based on previous comments. https://jsfiddle.net/b0dp64fh/4/ As it turns out, IE11 is the champion in this competition! Firefox ❌ The properties ( Chrome ✔️ Manipulating the properties works. IE11 ✔️ Manipulating the properties works. Edge 〰️ Manipulating Safari 〰️ Manipulating |
currentScale/currentTranslate only work in standalone SVG documents in Firefox so they won't work in a fiddle. |
As an aficionado of full page SVG web applications I am fond of zoom-pan. |
Chrome/Blink will only check the value of the |
Loading the equivalent standalone SVG into FF and Blink didn't seem to change the results significantly.
The only difference to my former results is that manipulating the |
What do you mean by "controls", @fsoder ? The scroll bars on the window? They don't seem to be tied in to the currentTranslate properties. Altogether, I'm not seeing any user-facing zoom & pan controls in either Chrome or Firefox. Pretty sure WebKit is the same. And the value of the attribute (not present, But, the We also need to clarify how they interact with other ways of setting & getting transformations on the root SVG: the transform property & attribute (which wasn't allowed on We currently have a note:
Which makes sense, because transform property on the outer applies to the box as a whole, and this properties are applying inside that box, more like a modification of the Last I checked, some browsers apply an SVG view transform as an external transform (on the outside box of the SVG) and some as an internal transform (to the viewBox-scaled graphics). I've previously argued that it should behave like a regular |
No, you can initiate panning by holding down the Shift-key and dragging. I refer to this as "controls" because it's pretty non-obvious that it's there. Panning perform like this is however reflected in |
Interesting. OK, now that I know how, I can pan the SVG in Chrome, for SVG as a separate tab or SVG as an
Well, that is really buggy. The Chrome UI shows the current browser zoom level & lets me change it, but the rendering doesn't update from whatever zoom level I had set when I opened the SVG. So, technically this is a (partial) implementation, but I'm not sure it's enough to save the feature. I don't suppose you have any way of measuring usage of the UI, now that there's no SVGZoom/SVGScroll event triggered by the user-initiated action? |
(I think this would only trigger at the equivalent of There's no measurements for activation of the panning feature. The only relevant metrics I'm aware of is |
The SVG Working Group just discussed
The full IRC log of that discussion<krit> topic: Decide what to do with zoom and pan<krit> GitHub: https://github.com//issues/56 <krit> AmeliaBR: zoom and pan is an attribute from SVG 1 that never got fully implemented by browsers <krit> AmeliaBR: last implementation was the Adobe SVG Plugin <krit> AmeliaBR: issue resurfaces last month when it was mentioned that there is interaction with other features <krit> AmeliaBR: with some that are implemented on the DOM level and we got feedback from UAs what does and does not work <krit> AmeliaBR: Blink does have some panning and zooming and it is buggy in the edge cases. Not sure if it counts as an implementation that needs preserving <krit> AmeliaBR: unfortunately they don't have metrics <krit> AmeliaBR: it works for standalone SVGs and embedded SVGs. <krit> AmeliaBR: but it is not intecreted with zoomon <krit> s/zoomon/zooming/ <krit> AmeliaBR: my proposal is to drop the attribtue <krit> AmeliaBR: but keep the DOM properties but define them better in a way that interacts with other features like viewBox and the SVG view behaviour. <krit> AmeliaBR: but it still needs work to figure out what the redefinition would look like <krit> AmeliaBR: but that can be discussed separately <krit> krit: what are the alternatives used today? <krit> chris: manipulate the viewBox using script or apply transform using script <krit> AmeliaBR: zoom and pan is about telling the browther to use its own zoom and pan with defaults and an attribute to disable that <chris> it seems fine to me to drop the attr <krit> AmeliaBR: since most browsers don't use zoom and pan features, ppl are not using the attribute to disable it. So if browsers would start implementing it it would break things to. <krit> s/to/too/ <krit> myles: removing it makes sense to remove it <krit> chris: Agree. It gives control over a not implemented feature. <krit> AmeliaBR: I'd like to have an opt-in for a browser zoom and pan feature but it probably wouldn't work this way. <krit> myles: If there is a new proposal we can have a clean cut <krit> proposal: remove zoomAndPan attribute and expectation for zoom and pan feature. <krit> RESOLUTION: remove zoomAndPan attribute and expectation for zoom and pan feature. <krit> krit: 2nd part is the redefinition of the DOM features <AmeliaBR> https://svgwg.org/svg2-draft/struct.html#__svg__SVGSVGElement__currentScale <krit> AmeliaBR: there is a currentScale and currentRotate DOM properties on the SVGSVGelement <krit> krit: for that we need to define in which cascade they apply? <krit> AmeliaBR: yeah. They need to get redefined as something that is independent from the zoomAndPan attribute and how they interact with things like getCTM() <krit> krit: Do we know in which order it applies to in combination with viewBox and transform attribute? <krit> AmeliaBR: haven't looked into it. <krit> krit: so there are more actions needed how the properties interact with other coordinate system manipulating attributes and functions like getCTM() <krit> krit: should we open a new issue for that? <krit> AmeliaBR: might make sense to have a new issue but we can leave it for now and I take an. action to start the edit and see how much work it is. <krit> AmeliaBR: ok, so leave the issue open and AmeliaBR gets back to the group |
OK. Tearing out zoomAndPan is pretty straightforward. Coming up with a sensible definition of how PS, demo for the mess. Three ways to set a transform on the SVG root, most browsers treat each one differently, major browsers are different from each other: https://bronze-soup.glitch.me/ |
The
zoomAndPan
features from SVG 1 are not implemented in browsers as initially proposed. The section is still in SVG 2, however.We either need commitments from implementers to add zoom & pan control, or need to significantly revise/remove this section.
The text was updated successfully, but these errors were encountered: