From e3cb7f7a448c3972cb386f91c467a852a1999c9e Mon Sep 17 00:00:00 2001 From: Meggin Kearney Date: Tue, 23 Feb 2016 17:27:19 -0800 Subject: [PATCH 1/6] Update amp-ad.md Fixed broken JS Example (missing end ```). --- builtins/amp-ad.md | 1 + 1 file changed, 1 insertion(+) diff --git a/builtins/amp-ad.md b/builtins/amp-ad.md index 56bc5379fa43..37efa02ca2c1 100644 --- a/builtins/amp-ad.md +++ b/builtins/amp-ad.md @@ -182,3 +182,4 @@ draw3p(function(config, done) { done(config); }, 100) }); +``` From ae6ab856bc359d057ba0e77eb8960993185a0308 Mon Sep 17 00:00:00 2001 From: Meggin Kearney Date: Tue, 23 Feb 2016 17:39:19 -0800 Subject: [PATCH 2/6] Update amp-access.md Small fixes (broken tables, lingering 'spec', Google AMP Cache, numbering). --- extensions/amp-access/amp-access.md | 65 +++++++++++++++-------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/extensions/amp-access/amp-access.md b/extensions/amp-access/amp-access.md index f29c2b358f6f..73b4fe6aca07 100644 --- a/extensions/amp-access/amp-access.md +++ b/extensions/amp-access/amp-access.md @@ -37,8 +37,8 @@ limitations under the License. -The following lists validation errors specific to the `amp-access-spec` tag -(see also `amp-access-spec` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii)): +The following lists validation errors specific to the `amp-access` tag +(see also `amp-access` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii)): @@ -70,13 +70,14 @@ The proposed solution gives control to the Publisher over the following decision - Flexibility over access parameters at a per-document level The solution comprises the following components: - 1. [**AMP Reader ID**][2]: provided by AMP ecosystem, this is a unique identifier of the reader as seen by AMP. - 2. [**Access Content Markup**][3]: authored by the Publisher, defines which parts of a document are visible in which circumstances. - 3. [**Authorization endpoint**][4]: provided by the Publisher, returns the response that explains which part of a document the Reader can consume. - 4. [**Pingback endpoint**][5]: provided by the Publisher, is used to send the “view” impression for a document. - 5. [**Login Link and Login Page**][6]: allows the publisher to authenticate the Reader and connect their identity with AMP Reader ID. -AMP Cache returns the document to the Reader with some sections obscured using Access Content Markup. The AMP Runtime calls the Authorization endpoint and uses the response to either hide or show different sections as defined by the Access Content Markup. After the document has been shown to the Reader, AMP Runtime calls the Pingback endpoint that can be used by the Publisher to update the countdown meter. +1. [**AMP Reader ID**][2]: provided by AMP ecosystem, this is a unique identifier of the reader as seen by AMP. +2. [**Access Content Markup**][3]: authored by the Publisher, defines which parts of a document are visible in which circumstances. +3. [**Authorization endpoint**][4]: provided by the Publisher, returns the response that explains which part of a document the Reader can consume. +4. [**Pingback endpoint**][5]: provided by the Publisher, is used to send the “view” impression for a document. +5. [**Login Link and Login Page**][6]: allows the publisher to authenticate the Reader and connect their identity with AMP Reader ID. + +Google AMP Cache returns the document to the Reader with some sections obscured using Access Content Markup. The AMP Runtime calls the Authorization endpoint and uses the response to either hide or show different sections as defined by the Access Content Markup. After the document has been shown to the Reader, AMP Runtime calls the Pingback endpoint that can be used by the Publisher to update the countdown meter. The solution also allows the Publisher to place in the AMP document a Login Link that launches the Login/Subscribe Page where the Publisher can authenticate the Reader and associate the Reader’s identity in their system with the AMP Reader ID. @@ -106,11 +107,11 @@ Access Content Markup determines which sections are visible or hidden based on t ### Authorization Endpoint -Authorization is an endpoint provided by the publisher and called by AMP Runtime or AMP Cache. It is a credentialed CORS endpoint. This endpoint returns the access parameters that can be used by the Content Markup to hide or show different parts of the document. +Authorization is an endpoint provided by the publisher and called by AMP Runtime or Google AMP Cache. It is a credentialed CORS endpoint. This endpoint returns the access parameters that can be used by the Content Markup to hide or show different parts of the document. ### Pingback Endpoint -Pingback is an endpoint provided by the publisher and called by AMP Runtime or AMP Cache. It is a credentialed CORS endpoint. AMP Runtime calls this endpoint automatically when the Reader has started viewing the document. On of the main goals of the Pingback is for the Publisher to update metering information. +Pingback is an endpoint provided by the publisher and called by AMP Runtime or Google AMP Cache. It is a credentialed CORS endpoint. AMP Runtime calls this endpoint automatically when the Reader has started viewing the document. On of the main goals of the Pingback is for the Publisher to update metering information. ### Login Page and Login Link @@ -135,13 +136,13 @@ All of the endpoints are configured in the AMP document as a JSON object in the The following properties are defined in this configuration: -Property | Values | Description -------------- | -------------------- |--------------------------------- -authorization | <URL> | The HTTPS URL for the Authorization endpoint. -pingback | <URL> | The HTTPS URL for the Pingback endpoint. -login | <URL> or <Map[string, URL]> | The HTTPS URL for the Login Page or a set of URLs for different types of login pages. -authorizationFallbackResponse | <object> | The JSON object to be used in place of the authorization response if it fails. -type | "client" or "server" | Default is “client”. The "server" option is under design discussion and these docs will be updated when it is ready. +|Property | Values | Description | +-------------- | -------------------- | --------------------------------- | +| authorization | <URL> | The HTTPS URL for the Authorization endpoint. | +| pingback | <URL> | The HTTPS URL for the Pingback endpoint. | +| login | <URL> or <Map[string, URL]> | The HTTPS URL for the Login Page or a set of URLs for different types of login pages. | +| authorizationFallbackResponse | <object> | The JSON object to be used in place of the authorization response if it fails. | +| type | "client" or "server" | Default is “client”. The "server" option is under design discussion and these docs will be updated when it is ready. | *<URL>* values specify HTTPS URLs with substitution variables. The substitution variables are covered in more detail in the [Access URL Variables][7] section below. @@ -164,17 +165,17 @@ Here’s an example of the AMP Access configuration: When configuring the URLs for various endpoints, the Publisher can use substitution variables. The full list of these variables are defined in the [AMP Var Spec](https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md). In addition, this spec adds a few access-specific variables such as `READER_ID` and `AUTHDATA`. Some of the most relevant variables are described in the table below: -Var | Description ------------------ | ----------- -READER_ID | The AMP Reader ID. -AUTHDATA(field) | The value of the field in the authorization response. -RETURN_URL | The placeholder for the return URL specified by the AMP runtime for a Login Dialog to return to. -SOURCE_URL | The Source URL of this AMP Document. If document is served from CDN, AMPDOC_URL will be a CDN URL, while SOURCE_URL will be the original source URL. -AMPDOC_URL | The URL of this AMP Document. -CANONICAL_URL | The canonical URL of this AMP Document. -DOCUMENT_REFERRER | The Referrer URL. -VIEWER | The URL of the AMP Viewer. -RANDOM | A random number. Helpful to avoid browser cache. +| Var | Description | +| ----------------- | ----------- | +| READER_ID | The AMP Reader ID. | +| AUTHDATA(field) | The value of the field in the authorization response. | +| RETURN_URL | The placeholder for the return URL specified by the AMP runtime for a Login Dialog to return to. | +| SOURCE_URL | The Source URL of this AMP Document. If document is served from CDN, AMPDOC_URL will be a CDN URL, while SOURCE_URL will be the original source URL. | +| AMPDOC_URL | The URL of this AMP Document. | +| CANONICAL_URL | The canonical URL of this AMP Document. | +| DOCUMENT_REFERRER | The Referrer URL. | +| VIEWER | The URL of the AMP Viewer. | +| RANDOM | A random number. Helpful to avoid browser cache. | Here’s an example of the URL extended with Reader ID, Canonical URL, Referrer information and random cachebuster: ``` @@ -311,7 +312,7 @@ AMP Runtime uses the following CSS classes during the authorization flow: 1. `amp-access-loading` CSS class is set on the document root when the authorization flow starts and removed when it completes or fails. 2. `amp-access-error` CSS class is set on the document root when the authorization flow fails. -In the *server* option, the call to Authorization endpoint is done by AMP Cache as a simple HTTPS endpoint. This means that the Publisher’s cookies cannot be delivered in this case. +In the *server* option, the call to Authorization endpoint is done by Google AMP Cache as a simple HTTPS endpoint. This means that the Publisher’s cookies cannot be delivered in this case. ### Pingback Endpoint @@ -418,10 +419,10 @@ To implement FCF, the Publisher must (1) be able to determine the referring serv Both steps are covered by the AMP Access spec. The referrer can be injected into the Authorization and Pingback URLs using `DOCUMENT_REFERRER` URL substitution as described in [Access URL Variables][7]. The view counting can be done using Pingback endpoint on the server-side. This is very similar to the metering implementation described in [Metering][12]. ## AMP Glossary - - **AMP Document** - the HTML document that follows AMP format and validated by AMP Validator. AMP Documents are cacheable by AMP Cache. + - **AMP Document** - the HTML document that follows AMP format and validated by AMP Validator. AMP Documents are cacheable by Google AMP Cache. - **AMP Validator** - the computer program that performs a static analysis of an HTML document and returns success or failure depending on whether the document conforms to the AMP format. - **AMP Runtime** - the JavaScript runtime that executes AMP Document. - - **AMP Cache** - the proxying cache for AMP documents. + - **Google AMP Cache** - the proxying cache for AMP documents. - **AMP Viewer** - the Web or native application that displays/embeds AMP Documents. - **Publisher.com** - the site of an AMP publisher. - **CORS endpoint** - cross-origin HTTPS endpoint. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for more info. See [CORS Origin Security][9] for how such requests can be secured. @@ -470,7 +471,7 @@ field_ref: field_ref '.' field_name | field_name literal: STRING | NUMERIC | TRUE | FALSE | NULL ``` -Notice that ```amp-access``` expressions are evaluated by the AMP Runtime and AMP Cache. This is NOT part of the specification that the Publisher needs to implement. It is here simply for informational properties. +Notice that ```amp-access``` expressions are evaluated by the AMP Runtime and Google AMP Cache. This is NOT part of the specification that the Publisher needs to implement. It is here simply for informational properties. ## Detailed Discussion From 9ff360c737de174d727790fac8ae5085d2ad1f17 Mon Sep 17 00:00:00 2001 From: Meggin Kearney Date: Tue, 23 Feb 2016 17:44:34 -0800 Subject: [PATCH 3/6] Update amp-accordion.md Added mention that there's no validations yet, and also added break between list and example. --- extensions/amp-accordion/amp-accordion.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/amp-accordion/amp-accordion.md b/extensions/amp-accordion/amp-accordion.md index eac811588e61..1e715e02b940 100644 --- a/extensions/amp-accordion/amp-accordion.md +++ b/extensions/amp-accordion/amp-accordion.md @@ -23,7 +23,7 @@ limitations under the License. - + @@ -47,6 +47,8 @@ Each of the `amp-accordion` component’s immediate children is considered a sec - Any additional children of the `
` would be ignored not be displayed. (This should just be a safety backup and should be enforced in the validator) - Clicking/tapping on the heading of a section expands/ or collapses the section. +Example: + ```html
From 5668f9b0f97f291e609e19c9c1617181cc7d5d84 Mon Sep 17 00:00:00 2001 From: Meggin Kearney Date: Tue, 23 Feb 2016 17:48:33 -0800 Subject: [PATCH 4/6] Update amp-dailymotion.md Added link to Dailymotion. --- extensions/amp-dailymotion/amp-dailymotion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/amp-dailymotion/amp-dailymotion.md b/extensions/amp-dailymotion/amp-dailymotion.md index 67622d38c2e3..e0056a4a58c2 100644 --- a/extensions/amp-dailymotion/amp-dailymotion.md +++ b/extensions/amp-dailymotion/amp-dailymotion.md @@ -19,7 +19,7 @@ limitations under the License.
AvailabilityStableStable; no validations yet.
Required Script
- + From cebd438428ae8cdd012f0b17fbe6d8c3455d8279 Mon Sep 17 00:00:00 2001 From: Meggin Kearney Date: Tue, 23 Feb 2016 17:49:44 -0800 Subject: [PATCH 5/6] Update amp-mustache.md Removed dangling format. --- extensions/amp-mustache/amp-mustache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/amp-mustache/amp-mustache.md b/extensions/amp-mustache/amp-mustache.md index 1fad78cff33d..3d2a40081382 100644 --- a/extensions/amp-mustache/amp-mustache.md +++ b/extensions/amp-mustache/amp-mustache.md @@ -61,7 +61,7 @@ for more details. Some of the core Mustache tags are: - \{\{variable\}\} - variable tag. It outputs the the HTML-escaped value of a variable; - \{\{#section\}\}\{\{/section\}\} - section tag. It can test existance of a variable and iterate over it if it's an array; -- \{\{^section\}\}\{\{/section\}\}` - inverted tag. It can test non-existance of a variable. +- \{\{^section\}\}\{\{/section\}\} - inverted tag. It can test non-existance of a variable. ## Usage From 5ccfb943d344c09e610125c8e5df02290cbc6125 Mon Sep 17 00:00:00 2001 From: Dima Voytenko Date: Tue, 23 Feb 2016 19:32:21 -0800 Subject: [PATCH 6/6] Extend messaging channel timeout to 20s --- src/service/viewer-impl.js | 2 +- test/functional/test-viewer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service/viewer-impl.js b/src/service/viewer-impl.js index a55ad0417804..64a19c40e896 100644 --- a/src/service/viewer-impl.js +++ b/src/service/viewer-impl.js @@ -260,7 +260,7 @@ export class Viewer { * @private @const {!Promise} */ this.messagingReadyPromise_ = timer.timeoutPromise( - 5000, + 20000, new Promise(resolve => { /** @private @const {function(!Viewer)} */ this.messagingReadyResolver_ = resolve; diff --git a/test/functional/test-viewer.js b/test/functional/test-viewer.js index f99b2530a351..2a006d3a3761 100644 --- a/test/functional/test-viewer.js +++ b/test/functional/test-viewer.js @@ -222,7 +222,7 @@ describe('Viewer', () => { it('should post broadcast event but not fail w/o messaging', () => { viewer.broadcast({type: 'type1'}); expect(viewer.messageQueue_.length).to.equal(0); - clock.tick(5001); + clock.tick(20001); return viewer.messagingReadyPromise_.then(() => 'OK', () => 'ERROR') .then(res => { expect(res).to.equal('ERROR'); @@ -310,7 +310,7 @@ describe('Viewer', () => { expect(m2Resolved).to.be.false; // Timeout. - clock.tick(5001); + clock.tick(20001); return Promise.all([m1, m2]); }).then(() => { throw new Error('must never be here');
Description Displays a Dailymotion video. Displays a Dailymotion video.
Availability