This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The toString function should be non enumerable to match ES builtins. http://heycam.github.io/webidl/#es-stringifier
Does that match current UA behavior for HTMLAnchorElement and Location?
Chrome, Firefox & IE: window.location.propertyIsEnumerable('toString') false Chrome, Firefox & IE: document.createElement('a').propertyIsEnumerable('toString') false However: Chrome: HTMLAnchorElement.prototype.propertyIsEnumerable('toString') false Firefox & IE: HTMLAnchorElement.prototype.propertyIsEnumerable('toString') true This looks like a bug in IE's and Firefox's DOM bindings
> document.createElement('a').propertyIsEnumerable('toString') The property is not a property on the element itself. It's a property on the prototype. Nonexistent properties report "false" from propertyIsEnumerable (see ES6 19.1.3.4 step 7). You'd get false for document.createElement('a').propertyIsEnumerable('oblongify') too. So it sounds like in Firefox and IE this is an enumerable property on the prototype, as per current spec. It's not clear what you think the bug in their binding implementations is, exactly unless it's "not matching the behavior I want for this property"... Now maybe we can change browser behavior without breaking sites, given that the property is not enumerable in Chrome. I checked, and it's not enumerable in Safari either.
HTMLAnchorElement.prototype.toString is enumerable in Presto-based Opera, fwiw.
(In reply to Boris Zbarsky from comment #3) > > document.createElement('a').propertyIsEnumerable('toString') > > The property is not a property on the element itself. It's a property on > the prototype. Nonexistent properties report "false" from > propertyIsEnumerable (see ES6 19.1.3.4 step 7). You'd get false for > document.createElement('a').propertyIsEnumerable('oblongify') too. I forgot that propertyIsEnumerable is only for own properties. Then the IE and FF results are consistent.
Blink is phasing out the use of non-enumerable toString() and implementing 'stringifier' as spec'ed; see https://bugs.chromium.org/p/chromium/issues/detail?id=306606 and an initial set of these changes ( https://codereview.chromium.org/1905553002/ )
Sigbjørn, does that mean we can close this?
How you handle long-opened bugs with no activity I will leave up to you :) Moving Blink to be stringifier-compatible seems preferable by now; we'll try.
I think this should be closed, these changes will bring Blink in line with Edge and Firefox, so there's not much reason to think it would change again once interoperable.
WONTFIXING since all implementations will seemingly align here with what was already required.