- From: Ivan Kotenkov <kotenkov@yandex-team.ru>
- Date: Fri, 13 Sep 2013 17:28:20 +0400
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- Cc: public-web-perf@w3.org
- Message-Id: <2ECB0AD0-D1E3-490D-901A-70D79FF1AB82@yandex-team.ru>
Now I understand. Thanks for your patience in explaining this to me.
--
Regards,
Ivan Kotenkov
12.09.2013, Χ 18:20, Boris Zbarsky <bzbarsky@MIT.EDU> ΞΑΠΙΣΑΜ(Α):
> On 9/12/13 4:15 AM, Ivan Kotenkov wrote:
>> http://www.w3.org/TR/WebIDL/#dfn-read-only .
>> "The attribute is read only if the readonly keyword is used before the
>> attribute keyword.
>
> This is talking about IDL attributes (properties of the JS object)
>
>> I think, using setAttribute is a direct assignment
>
> setAttribute sets a _content_ attribute, not an IDL attribute. Please read up on the difference between the two.
>
>> Next let's look at an example. As a developer of chromium-based browser
>> I'll use chromium code as an example.
>> /interface HTMLInputElement/ is defined in HTMLInputElement.idl. Among
>> other attributes it has
>> /readonly attribute boolean willValidate;/
>
> Right, but it doesn't have a defined "willvalidate" content attribute at all. As in, <input willvalidate="something"> has no efeect whatsoever.
>
>> Now let's create a simple webpage that will try to change the attribute:
>
>> / input = document.getElementById('inp');/
>> / alert(input.willValidate);/
>> / input.setAttribute('willValidate', false);/
>> / alert(input.willValidate);/
>
> That's because the content "willValidate" attribute and the IDL "willValidate" attribute are completely unrelated. Try getAttribute("willValidate") after your setAttribute call.
>
>> Also, grepping the *.idl files for 'readonly' gives us attributes that
>> obviously should not be change by using setters, for example:
>> /HTMLFormElement.idl: readonly attribute HTMLCollection elements;/
>> /HTMLFormElement.idl: readonly attribute long length;/
>
> Those don't correspond to content attributes either.
>
> But the attribute we're discussing here _does_ correspond to a content attribute. <script lazyload> is supposed to change the behavior of the <script>.
>
> Again, the real problem the spec has here is that it doesn't actually define the behavior of the "lazyload" IDL attribute. It needs to do that.
>
> -Boris
Received on Friday, 13 September 2013 13:28:35 UTC