Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add AMP_DOM_Document & meta tag sanitizer #3758
Add AMP_DOM_Document & meta tag sanitizer #3758
Changes from 56 commits
e2951f5
395169d
a569500
043187a
847c753
834f26c
1ceb739
ab1b29a
97d6207
e68f592
d726fee
e388a22
71780f0
7192d67
7b57648
c36eff4
8efc564
4e952d9
7a5ca46
9267e8e
1e50685
ed93ad6
c98e7e5
51a2002
55b9877
2bdf1b9
cf34477
a9f1a04
fdd72cc
9ba845c
c7ae4c3
71a3e1f
788ee17
66efba6
c39e1a3
fcf7a14
2d280e7
189b7ca
442fb11
efa0bed
a9c4d8e
b50fd79
714b762
1eec1f4
9088fdc
72ae0c6
18e35d2
3bd83a4
3bdc795
f4c1013
9a57bc2
19334a0
2010c49
01848c7
e763fe3
cc4badb
8cbe6d6
fbd790f
41094b4
6ff286c
e94e3ca
c5415d2
7c037a9
8abb927
a214a25
46af79f
c739df0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What if there were no nodes in the
head
? Granted, this is not possible currently given theAMP_Meta_Sanitizer
, but if it did happen, then$previous_node
here could benull
and referenced below to$previous_node->nextSibling
would raise errors.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.
The head would never be empty, because we're enforcing the
<meta charset="utf-8">
to be present. But I can nevertheless harden the calls tonextSbiling
to make sure we won't randomly break this in the future.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.
Hmm, actually, I don't think it's worth hardening at the moment. Right now, the charset meta tag ensures the head always has at least 1 node, and I'm starting work on the optimized AMP stuff after this, where I'll rip most of the rest of this stuff out of
AMP_Theme_Support
anyway.