Intent to Deprecate and Remove: document.all.

532 views
Skip to first unread message

Mike West

unread,
Oct 14, 2013, 11:13:49 AM10/14/13
to blink-dev
Primary eng (and PM) emails

mk...@chromium.org


Summary

IE11 has removed document.all[1]. I'd suggest we support them by doing the same.


Motivation

document.all is nonstandard, and better implemented by a variety of other DOM methods (querySelector, etc.)


Usage information from UseCounter

If I'm reading the data correctly (DocumentAllLegacyUsage?), the usage is very minimal. Less than 0.0001%.


Compatibility Risk

document.all is supported by pretty much all browsers, as it was The Right Way to do things way back when. It's no longer the right way to do things, and IE dropping it means that it's really and truly dead going forward.


Row on feature dashboard?

No.


Requesting approval to remove too?

Yes. Though I'd certainly be open to deprecating for now, and removing later if the change is deemed risky.



-mike

Mark Pilgrim

unread,
Oct 14, 2013, 11:22:26 AM10/14/13
to Mike West, blink-dev
On Mon, Oct 14, 2013 at 11:13 AM, Mike West <mk...@chromium.org> wrote:
> IE11 has removed document.all[1]. I'd suggest we support them by doing the
> same.

I heartily endorse this event or product.

Kenji Baheux

unread,
Oct 14, 2013, 11:22:18 AM10/14/13
to Mike West, blink-dev
Maybe I stumble upon one of the 0.0001% instances but IIRC I had to deal with a site compatibility issue once where they were using document.all and something else down the line which didn't work. 

Any reason why we should not trust UseCounter on this one?


2013/10/15 Mike West <mk...@chromium.org>

Emil A Eklund

unread,
Oct 14, 2013, 11:39:24 AM10/14/13
to Mike West, blink-dev
Are you also proposing deleting/deprecating the other HTMLCollection
attributes on document or just document.all?

I strongly support removing document.all but fear that some of the
others[1] which are in the dom level 2 spec[2] are still widely used,
in particular document.forms. Would love to see some usage data if we
have it.

--
Emil

1: readonly attribute HTMLCollection images;
readonly attribute HTMLCollection applets;
readonly attribute HTMLCollection links;
readonly attribute HTMLCollection forms;
readonly attribute HTMLCollection anchors;
2: http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-1006298752

Mike West

unread,
Oct 14, 2013, 11:41:32 AM10/14/13
to e...@chromium.org, blink-dev

This intent was just targeting HTMLAllCollection, but I'd love to drop others in the future. If we're not measuring them yet, we ought to start.

-mike

Eric Seidel

unread,
Oct 14, 2013, 11:42:07 AM10/14/13
to Kenji Baheux, Mike West, blink-dev
I seem to recall this being a problem back when WebKit added document.all, that having document.all sent you down the IE path. The web has changed a lot since. :)

That said, I'm surprised usage is so low and that IE is considering removing this.

I agree with Kenji that we should be sure to dot our I's and cross our t's and make sure we're counting right.

But assuming 0.0001 bears out, sgtm.

I'm sure this doesnt catch if "all" in document checks... Does it catch if document.all checks?  I don't remember our behavior, document.all may evaluate to false/be undetectable.

Mike West

unread,
Oct 14, 2013, 11:46:57 AM10/14/13
to Eric Seidel, blink-dev, Kenji Baheux

The numbers surprised me too, which is why I was a bit iffy about the count in the Intent. :)

I'd love it if someone who knows more about UseCounter than I could help me validate that the data is accurate/reasonable.

-mike

PhistucK

unread,
Oct 14, 2013, 12:18:15 PM10/14/13
to Mike West, Eric Seidel, blink-dev, Kenji Baheux
Did you actually test Internet Explorer 11?
Perhaps they use the same trick the rest of the browsers use (falsify document.all checks but support it when used unconditionally)?

I did not get my hands on the new version yet, which is why I am asking.


PhistucK


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

Chris Wilson

unread,
Oct 14, 2013, 12:24:51 PM10/14/13
to eae, Mike West, blink-dev
Note that these other collections were part of the HTML DOM Level 1 standard (http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html#ID-1006298752); document.all was never (to my recollection) ever included in a formal DOM standard.

PhistucK

unread,
Oct 14, 2013, 12:25:48 PM10/14/13
to Mike West, Eric Seidel, blink-dev, Kenji Baheux
Also, bear in mind that Internet Explorer can do this because it has previous document modes for websites that do not cope well with the latest document mode.
So, basically, any quirks mode (Internet Explorer 5.5 or maybe the standardized Quirks Mode as well) and Internet Explorer 10 and lower mode would still have this property as usual.


PhistucK

Erik Arvidsson

unread,
Oct 14, 2013, 12:28:51 PM10/14/13
to Mike West, Eric Seidel, blink-dev, Kenji Baheux
I would love for us to be able to remove this but I don't think we can get away with it yet.

1. I see 4.86% usage of Document.all(). We also have trackers for DocumentAllLegacyCall (0.00%) (using HTMLAllCollection as a function) and DocumentAllTags (0.00%). Where did you see DocumentAllLegacyUsage?
2. IE11 did not remove it in their latest available beta. document.all is undetectable, just like in Firefox and Chrome.

I think a first step here is to show a deprecation warning for these.
--
erik


Mike West

unread,
Oct 14, 2013, 1:28:50 PM10/14/13
to Erik Arvidsson, Eric Seidel, blink-dev, Kenji Baheux
Yes; I'd apparently confused 'DocumentAllLegacyCall' with the whole thing. Too bad. :(

Since I was several orders of magnitude off, I'll retract the "remove" bit of this intent. Any objections to simply deprecating the call?

-mike

-Mike

PhistucK

unread,
Oct 14, 2013, 1:30:34 PM10/14/13
to Mike West, Erik Arvidsson, Eric Seidel, blink-dev, Kenji Baheux
I do not think you can even deprecate it any more than it already is. The web is full of legacy content that will never change.
You may want to deprecate it only in standards mode, if this is at all possible.


PhistucK


Ojan Vafai

unread,
Oct 14, 2013, 1:53:18 PM10/14/13
to Mike West, Erik Arvidsson, Eric Seidel, blink-dev, Kenji Baheux
If the usages is really ~4%, then I don't see the point in deprecating. We should only deprecate things we think we can reasonably remove in the short-term (say 6-12 months). Otherwise, we end up having the console always contain a bunch of deprecation spam, which is web developer hostile.

PhistucK

unread,
Oct 14, 2013, 1:54:35 PM10/14/13
to Ojan Vafai, Mike West, Erik Arvidsson, Eric Seidel, blink-dev, Kenji Baheux
Do we have quirks mode usage versus standards mode usage counters?


PhistucK


Mike Sherov

unread,
Oct 14, 2013, 2:36:52 PM10/14/13
to PhistucK, Mike West, Eric Seidel, blink-dev, Kenji Baheux
On Mon, Oct 14, 2013 at 12:18 PM, PhistucK <phis...@gmail.com> wrote:
Did you actually test Internet Explorer 11?
Perhaps they use the same trick the rest of the browsers use (falsify document.all checks but support it when used unconditionally)?

I did not get my hands on the new version yet, which is why I am asking.

Just checked the release preview on browserstack.com

if(document.all){ console.log("never logs"); } // doesn't log
if("all" in document){ console.log("logs just fine"); } // logs
console.log(document.all[0].tagName); //HTML

The other removals appear to be valid though. Unfortunately, and probably not coincidentally, none of the other removals were implemented in other browsers.



--
Mike Sherov
Chief Technologist
SNAP Interactive, Inc. | Ticker: STVI

Mike Sherov

unread,
Oct 14, 2013, 2:38:40 PM10/14/13
to PhistucK, Mike West, Eric Seidel, blink-dev, Kenji Baheux
On Mon, Oct 14, 2013 at 12:25 PM, PhistucK <phis...@gmail.com> wrote:
Also, bear in mind that Internet Explorer can do this because it has previous document modes for websites that do not cope well with the latest document mode.

Just FYI, they are getting rid of document modes as well: IE11 deprecates them: http://msdn.microsoft.com/en-us/library/ie/bg182625%28v=vs.85%29.aspx#docmode Perhaps they are preparing for a purge themselves.

PhistucK

unread,
Oct 14, 2013, 3:21:59 PM10/14/13
to Mike Sherov, Mike West, Eric Seidel, blink-dev, Kenji Baheux
Quirks mode would probably live forever, though, as it depends on the fact that there is no document type.
Of course, there is the 'standardized' quirks mode and there is the Internet Explorer 5.5 quirks mode - would both of them survive? they seem to be headed in the direction of dumping the Internet Explorer 5.5 quirks mode (and the rest, non edge, non quirks modes).

Can someone check whether the standardized quirks mode exposes document.all like Internet Explorer 10 and earlier does?


PhistucK

Ian Hickson

unread,
Oct 14, 2013, 11:11:09 PM10/14/13
to Chris Wilson, eae, Mike West, blink-dev
On Mon, 14 Oct 2013, Chris Wilson wrote:
>
> Note that these other collections were part of the HTML DOM Level 1
> standard (
> http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html#ID-1006298752);
> document.all was never (to my recollection) ever included in a formal
> DOM standard.

It's in the HTML DOM:

http://www.whatwg.org/specs/web-apps/current-work/#htmlallcollection
http://www.whatwg.org/specs/web-apps/current-work/#dom-document-all

...including the magic behaviour.

--
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'

PhistucK

unread,
Oct 15, 2013, 2:25:22 AM10/15/13
to Ian Hickson, Chris Wilson, eae, Mike West, blink-dev
Yes, I saw that, too. And it looks weird.
It seems like a requirement for those who decide to implement document.all (meaning, they have to implement it according to the details you specified) and not a requirement to implement it. Am I right?


PhistucK


James Robinson

unread,
Oct 15, 2013, 11:49:04 AM10/15/13
to PhistucK, Ian Hickson, Chris Wilson, eae, Mike West, blink-dev
On Mon, Oct 14, 2013 at 11:25 PM, PhistucK <phis...@gmail.com> wrote:
Yes, I saw that, too. And it looks weird.
It seems like a requirement for those who decide to implement document.all (meaning, they have to implement it according to the details you specified) and not a requirement to implement it. Am I right?


No.

"The all attribute must return an HTMLAllCollection rooted at the Document node, whose filter matches all elements." 

- James

PhistucK

unread,
Oct 15, 2013, 11:51:58 AM10/15/13
to James Robinson, Ian Hickson, Chris Wilson, eae, Mike West, blink-dev
Yes, but look at the title of that section.
It is under 15. Obsolete features, under 15.3 Requirements for implementations.
That hints (to me, anyway) that if you actually implement document.all, it must be implemented this way.


PhistucK

Ian Hickson

unread,
Oct 15, 2013, 1:32:17 PM10/15/13
to PhistucK, James Robinson, Chris Wilson, eae, Mike West, blink-dev
On Tue, 15 Oct 2013, PhistucK wrote:
>
> Yes, I saw that, too. And it looks weird. It seems like a requirement
> for those who decide to implement document.all (meaning, they have to
> implement it according to the details you specified) and not a
> requirement to implement it. Am I right?

It's required of HTML implementations per the current spec.

The spec might change, of course, if the implementations disagree.


On Tue, 15 Oct 2013, PhistucK wrote:
>
> Yes, but look at the title of that section.
> It is under 15. Obsolete features, under 15.3 Requirements for
> implementations.
> That hints (to me, anyway) that if you actually implement document.all, it
> must be implemented this way.

There are no hints in the HTML spec. Don't read between the lines. All the
information that the spec intends to convey is on the lines themselves.

The features are obsolete for authors, but they're required for
implementors, because there's a trillion or more Web pages out there that
use these features.

PhistucK

unread,
Oct 15, 2013, 1:33:19 PM10/15/13
to Ian Hickson, James Robinson, Chris Wilson, eae, Mike West, blink-dev
Thank you for the clarification.


PhistucK

Boris Zbarsky

unread,
Feb 12, 2014, 4:07:52 PM2/12/14
to blin...@chromium.org
On 10/14/13 12:28 PM, Erik Arvidsson wrote:
> 1. I see 4.86% usage of Document.all(). We also have trackers for
> DocumentAllLegacyCall (0.00%)

For what it's worth, we recently tried removing it in Gecko and it took
about 3 days for the first report of a site breaking as a result (see
<https://bugzilla.mozilla.org/show_bug.cgi?id=969030#c4>.

The big question is whether this is the only site that uses the legacy
caller on document.all....

-Boris

Ojan Vafai

unread,
Feb 12, 2014, 4:20:33 PM2/12/14
to Boris Zbarsky, blink-dev
FWIW, this number is wrong. Looking at Chrome's latest stable release on Windows, DocumentAllLegacyCall is used on 0.03% of sites. We've still been figuring out what the lower bound is on features we can safely remove, so this is a useful data point that 0.03% is likely too high.

Boris Zbarsky

unread,
Feb 12, 2014, 4:53:07 PM2/12/14
to PhistucK, blink-dev
On 2/12/14 4:14 PM, PhistucK wrote:
> By the way, I just checked and document.all is fully supported in edge
> mode in Internet Explorer 11.
> (Its typeof is "undefined", of course)

Sure. I think it's clear that document.all per se is widely used and
needs to be supported. The only question we at Mozilla had was about
the legacycaller on document.all.

-Boris

Ojan Vafai

unread,
Feb 12, 2014, 5:11:46 PM2/12/14
to Boris Zbarsky, blink-dev
Whoops, misspoke s/sites/pageviews/. 

Anyways, thanks for the data Boris.

Alex Russell

unread,
Feb 12, 2014, 9:19:25 PM2/12/14
to Mike West, blink-dev, Emil Eklund

+1 to this. Also LGTM on document.all removal.

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

PhistucK

unread,
Feb 12, 2014, 4:14:49 PM2/12/14
to Boris Zbarsky, blink-dev
By the way, I just checked and document.all is fully supported in edge mode in Internet Explorer 11.
(Its typeof is "undefined", of course)
document.all("q") also works.



PhistucK




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

Reply all
Reply to author
Forward
0 new messages