RE: [ResourcePriorities] Error in example

I have updated the spec to better define the lazyload and postpone IDL and content attributes. Let me know if these definitions need more tuning.

Thanks,
Jatinder

From: Ivan Kotenkov [mailto:kotenkov@yandex-team.ru]
Sent: Friday, September 13, 2013 6:28 AM
To: Boris Zbarsky
Cc: public-web-perf@w3.org
Subject: Re: [ResourcePriorities] Error in example

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<mailto: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 Saturday, 28 September 2013 00:54:25 UTC