On 12/20/12 12:14 PM, Jeff Walden wrote:
Setting it creates a shadowing property on window itself, using the exact
value passed in.
// Current Gecko
alert(typeof window.screenX); // number
window.screenX = "123";
alert(typeof window.screenX); // string, not number
Er... no. If you do that, you get number for the second alert, because
you did a qualified set. That's the whole complication with these
properties: they behave differently for qualified and unqualified sets.
// Proposed Gecko
alert(typeof window.screenX); // number
window.screenX = "123";
alert(typeof window.screenX); // number (setter coerces string->number, or
the setter silently did nothing)
This is compatible with IE9 (standards or quirks mode -- and not in IE9 compat
mode, and it seems not in older IE modes; I don't have IE10 to test) and Opera
behaviors. IE9 puts the accessor on Window.prototype, and Opera puts it on
window, but there's no visible difference in behavior for getting or setting.
But there's still a supposed compatibility bugaboo to changing, because sites
might have relied on the old behavior (notwithstanding that browsers are all
over the map here)
So specifically, for unqualified sets right now Gecko and WebKit
reconfigure the property to a data property, as do older IE, but not
newer IE or Opera, right?
And the proposal here is to align with new IE and Opera?
-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform