On 2015-08-25 5:45 PM, Martin Thomson wrote:
Maybe some day we can remove the aliases by just backing out the patch
that creates prefixed aliases, but that seems unlikely in the short
term [1][2].
Do the aliases only work when you call them or can the webpage also detect
them? IOW, what would code like below do?
if (window.mozRTCPeerConnection)
foo();
else if (window.RTCPeerConnection)
bar();
The following code would call foo(). In the patch that I have,
mozRTCPeerConnection looks exactly like RTCPeerConnection. That means
that window.mozRTCPeerConnection is present, can be instantiated, can
be tested with instanceof, and can be passed to any functions that
accept RTCPeerConnection (there aren't any that I can think of there).
The only difference I'm aware of is that constructing the prefixed
version drops a polite warning (using document->WarnOnceAbout()) into
the console.
Hmm, I see. Have you considered the implications of making the alias
falsey in conditions, similar to document.all? Without doing that, we
would never know if the bar() path in the above example will break
content when we remove the alias.
Also, I think it's probably a good idea to add a use counter for the
aliased name.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform