-
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
Move Cid service to doc-scope and fixes to elements to work in shadow #7113
Conversation
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.
You'll need to rebase. |
492d2f0
to
66b0f1a
Compare
66b0f1a
to
4aba37b
Compare
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.
Apologies for a slow review. All looks good, with couple of notes.
*/ | ||
export function installCidService(window) { | ||
return fromClass(window, 'cid', Cid); | ||
export function installCidServiceForDoc(ampdoc) { |
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.
So, is this now only useful for testing? If so, could you please rename this method to installCidServiceForDocForTesting
?
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.
Just sent #7209
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.
We don't currently have such naming convention. Isn't cid service installed in amp-analytics
? Could we use installCidServiceForDoc
in amp-analytics
instead of renaming?
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.
OK, I now understand we don't need this method after compilation. Either change it to ForTesting
or dropping this method is fine.
@@ -100,7 +100,7 @@ export class AmpForm { | |||
this.timer_ = timerFor(this.win_); | |||
|
|||
/** @const @private {!../../../src/service/url-replacements-impl.UrlReplacements} */ | |||
this.urlReplacement_ = urlReplacementsForDoc(this.win_.document); | |||
this.urlReplacement_ = urlReplacementsForDoc(element); |
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.
oops. thanks for fixing.
this.playerReadyPromise_ = new Promise(resolve => { | ||
this.playerReadyResolver_ = resolve; | ||
}); | ||
|
||
this.win.addEventListener( | ||
const ampdoc = this.getAmpDoc(); | ||
ampdoc.win.addEventListener( |
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.
We should be using our iframe messaging helpers here. /cc @jridgewell
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 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.
cc/ @aghassemi as he has another PR that touches this path - maybe can update the listener to use the helpers
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.
will do
Fixes #7064