-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 URL rewriting and srcset
support to amp-bind
#7206
Add URL rewriting and srcset
support to amp-bind
#7206
Conversation
/to @aghassemi /cc @dvoytenko |
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.
Look good, just a small change request.
@@ -192,7 +250,9 @@ function createElementRules_() { | |||
}, | |||
blockedURLs: ['__amp_source_origin'], | |||
}, | |||
// TODO: Support `srcset`. | |||
srcset: { |
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.
there is no srcset on amp-video
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.
Woops, done.
@@ -211,6 +227,24 @@ describe('BindValidator', () => { | |||
/* eslint no-script-url: 0 */ 'javascript:alert(1)\n;')).to.be.false; | |||
expect(val.isResultValid( | |||
'AMP-VIDEO', 'src', '__amp_source_origin')).to.be.false; | |||
|
|||
// srcset | |||
expect(val.isResultValid( |
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.
ditto
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.
Done.
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.
Thanks for the review.
@@ -192,7 +250,9 @@ function createElementRules_() { | |||
}, | |||
blockedURLs: ['__amp_source_origin'], | |||
}, | |||
// TODO: Support `srcset`. | |||
srcset: { |
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.
Woops, done.
@@ -211,6 +227,24 @@ describe('BindValidator', () => { | |||
/* eslint no-script-url: 0 */ 'javascript:alert(1)\n;')).to.be.false; | |||
expect(val.isResultValid( | |||
'AMP-VIDEO', 'src', '__amp_source_origin')).to.be.false; | |||
|
|||
// srcset | |||
expect(val.isResultValid( |
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.
Done.
8837022
to
aaf60de
Compare
* add srcset support * fix types * rewrite urls for cache * ignore compiler warnings in third_party/caja * whitelist amp-bind to depend on sanitizer.js * ali's comments
* add srcset support * fix types * rewrite urls for cache * ignore compiler warnings in third_party/caja * whitelist amp-bind to depend on sanitizer.js * ali's comments
* add srcset support * fix types * rewrite urls for cache * ignore compiler warnings in third_party/caja * whitelist amp-bind to depend on sanitizer.js * ali's comments
Partial for #6199.
srcset
attribute inBindValidator