Closed Bug 1328138 Opened 7 years ago Closed 5 years ago

Remove XMLDocument's async IDL attribute

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox53 --- wontfix
firefox68 --- fixed

People

(Reporter: zcorpan, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

(4 keywords)

Attachments

(2 files, 2 obsolete files)

alert('async' in document.implementation.createDocument(null,null)) // true

https://dxr.mozilla.org/mozilla-central/source/dom/webidl/XMLDocument.webidl#22

This is not in any spec nor any other browser as far as I know.

document.async was removed from HTML spec in https://github.com/whatwg/html/commit/e236f46820b93d6fe2e2caae0363331075c6c4fb

web-platform-tests test added in: https://github.com/w3c/web-platform-tests/pull/4331
Priority: -- → P3
Keywords: site-compat
It seems that the effect this has is that if you create an XMLDocument and then set .async = false before loading it, it will load synchronously.  (Which will freeze the page on a network load, I guess?)  I wouldn't think we'd want this functionality anyway.
Assignee: nobody → ayg
Status: NEW → ASSIGNED
Comment on attachment 8894259 [details]
Bug 1328138 - Get rid of document.async

https://reviewboard.mozilla.org/r/165352/#review170800

We need some telemetry data about usage. Hopefully it is very close to 0.
Attachment #8894259 - Flags: review?(bugs)
I think this is what the isNukedFromDocument for async subtest is testing. This fails in Firefox but passes in other browsers.
Current use counter data from telemetry:

The data comes from Firefox 64 beta. It was collected from 508,758,104 top level page loads and 3,530,295,659 individual document loads.

ASYNC_getter:	0.001%	
ASYNC_setter:	0.007%	

Olli, what do you think for removal?
Flags: needinfo?(bugs)
I think this should go with .load() https://searchfox.org/mozilla-central/source/dom/webidl/XMLDocument.webidl#17
And the now expired telemetry for that hints the usage is very very low.
So, I guess we could try.
Flags: needinfo?(bugs)
Attached file Bug 1328138 - Remove XMLDocument.async (obsolete) —
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Flags: needinfo?(ehsan)
Hmm, I was using https://georgf.github.io/usecounters/index.html#kind=page&group=XMLDOCUMENT&channel=beta&version=64 but that only cites ~1.3e9 page loads.  On 62 beta the count is much higher as you noted.  On 63 it is lower, but on 60 and 61 the usage of the setter is close to 0.02%.

I guess this is too high for removal?  Do we have a specific guideline that we use for these cases?  IIRC Blink uses a threshold of 0.03%.

We don't seem to have separate telemetry for document.load() right?
Flags: needinfo?(ehsan)
> I guess this is too high for removal?

I don't know.  0.02% is certainly much better than the numbers from comment 4...

> Do we have a specific guideline that we use for these cases?

Not yet.

I think the right thing to do is to put this behind a pref, flip the pref, and see what fallout, if any, is reported.

> We don't seem to have separate telemetry for document.load() right?

We do.  It's tracked by the UseOfDOM3LoadMethod and ChromeUseOfDOM3LoadMethod counters.  It's not an IDL usecounter because we wanted to track those separately, hence the different naming.

load() usage is _much_ lower than .async setter usage.  More like .003% of pageloads (so almost an order of magnitude less).  I'm not sure why, actually.
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #11)
> > Do we have a specific guideline that we use for these cases?
> 
> Not yet.
> 
> I think the right thing to do is to put this behind a pref, flip the pref,
> and see what fallout, if any, is reported.

That sounds good to me.

> > We don't seem to have separate telemetry for document.load() right?
> 
> We do.  It's tracked by the UseOfDOM3LoadMethod and
> ChromeUseOfDOM3LoadMethod counters.  It's not an IDL usecounter because we
> wanted to track those separately, hence the different naming.
> 
> load() usage is _much_ lower than .async setter usage.  More like .003% of
> pageloads (so almost an order of magnitude less).  I'm not sure why,
> actually.

I see.  That boggles my mind...  It seems to suggest that there are *tons* pages that set document.async to false/true but then *don't* call document.load().  <https://georgf.github.io/usecounters/index.html#kind=page&group=DEPRECATED&channel=beta&version=62> says document.load() is used on 0.003% of top-level pages.

If my understanding above correct, hiding both should actually be quite safe, since setting async would only change the behavior of load() so for most of the existing consumers, it is a no-op already.
Component: DOM → DOM: Core & HTML
Attachment #9022495 - Attachment is obsolete: true
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0e369b6ee8ff
Disable the XMLDocument.async API on trunk; r=bzbarsky
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

This isn't fully fixed yet, though. Could you file a followup for the actual removal?

Flags: needinfo?(ehsan)

(In reply to :Ms2ger (he/him; ⌚ UTC+1/+2) from comment #16)

This isn't fully fixed yet, though. Could you file a followup for the actual removal?

I intentionally didn't file a follow-up yet because it's still unclear what the follow-up work would be (we don't yet know if unshipping will be successful.) I have a calendar entry to revisit this if everything goes uneventful but if you really want a bug here is one for you: bug 1546112.

Flags: needinfo?(ehsan)
Attachment #8894259 - Attachment is obsolete: true
Blocks: 1546112
Type: defect → enhancement
Regressions: 1561036
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: