Skip to content

Validation roll-up#1879

Merged
Gregable merged 9 commits intoampproject:masterfrom
Gregable:validation
Feb 9, 2016
Merged

Validation roll-up#1879
Gregable merged 9 commits intoampproject:masterfrom
Gregable:validation

Conversation

@Gregable
Copy link
Copy Markdown
Member

@Gregable Gregable commented Feb 9, 2016

Handful of changes to validate various tags: carousel, install-serviceworker, wordpress rel=attachment.

Note: Significant change to start validating URLs in attribute values for tags such as <img src= or <a href=.

Affects Github #1711, Github #1847

powdercloud and others added 9 commits February 9, 2016 14:15
- Avoid using the return value of addPositionTo (which is
  Token, not ErrorToken)
- Assert that the elements returned by querySelectorAll are
  HTMLElement instances.
Create new UrlSpec usable by AttrSpec for allowed protocols in href/src
attributes.
Validate URLs are not missing
Validate URLs are valid (via goog.Uri.parse)
Validate protocols are allowed for certain tags
Add colon to Entities list for htmlparser.
Fix lookupEntity_ in htmlparser to actually look up the entity by name.

anchor's href: http, https, mailto, sms, whatsapp, viber
img's src: http, https
amp-audio > source's src: http, https
amp-video > source's src: https
audio > source's src: http, https
video > source's src: https
amp-img's src: data, http, https
amp-anim's src: data, http, https
amp-video's src: https
amp-ad's src: https
amp-embed's src: https
amp-youtube's src: https
amp-twitter's src: https
amp-instagram's src: https
amp-iframe's src: https
amp-pixel's src: https
amp-audio's src: http, https
amp-list's src: https
amp-install-serviceworker's src: https
@googlebot
Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@powdercloud
Copy link
Copy Markdown
Contributor

@googlebot confirmed.

1 similar comment
@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

@googlebot confirmed.

Gregable added a commit that referenced this pull request Feb 9, 2016
@Gregable Gregable merged commit 90b2580 into ampproject:master Feb 9, 2016
@Gregable Gregable deleted the validation branch June 20, 2016 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants