Re: [WebIDL] Should stringifiers use [[Get]] and [[Call]] or call the canonical getter/function?

Ian Hickson wrote:
> On Fri, 5 Oct 2012, Boris Zbarsky wrote:
>> On 10/5/12 4:53 PM, Ian Hickson wrote:
>>> On Fri, 5 Oct 2012, Boris Zbarsky wrote:
>>>> And in particular, the way the spec is phrased right now means that this
>>>> bit of WebIDL from HTMLAnchorElement:
>>>>
>>>>       stringifier attribute DOMString href;
>>>>
>>>> does not have the same behavior as this bit would:
>>>>
>>>>      attribute DOMString href;
>>>>      stringifier DOMString();
>>>>
>>>> with prose defining DOMString to do the same thing as the href getter.
>>> Which do browsers do? (If either.)
>> In Chrome and Safari, I don't think it's possible to modify the behavior of
>> element.href, so it's impossible to test there.
>>
>> In Gecko and Presto and IE9, this testcase:
>>
>>    <pre><script>
>>      var a = document.createElement("a");
>>      a.href = "http://w3.org"
>>      document.writeln(a.toString());
>>      document.writeln(a.href);
>>      Object.defineProperty(a, "href", { value: "Haha" });
>>      document.writeln(a.toString());
>>      document.writeln(a.href);
>>    </script>
>>
>> writes out "http://w3.org" three times, then "Haha". Which is consistent with
>> how I want the WebIDL spec to work, not with how it works right now.
>
> Makes sense to me. Heycam tells me he's going to fix this in WebIDL; if
> that ends up not happening, please let me know so I can fix it in HTML
> instead.

Using [[Get]] and [[Call]] seems the more obvious way to for this to, to 
be honest.  And it's consistent with how [PutForwards] works.  Travis, 
any view on this?

Received on Friday, 2 August 2013 04:46:23 UTC