Add <meta name="responsive-embedded-sizing">#12444
Conversation
4f63023 to
5d63e86
Compare
|
If either name, http-equiv, or itemprop is specified in meta element, then the content attribute must also be specified. |
|
https://html.spec.whatwg.org/#the-meta-element
But just below:
So |
The above specifications are for user agents, not for authors.
|
| the user agent must run the following algorithm:</p> | ||
|
|
||
| <ol> | ||
| <li><p>If <var>element</var> is not inserted by the parser, then return.</p></li> |
There was a problem hiding this comment.
This doesn't seem like a good idea. This will just encourage people to use document.write() instead of tree manipulation.
There was a problem hiding this comment.
Suggesting an alternative where once the body element is seen this cannot be modified.
There was a problem hiding this comment.
That's also not a primitive that exists?
There was a problem hiding this comment.
It is, eg for render blocking.
There was a problem hiding this comment.
A similar approach is to cement it at the beginning of the first render
There was a problem hiding this comment.
This is different, I mean that you can't apply it once the body is seen, even if it's inserted to the head
Can you expand a bit more? It looks to me that if it's valid only in <head>, and only by the parser, then you can't insert to the head once the body is seen, so we're talking about the same thing. Did I miss anything?
For b and c, The best way to spec this I think is to have this as a tri state of sorts (true, false, uninitialized) and set it to false on some conditions (eg body insertion). Not sure if parser-inserted is that important given the other conditions or what the best way to spec it given document.write().
I was worried "hey, it's alredy defined there, use existing definition" feedback, so I'm fine with your suggestion if that is preferred.
Two questions before I update this PR. I couldn't read whether you and @annevk want to allow tree manipulation or not, and whether to allow document.write(), when the script is in <head>. Could you clarify which you want?
@annevk previously requested this to be immutable, so I'm trying to respond to the request. My understanding of the "immutable" is not allowing tree manipulation nor document.write() even in <head>, but I'm happy to be corrected if that was wrong.
There was a problem hiding this comment.
Three questions actually, sorry. Custom elements could inject a <meta> element asynchronously. Do we want to allow that?
There was a problem hiding this comment.
This is different, I mean that you can't apply it once the body is seen, even if it's inserted to the head
Can you expand a bit more? It looks to me that if it's valid only in
<head>, and only by the parser, then you can't insert to the head once the body is seen, so we're talking about the same thing. Did I miss anything?
It's almost the same but not exactly. What I am suggesting still allows inserting it dynamically in a parser blocking script included in the head. It's a more established concept than "only by the parser" and I think it might do in terms of security etc. it's equivalent behavior to the blocking attribute - which can make some sense given that they both impact rendering behavior.
For b and c, The best way to spec this I think is to have this as a tri state of sorts (true, false, uninitialized) and set it to false on some conditions (eg body insertion). Not sure if parser-inserted is that important given the other conditions or what the best way to spec it given document.write().
I was worried "hey, it's alredy defined there, use existing definition" feedback, so I'm fine with your suggestion if that is preferred.
Two questions before I update this PR. I couldn't read whether you and @annevk want to allow tree manipulation or not, and whether to allow
document.write(), when the script is in<head>. Could you clarify which you want?@annevk previously requested this to be immutable, so I'm trying to respond to the request. My understanding of the "immutable" is not allowing tree manipulation nor
document.write()even in<head>, but I'm happy to be corrected if that was wrong.
There was a problem hiding this comment.
Thanks a lot for the clarification @noamr. So you want to allow tree manipulations, document.write(), and async custom elements injections, as long as they're done before <body> starts. /cc @tabatkins @bfgeek
@annevk can you confirm if you agree this achieves "immutable"?
There was a problem hiding this comment.
Thanks a lot for the clarification @noamr. So you want to allow tree manipulations,
document.write(), and async custom elements injections, as long as they're done before<body>starts. /cc @tabatkins @bfgeek
Yes but only for the first time (when uninitialized)
So you can document.write or append the meta, but only if it wasn't already there and only if the body didn't start yet.
|
@annevk can you help whether the @mtrootyy wrote:
|
5d63e86 to
ad98ae3
Compare
ad98ae3 to
49c5445
Compare
| <p>Each <code>Document</code> has a boolean | ||
| <dfn data-x="concept-document-responsive-embedded-sizing">responsive embedded sizing</dfn>, | ||
| initially false.</p> | ||
|
|
There was a problem hiding this comment.
@kojiishi this is what I mean by "move things around"
The note below this ("as the name indicates") relates to the paragraph about "navigation ID or webdriver Bidi", and the new paragraph splits them in the middle.
There was a problem hiding this comment.
I got it, thanks for the explanation and thanks for catching this. Done.
49c5445 to
fe4fc74
Compare
This adds `<meta name="responsive-embedded-sizing">` as an immutable standardized name. This is used by the CSS [responsive embedded sizing flag]. [responsive embedded sizing flag]: https://drafts.csswg.org/css-sizing-4/#document-responsive-embedded-sizing-flag
fe4fc74 to
615fb1c
Compare
There was a problem hiding this comment.
(Unofficial as I'm not an approver and we need multi implementer support)
I think this PR does the right thing in a way that's concise and consistent enough.
Editorially I can't say about maintaining the outdated wording style of existing meta tag or moving forward.
| <div algorithm> | ||
| <p>If a <code>meta</code> element is | ||
| <span data-x="node is inserted into a document">inserted into the document</span>, | ||
| the user agent must run the following algorithm:</p> |
There was a problem hiding this comment.
I think this wording style is outdated but will leave to @annevk whether this needs to be consistent with what's around it or with new style.
This adds
<meta name="responsive-embedded-sizing">as an immutable standardized name.This is used by the CSS responsive embedded sizing flag.
(See WHATWG Working Mode: Changes for more details.)
/dom.html ( diff )
/semantics.html ( diff )