-
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
🐛 propagate title attribute in amp-iframe #27037
Conversation
Hey @ampproject/wg-caching, these files were changed:
|
This reverts commit 2541fa3.
title
attribute to amp-iframe validator
4003820
to
e5828e7
Compare
@@ -618,6 +619,9 @@ export class AmpIframe extends AMP.BaseElement { | |||
); | |||
} | |||
} | |||
if (this.iframe_) { | |||
this.propagateAttributes(['title'], this.iframe_); |
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 ideally propagate all ATTRIBUTES_TO_PROPAGATE
, but this was causing an e2e test error when I tried that, so only propagating title
on mutate.
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.
A comment here indicating why only title
is propagated would be nice.
title
attribute to amp-iframe validatorThere 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.
Getting pretty close here, like the change to propagate the title mutation!
An additional test and a comment for the selective mutation transfer would be prudent.
@@ -46,6 +46,7 @@ const TAG_ = 'amp-iframe'; | |||
|
|||
/** @const {!Array<string>} */ | |||
const ATTRIBUTES_TO_PROPAGATE = [ | |||
'title', |
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.
Nit: The rest of these appear to be alphabetised. Might want to keep the pattern up.
@@ -235,7 +236,8 @@ describes.realWin( | |||
expect(iframe.getAttribute('referrerpolicy')).to.equal('no-referrer'); | |||
expect(iframe.getAttribute('frameborder')).to.equal('3'); | |||
expect(iframe.getAttribute('tabindex')).to.equal('-1'); | |||
// unsupproted attributes | |||
expect(iframe.getAttribute('title')).to.equal('example title'); |
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.
Can we also add a test for when the title
is mutated since this change is propagating it?
@@ -618,6 +619,9 @@ export class AmpIframe extends AMP.BaseElement { | |||
); | |||
} | |||
} | |||
if (this.iframe_) { | |||
this.propagateAttributes(['title'], this.iframe_); |
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.
A comment here indicating why only title
is propagated would be nice.
Approved the visual diff change, and will look at the test addition in a few minutes. |
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.
Changes look good, thank you for contributing this fix!
@maxlever You might want to pull the |
@kristoferbaxter i removed the update: split |
Improve a11y by propagating
title
attribute from amp-iframe to iframe. Resolves #17308.