Intent to Ship: [MimeTypeArray | PluginArray | Plugin] # getter item() and namedItem() argument should be non-optional

60 views
Skip to first unread message

Luna Lu

unread,
Mar 17, 2017, 12:02:28 PM3/17/17
to blin...@chromium.org

Contact emails

lun...@chromium.org


Spec

https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray https://html.spec.whatwg.org/multipage/webappapis.html#plugins-2


Summary

According to the spec, those getters' argument should not be optional. An 'index' or 'name' must be specified in order to get the item wanted in the array.


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

No


Interoperability and Compatibility Risk


Edge: Shipped

Firefox: Shipped

Safari: No signals

Web developers: No signals


OWP launch tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=701560


Entry on the feature dashboard

https://www.chromestatus.com/feature/5763883465703424


foo...@google.com

unread,
Mar 18, 2017, 10:24:42 PM3/18/17
to blink-dev
lgtm1

PhistucK

unread,
Mar 19, 2017, 2:47:26 AM3/19/17
to Philip Jägenstedt, blink-dev
Any use counter as this will start throwing, if I understand correctly?


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Philip Jägenstedt

unread,
Mar 21, 2017, 1:42:16 AM3/21/17
to PhistucK, blink-dev
There are no use counters for this, and IMHO adding them would be excessive since these arguments are already non-optional in Edge and Firefox. (I spot checked a few cases in each.)

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

Luna

unread,
Mar 21, 2017, 1:34:59 PM3/21/17
to blink-dev, phis...@gmail.com, foo...@google.com
I confirm that arguments for these APIs are non-optional. I verified them using BrowserStack. 
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Luna

unread,
Mar 24, 2017, 1:52:38 PM3/24/17
to blink-dev, phis...@gmail.com, foo...@google.com
Also, I'd also like to change the return type to be nullable, which also matches with the spec.

TAMURA, Kent

unread,
Mar 27, 2017, 9:48:48 PM3/27/17
to Luna, blink-dev, PhistucK, Philip Jägenstedt
A similar change for CSSStyleSheet.insertRule() broke many sites, and we needed to revert it in a stable branch.

Can you investigate their typical usage with http archive?

--
TAMURA Kent
Software Engineer, Google


Rick Byers

unread,
Mar 30, 2017, 12:55:17 PM3/30/17
to TAMURA, Kent, Luna, blink-dev, PhistucK, Philip Jägenstedt
Yeah it's a good question whether more analysis is needed to confirm up front that WebKit-specific code depending on this is rare.

A key difference I see here between this issue and issue 319695 is that these APIs are quite niche, while CSSStyleSheet#insertRule seems likely to be more popular.  Also it's easier to imagine developers omitting the index argument ("insertRule(rule)") than it is to imagine how they would omit an item argument ("mimeTypes[]" is a syntax error, "mimeTypes.item()" is a pretty strange thing to imagine someone typing).  An HTTP Archive search is going to be tricky to have much confidence in (which obscure patterns in particular should we look for?  Do we think any would be more likely than the ones we can't find statically like "var o = navigator.mimeTypes; ... ; o.item();"?).  If we want real confidence here we probably need to add a UseCounter via custom bindings and wait for it to hit stable.

Personally my instinct is that the risk here is very low and we're better off just fixing low-risk cases like this and being on the look-out for regressions (err on a side of revert at the first report of an issue in the wild) than making them 10x more expensive to fix by requiring UseCounters for them.  We've got a long list of little low-risk changes like this, where the result of being more cautious is that we'll just attempt to fix much fewer of them.  So I'll give my LGTM2.  But this is definitely open to debate / judgement.  Other opinions?

Rick

Jochen Eisinger

unread,
Mar 31, 2017, 5:50:54 AM3/31/17
to Rick Byers, TAMURA, Kent, Luna, blink-dev, PhistucK, Philip Jägenstedt
given that Edge and Firefox have this shipped, I agree that it seems low risk, so lgtm3

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




Reply all
Reply to author
Forward
0 new messages