New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 367890 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Compat



Sign in to add a comment

Investigate either deprecating or properly implementing SVGZoomEvent

Project Member Reported by pdr@chromium.org, Apr 28 2014

Issue description

SVGZoomEvent [1] doesn't currently work at all, but it appears to be supported in all other major browsers. We should investigate either pushing for deprecation or properly implementing this feature.

[1] https://svgwg.org/svg2-draft/single-page.html#script-InterfaceSVGZoomEvent
 

Comment 1 by dschu...@601t.com, May 6 2014

Demo. An alert box should appear if on zoom fires.

It seems that Firefox fires the event before zooming. IE and Presto after.

Safari and Blink don't support the event as mentioned by pdr.
svgzoom.svg
277 bytes Download
Cc: dschulze@chromium.org
Cc: phil...@opera.com
Labels: -Type-Bug Type-Compat
Seems wrong that we have this type but it's not actually wired up (eg. feature detection for SVGZoomEvent will pass - for example http://rbyers.github.io/InputDevice/tests/inputdevice-script.html#usePolyfill).

I'd say if we never actually fire this event, and don't have immediate plans to do so, we should remove the web-exposed surface area.  Philip, WDYT?  Maybe a Hotlist-GoodFirstBug?

Comment 4 by phil...@opera.com, Jul 9 2015

Cc: f...@opera.com ed@chromium.org
The spec is vague: "The zoom event occurs when the user initiates an action which causes the current view of the SVG document fragment to be rescaled."

To fire it on any user initiated zoom, like a pinch zoom, doesn't seem sound jank-wise, not sure if that's the intention.

It looks like Gecko does have code that would fire the event, but I'm not sure when.

SVG experts, do you think that this event makes any sense?

Comment 5 by f...@opera.com, Jul 10 2015

In Presto I believe we dispatched this even when the user scale (SVGSVGElement.currentScale [1]) changed.

Looking at SVG 1.1 that seems to be what it has to say about it too [2]. SVG2 still has the same text AFAICT. (See also TC above... which I noticed now)

So, this event would not (necessarily) be dispatched on "any user initiated zoom", even though I suppose it could in the cases where <svg> is the document element in the top-level browsing context (IIRC we did not do that in Presto). If SVGSVGElement.currentScale isn't changed, then no event would be sent pretty much (in my interpretation).

Having a "loose" SVGZoomEvent sounds pretty busted to me. Goes pretty well together with the busted currentScale implementation though I suppose... ( issue 174568  and just look at the code...)

And then about "making sense"... It probably only actually make sense if it's triggerable through some user-action (in Presto we had shortcuts to zoom-in/out of SVG fragments for instance.) I'm not aware of that same functionality in Blink/Chromium, so not much sense there I suppose.

[1] http://www.w3.org/TR/SVG11/struct.html#__svg__SVGSVGElement__currentScale
[2] 'SVGZoom' in http://www.w3.org/TR/SVG11/interact.html#SVGEvents

Comment 6 by phil...@opera.com, Jul 10 2015

Is there any connection to useCurrentView and currentView which have been removed from the spec, or just currentScale?

https://github.com/w3c/svgwg/commit/4c26fd36937a65192024208d85c144a21071b057

Comment 7 by f...@opera.com, Jul 10 2015

AFAICR, there's no connection between them (currentView does not affect currentScale even though it can add additional scaling to the "view". currentView it's essentially tied to the mechanism by which a fragment modifies the view of an SVG.)

Comment 8 by phil...@opera.com, Jul 10 2015

If I were to search for use of SVGZoomEvent usage in httparchive, is it just the case-insensitive strings "SVGZoomEvent" and "SVGZoomEvents" I should look for, or can there be events using this interface with another event name?

Comment 9 by f...@opera.com, Jul 10 2015

Maybe you should also search for SVGZoom (which is what the event name supposed to be IIRC). Or well, also maybe "only"...

Comment 10 by phil...@opera.com, Jul 10 2015

OK, I'll do a case-insensitive search for SVGZoom.

Comment 11 by phil...@opera.com, Jul 10 2015

There were a lot of matches for SVGZoomAndPan, but only a measly 42 excluding that. Of those all but one seems to be blueconic.min.js, where the string appears in a long list of global attributes, I presume to filter it or something, but not to actually use it.

What remains is http://www.viewerjs.org/javascripts/sie.js

This looks like it's trying to polyfill the SVGZoomEvent.

So, sure seems like something unused that would be easy to remove, unless of course it's a really good API and no one has noticed yet :)

Comment 12 by phil...@opera.com, Jul 10 2015

There were a lot of matches for SVGZoomAndPan, but only a measly 42 excluding that. Of those all but one seems to be blueconic.min.js, where the string appears in a long list of global attributes, I presume to filter it or something, but not to actually use it.

What remains is http://www.viewerjs.org/javascripts/sie.js

This looks like it's trying to polyfill the SVGZoomEvent.

So, sure seems like something unused that would be easy to remove, unless of course it's a really good API and no one has noticed yet :)

Comment 13 by f...@opera.com, Jul 10 2015

> What remains is http://www.viewerjs.org/javascripts/sie.js
> This looks like it's trying to polyfill the SVGZoomEvent.

Yeah, that wall of text looks like it some form of SVG polyfill... (I saw svgtovml or something at the end)

> ..., unless of course it's a really good API and no one has noticed yet 

Isn't that always the case? ;-)

Comment 14 by phil...@opera.com, Jul 10 2015

Filed a spec issue seeking input:
https://github.com/w3c/svgwg/issues/21

Comment 15 by phil...@opera.com, Feb 5 2016

Cc: davve@opera.com
Good news, SVGZoomEvent is gone from the spec! Anyone keen to attempt removal in Blink?

Comment 16 by davve@opera.com, Feb 5 2016

Owner: davve@opera.com
So do we deprecate onzoom="..." first or go straight to removal? Since it's non-functional today plus having low usage according to httparchive perhaps it's alright to remove it straight away?

Comment 17 by phil...@opera.com, Feb 5 2016

Looks like onzoom exists only in core/svg/SVGAttributeNames.in? Even it's a functional event handler content attribute (because of macros) it seems fine to remove together with SVGZoomEvent without further measurements.

Comment 18 by phil...@opera.com, Feb 5 2016

I was confused, there are no use counters for this yet, because the whole of SVGZoomEvent is very nearly dead code.

Comment 19 by davve@opera.com, Feb 5 2016

Seems like the safest way forward is to request deprecation for SVGZoomEvent and when onzoom="..." is used. So deprecated in M50 and possibly removed in M51.
Project Member

Comment 20 by bugdroid1@chromium.org, Feb 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3593524a1ffcca4b91dacd355b6fc3145ffa223d

commit 3593524a1ffcca4b91dacd355b6fc3145ffa223d
Author: davve <davve@opera.com>
Date: Wed Feb 17 02:56:34 2016

Deprecate SVGZoomEvent and SVGZoomEvents

Deprecate the SVGZoomEvent interface and the corresponding onzoom
attribute. Show deprecation message to the user when creating the
event or when setting up an event handler using onzoom="..." on
<svg:svg>.

Intent to deprecate:

https://groups.google.com/a/chromium.org/d/msg/blink-dev/5PEUh2qHa7c/IUGlM4a9CQAJ

BUG= 367890 

Review URL: https://codereview.chromium.org/1691883003

Cr-Commit-Position: refs/heads/master@{#375771}

[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/LayoutTests/svg/custom/immutable-properties-expected.txt
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/Source/build/scripts/make_event_factory.py
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[modify] http://crrev.com/3593524a1ffcca4b91dacd355b6fc3145ffa223d/tools/metrics/histograms/histograms.xml

Comment 21 by davve@opera.com, Feb 17 2016

To correct https://code.google.com/p/chromium/issues/detail?id=367890#c19, the removal is planned for M52 in order for us to have time to look at the counter data from stable.

Comment 22 Deleted

Comment 23 Deleted

Apparently, after further investigation, D3.js uses the wheel event instead of the zoom event.  So there's no concern about deprecating or removing zoom.
Cc: sshruthi@chromium.org rbyers@chromium.org
Labels: Hotlist-PredictabilityInfra
Usage is basically 0: https://www.chromestatus.com/metrics/feature/timeline/popularity/1232

The deprecation message says this will be removed in M52, and obviously that didn't happen.  Anyone keen to do the intent to remove (should be trivial) and remove the code here?

If there's no concrete plan to actually remove this API in M54 then we should remove the deprecation message.
Owner: shanmug...@samsung.com
Status: Assigned (was: Available)
I will do it!!

Comment 27 by davve@opera.com, Jul 5 2016

Thanks shanmuga.m for picking it up when I apparently dropped it on the floor.
Status: Started (was: Assigned)
Welcome David!!
Please have a look https://codereview.chromium.org/2133983003/
Project Member

Comment 29 by bugdroid1@chromium.org, Jul 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3456eac8244e0afc9f0f1e276a0625c7fec10dd6

commit 3456eac8244e0afc9f0f1e276a0625c7fec10dd6
Author: shanmuga.m <shanmuga.m@samsung.com>
Date: Wed Jul 13 07:05:12 2016

Remove SVGZoomEvent interface and onzoom attribute

Remove SVGZoomEvent(s) interface and its corresponding
onzoom attribute.

It has been removed from SVG 2.0 specification.

BUG= 367890 

Review-Url: https://codereview.chromium.org/2133983003
Cr-Commit-Position: refs/heads/master@{#405061}

[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/fast/events/event-creation.html
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/Document-createEvent-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/global-constructors-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/immutable-properties-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/script-tests/global-constructors.js
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/script-tests/immutable-properties.js
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/dom/svg2-inheritance-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/dom/svg2-inheritance.html
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/build/scripts/make_event_factory.py
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/events/EventAliases.in
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/svg/SVGAttributeNames.in
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[delete] https://crrev.com/b39abd27bae2248520b90fe932504afbbd7debd6/third_party/WebKit/Source/core/svg/SVGZoomEvent.cpp
[delete] https://crrev.com/b39abd27bae2248520b90fe932504afbbd7debd6/third_party/WebKit/Source/core/svg/SVGZoomEvent.h
[delete] https://crrev.com/b39abd27bae2248520b90fe932504afbbd7debd6/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl

Cc: -phil...@opera.com foolip@chromium.org
Status: Fixed (was: Started)
Project Member

Comment 31 by bugdroid1@chromium.org, Jul 13 2016

Labels: merge-merged-2795
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3456eac8244e0afc9f0f1e276a0625c7fec10dd6

commit 3456eac8244e0afc9f0f1e276a0625c7fec10dd6
Author: shanmuga.m <shanmuga.m@samsung.com>
Date: Wed Jul 13 07:05:12 2016

Remove SVGZoomEvent interface and onzoom attribute

Remove SVGZoomEvent(s) interface and its corresponding
onzoom attribute.

It has been removed from SVG 2.0 specification.

BUG= 367890 

Review-Url: https://codereview.chromium.org/2133983003
Cr-Commit-Position: refs/heads/master@{#405061}

[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/android_webview/tools/system_webview_shell/test/data/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/fast/events/event-creation.html
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/Document-createEvent-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/global-constructors-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/immutable-properties-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/script-tests/global-constructors.js
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/custom/script-tests/immutable-properties.js
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/dom/svg2-inheritance-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/svg/dom/svg2-inheritance.html
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/build/scripts/make_event_factory.py
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/events/EventAliases.in
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/svg/SVGAttributeNames.in
[modify] https://crrev.com/3456eac8244e0afc9f0f1e276a0625c7fec10dd6/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[delete] https://crrev.com/b39abd27bae2248520b90fe932504afbbd7debd6/third_party/WebKit/Source/core/svg/SVGZoomEvent.cpp
[delete] https://crrev.com/b39abd27bae2248520b90fe932504afbbd7debd6/third_party/WebKit/Source/core/svg/SVGZoomEvent.h
[delete] https://crrev.com/b39abd27bae2248520b90fe932504afbbd7debd6/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl

Components: Blink>Infra>Predictability
Labels: -Hotlist-PredictabilityInfra

Sign in to add a comment