-
Notifications
You must be signed in to change notification settings - Fork 4k
✨A4A: introduce head validation #29167
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
Conversation
| // certain elements from the detached DOM. | ||
| const nextElement = element.nextElementSibling; | ||
|
|
||
| switch (element.tagName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is tagName guaranteed to be upperCase across browsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName
- For DOM trees which represent HTML documents, the returned tag name is always in the canonical upper-case form. For example, tagName called on a
element returns "DIV".- The tag names of elements in an XML DOM tree are returned in the same case in which they're written in the original XML file. If an XML document includes a tag "", then the tagName property's value is "SomeTag".
I don't think we need to worry about XML case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asked because I saw many usages of tagName.toUpperCase() in our code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, you think I should add it just to be safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do so, just to be safer. (browsers can be weird)
|
This pull request introduces 4 alerts when merging 73c49f2 into 8e03ac2 - view on LGTM.com new alerts:
|
|
This pull request introduces 4 alerts when merging a7e9176 into 8e03ac2 - view on LGTM.com new alerts:
|
| // certain elements from the detached DOM. | ||
| const nextElement = element.nextElementSibling; | ||
|
|
||
| switch (element.tagName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asked because I saw many usages of tagName.toUpperCase() in our code base.
|
This pull request introduces 4 alerts when merging 54d4884 into 81f88ce - view on LGTM.com new alerts:
|
|
Adding @rsimha as owners bot suggestion for |
* head validation * rename * add tests * docs and types * allow preloadExtension * comments * rename func * dep check * dep check again * toUpperCase
Part of #27189