Intent to Remove : document.clear

43 views
Skip to first unread message

Deepak

unread,
May 19, 2015, 2:12:47 AM5/19/15
to blin...@chromium.org


Primary eng (and PM) emails

phi...@opera.com
a...@chromium.org


Summary

Remove the Document.clear() method.


Motivation

It is a NH4 era method that is no op in all browsers.
It is specced to do nothing.
www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-clear


Compatibility Risk

Virtually none. It's not implemented by Firefox or IE, and usage is as low as it gets.


Alternative implementation suggestion for web developers

document.open can be used to clear the screen.


Usage information from UseCounter

Usage > 0.0038%


Entry on chromestatus.com, crbug.com, or MDN

crbug: http://code.google.com/p/chromium/issues/detail?id=238784

chromestatus :

http://www.chromestatus.com/metrics/feature/timeline/popularity/74

Requesting approval to remove too?

Yes.

Philip Jägenstedt

unread,
May 19, 2015, 5:27:10 AM5/19/15
to Deepak, blink-dev
As noted in the motivation, this is part of the HTML spec. I just tested and it is supported in both IE11 and Firefox Nightly, and it's still in the WebKit source code.

While Document.clear() used to be deprecated, I "undeprecated" it about a year ago:

Even though the usage is low, I think we should leave Document.clear() alone, as we already have interoperability and it adds no complexity to the code base. It's one of many in this category, others are Attr.specified, DOMImplementation.hasFeature(), Document.captureEvents() and SVGSVGElement.suspendRedraw().

If you enjoy removing things, Range.compareNode() and Range.expand() are already deprecated and ripe for removal :)

Philip
Reply all
Reply to author
Forward
0 new messages