Intent to Remove: SVGSVGElement.suspendRedraw, unsuspendRedraw[All] and forceRedraw

101 views
Skip to first unread message

Erik Dahlstrom

unread,
Feb 2, 2015, 5:28:41 AM2/2/15
to blink-dev.chromium.org
Primary eng (and PM) emails
e...@opera.com

Summary
The methods suspendRedraw, unsuspendRedraw[All] and forceRedraw on the
SVGSVGElement interface are currently implemented as stubs. For that
reason I have skipped the intent-to-deprecate, the methods have de-facto
been deprecated for quite some time.

Motivation
Since these methods don't do anything useful I'd like to see if we can
drop them completely.

Usage information from UseCounter
None collected.

How much of the web are you going to break?
Given that these methods are no-ops in most browsers it seems reasonable
to assume that there's no significant amount of content depending on them.
Any content that doesn't check if the methods exist before calling them
will potentially break.

Entry on chromestatus.com
There's no entry.

Compatibility Risk
These methods are no-ops in Gecko, see
https://github.com/mozilla/gecko-dev/blob/fa348d6809f694b7eb4c3adf099614ea70067e3c/dom/svg/SVGSVGElement.cpp#L285.

Similarly in WebKit, see
https://github.com/WebKit/webkit/blob/14314faa7e3b7c05563a52c7dd2f5ff5be421cb0/Source/WebCore/svg/SVGSVGElement.cpp#L317
and https://bugs.webkit.org/show_bug.cgi?id=11275.


--
Erik Dahlstrom, Web Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group

PhistucK

unread,
Feb 2, 2015, 6:38:18 AM2/2/15
to Erik Dahlstrom, blink-dev.chromium.org
A method has a much higher bar for removal, regardless of its purpose or consequences. I think a use counter should be added, just to make sure code does not break all of a sudden.

However, if a Googler can search the index for such calls, that could help deciding it is useless...


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Erik Dahlstrom

unread,
Feb 2, 2015, 8:40:35 AM2/2/15
to blin...@chromium.org
It's certainly possible to add a UseCounter for any calls to these methods, but I'm afraid that wouldn't really answer the question of whether content would break or not. E.g I'm not sure how to exclude calls that were enclosed in try/catch or calls that checked for the methods existence first.

The calls are part of this (wider scoped) UseCounter: https://www.chromestatus.com/metrics/feature/timeline/popularity/567 (currently 0.0304). That gives an upper bound for how much content might potentially be affected.


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

PhistucK

unread,
Feb 2, 2015, 9:04:03 AM2/2/15
to Erik Dahlstrom, blink-dev
Then the index search would give us a clearer picture. I hope some Googler can get the results, hopefully with a shallow verification of no try/catch/method existence verification. :)


PhistucK

Stephen Chenney

unread,
Feb 2, 2015, 10:41:29 AM2/2/15
to PhistucK, Erik Dahlstrom, blink-dev
Does IE support it? I doubt it, but if it did that would justify some kind of use counter. Otherwise, no browser of note implements it and I can't believe people actually used it, particularly the libraries that most people use for SVG content.

What's the spec status or working group opinion? A link to that would be helpful.

Cheers,
Stephen.

Simon Pieters

unread,
Feb 2, 2015, 11:11:22 AM2/2/15
to Erik Dahlstrom, PhistucK, blink-dev, Stephen Chenney
On Mon, 02 Feb 2015 15:03:18 +0100, PhistucK <phis...@gmail.com> wrote:

> Then the index search would give us a clearer picture. I hope some
> Googler
> can get the results, hopefully with a shallow verification of no
> try/catch/method existence verification. :)

On github search I see 21,225 results in just .js files:

https://github.com/search?l=javascript&q=suspendRedraw+OR+unsuspendRedraw+OR+forceRedraw&type=Code&utf8=✓

Not all of them are relevant, but it's easy to find unconditional
invocations.


In httparchive:

SELECT page, url, body
FROM [httparchive:runs.2014_08_15_requests_body]
WHERE REGEXP_MATCH(body, r"\b(un)?(suspend|force)Redraw\b")

652 rows

SELECT page, COUNT(*) as num
FROM [test.suspendRedraw]
GROUP BY page
ORDER BY num desc;

633 rows

There are 129,236 pages in the dataset, so ~0.05% of the pages match.

If someone wants to analyze the httparchive data further, the matching
rows including response body is available here (64.58 MB):

https://storage.googleapis.com/zcorpan/suspendRedraw.csv.gz



On Mon, 02 Feb 2015 16:41:25 +0100, Stephen Chenney
<sche...@chromium.org> wrote:

> Does IE support it?

IE11 does at least.

https://www.browserstack.com/screenshots/d09703e5286ac62e484903b48f10f9863ffbeb10/win8.1_ie_11.0.png

--
Simon Pieters
Opera Software

Simon Pieters

unread,
Feb 2, 2015, 2:17:50 PM2/2/15
to Erik Dahlstrom, PhistucK, blink-dev, Stephen Chenney
On Mon, 02 Feb 2015 17:11:14 +0100, Simon Pieters <sim...@opera.com> wrote:

> On Mon, 02 Feb 2015 15:03:18 +0100, PhistucK <phis...@gmail.com> wrote:
>
>> Then the index search would give us a clearer picture. I hope some
>> Googler
>> can get the results, hopefully with a shallow verification of no
>> try/catch/method existence verification. :)
>
> On github search I see 21,225 results in just .js files:
>
> https://github.com/search?l=javascript&q=suspendRedraw+OR+unsuspendRedraw+OR+forceRedraw&type=Code&utf8=✓
>
> Not all of them are relevant, but it's easy to find unconditional
> invocations.

Just "suspendRedraw" gives 1,801 results.

https://github.com/search?l=javascript&q=suspendRedraw&ref=searchresults&type=Code&utf8=✓

Excluding "try" results in 192 matches, but this is obviously blunt since
a script can use try/catch for other things.

https://github.com/search?l=javascript&q=suspendRedraw+NOT+try&ref=searchresults&type=Code&utf8=✓


> In httparchive:
>
> SELECT page, url, body
> FROM [httparchive:runs.2014_08_15_requests_body]
> WHERE REGEXP_MATCH(body, r"\b(un)?(suspend|force)Redraw\b")
>
> 652 rows
>
> SELECT page, COUNT(*) as num
> FROM [test.suspendRedraw]
> GROUP BY page
> ORDER BY num desc;
>
> 633 rows
>
> There are 129,236 pages in the dataset, so ~0.05% of the pages match.

Oops. ~0.51%.

> If someone wants to analyze the httparchive data further, the matching
> rows including response body is available here (64.58 MB):
>
> https://storage.googleapis.com/zcorpan/suspendRedraw.csv.gz

I looked at some of them and it seems there is some amount of custom
forceRedraw() functions which is not relevant.

Searching for just ".suspendRedraw(" gives only 7 matches (~0.005%).

SELECT url
FROM [httparchive:runs.2014_08_15_requests_body]
WHERE REGEXP_MATCH(body, r'\.suspendRedraw\s*\(')

http://www.virtual-expo.com/wp-content/themes/halfscreen/design/js/libs/cluster.js
http://www.ait-themes.com/wp-content/themes/aitthemes/design/js/libs/cluster.js
http://www.mojotech.com/js/vendor/svg.js
http://www.muschealth.org/js/svg/svg.js
http://www.ntglobal.org/wp-content/themes/creator/design/js/libs/cluster.js
http://www.muschealth.org/js/svg/svg.js
https://static.4virtuals.com/js/22a9a01b.main.js

Elliott Sprehn

unread,
Feb 2, 2015, 9:18:08 PM2/2/15
to Simon Pieters, Erik Dahlstrom, PhistucK, blink-dev, Stephen Chenney
Given that these are no-ops anyway they're not much burden to the engine, removing them seems like it's just going to cause broken pages for little return.

Simon Pieters

unread,
Feb 3, 2015, 3:46:33 AM2/3/15
to Elliott Sprehn, Erik Dahlstrom, PhistucK, blink-dev, Stephen Chenney
On Tue, 03 Feb 2015 03:17:21 +0100, Elliott Sprehn <esp...@chromium.org>
wrote:

> Given that these are no-ops anyway they're not much burden to the engine,
> removing them seems like it's just going to cause broken pages for little
> return.

I agree. They are specified as no-ops in SVG2 except for forceRedraw(),
but that should be specified as a no-op as well to match implementations.
I've filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=27947

Erik Dahlström

unread,
Feb 3, 2015, 9:44:45 AM2/3/15
to Elliott Sprehn, Simon Pieters, PhistucK, blink-dev, Stephen Chenney
Thanks everyone for the constructive feedback. I retract the intent to
remove for now.

Since the methods are no-ops I still think it would be good to generate
warnings in the developer console about them being deprecated, e.g
"SVGSVGElement.{methodname} is now a no-op, as per SVG2 {link to spec}.".

Unless there are any objections to that I'll file a patch adding the
deprecation messages (and corresponding UseCounters) shortly.

PhistucK

unread,
Feb 3, 2015, 12:25:13 PM2/3/15
to Erik Dahlström, Elliott Sprehn, Simon Pieters, blink-dev, Stephen Chenney
That makes sense. Make sure you mention it is deprecated (and will be removed "soon"?), rather than just mentioning it is a no operation method.


PhistucK

Philip Jägenstedt

unread,
Feb 3, 2015, 3:53:05 PM2/3/15
to Erik Dahlström, Elliott Sprehn, Simon Pieters, PhistucK, blink-dev, Stephen Chenney
I'm a bit torn about having deprecation messages for things we never
intend to remove regardless of the usage, but it seems worth it if
there are people who expect these functions to do something.
NodeIterator.detach() and Range.detach() are other examples of this
that you could emulate.

Philip

Philip Rogers

unread,
Feb 3, 2015, 4:11:11 PM2/3/15
to Philip Jägenstedt, Erik Dahlström, Elliott Sprehn, Simon Pieters, PhistucK, blink-dev, Stephen Chenney
I agree with Philip and think that usecounter'ing these would be fine for now.

I did a quick search and it looks like the bulk of the usage is from svg.js (http://svgjs.com).
Reply all
Reply to author
Forward
0 new messages