Html: About ambivalent description of "non-blocking" flag

Created on 8 Feb 2017  路  7Comments  路  Source: whatwg/html

In the spec:

If was-parser-inserted is true and the element does not have an async attribute, then set the element鈥檚 "non-blocking" flag to true.

But above spec says that:

It is unset by the HTML parser and the XML parser on script elements they insert.

I see that:

If was-parser-inserted is true, then flag the element as "parser-inserted" again, and set the element鈥檚 "non-blocking" flag to false.

So,I want to know what exactly the "non-blocking" flag should be when inserted?And the excute order of these steps and why arrange these steps by this order(I hope you talk about from not only the real execution,but also the spec).Thanks a lot.

Most helpful comment

1: I notice that the outdated spec about script tag have a large of contents,but in the newest spec it looks like a little less content about script tag and is dispersive?

I don't really know anything about that fork, sorry. To be clear, it's maintained by a different organization than the WHATWG (which maintains the HTML Standard). It's maintained by an organization called the W3C. The W3C often takes our work, copies and pastes it onto w3.org, puts their logo and stylesheet on it, and calls it their own. You can see other instances at https://wiki.whatwg.org/wiki/Fork_tracking. So we're completely uninvolved in those documents, and in general they should be assumed to be very inaccurate. They certainly are not what browser vendors implement.

2: I notice that Status of w3c document and Web Platform Working Group Charter,I think the old spec is still stable and can be read to know?Say this just because I have read almost the first half of script tag description of the old spec,I am afraid of that I misunderstanding many concepts and consider the something incorrect is correct although I find that most contents are the same of them.Could you talk about this further?

No, you should never read that spec. It's just copied and pasted by people who have never worked on it productively, and usually don't read it themselves. Sometimes they try to copy and paste our new work to update their fork, but usually they don't do so very successfully, leading to a lot of bugs in that document.

I'm sorry you wasted your time on that document :(. I know it sucks. We're pretty upset about the whole situation too.

3: When I go to one chapter of the newest spec,there is no sidebar on the left,I think it would probably be better add a search bar or table of contents sidebar on the left?

Sure, that's a reasonable suggestion. It's tracked in https://github.com/whatwg/html/issues/311.

All 7 comments

I'm sorry, I don't really understand the question. What about the spec is unclear? As you've quoted, various parts in the spec set and unset it. Are you asking how those steps can be reached? That should be pretty clear by reading through the algorithms in which they appear.

@domenic Thanks for you reply.I am sorry,I will try to describe again more clear.

If was-parser-inserted is true and the element does not have an async attribute, then set the element鈥檚 "non-blocking" flag to true.

This means the we set the "non-blocking" flag when the script element inserts to the document.

But there is a opposite describtion that "It is unset by the HTML parser and the XML parser on script elements they insert"

This means the we unset the "non-blocking" flag when the script element inserts to the document.

So,I think I am a little confused, exactly set or unset?

So part of the problem here is that you're looking at the wrong spec. I just followed your links and they go to the outdated W3C fork of our work. The HTML Standard is at https://html.spec.whatwg.org/multipage/.

Anyway, the issue is that you are not looking at the parser. "prepare a script" is called for script execution, whereas the parser unsets it at https://html.spec.whatwg.org/multipage/#parsing-main-inhead:non-blocking . Script execution is not parsing.

Closing, as I think this is fairly clear, but happy to continue discussing in the closed thread!

@domenic Thanks for your clear.

Three questions.

1: I notice that the outdated spec about script tag have a large of contents,but in the newest spec it looks like a little less content about script tag and is dispersive?

2: I notice that Status of w3c document and Web Platform Working Group Charter,I think the old spec is still stable and can be read to know?Say this just because I have read almost the first half of script tag description of the old spec,I am afraid of that I misunderstanding many concepts and consider the something incorrect is correct although I find that most contents are the same of them.Could you talk about this further?

3: When I go to one chapter of the newest spec,there is no sidebar on the left,I think it would probably be better to add a search bar or table of contents sidebar on the left?

1: I notice that the outdated spec about script tag have a large of contents,but in the newest spec it looks like a little less content about script tag and is dispersive?

I don't really know anything about that fork, sorry. To be clear, it's maintained by a different organization than the WHATWG (which maintains the HTML Standard). It's maintained by an organization called the W3C. The W3C often takes our work, copies and pastes it onto w3.org, puts their logo and stylesheet on it, and calls it their own. You can see other instances at https://wiki.whatwg.org/wiki/Fork_tracking. So we're completely uninvolved in those documents, and in general they should be assumed to be very inaccurate. They certainly are not what browser vendors implement.

2: I notice that Status of w3c document and Web Platform Working Group Charter,I think the old spec is still stable and can be read to know?Say this just because I have read almost the first half of script tag description of the old spec,I am afraid of that I misunderstanding many concepts and consider the something incorrect is correct although I find that most contents are the same of them.Could you talk about this further?

No, you should never read that spec. It's just copied and pasted by people who have never worked on it productively, and usually don't read it themselves. Sometimes they try to copy and paste our new work to update their fork, but usually they don't do so very successfully, leading to a lot of bugs in that document.

I'm sorry you wasted your time on that document :(. I know it sucks. We're pretty upset about the whole situation too.

3: When I go to one chapter of the newest spec,there is no sidebar on the left,I think it would probably be better add a search bar or table of contents sidebar on the left?

Sure, that's a reasonable suggestion. It's tracked in https://github.com/whatwg/html/issues/311.

@domenic Thanks for your clarification!It's very useful and helpful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazarljubenovic picture lazarljubenovic  路  4Comments

NE-SmallTown picture NE-SmallTown  路  3Comments

tontonsb picture tontonsb  路  3Comments

holloway picture holloway  路  3Comments

NE-SmallTown picture NE-SmallTown  路  4Comments