-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render-blocking: the definition of "created by its node document's parser" is a little bit vague #10145
Comments
In particular, it's easy to track whether an element came from the parser, but not so much which document it came from (that's what the spec says roughly to do). In particular, current behavior in Gecko for implicitly render-blocking stylesheets is not what the spec says: if you remove and then append a stylesheet back via script, it doesn't remain render-blocking. It seems blink keeps track of whether the stylesheet came from the parser but not from which parser / document. |
Agreed, this shouldn't be render-blocking. The current spec is basically a translation of Blink's implementation. Blink's element creation has a flag But the flag is also set for fragment parsing... I'll make a test case later to see if there's a bug. Regarding the spec, the intention is to block on elements directly created by parsing the main resource without involving any scripting. Probably the same as Edit: I'm not sure if an element created by |
Tested in the following case, it seems
The iframe:
I don't have a strong opinion about this, but nodes created by
|
I think an element should be render-blocking if it's parser-inserted, but should stop being render-blocking as soon as it is detached from its tree... But also, implicitly render-blocking links and such are a bit more subtle. Gecko doesn't block rendering etc on stylesheets with media attributes that don't match for example, or for alternate stylesheets, and I don't think we'd want to start doing that. |
Agreed. I originally wanted to make "implicit render-blockingness" a stateless thing that can be determined from an element itself. It seems that it has to be maintained as an internal flag on the element that:
This part should be fine (or trivially fixable). For example, this part says we block rendering on a |
As per discussion in whatwg#10145.
As per discussion in whatwg#10145.
What is the issue with the HTML Standard?
In the Spec, to define implicitly potentially render-blocking there are:
For style element:
For link element:
For the script element:
We emphasize that the parser should be created by
Document
, this constraint looks a little bit vague to me.And found in Gecko codebase, there are several parsing originations:
Would it be more efficient to put the constraint on the parsing originations? For instance,
<style>
element parsed in the parser for fragment should not be implicitly potentially render-blocking?WDYT? @emilio @xiaochengh @noamr @zcorpan
The text was updated successfully, but these errors were encountered: