Skip to content
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

Merged
merged 1 commit into from
Jan 24, 2017

Conversation

mkhatib
Copy link
Contributor

@mkhatib mkhatib commented Jan 20, 2017

Fixes #7064

Copy link
Contributor

@lannka lannka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are competing with @muxin #7111

@jridgewell
Copy link
Contributor

You'll need to rebase.

@mkhatib mkhatib merged commit e9349d5 into ampproject:master Jan 24, 2017
@mkhatib mkhatib deleted the debug-analytics-shadow branch January 24, 2017 01:43
Copy link
Contributor

@dvoytenko dvoytenko left a 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) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just sent #7209

Copy link
Contributor

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?

Copy link
Contributor

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);
Copy link
Contributor

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(
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants