diff --git a/.renovaterc.json b/.renovaterc.json index c90fa3a20e5b..15fe3305c351 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -21,22 +21,22 @@ { "groupName": "subpackage devDependencies", "matchPaths": ["**/*"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "build-system devDependencies", "matchPaths": ["build-system/**"], "labels": ["WG: infra"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "validator devDependencies", "matchPaths": ["validator/**"], "labels": ["WG: caching"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "validator webui", @@ -47,16 +47,16 @@ "groupName": "core devDependencies", "matchFiles": ["package.json"], "labels": ["WG: infra"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "linting devDependencies", "matchFiles": ["package.json"], "matchPackagePatterns": ["\\b(prettier|eslint)\\b"], "labels": ["WG: infra"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "babel devDependencies", @@ -64,16 +64,16 @@ "matchPackagePatterns": ["\\bbabel"], "major": {"automerge": false, "assignAutomerge": false}, "labels": ["WG: infra", "WG: performance"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "esbuild devDependencies", "matchFiles": ["package.json"], "matchPackagePatterns": ["\\besbuild\\b"], "labels": ["WG: infra", "WG: performance"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "ampproject devDependencies", @@ -81,8 +81,8 @@ "matchPackagePatterns": ["^@ampproject/"], "matchDepTypes": ["devDependencies"], "labels": ["WG: bento", "WG: components", "WG: performance"], - "automerge": true, - "assignAutomerge": true + "rebaseWhen": "never", + "automerge": true }, { "groupName": "ampproject dependencies", @@ -90,8 +90,8 @@ "matchPackagePatterns": ["^@ampproject/"], "matchDepTypes": ["dependencies"], "labels": ["WG: bento", "WG: components", "WG: performance"], - "automerge": false, - "assignAutomerge": false + "rebaseWhen": "never", + "automerge": false }, { "groupName": "core dependencies", @@ -99,8 +99,8 @@ "excludePackagePatterns": ["^@ampproject/"], "matchDepTypes": ["dependencies"], "labels": ["WG: bento", "WG: components", "WG: performance"], - "automerge": false, - "assignAutomerge": false + "rebaseWhen": "never", + "automerge": false } ] } diff --git a/OWNERS b/OWNERS index 44cb5e1c5831..5f9b5e5d0500 100644 --- a/OWNERS +++ b/OWNERS @@ -48,7 +48,7 @@ }, { // Locked down to minimize new import aliases being added - pattern: 'jsconfig.json', + pattern: 'tsconfig.json', owners: [{name: 'ampproject/wg-performance', required: true}], }, ], diff --git a/ads/google/a4a/test/test-utils.js b/ads/google/a4a/test/test-utils.js index b65b360354f6..524d682526be 100644 --- a/ads/google/a4a/test/test-utils.js +++ b/ads/google/a4a/test/test-utils.js @@ -44,7 +44,7 @@ import {MockA4AImpl} from '../../../../extensions/amp-a4a/0.1/test/utils'; import {Services} from '#service'; import {buildUrl} from '#ads/google/a4a/shared/url-builder'; import {createElementWithAttributes} from '#core/dom'; -import {createIframePromise} from '../../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {installDocService} from '#service/ampdoc-impl'; import {installExtensionsService} from '#service/extensions-impl'; import {installXhrService} from '#service/xhr-impl'; diff --git a/ads/google/ima/ima-video.js b/ads/google/ima/ima-video.js index 27c67be3bab3..1234fe4b0ea5 100644 --- a/ads/google/ima/ima-video.js +++ b/ads/google/ima/ima-video.js @@ -254,12 +254,9 @@ function renderElements(elementOrDoc) { -
- - -:- / 0:00 -
+
-:-
-
+ @@ -949,14 +946,35 @@ function playerDataTick() { */ export function updateTime(currentTime, duration) { const { + 'progress': progress, 'progressLine': progressLine, 'progressMarker': progressMarker, 'time': time, } = elements; - time.textContent = formatTime(currentTime) + ' / ' + formatTime(duration); - const progressPercent = Math.floor((currentTime / duration) * 100); - setStyle(progressLine, 'width', progressPercent + '%'); - setStyle(progressMarker, 'left', progressPercent - 1 + '%'); + + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/duration + const isLivestream = duration === Infinity; + + // Progress bar should not be displayed on livestreams. + // TODO(alanorozco): This is likely handled by native controls, so we wouldn't + // need this clause if we switch. https://go.amp.dev/issue/8841 + if (progress.hasAttribute('hidden') !== isLivestream) { + toggle(progress, !isLivestream); + progress.setAttribute('aria-hidden', String(isLivestream)); + } + + // TODO(alanorozco): Consider adding a label for livestreams to display next + // to the current time. + const currentTimeFormatted = formatTime(currentTime); + time.textContent = isLivestream + ? currentTimeFormatted + : `${currentTimeFormatted} / ${formatTime(duration)}`; + + if (!isLivestream) { + const progressPercent = Math.floor((currentTime / duration) * 100); + setStyle(progressLine, 'width', progressPercent + '%'); + setStyle(progressMarker, 'left', progressPercent - 1 + '%'); + } } /** @@ -1452,9 +1470,6 @@ export function getPropertiesForTesting() { playPauseDiv: elements['playButton'], countdownDiv: elements['countdown'], timeDiv: elements['time'], - progressBarWrapper: elements['progress'], - progressLine: elements['progressLine'], - progressMarkerDiv: elements['progressMarker'], muteUnmuteDiv: elements['muteButton'], fullscreenDiv: elements['fullscreenButton'], bigPlayDiv: elements['overlayButton'], diff --git a/build-system/babel-config/import-resolver.js b/build-system/babel-config/import-resolver.js index befb4056cac6..e600e4c65331 100644 --- a/build-system/babel-config/import-resolver.js +++ b/build-system/babel-config/import-resolver.js @@ -18,11 +18,11 @@ const fs = require('fs'); const path = require('path'); -const JSCONFIG_PATH = path.join(__dirname, '..', '..', 'jsconfig.json'); -let jsConfigPaths = null; +const TSCONFIG_PATH = path.join(__dirname, '..', '..', 'tsconfig.json'); +let tsConfigPaths = null; /** - * Reads import paths from jsconfig.json. This file is used by VSCode for + * Reads import paths from tsconfig.json. This file is used by VSCode for * Intellisense/auto-import. Rather than duplicate and require updating both * files, we can read from it directly. JSConfig format looks like: * { compilerOptions: { paths: { @@ -38,9 +38,9 @@ let jsConfigPaths = null; * @return {!Object} */ function readJsconfigPaths() { - if (!jsConfigPaths) { - const jsConfig = JSON.parse(fs.readFileSync(JSCONFIG_PATH, 'utf8')); - const aliasPaths = jsConfig.compilerOptions.paths; + if (!tsConfigPaths) { + const tsConfig = JSON.parse(fs.readFileSync(TSCONFIG_PATH, 'utf8')); + const aliasPaths = tsConfig.compilerOptions.paths; const stripSuffix = (s) => s.replace(/\/\*$/, ''); const aliases = Object.entries(aliasPaths).map(([alias, [dest]]) => [ @@ -48,10 +48,10 @@ function readJsconfigPaths() { stripSuffix(dest), ]); - jsConfigPaths = Object.fromEntries(aliases); + tsConfigPaths = Object.fromEntries(aliases); } - return jsConfigPaths; + return tsConfigPaths; } /** diff --git a/build-system/compile/bundles.config.extensions.json b/build-system/compile/bundles.config.extensions.json index 724dd830ec02..562448b67551 100644 --- a/build-system/compile/bundles.config.extensions.json +++ b/build-system/compile/bundles.config.extensions.json @@ -903,6 +903,7 @@ "latestVersion": "0.1", "options": { "hasCss": true, + "npm": true, "wrapper": "bento" } }, diff --git a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js index 95f6ae994e19..227b3fc30773 100644 --- a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js +++ b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js @@ -16,8 +16,8 @@ import {BaseElement} from './base-element'; __css_import__; -import {dict} from '../../../src/core/types/object'; -import {isExperimentOn} from '../../../src/experiments'; +import {dict} from '#core/types/object'; +import {isExperimentOn} from '#experiments'; import {userAssert} from '../../../src/log'; /** @const {string} */ diff --git a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/base-element.js b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/base-element.js index a1f70ab9843f..3cf917a0a48e 100644 --- a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/base-element.js +++ b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/base-element.js @@ -16,7 +16,7 @@ __jss_import_component_css__; import {__component_name_pascalcase__} from './component'; -import {PreactBaseElement} from '../../../src/preact/base-element'; +import {PreactBaseElement} from '#preact/base-element'; export class BaseElement extends PreactBaseElement {} diff --git a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/component.js b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/component.js index 2bba7ac5b007..a8ca74a09966 100644 --- a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/component.js +++ b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/component.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import * as Preact from '../../../src/preact'; -import {ContainWrapper} from '../../../src/preact/component'; +import * as Preact from '#preact'; +import {ContainWrapper} from '#preact/component'; import { useCallback, useEffect, @@ -23,7 +23,7 @@ import { useMemo, useRef, useState, -} from '../../../src/preact'; +} from '#preact'; __jss_import_use_styles__; /** diff --git a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.js b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.js index 58163723bb93..826055d012c4 100644 --- a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.js +++ b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as Preact from '../../../../src/preact'; +import * as Preact from '#preact'; import {__component_name_pascalcase__} from '../component' import {withKnobs} from '@storybook/addon-knobs'; diff --git a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js index 8f1a6a0575e6..45322b06c82e 100644 --- a/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js +++ b/build-system/tasks/make-extension/template/bento/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js @@ -15,8 +15,8 @@ */ import '../amp-__component_name_hyphenated__'; -import {htmlFor} from '../../../../src/core/dom/static-template'; -import {toggleExperiment} from '../../../../src/experiments'; +import {htmlFor} from '#core/dom/static-template'; +import {toggleExperiment} from '#experiments'; import {waitFor} from '../../../../testing/test-helper'; describes.realWin( diff --git a/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js b/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js index 4156a3c383bc..dee4b0b02acd 100644 --- a/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js +++ b/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/amp-__component_name_hyphenated__.js @@ -15,10 +15,10 @@ */ __css_import__; -import {Layout} from '../../../src/core/dom/layout'; +import {Layout, applyFillContent} from '#core/dom/layout'; const TAG = 'amp-__component_name_hyphenated__'; - + export class Amp__component_name_pascalcase__ extends AMP.BaseElement { /** @param {!AmpElement} element */ constructor(element) { @@ -37,7 +37,7 @@ export class Amp__component_name_pascalcase__ extends AMP.BaseElement { this.container_ = this.element.ownerDocument.createElement('div'); this.container_.textContent = this.myText_; this.element.appendChild(this.container_); - this.applyFillContent(this.container_, /* replacedContent */ true); + applyFillContent(this.container_, /* replacedContent */ true); } /** @override */ diff --git a/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js b/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js index ccc813f1777c..f9eb5dfd0541 100644 --- a/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js +++ b/build-system/tasks/make-extension/template/classic/extensions/amp-__component_name_hyphenated__/__component_version__/test/test-amp-__component_name_hyphenated__.js @@ -15,7 +15,7 @@ */ import '../amp-__component_name_hyphenated__'; -import {htmlFor} from '../../../../src/core/dom/static-template'; +import {htmlFor} from '#core/dom/static-template'; describes.realWin( 'amp-__component_name_hyphenated__-v__component_version__', diff --git a/build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.amp.js b/build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.amp.js index 012923b93821..93b1f94b6aba 100644 --- a/build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.amp.js +++ b/build-system/tasks/make-extension/template/shared/extensions/amp-__component_name_hyphenated__/__component_version__/storybook/Basic.amp.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as Preact from '../../../../src/preact'; +import * as Preact from '#src/preact'; import {withAmp} from '@ampproject/storybook-addon'; import {withKnobs} from '@storybook/addon-knobs'; diff --git a/build-system/tasks/validate-html-fixtures.js b/build-system/tasks/validate-html-fixtures.js index 5d7e4ce90993..c6182f0eeef1 100644 --- a/build-system/tasks/validate-html-fixtures.js +++ b/build-system/tasks/validate-html-fixtures.js @@ -113,7 +113,20 @@ async function runCheck(filesToCheck) { } } if (foundValidationErrors) { - throw new Error('Please address the errors listed above.'); + log('Please address the errors listed above.'); + log( + '⤷ If a failing fixture is a', + cyan('Bento'), + 'document, it is not meant to be valid AMP.' + ); + log( + '⤷ Place it under any directory named', + cyan('bento'), + 'like', + cyan('examples/bento/'), + 'so that it is not validated.' + ); + throw new Error('Validation failed.'); } log(green('SUCCESS:'), 'All HTML fixtures are valid.'); } diff --git a/build-system/test-configs/config.js b/build-system/test-configs/config.js index d0359ff06c51..31ae7ff8f4d0 100644 --- a/build-system/test-configs/config.js +++ b/build-system/test-configs/config.js @@ -200,6 +200,13 @@ const htmlFixtureGlobs = [ 'examples/**/*.html', 'test/fixtures/e2e/**/*.html', + // The following are not AMP documents and are not meant to validate. + '!**/bento/**/*.html', + '!examples/amp-video-iframe/frame*.html', + '!examples/viewer-iframe-poll.html', + '!examples/viewer-webview.html', + '!examples/viewer.html', + // TODO(#25149): Fix these invalid files and remove them from this list. '!examples/accordion.amp.html', '!examples/ad-lightbox.amp.html', @@ -252,7 +259,6 @@ const htmlFixtureGlobs = [ '!examples/amp-redbull-player.amp.html', '!examples/amp-script/example.amp.html', '!examples/amp-script/example.sandboxed.amp.html', - '!examples/amp-script/hello-world.html', '!examples/amp-script/todomvc.amp.html', '!examples/amp-script/vue-todomvc.amp.html', '!examples/amp-skimlinks.html', @@ -306,13 +312,6 @@ const htmlFixtureGlobs = [ '!examples/amp-subscriptions-google/amp-subscriptions.amp.html', '!examples/amp-subscriptions-rtp.amp.html', '!examples/amp-tiktok.amp.html', - '!examples/amp-video-iframe/consent.html', - '!examples/amp-video-iframe/frame-consent-es2015.html', - '!examples/amp-video-iframe/frame-consent.html', - '!examples/amp-video-iframe/frame-es2015.html', - '!examples/amp-video-iframe/frame-videojs.html', - '!examples/amp-video-iframe/frame.html', - '!examples/amp-video/multi-bitrate/multi-bitrate.html', '!examples/ampcontext-creative-json.html', '!examples/ampcontext-creative.html', '!examples/amphtml-ads/adchoices-1.a4a.html', @@ -342,7 +341,6 @@ const htmlFixtureGlobs = [ '!examples/article-super-short.amp.html', '!examples/article.amp.html', '!examples/auto-ads.amp.html', - '!examples/bento.amp.html', '!examples/beopinion.amp.html', '!examples/beopinion.article.amp.html', '!examples/bind/carousels.amp.html', @@ -354,7 +352,6 @@ const htmlFixtureGlobs = [ '!examples/bind/sandbox.amp.html', '!examples/bind/svgimage.amp.html', '!examples/bodymovin-animation.amp.html', - '!examples/brightcove.amp.html', '!examples/csa.amp.html', '!examples/csp.amp.html', '!examples/date-picker.amp.html', @@ -366,10 +363,8 @@ const htmlFixtureGlobs = [ '!examples/forms.amp.html', '!examples/gfk-sensic-analytics.amp.html', '!examples/gwd.amp.html', - '!examples/ima-video.amp.html', '!examples/image-lightbox.amp.html', '!examples/img.amp.html', - '!examples/jwplayer.amp.html', '!examples/linkers.html', '!examples/live-blog-non-floating-button.amp.html', '!examples/live-list.amp.html', @@ -384,10 +379,6 @@ const htmlFixtureGlobs = [ '!examples/metadata-examples/video-json-ld.amp.html', '!examples/mraid/inabox-mraid.html', '!examples/multiple-docs.html', - '!examples/old-boilerplate.amp.html', - '!examples/ooyalaplayer.amp.html', - '!examples/playbuzz.amp.html', - '!examples/powr-player.amp.html', '!examples/pwa-multidoc-loader.html', '!examples/pwa/pwa-sd-polyfill.html', '!examples/pwa/pwa.html', @@ -405,11 +396,6 @@ const htmlFixtureGlobs = [ '!examples/user-notification.amp.html', '!examples/valueimpression.amp.html', '!examples/video-animation-sync.html', - '!examples/viewer-iframe-poll.html', - '!examples/viewer-webview.html', - '!examples/viewer.html', - '!examples/vimeo.amp.html', - '!examples/viqeo.amp.html', '!examples/visual-tests/amp-accordion/amp-accordion.html', '!examples/visual-tests/amp-date-picker/amp-date-picker.amp.html', '!examples/visual-tests/amp-inabox/amp-inabox-gpt.html', @@ -505,8 +491,6 @@ const htmlFixtureGlobs = [ '!test/fixtures/e2e/amp-story-player/pre-rendering.html', '!test/fixtures/e2e/amp-story/amp-story.amp.html', '!test/fixtures/e2e/amp-subscriptions-google/swg.amp.html', - '!test/fixtures/e2e/amp-video/analytics-triggers.html', - '!test/fixtures/e2e/amp-video/autoplay.html', '!test/fixtures/e2e/amp-video/videos-cdn.html', '!test/fixtures/e2e/amp-viewer-integration/viewer.html', '!test/fixtures/e2e/amp4email/element-size-race.html', diff --git a/builtins/amp-img/amp-img.js b/builtins/amp-img/amp-img.js index f4667d4eceb2..75bb44231d92 100644 --- a/builtins/amp-img/amp-img.js +++ b/builtins/amp-img/amp-img.js @@ -15,7 +15,7 @@ */ import {BaseElement} from '../../src/base-element'; -import {Layout, isLayoutSizeDefined} from '#core/dom/layout'; +import {Layout, applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {ReadyState} from '#core/constants/ready-state'; import {Services} from '#service'; import {dev} from '../../src/log'; @@ -224,7 +224,7 @@ export class AmpImg extends BaseElement { if (!IS_ESM) { guaranteeSrcForSrcsetUnsupportedBrowsers(this.img_); } - this.applyFillContent(this.img_, true); + applyFillContent(this.img_, true); propagateObjectFitStyles(this.element, this.img_); if (!serverRendered) { diff --git a/builtins/amp-layout/amp-layout.js b/builtins/amp-layout/amp-layout.js index 186f4122e4e0..d91182e98858 100644 --- a/builtins/amp-layout/amp-layout.js +++ b/builtins/amp-layout/amp-layout.js @@ -15,7 +15,8 @@ */ import {BaseElement} from '../../src/base-element'; -import {Layout, isLayoutSizeDefined} from '#core/dom/layout'; +import {Layout, applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; +import {realChildNodes} from '#core/dom/query'; import {registerElement} from '#service/custom-element-registry'; class AmpLayout extends BaseElement { @@ -35,8 +36,8 @@ class AmpLayout extends BaseElement { return; } const container = this.win.document.createElement('div'); - this.applyFillContent(container); - this.getRealChildNodes().forEach((child) => { + applyFillContent(container); + realChildNodes(this.element).forEach((child) => { container.appendChild(child); }); this.element.appendChild(container); diff --git a/css/amp-ima-video-iframe.css b/css/amp-ima-video-iframe.css index e1d7920102de..4b08175d4585 100644 --- a/css/amp-ima-video-iframe.css +++ b/css/amp-ima-video-iframe.css @@ -104,7 +104,6 @@ button > svg { } .time { - margin-right: 20px; text-align: center; font-size: 14px; text-shadow: 0 0 10px black; @@ -114,7 +113,12 @@ button > svg { height: 30px; flex-grow: 1; position: relative; - margin-right: 20px; + margin: 0 20px; +} + +/* Push the next item as if `.progress` was present */ +.progress[hidden] + * { + margin-left: auto; } .progress::after { diff --git a/docs/building-an-amp-extension.md b/docs/building-an-amp-extension.md index df971c204f58..0d1c08e9053c 100644 --- a/docs/building-an-amp-extension.md +++ b/docs/building-an-amp-extension.md @@ -367,7 +367,7 @@ The AMP runtime will not manage scheduling layouting for elements that have owners. ```javascript -this.cells_ = this.getRealChildren(); +this.cells_ = realChildElements(this.element); this.cells_.forEach((cell) => { Services.ownersForDoc(this.element).setOwner(cell, this.element); diff --git a/examples/ad-lightbox.amp.html b/examples/ad-lightbox.amp.html index 73c44895836a..41149bcbfe2a 100644 --- a/examples/ad-lightbox.amp.html +++ b/examples/ad-lightbox.amp.html @@ -14,7 +14,7 @@ limitations under the license. --> - + AMP Ad Lightbox Prototype Example diff --git a/examples/amp-ad-exit-conversion.html b/examples/amp-ad-exit-conversion.html index b03cac26649a..3c4b1333993b 100644 --- a/examples/amp-ad-exit-conversion.html +++ b/examples/amp-ad-exit-conversion.html @@ -1,5 +1,5 @@ - + amp-ad-exit example with conversion tracking diff --git a/examples/amp-ad-exit.amp.html b/examples/amp-ad-exit.amp.html index f8e75f2463ef..9617ad2c3d3b 100644 --- a/examples/amp-ad-exit.amp.html +++ b/examples/amp-ad-exit.amp.html @@ -1,5 +1,5 @@ - + amp-ad-exit example diff --git a/examples/amp-ad/sticky-creative.html b/examples/amp-ad/sticky-creative.html index 2b11d1564bff..e7ed169ef30a 100644 --- a/examples/amp-ad/sticky-creative.html +++ b/examples/amp-ad/sticky-creative.html @@ -1,4 +1,4 @@ - + diff --git a/examples/amp-autocomplete.ssr.html b/examples/amp-autocomplete.ssr.html index a80ebdb9206c..c6d3a0ace582 100644 --- a/examples/amp-autocomplete.ssr.html +++ b/examples/amp-autocomplete.ssr.html @@ -1,5 +1,5 @@ - + Forms Examples in AMP diff --git a/examples/amp-consent/amp-consent-iframe.embed.html b/examples/amp-consent/amp-consent-iframe.embed.html index 4fc8e8032706..e819cc1daf9e 100644 --- a/examples/amp-consent/amp-consent-iframe.embed.html +++ b/examples/amp-consent/amp-consent-iframe.embed.html @@ -1,5 +1,5 @@ - + diff --git a/examples/amp-script/hello-world.html b/examples/amp-script/hello-world.html deleted file mode 100644 index 1247fda690bd..000000000000 --- a/examples/amp-script/hello-world.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/examples/amp-story/ads/app-install.html b/examples/amp-story/ads/app-install.html index 05629b56a9c4..1155714adae2 100644 --- a/examples/amp-story/ads/app-install.html +++ b/examples/amp-story/ads/app-install.html @@ -1,5 +1,5 @@ - + diff --git a/examples/amp-story/amp-story-desktop-one-panel.html b/examples/amp-story/amp-story-desktop-one-panel.html index 30379e1360b7..042c813b7e59 100644 --- a/examples/amp-story/amp-story-desktop-one-panel.html +++ b/examples/amp-story/amp-story-desktop-one-panel.html @@ -1,5 +1,5 @@ - + amp-story-desktop-one-panel example diff --git a/examples/amp-story/player-local-stories.html b/examples/amp-story/player-local-stories.html index b248648b25ab..6f20dcf2e961 100644 --- a/examples/amp-story/player-local-stories.html +++ b/examples/amp-story/player-local-stories.html @@ -1,5 +1,5 @@ - + Story Player (Non-AMP) diff --git a/examples/amp-story/player-story-attribution.html b/examples/amp-story/player-story-attribution.html index 278e9252a464..a545b918aea4 100644 --- a/examples/amp-story/player-story-attribution.html +++ b/examples/amp-story/player-story-attribution.html @@ -1,5 +1,5 @@ - + Story Attribution diff --git a/examples/amp-story/player-with-button.html b/examples/amp-story/player-with-button.html index a473521315fd..eb240dc4cc87 100644 --- a/examples/amp-story/player-with-button.html +++ b/examples/amp-story/player-with-button.html @@ -1,4 +1,4 @@ - + Story Player (Non-AMP) diff --git a/examples/amp-story/player.html b/examples/amp-story/player.html index bbbe8f49d4e3..9fe854eea839 100644 --- a/examples/amp-story/player.html +++ b/examples/amp-story/player.html @@ -1,5 +1,5 @@ - + Story Player (Non-AMP) diff --git a/examples/amp-subscriptions-google/amp-subscriptions-iframe.provider.html b/examples/amp-subscriptions-google/amp-subscriptions-iframe.provider.html index 00fa169b2349..de960f9f89af 100644 --- a/examples/amp-subscriptions-google/amp-subscriptions-iframe.provider.html +++ b/examples/amp-subscriptions-google/amp-subscriptions-iframe.provider.html @@ -1,5 +1,5 @@ - + diff --git a/examples/amp-video-iframe/consent.html b/examples/amp-video-iframe/consent.html index 401ab6b7f6d9..96e345e9eab3 100644 --- a/examples/amp-video-iframe/consent.html +++ b/examples/amp-video-iframe/consent.html @@ -8,6 +8,7 @@ name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1" /> + - - - - - - -

amp-video

+ + + Multi bitrate + + + + + + + + + +

amp-video

- amp-video autoplay muted loop - multi-bitrate> - - - - - - - + > + + + + + + + diff --git a/examples/ampcontext-creative-json.html b/examples/ampcontext-creative-json.html index 04bba06626a4..21e76236d0bb 100644 --- a/examples/ampcontext-creative-json.html +++ b/examples/ampcontext-creative-json.html @@ -1,5 +1,5 @@ - + - - - - -

Brightcove Player

- - -

Actions

- - - - - - -

Autoplay

- - + + + Brightcove Player Example + + + + + + + + + + +

Brightcove Player

+ + +

Actions

+ + + + + -

Dock

+

Autoplay

+ layout="responsive" + width="480" + height="270" + > -
- +

Dock

+

+ + +

+ +
+ diff --git a/examples/everything.iframed.html b/examples/everything.iframed.html index 31689bdef562..f4a1423c5423 100644 --- a/examples/everything.iframed.html +++ b/examples/everything.iframed.html @@ -1,5 +1,5 @@ - + diff --git a/examples/ima-video.amp.html b/examples/ima-video.amp.html index cdb51e09a896..810af76d3b26 100644 --- a/examples/ima-video.amp.html +++ b/examples/ima-video.amp.html @@ -1,51 +1,61 @@ - + - + IMA examples - - - - +

amp-ima-video

Resources

Video1

- Uses the Pre roll + Bumper IMA Sample Tag. Also, with custom ad label in Spanish + Uses the Pre roll + Bumper IMA Sample Tag. Also, with custom ad label in + Spanish
- - - + + +

Video1 Actions

@@ -57,15 +67,20 @@

Video1 Actions

Video2

-
- Uses the Post roll IMA Sample Tag. -
+
Uses the Post roll IMA Sample Tag.
- - + +

Video2 Actions

@@ -77,18 +92,24 @@

Video2 Actions

-

Video3

Uses the Pre-, Mid-, and Post Roll IMA Sample Tag.
- - - + + +

Video3 Actions

@@ -99,19 +120,26 @@

Video3 Actions

-

Video4

- Uses the Single Skippable Inline IMA Sample Tag. Also, this video with autoplay + Uses the Single Skippable Inline IMA Sample Tag. Also, this video with + autoplay
- - - + + +

Video4 Actions

@@ -122,19 +150,26 @@

Video4 Actions

Video5

-
- With Source and Track Captions -
- - - +
With Source and Track Captions
+ + + +
- - - - + diff --git a/examples/jwplayer.amp.html b/examples/jwplayer.amp.html index 14cae2265cf2..d8451d09f87c 100644 --- a/examples/jwplayer.amp.html +++ b/examples/jwplayer.amp.html @@ -1,99 +1,98 @@ - + - - - JWPlayer AMP Example - - - - - - - - - - -

JWPlayer AMP Examples

+ + + JWPlayer AMP Example + + + + + + + + + + +

JWPlayer AMP Examples

-

Responsive

- - +

Responsive

+ + -

Non-responsive, with a playlist

- - +

Non-responsive, with a playlist

+ + -

Docking

- - +

Docking

+ + -

Responsive contextual

- - +

Responsive contextual

+ + -

Non-Responsive, with a VAST Ad

- - +

Non-Responsive, with a VAST Ad

+ + -

Non-Responsive, with an IMA Ad

- - +

Non-Responsive, with an IMA Ad

+ + +

External Controls

+ + -

External Controls

- - -
- - - - - -
-
-
-
- +

+ + + + + +

+ +
+ diff --git a/examples/mraid/inabox-mraid.html b/examples/mraid/inabox-mraid.html index 304f466c37d9..6ec9081db5b1 100644 --- a/examples/mraid/inabox-mraid.html +++ b/examples/mraid/inabox-mraid.html @@ -1,5 +1,5 @@ - + diff --git a/examples/multiple-docs.html b/examples/multiple-docs.html index f3e13b4f2c0b..2337a323c6a0 100644 --- a/examples/multiple-docs.html +++ b/examples/multiple-docs.html @@ -1,5 +1,5 @@ - + diff --git a/examples/old-boilerplate.amp.html b/examples/old-boilerplate.amp.html deleted file mode 100644 index 1627a9522a9f..000000000000 --- a/examples/old-boilerplate.amp.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Twitter examples - - - - - - -

AMP boilerplate

-

Testing if the old validator is still accepted.

-

- "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..." - "There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..." -

- - diff --git a/examples/ooyalaplayer.amp.html b/examples/ooyalaplayer.amp.html index 77f9f2462583..00f52581aac4 100644 --- a/examples/ooyalaplayer.amp.html +++ b/examples/ooyalaplayer.amp.html @@ -4,7 +4,7 @@ - + diff --git a/examples/playbuzz.amp.html b/examples/playbuzz.amp.html index b269acf613ac..4c066cb940d1 100644 --- a/examples/playbuzz.amp.html +++ b/examples/playbuzz.amp.html @@ -1,71 +1,113 @@ - + - - - playbuzz examples - - - - - - - - - - - -
- -

Times.com

-

Some Article

- - -

orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. Maecenas posuere pulvinar mi, ac congue nulla placerat nec.

- - - -

orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. Maecenas posuere pulvinar mi, ac congue nulla placerat nec.

- + + + playbuzz examples + + + + + + + + +
+

Times.com

+

Some Article

+ +

+ orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis + arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, + pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat + varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum + vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum + augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, + lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies + est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce + sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum + vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. + Maecenas posuere pulvinar mi, ac congue nulla placerat nec. +

- - -

orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. Maecenas posuere pulvinar mi, ac congue nulla placerat nec.

- - - - - -

orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. Maecenas posuere pulvinar mi, ac congue nulla placerat nec.

+ data-item="a6aa5a14-8888-4618-b2e3-fe6a30d8c51b" + layout="responsive" + height="300" + width="300" + data-item-info="false" + data-share-buttons="false" + data-comments="false" + > + + +

+ orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis + arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, + pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat + varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum + vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum + augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, + lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies + est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce + sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum + vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. + Maecenas posuere pulvinar mi, ac congue nulla placerat nec. +

+ + + +

+ orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis + arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, + pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat + varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum + vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum + augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, + lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies + est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce + sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum + vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. + Maecenas posuere pulvinar mi, ac congue nulla placerat nec. +

+ + + +

+ orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis + arcu, vehicula sed pretium eget, pulvinar eu elit. Ut nibh nulla, + pharetra at tristique at, pharetra et mi. Ut elementum quam eu feugiat + varius. Vestibulum dui ligula, dapibus at suscipit venenatis, elementum + vitae libero. Vivamus efficitur nibh et tortor semper, sit amet interdum + augue tempor. Nulla vitae tempus dolor, ac molestie odio. Cras cursus, + lectus ac consectetur scelerisque, mi arcu egestas velit, ac ultricies + est mi aliquam enim. Aenean ac neque in arcu euismod ornare. Fusce + sodales massa ac lectus finibus rutrum. Nunc laoreet nunc id rutrum + vehicula. Sed tempor turpis posuere, auctor elit quis, ultricies ligula. + Maecenas posuere pulvinar mi, ac congue nulla placerat nec. +

-
Footer
- - +
Footer
+ diff --git a/examples/powr-player.amp.html b/examples/powr-player.amp.html index f93b1b0c0cbd..bb48999c7127 100644 --- a/examples/powr-player.amp.html +++ b/examples/powr-player.amp.html @@ -59,16 +59,6 @@

Autoplay

layout="responsive" width="480" height="270"> -

Dock

- - -
diff --git a/examples/pwa/pwa-sd-polyfill.html b/examples/pwa/pwa-sd-polyfill.html index 9ec70dd9dc48..96f27adeecf0 100644 --- a/examples/pwa/pwa-sd-polyfill.html +++ b/examples/pwa/pwa-sd-polyfill.html @@ -1,5 +1,5 @@ - + PWA diff --git a/examples/pwa/pwa.html b/examples/pwa/pwa.html index 1fee495ea90b..aa9a843ae915 100644 --- a/examples/pwa/pwa.html +++ b/examples/pwa/pwa.html @@ -1,5 +1,5 @@ - + PWA diff --git a/examples/timeago.amp.html b/examples/timeago.amp.html index 1bad7ebc6781..9c61d96ecb2e 100644 --- a/examples/timeago.amp.html +++ b/examples/timeago.amp.html @@ -1,5 +1,5 @@ - + diff --git a/examples/viewer-iframe-poll.html b/examples/viewer-iframe-poll.html index 6e7b2473a86d..ff4e97d92701 100644 --- a/examples/viewer-iframe-poll.html +++ b/examples/viewer-iframe-poll.html @@ -1,5 +1,5 @@ - + Viewer diff --git a/examples/viewer-webview.html b/examples/viewer-webview.html index 25af9c8c8d22..d1dea641d697 100644 --- a/examples/viewer-webview.html +++ b/examples/viewer-webview.html @@ -1,5 +1,5 @@ - + Viewer diff --git a/examples/viewer.html b/examples/viewer.html index 946154d0b3eb..08768949c034 100644 --- a/examples/viewer.html +++ b/examples/viewer.html @@ -1,5 +1,5 @@ - + Viewer diff --git a/examples/vimeo.amp.html b/examples/vimeo.amp.html index 602313edc0dc..c99f44f96515 100644 --- a/examples/vimeo.amp.html +++ b/examples/vimeo.amp.html @@ -1,6 +1,6 @@ - + - + Vimeo examples @@ -10,51 +10,41 @@ - - -

Vimeo

+ body { + max-width: 527px; + font-family: 'Questrial', Arial; + } + .spacer { + height: 100vh; + } + + + +

Vimeo

+ + +

Actions

+ + + + + - - -

Actions

- - - - - - -

Autoplay

- - - -

Dock

- - -
- - +

Autoplay

+ + + diff --git a/examples/viqeo.amp.html b/examples/viqeo.amp.html index 47433df41967..8fdf64b7636e 100644 --- a/examples/viqeo.amp.html +++ b/examples/viqeo.amp.html @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the license. --> - + - + Viqeo examples @@ -23,72 +23,72 @@ - - + + +

amp-viqeo-player

+ + -

amp-viqeo-player

- - +

Actions

+ + + + + -

Actions

- - - - - +

Autoplay

+ + -

Autoplay

- - +

Without autoplay

+ + -

Without autoplay

- - - -
- - +
+ diff --git a/examples/visual-tests/amp-story-player/back-button.html b/examples/visual-tests/amp-story-player/back-button.html index defb20d53efe..41912d9607bc 100644 --- a/examples/visual-tests/amp-story-player/back-button.html +++ b/examples/visual-tests/amp-story-player/back-button.html @@ -1,4 +1,4 @@ - + Story Player (Non-AMP) diff --git a/extensions/amp-3d-gltf/0.1/amp-3d-gltf.js b/extensions/amp-3d-gltf/0.1/amp-3d-gltf.js index 2310ba413712..ab9883171f76 100644 --- a/extensions/amp-3d-gltf/0.1/amp-3d-gltf.js +++ b/extensions/amp-3d-gltf/0.1/amp-3d-gltf.js @@ -16,11 +16,11 @@ import {ActionTrust} from '#core/constants/action-constants'; import {Deferred} from '#core/data-structures/promise'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {assertHttpsUrl, resolveRelativeUrl} from '../../../src/url'; import {dev, devAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor, postMessage} from '../../../src/iframe-helper'; import { observeContentSize, @@ -166,7 +166,7 @@ export class Amp3dGltf extends AMP.BaseElement { const iframe = getIframe(this.win, this.element, TYPE, this.context_); iframe.title = this.element.title || 'GLTF 3D model'; - this.applyFillContent(iframe, true); + applyFillContent(iframe, true); this.iframe_ = iframe; this.unlistenMessage_ = devAssert(this.listenGltfViewerMessages_()); diff --git a/extensions/amp-3d-gltf/0.1/test/test-amp-3d-gltf.js b/extensions/amp-3d-gltf/0.1/test/test-amp-3d-gltf.js index 8e9ced08e8d1..b33995786b7e 100644 --- a/extensions/amp-3d-gltf/0.1/test/test-amp-3d-gltf.js +++ b/extensions/amp-3d-gltf/0.1/test/test-amp-3d-gltf.js @@ -15,7 +15,7 @@ */ import '../amp-3d-gltf'; -import {createIframeWithMessageStub} from '../../../../testing/iframe'; +import {createIframeWithMessageStub} from '#testing/iframe'; describes.realWin( 'amp-3d-gltf', diff --git a/extensions/amp-3q-player/0.1/test/test-amp-3q-player.js b/extensions/amp-3q-player/0.1/test/test-amp-3q-player.js index 26248720f11c..19891d8bd471 100644 --- a/extensions/amp-3q-player/0.1/test/test-amp-3q-player.js +++ b/extensions/amp-3q-player/0.1/test/test-amp-3q-player.js @@ -19,7 +19,7 @@ import * as fullscreen from '#core/dom/fullscreen'; import {Services} from '#service'; import {VideoEvents} from '../../../../src/video-interface'; import {createElementWithAttributes} from '#core/dom'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {listenOncePromise} from '../../../../src/event-helper'; describes.realWin( diff --git a/extensions/amp-a4a/0.1/amp-a4a.js b/extensions/amp-a4a/0.1/amp-a4a.js index a63dc941de93..be7af0a105f7 100644 --- a/extensions/amp-a4a/0.1/amp-a4a.js +++ b/extensions/amp-a4a/0.1/amp-a4a.js @@ -21,7 +21,12 @@ import {Deferred, tryResolve} from '#core/data-structures/promise'; import {DetachedDomStream, streamResponseToWriter} from '#core/dom/stream'; import {DomTransformStream} from '../../../src/utils/dom-tranform-stream'; import {GEO_IN_GROUP} from '../../amp-geo/0.1/amp-geo-in-group'; -import {Layout, LayoutPriority, isLayoutSizeDefined} from '#core/dom/layout'; +import { + Layout, + LayoutPriority, + applyFillContent, + isLayoutSizeDefined, +} from '#core/dom/layout'; import {Services} from '#service'; import {SignatureVerifier, VerificationStatus} from './signature-verifier'; import { @@ -1817,7 +1822,7 @@ export class AmpA4A extends AMP.BaseElement { width ); if (!this.uiHandler.isStickyAd()) { - this.applyFillContent(this.iframe); + applyFillContent(this.iframe); } let body = ''; @@ -1908,7 +1913,7 @@ export class AmpA4A extends AMP.BaseElement { ) ); if (!this.uiHandler.isStickyAd()) { - this.applyFillContent(this.iframe); + applyFillContent(this.iframe); } const fontsArray = []; if (creativeMetaData.customStylesheets) { diff --git a/extensions/amp-a4a/0.1/test/test-a4a-integration.js b/extensions/amp-a4a/0.1/test/test-a4a-integration.js index 2880830fbc6c..837dbce0940b 100644 --- a/extensions/amp-a4a/0.1/test/test-a4a-integration.js +++ b/extensions/amp-a4a/0.1/test/test-a4a-integration.js @@ -23,7 +23,7 @@ import '../../../amp-ad/0.1/amp-ad-xorigin-iframe-handler'; import {AMP_SIGNATURE_HEADER} from '../signature-verifier'; import {FetchMock, networkFailure} from './fetch-mock'; import {MockA4AImpl, TEST_URL} from './utils'; -import {createIframePromise} from '../../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {getA4ARegistry, signingServerURLs} from '#ads/_a4a-config'; import {installCryptoService} from '#service/crypto-impl'; import {installDocService} from '#service/ampdoc-impl'; diff --git a/extensions/amp-a4a/0.1/test/test-a4a-var-source.js b/extensions/amp-a4a/0.1/test/test-a4a-var-source.js index e38d1a710d20..3521f99dedb4 100644 --- a/extensions/amp-a4a/0.1/test/test-a4a-var-source.js +++ b/extensions/amp-a4a/0.1/test/test-a4a-var-source.js @@ -15,7 +15,7 @@ */ import {A4AVariableSource} from '../a4a-variable-source'; -import {createIframePromise} from '../../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {installDocumentInfoServiceForDoc} from '#service/document-info-impl'; describes.sandboxed('A4AVariableSource', {}, () => { diff --git a/extensions/amp-a4a/0.1/test/test-amp-a4a.js b/extensions/amp-a4a/0.1/test/test-amp-a4a.js index 6085a27c2192..dc8e97dcdd36 100644 --- a/extensions/amp-a4a/0.1/test/test-amp-a4a.js +++ b/extensions/amp-a4a/0.1/test/test-amp-a4a.js @@ -50,7 +50,7 @@ import {Services} from '#service'; import {Signals} from '#core/data-structures/signals'; import {cancellation} from '../../../../src/error-reporting'; import {createElementWithAttributes} from '#core/dom'; -import {createIframePromise} from '../../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {dev, user} from '../../../../src/log'; import { incrementLoadingAds, @@ -58,7 +58,7 @@ import { } from '../../../amp-ad/0.1/concurrent-load'; import {installRealTimeConfigServiceForDoc} from '#service/real-time-config/real-time-config-impl'; import {layoutRectLtwh, layoutSizeFromRect} from '#core/math/layout-rect'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {resetScheduledElementForTesting} from '#service/custom-element-registry'; import {data as testFragments} from './testdata/test_fragments'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-a4a/0.1/test/test-name-frame-renderer.js b/extensions/amp-a4a/0.1/test/test-name-frame-renderer.js index 6ec6a27602df..216863fd8d37 100644 --- a/extensions/amp-a4a/0.1/test/test-name-frame-renderer.js +++ b/extensions/amp-a4a/0.1/test/test-name-frame-renderer.js @@ -36,7 +36,6 @@ describes.realWin('NameFrameRenderer', realWinConfig, (env) => { size: {width: '320', height: '50'}, requestUrl: 'http://www.google.com', win: env.win, - applyFillContent: () => {}, sentinel: 's-1234', }; diff --git a/extensions/amp-accordion/0.1/amp-accordion.js b/extensions/amp-accordion/0.1/amp-accordion.js index ec14ff6845d4..2182e4c85ac8 100644 --- a/extensions/amp-accordion/0.1/amp-accordion.js +++ b/extensions/amp-accordion/0.1/amp-accordion.js @@ -22,7 +22,7 @@ import {Layout} from '#core/dom/layout'; import {Services} from '#service'; import {bezierCurve} from '#core/data-structures/curve'; import {clamp} from '#core/math'; -import {closest} from '#core/dom/query'; +import {closest, realChildElements} from '#core/dom/query'; import {createCustomEvent} from '../../../src/event-helper'; import {dev, devAssert, user, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; @@ -89,7 +89,7 @@ class AmpAccordion extends AMP.BaseElement { this.sessionId_ = this.getSessionStorageKey_(); this.currentState_ = this.getSessionState_(); - this.sections_ = this.getRealChildren(); + this.sections_ = realChildElements(this.element); this.sections_.forEach((section, index) => { userAssert( section.tagName.toLowerCase() == 'section', diff --git a/extensions/amp-accordion/0.1/test/test-amp-accordion.js b/extensions/amp-accordion/0.1/test/test-amp-accordion.js index d305564dd9b7..e70bfd9fca05 100644 --- a/extensions/amp-accordion/0.1/test/test-amp-accordion.js +++ b/extensions/amp-accordion/0.1/test/test-amp-accordion.js @@ -22,7 +22,7 @@ import {Services} from '#service'; import {computedStyle} from '#core/dom/style'; import {createElementWithAttributes, tryFocus} from '#core/dom'; import {htmlFor} from '#core/dom/static-template'; -import {poll} from '../../../../testing/iframe'; +import {poll} from '#testing/iframe'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; describes.realWin( diff --git a/extensions/amp-accordion/1.0/test/test-amp-accordion.js b/extensions/amp-accordion/1.0/test/test-amp-accordion.js index f649a5dfd3b9..0c9937b141b3 100644 --- a/extensions/amp-accordion/1.0/test/test-amp-accordion.js +++ b/extensions/amp-accordion/1.0/test/test-amp-accordion.js @@ -20,7 +20,7 @@ import {CanRender} from '../../../../src/context/contextprops'; import {htmlFor} from '#core/dom/static-template'; import {subscribe, unsubscribe} from '../../../../src/context'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-accordion:1.0', diff --git a/extensions/amp-accordion/1.0/test/test-component.js b/extensions/amp-accordion/1.0/test/test-component.js index c1d721ce03b9..eddd4f61beaf 100644 --- a/extensions/amp-accordion/1.0/test/test-component.js +++ b/extensions/amp-accordion/1.0/test/test-component.js @@ -23,7 +23,7 @@ import { } from '../component'; import {mount} from 'enzyme'; import {useAmpContext} from '#preact/context'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; const ContextReader = (props) => { const {renderable} = useAmpContext(); diff --git a/extensions/amp-ad/0.1/amp-ad-xorigin-iframe-handler.js b/extensions/amp-ad/0.1/amp-ad-xorigin-iframe-handler.js index ff9954ccd1d7..d879f418fd4d 100644 --- a/extensions/amp-ad/0.1/amp-ad-xorigin-iframe-handler.js +++ b/extensions/amp-ad/0.1/amp-ad-xorigin-iframe-handler.js @@ -25,6 +25,7 @@ import { listenForOncePromise, postMessageToWindows, } from '../../../src/iframe-helper'; +import {applyFillContent} from '#core/dom/layout'; import {dev, devAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import {getData} from '../../../src/event-helper'; @@ -101,7 +102,7 @@ export class AmpAdXOriginIframeHandler { this.iframe = iframe; this.iframe.setAttribute('scrolling', 'no'); if (!this.uiHandler_.isStickyAd()) { - this.baseInstance_.applyFillContent(this.iframe); + applyFillContent(this.iframe); } const timer = Services.timerFor(this.baseInstance_.win); diff --git a/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js b/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js index 5ed3d6d6726e..2d3cd1bafcac 100644 --- a/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js +++ b/extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js @@ -26,7 +26,7 @@ import {LayoutPriority} from '#core/dom/layout'; import {Services} from '#service'; import {adConfig} from '#ads/_config'; import {createElementWithAttributes} from '#core/dom'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; function createAmpAd(win, attachToAmpdoc = false, ampdoc) { const ampAdElement = createElementWithAttributes(win.document, 'amp-ad', { diff --git a/extensions/amp-ad/0.1/test/test-amp-ad-ui.js b/extensions/amp-ad/0.1/test/test-amp-ad-ui.js index 1cfbdb1691f5..b6523960fd0f 100644 --- a/extensions/amp-ad/0.1/test/test-amp-ad-ui.js +++ b/extensions/amp-ad/0.1/test/test-amp-ad-ui.js @@ -19,7 +19,7 @@ import * as domQuery from '#core/dom/query'; import {AmpAdUIHandler} from '../amp-ad-ui'; import {BaseElement} from '../../../../src/base-element'; import {createElementWithAttributes} from '#core/dom'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {setStyles} from '#core/dom/style'; describes.realWin( diff --git a/extensions/amp-ad/0.1/test/test-amp-ad-xorigin-iframe-handler.js b/extensions/amp-ad/0.1/test/test-amp-ad-xorigin-iframe-handler.js index 0a2ef0a132d5..c53e2ad7f3ce 100644 --- a/extensions/amp-ad/0.1/test/test-amp-ad-xorigin-iframe-handler.js +++ b/extensions/amp-ad/0.1/test/test-amp-ad-xorigin-iframe-handler.js @@ -19,10 +19,7 @@ import {AmpAdXOriginIframeHandler} from '../amp-ad-xorigin-iframe-handler'; import {BaseElement} from '../../../../src/base-element'; import {Services} from '#service'; import {Signals} from '#core/data-structures/signals'; -import { - createIframeWithMessageStub, - expectPostMessage, -} from '../../../../testing/iframe'; +import {createIframeWithMessageStub, expectPostMessage} from '#testing/iframe'; import {layoutRectLtwh} from '#core/math/layout-rect'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-ad/0.1/test/test-amp-ad.js b/extensions/amp-ad/0.1/test/test-amp-ad.js index 07f41c992adb..1511ca25039e 100644 --- a/extensions/amp-ad/0.1/test/test-amp-ad.js +++ b/extensions/amp-ad/0.1/test/test-amp-ad.js @@ -19,7 +19,7 @@ import {AmpAd3PImpl} from '../amp-ad-3p-impl'; import {Services} from '#service'; import {adConfig} from '#ads/_config'; import {getA4ARegistry} from '#ads/_a4a-config'; -import {stubService} from '../../../../testing/test-helper'; +import {stubService} from '#testing/test-helper'; describes.realWin('Ad loader', {amp: true}, (env) => { let win, doc; diff --git a/extensions/amp-ad/0.1/test/test-concurrent-load.js b/extensions/amp-ad/0.1/test/test-concurrent-load.js index 09a015c9c41a..8dead74f602a 100644 --- a/extensions/amp-ad/0.1/test/test-concurrent-load.js +++ b/extensions/amp-ad/0.1/test/test-concurrent-load.js @@ -23,7 +23,7 @@ import { waitFor3pThrottle, } from '../concurrent-load'; import {installTimerService} from '#service/timer-impl'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin('concurrent-load', {}, (env) => { describe('getAmpAdRenderOutsideViewport', () => { diff --git a/extensions/amp-addthis/0.1/amp-addthis.js b/extensions/amp-addthis/0.1/amp-addthis.js index 2d07fb4c8595..1b1af112b8c2 100644 --- a/extensions/amp-addthis/0.1/amp-addthis.js +++ b/extensions/amp-addthis/0.1/amp-addthis.js @@ -52,6 +52,7 @@ import {DwellMonitor} from './addthis-utils/monitors/dwell-monitor'; import {PostMessageDispatcher} from './post-message-dispatcher'; import {ScrollMonitor} from './addthis-utils/monitors/scroll-monitor'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {callEng} from './addthis-utils/eng'; import {callLojson} from './addthis-utils/lojson'; import {callPjson} from './addthis-utils/pjson'; @@ -66,7 +67,6 @@ import { import {getOgImage} from './addthis-utils/meta'; import {getWidgetOverload} from './addthis-utils/get-widget-id-overloaded-with-json-for-anonymous-mode'; import {internalRuntimeVersion} from '../../../src/internal-version'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listen} from '../../../src/event-helper'; import {parseUrlDeprecated} from '../../../src/url'; import {setStyle} from '#core/dom/style'; @@ -310,7 +310,7 @@ class AmpAddThis extends AMP.BaseElement { ); const iframeLoadPromise = this.loadPromise(iframe); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = /** @type {HTMLIFrameElement} */ (iframe); diff --git a/extensions/amp-analytics/0.1/test/test-amp-analytics.js b/extensions/amp-analytics/0.1/test/test-amp-analytics.js index 7d00e43f8d3c..3611d8d901a3 100644 --- a/extensions/amp-analytics/0.1/test/test-amp-analytics.js +++ b/extensions/amp-analytics/0.1/test/test-amp-analytics.js @@ -17,10 +17,7 @@ import {AmpAnalytics} from '../amp-analytics'; import {AnalyticsConfig} from '../config'; import {ClickEventTracker, VisibilityTracker} from '../events'; -import { - ImagePixelVerifier, - mockWindowInterface, -} from '../../../../testing/test-helper'; +import {ImagePixelVerifier, mockWindowInterface} from '#testing/test-helper'; import {LayoutPriority} from '#core/dom/layout'; import {LinkerManager} from '../linker-manager'; import {Services} from '#service'; @@ -34,7 +31,7 @@ import { import {installCryptoService} from '#service/crypto-impl'; import {installUserNotificationManagerForTesting} from '../../../amp-user-notification/0.1/amp-user-notification'; import {instrumentationServiceForDocForTesting} from '../instrumentation'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin( 'amp-analytics', diff --git a/extensions/amp-analytics/0.1/test/test-config.js b/extensions/amp-analytics/0.1/test/test-config.js index 5c4bd7be64e8..c45af4aefded 100644 --- a/extensions/amp-analytics/0.1/test/test-config.js +++ b/extensions/amp-analytics/0.1/test/test-config.js @@ -18,7 +18,7 @@ import {AnalyticsConfig, expandConfigRequest, mergeObjects} from '../config'; import {Services} from '#service'; import {installDocService} from '#service/ampdoc-impl'; import {map} from '#core/types/object'; -import {stubService} from '../../../../testing/test-helper'; +import {stubService} from '#testing/test-helper'; import {user} from '../../../../src/log'; describes.realWin( diff --git a/extensions/amp-analytics/0.1/test/test-cookie-writer.js b/extensions/amp-analytics/0.1/test/test-cookie-writer.js index e5040b608c59..da955145eef3 100644 --- a/extensions/amp-analytics/0.1/test/test-cookie-writer.js +++ b/extensions/amp-analytics/0.1/test/test-cookie-writer.js @@ -20,7 +20,7 @@ import {CookieWriter} from '../cookie-writer'; import {dict} from '#core/types/object'; import {installLinkerReaderService} from '../linker-reader'; import {installVariableServiceForTesting} from '../variables'; -import {stubService} from '../../../../testing/test-helper'; +import {stubService} from '#testing/test-helper'; const TAG = '[amp-analytics/cookie-writer]'; diff --git a/extensions/amp-analytics/0.1/test/test-events.js b/extensions/amp-analytics/0.1/test/test-events.js index 9204f423fab2..69730df7599b 100644 --- a/extensions/amp-analytics/0.1/test/test-events.js +++ b/extensions/amp-analytics/0.1/test/test-events.js @@ -31,7 +31,7 @@ import { import {AmpdocAnalyticsRoot} from '../analytics-root'; import {Deferred} from '#core/data-structures/promise'; import {Signals} from '#core/data-structures/signals'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {toggleExperiment} from '#experiments'; describes.realWin('Events', {amp: 1}, (env) => { diff --git a/extensions/amp-analytics/0.1/test/test-iframe-transport.js b/extensions/amp-analytics/0.1/test/test-iframe-transport.js index b335dc00de87..aac91624eaf4 100644 --- a/extensions/amp-analytics/0.1/test/test-iframe-transport.js +++ b/extensions/amp-analytics/0.1/test/test-iframe-transport.js @@ -19,7 +19,7 @@ import { getIframeTransportScriptUrlForTesting, } from '../iframe-transport'; import {addParamsToUrl} from '../../../../src/url'; -import {expectPostMessage} from '../../../../testing/iframe.js'; +import {expectPostMessage} from '#testing/iframe.js'; import {urls} from '../../../../src/config'; import {user} from '../../../../src/log'; diff --git a/extensions/amp-analytics/0.1/test/test-linker-manager.js b/extensions/amp-analytics/0.1/test/test-linker-manager.js index 5cfee2cd8774..d7f6895a2702 100644 --- a/extensions/amp-analytics/0.1/test/test-linker-manager.js +++ b/extensions/amp-analytics/0.1/test/test-linker-manager.js @@ -27,7 +27,7 @@ import { linkerReaderServiceFor, } from '../linker-reader'; import {installVariableServiceForTesting} from '../variables'; -import {mockWindowInterface} from '../../../../testing/test-helper'; +import {mockWindowInterface} from '#testing/test-helper'; // TODO(ccordry): Refactor all these tests with async/await. describes.realWin('Linker Manager', {amp: true}, (env) => { diff --git a/extensions/amp-analytics/0.1/test/test-linker-reader.js b/extensions/amp-analytics/0.1/test/test-linker-reader.js index 22b517e811f8..4c6d505e02c4 100644 --- a/extensions/amp-analytics/0.1/test/test-linker-reader.js +++ b/extensions/amp-analytics/0.1/test/test-linker-reader.js @@ -18,7 +18,7 @@ import { installLinkerReaderService, linkerReaderServiceFor, } from '../linker-reader'; -import {mockWindowInterface} from '../../../../testing/test-helper'; +import {mockWindowInterface} from '#testing/test-helper'; describes.sandboxed('LinkerReader', {}, (env) => { let linkerReader; diff --git a/extensions/amp-analytics/0.1/test/test-linker.js b/extensions/amp-analytics/0.1/test/test-linker.js index ed78000233ef..d36ab0ac4898 100644 --- a/extensions/amp-analytics/0.1/test/test-linker.js +++ b/extensions/amp-analytics/0.1/test/test-linker.js @@ -15,7 +15,7 @@ */ import {createLinker, parseLinker} from '../linker'; -import {mockWindowInterface} from '../../../../testing/test-helper'; +import {mockWindowInterface} from '#testing/test-helper'; const TAG = '[amp-analytics/linker]'; diff --git a/extensions/amp-analytics/0.1/test/test-requests.js b/extensions/amp-analytics/0.1/test/test-requests.js index 656864d0b3d4..dd532b4d2716 100644 --- a/extensions/amp-analytics/0.1/test/test-requests.js +++ b/extensions/amp-analytics/0.1/test/test-requests.js @@ -21,7 +21,7 @@ import {ExpansionOptions, installVariableServiceForTesting} from '../variables'; import {RequestHandler, expandPostMessage} from '../requests'; import {Services} from '#service'; import {installLinkerReaderService} from '../linker-reader'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin('Requests', {amp: 1}, (env) => { let ampdoc; diff --git a/extensions/amp-analytics/0.1/test/test-transport.js b/extensions/amp-analytics/0.1/test/test-transport.js index e26b38aeb3b7..6b212b6bceba 100644 --- a/extensions/amp-analytics/0.1/test/test-transport.js +++ b/extensions/amp-analytics/0.1/test/test-transport.js @@ -16,10 +16,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {AmpScriptService} from '../../../../extensions/amp-script/0.1/amp-script'; -import { - ImagePixelVerifier, - mockWindowInterface, -} from '../../../../testing/test-helper'; +import {ImagePixelVerifier, mockWindowInterface} from '#testing/test-helper'; import {Services} from '#service'; import {Transport} from '../transport'; import {getMode} from '../../../../src/mode'; diff --git a/extensions/amp-analytics/0.1/test/test-vendors.js b/extensions/amp-analytics/0.1/test/test-vendors.js index 6815886844aa..da650e3ee363 100644 --- a/extensions/amp-analytics/0.1/test/test-vendors.js +++ b/extensions/amp-analytics/0.1/test/test-vendors.js @@ -18,13 +18,10 @@ import {AmpAnalytics} from '../amp-analytics'; import {AnalyticsConfig} from '../config'; import {ExpansionOptions, variableServiceForDoc} from '../variables'; import {IFRAME_TRANSPORTS} from '../iframe-transport-vendors'; -import { - ImagePixelVerifier, - mockWindowInterface, -} from '../../../../testing/test-helper'; +import {ImagePixelVerifier, mockWindowInterface} from '#testing/test-helper'; import {Services} from '#service'; import {hasOwn} from '#core/types/object'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import VENDOR_REQUESTS from './vendor-requests.json' assert {type: 'json'}; // lgtm[js/syntax-error] describes.realWin( diff --git a/extensions/amp-anim/0.1/amp-anim.js b/extensions/amp-anim/0.1/amp-anim.js index 027455a72e14..cf2a67705ba3 100644 --- a/extensions/amp-anim/0.1/amp-anim.js +++ b/extensions/amp-anim/0.1/amp-anim.js @@ -15,9 +15,9 @@ */ import * as st from '#core/dom/style'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dev} from '../../../src/log'; import {guaranteeSrcForSrcsetUnsupportedBrowsers} from '#core/dom/img'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import { observeWithSharedInOb, unobserveWithSharedInOb, @@ -57,7 +57,7 @@ export class AmpAnim extends AMP.BaseElement { this.img_ = new Image(); this.img_.setAttribute('decoding', 'async'); propagateAttributes(BUILD_ATTRIBUTES, this.element, this.img_); - this.applyFillContent(this.img_, true); + applyFillContent(this.img_, true); propagateObjectFitStyles(this.element, this.img_); // Remove role=img otherwise this breaks screen-readers focus and diff --git a/extensions/amp-animation/0.1/test/test-keyframes-extractor.js b/extensions/amp-animation/0.1/test/test-keyframes-extractor.js index 3c37d8cebd72..b2c4a850d814 100644 --- a/extensions/amp-animation/0.1/test/test-keyframes-extractor.js +++ b/extensions/amp-animation/0.1/test/test-keyframes-extractor.js @@ -15,7 +15,7 @@ */ import {extractKeyframes} from '../parsers/keyframes-extractor'; -import {poll} from '../../../../testing/iframe'; +import {poll} from '#testing/iframe'; describes.realWin('extractKeyframes', {amp: 1}, (env) => { let win, doc; diff --git a/extensions/amp-animation/0.1/test/test-web-animations.js b/extensions/amp-animation/0.1/test/test-web-animations.js index fda7de85b539..75284f9a7588 100644 --- a/extensions/amp-animation/0.1/test/test-web-animations.js +++ b/extensions/amp-animation/0.1/test/test-web-animations.js @@ -21,7 +21,7 @@ import {closestAncestorElementBySelector} from '#core/dom/query'; import {htmlFor, htmlRefs} from '#core/dom/static-template'; import {isArray, isObject} from '#core/types'; -import {poll} from '../../../../testing/iframe'; +import {poll} from '#testing/iframe'; import {user} from '../../../../src/log'; describes.realWin('MeasureScanner', {amp: 1}, (env) => { diff --git a/extensions/amp-apester-media/0.1/amp-apester-media.js b/extensions/amp-apester-media/0.1/amp-apester-media.js index f6d0d9d99a3c..d945b25bcc1c 100644 --- a/extensions/amp-apester-media/0.1/amp-apester-media.js +++ b/extensions/amp-apester-media/0.1/amp-apester-media.js @@ -17,6 +17,11 @@ import {CSS} from '../../../build/amp-apester-media-0.1.css'; import {IntersectionObserver3pHost} from '../../../src/utils/intersection-observer-3p-host'; import {Services} from '#service'; import {addParamsToUrl} from '../../../src/url'; +import { + applyFillContent, + getLengthNumeral, + isLayoutSizeDefined, +} from '#core/dom/layout'; import {dev, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import { @@ -26,7 +31,6 @@ import { setFullscreenOff, setFullscreenOn, } from './utils'; -import {getLengthNumeral, isLayoutSizeDefined} from '#core/dom/layout'; import {handleCompanionAds} from './monetization'; import { observeWithSharedInOb, @@ -245,7 +249,7 @@ class AmpApesterMedia extends AMP.BaseElement { iframe.height = this.height_; iframe.width = this.width_; iframe.classList.add('amp-apester-iframe'); - this.applyFillContent(iframe); + applyFillContent(iframe); return iframe; } diff --git a/extensions/amp-audio/0.1/amp-audio.js b/extensions/amp-audio/0.1/amp-audio.js index 44e84618239e..169e53c0c1e8 100644 --- a/extensions/amp-audio/0.1/amp-audio.js +++ b/extensions/amp-audio/0.1/amp-audio.js @@ -22,9 +22,12 @@ import { setMediaSession, validateMediaMetadata, } from '../../../src/mediasession-helper'; -import {Layout, isLayoutSizeFixed} from '#core/dom/layout'; +import {Layout, applyFillContent, isLayoutSizeFixed} from '#core/dom/layout'; import {assertHttpsUrl} from '../../../src/url'; -import {closestAncestorElementBySelector} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + realChildNodes, +} from '#core/dom/query'; import {dev, user} from '../../../src/log'; import {getMode} from '../../../src/mode'; import {listen} from '../../../src/event-helper'; @@ -140,8 +143,8 @@ export class AmpAudio extends AMP.BaseElement { audio ); - this.applyFillContent(audio); - this.getRealChildNodes().forEach((child) => { + applyFillContent(audio); + realChildNodes(this.element).forEach((child) => { if (child.getAttribute && child.getAttribute('src')) { assertHttpsUrl(child.getAttribute('src'), dev().assertElement(child)); } diff --git a/extensions/amp-base-carousel/1.0/test/test-amp-base-carousel.js b/extensions/amp-base-carousel/1.0/test/test-amp-base-carousel.js index 24d69f208398..358f1a27f942 100644 --- a/extensions/amp-base-carousel/1.0/test/test-amp-base-carousel.js +++ b/extensions/amp-base-carousel/1.0/test/test-amp-base-carousel.js @@ -22,7 +22,7 @@ import {setStyles} from '#core/dom/style'; import {toArray} from '#core/types/array'; import {toggleExperiment} from '#experiments'; import {useStyles} from '../component.jss'; -import {waitFor, whenCalled} from '../../../../testing/test-helper'; +import {waitFor, whenCalled} from '#testing/test-helper'; describes.realWin( 'amp-base-carousel:1.0', diff --git a/extensions/amp-beopinion/0.1/amp-beopinion.js b/extensions/amp-beopinion/0.1/amp-beopinion.js index 4c3d10fbfc32..2d74ba1b3ebb 100644 --- a/extensions/amp-beopinion/0.1/amp-beopinion.js +++ b/extensions/amp-beopinion/0.1/amp-beopinion.js @@ -15,8 +15,8 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; @@ -72,7 +72,7 @@ class AmpBeOpinion extends AMP.BaseElement { layoutCallback() { const iframe = getIframe(this.win, this.element, TYPE); iframe.title = this.element.title || 'BeOpinion content'; - this.applyFillContent(iframe); + applyFillContent(iframe); listenFor( iframe, 'embed-size', diff --git a/extensions/amp-bodymovin-animation/0.1/amp-bodymovin-animation.js b/extensions/amp-bodymovin-animation/0.1/amp-bodymovin-animation.js index bc9f0219e9be..964b5f766372 100644 --- a/extensions/amp-bodymovin-animation/0.1/amp-bodymovin-animation.js +++ b/extensions/amp-bodymovin-animation/0.1/amp-bodymovin-animation.js @@ -17,6 +17,7 @@ import {ActionTrust} from '#core/constants/action-constants'; import {Deferred} from '#core/data-structures/promise'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {assertHttpsUrl} from '../../../src/url'; import {batchFetchJsonFor} from '../../../src/batched-json'; import {clamp} from '#core/math'; @@ -24,7 +25,6 @@ import {dict} from '#core/types/object'; import {getData, listen} from '../../../src/event-helper'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; import {isFiniteNumber, isObject} from '#core/types'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {parseJson} from '#core/types/object/json'; import {removeElement} from '#core/dom'; @@ -146,7 +146,7 @@ export class AmpBodymovinAnimation extends AMP.BaseElement { iframe.title = this.element.title || 'Airbnb BodyMovin animation'; return Services.vsyncFor(this.win) .mutatePromise(() => { - this.applyFillContent(iframe); + applyFillContent(iframe); this.unlistenMessage_ = listen( this.win, 'message', diff --git a/extensions/amp-brid-player/0.1/amp-brid-player.js b/extensions/amp-brid-player/0.1/amp-brid-player.js index 0d6f3a243d8d..ea0c871242d9 100644 --- a/extensions/amp-brid-player/0.1/amp-brid-player.js +++ b/extensions/amp-brid-player/0.1/amp-brid-player.js @@ -34,6 +34,7 @@ import { isFullscreenElement, } from '#core/dom/fullscreen'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import { getConsentPolicyInfo, getConsentPolicyState, @@ -41,7 +42,6 @@ import { import {getData, listen} from '../../../src/event-helper'; import {htmlFor} from '#core/dom/static-template'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {propagateAttributes} from '#core/dom/propagate-attributes'; const TAG = 'amp-brid-player'; @@ -249,7 +249,7 @@ class AmpBridPlayer extends AMP.BaseElement { `; propagateAttributes(['aria-label'], this.element, placeholder); - this.applyFillContent(placeholder); + applyFillContent(placeholder); const altText = placeholder.hasAttribute('aria-label') ? 'Loading video - ' + placeholder.getAttribute('aria-label') diff --git a/extensions/amp-brightcove/0.1/test/test-amp-brightcove.js b/extensions/amp-brightcove/0.1/test/test-amp-brightcove.js index 64626e476b5b..fb43c5e514f5 100644 --- a/extensions/amp-brightcove/0.1/test/test-amp-brightcove.js +++ b/extensions/amp-brightcove/0.1/test/test-amp-brightcove.js @@ -22,7 +22,7 @@ import {CommonSignals} from '#core/constants/common-signals'; import {VideoEvents} from '../../../../src/video-interface'; import {createElementWithAttributes} from '#core/dom'; import {listenOncePromise} from '../../../../src/event-helper'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {parseUrlDeprecated} from '../../../../src/url'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; diff --git a/extensions/amp-byside-content/0.1/amp-byside-content.js b/extensions/amp-byside-content/0.1/amp-byside-content.js index fd955da4f774..d5af1cc4febe 100644 --- a/extensions/amp-byside-content/0.1/amp-byside-content.js +++ b/extensions/amp-byside-content/0.1/amp-byside-content.js @@ -35,10 +35,10 @@ import {CSS} from '../../../build/amp-byside-content-0.1.css'; import {Services} from '#service'; import {addParamsToUrl, assertHttpsUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {createElementWithAttributes, removeElement} from '#core/dom'; import {debounce} from '#core/types/function'; import {dict} from '#core/types/object'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor} from '../../../src/iframe-helper'; import {setStyles} from '#core/dom/style'; import {user, userAssert} from '../../../src/log'; @@ -170,7 +170,7 @@ export class AmpBysideContent extends AMP.BaseElement { placeholder.setAttribute('placeholder', ''); placeholder.appendChild(this.createBySideLoader_()); - this.applyFillContent(placeholder); + applyFillContent(placeholder); return placeholder; } @@ -197,7 +197,7 @@ export class AmpBysideContent extends AMP.BaseElement { }); this.element.appendChild(this.getOverflowElement_()); - this.applyFillContent(iframe); + applyFillContent(iframe); return this.composeSrcUrl_() .then((src) => { diff --git a/extensions/amp-byside-content/0.1/test/test-amp-byside-content.js b/extensions/amp-byside-content/0.1/test/test-amp-byside-content.js index b01761a8f0cb..8a29c59b2563 100644 --- a/extensions/amp-byside-content/0.1/test/test-amp-byside-content.js +++ b/extensions/amp-byside-content/0.1/test/test-amp-byside-content.js @@ -15,7 +15,7 @@ */ import '../amp-byside-content'; -import {mockServiceForDoc} from '../../../../testing/test-helper'; +import {mockServiceForDoc} from '#testing/test-helper'; describes.realWin( 'amp-byside-content', diff --git a/extensions/amp-cache-url/0.1/test/validator-amp-cache-url.html b/extensions/amp-cache-url/0.1/test/validator-amp-cache-url.html new file mode 100644 index 000000000000..c7da9747c990 --- /dev/null +++ b/extensions/amp-cache-url/0.1/test/validator-amp-cache-url.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/amp-cache-url/0.1/test/validator-amp-cache-url.out b/extensions/amp-cache-url/0.1/test/validator-amp-cache-url.out new file mode 100644 index 000000000000..d3ae144e90b1 --- /dev/null +++ b/extensions/amp-cache-url/0.1/test/validator-amp-cache-url.out @@ -0,0 +1,50 @@ +PASS +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/extensions/amp-cache-url/validator-amp-cache-url.protoascii b/extensions/amp-cache-url/validator-amp-cache-url.protoascii index 2ac897267e78..34d3667b7464 100644 --- a/extensions/amp-cache-url/validator-amp-cache-url.protoascii +++ b/extensions/amp-cache-url/validator-amp-cache-url.protoascii @@ -20,6 +20,7 @@ tags: { # amp-cache-url extension_spec: { name: "amp-cache-url" version: "0.1" + requires_usage: NONE } attr_lists: "common-extension-attrs" } diff --git a/extensions/amp-call-tracking/0.1/test/test-amp-call-tracking.js b/extensions/amp-call-tracking/0.1/test/test-amp-call-tracking.js index 8b4a028aec40..5744da099153 100644 --- a/extensions/amp-call-tracking/0.1/test/test-amp-call-tracking.js +++ b/extensions/amp-call-tracking/0.1/test/test-amp-call-tracking.js @@ -17,6 +17,7 @@ import '../amp-call-tracking'; import {Services} from '#service'; import {clearResponseCacheForTesting} from '../amp-call-tracking'; +import {realChildElements} from '#core/dom/query'; describes.realWin( 'amp-call-tracking', @@ -77,7 +78,7 @@ describes.realWin( } function expectHyperlinkToBe(callTrackingEl, href, textContent) { - const hyperlink = callTrackingEl.getRealChildren()[0]; + const hyperlink = realChildElements(callTrackingEl)[0]; expect(hyperlink.getAttribute('href')).to.equal(href); expect(hyperlink.textContent).to.equal(textContent); diff --git a/extensions/amp-carousel/0.1/scrollable-carousel.js b/extensions/amp-carousel/0.1/scrollable-carousel.js index d6c3b674ea75..d32f51a2c9da 100644 --- a/extensions/amp-carousel/0.1/scrollable-carousel.js +++ b/extensions/amp-carousel/0.1/scrollable-carousel.js @@ -27,6 +27,7 @@ import { observeWithSharedInOb, unobserveWithSharedInOb, } from '../../../src/viewport-observer'; +import {realChildElements} from '#core/dom/query'; /** @const {string} */ const TAG = 'amp-scrollable-carousel'; @@ -59,7 +60,7 @@ export class AmpScrollableCarousel extends BaseCarousel { /** @override */ buildCarousel() { - this.cells_ = this.getRealChildren(); + this.cells_ = realChildElements(this.element); this.container_ = this.element.ownerDocument.createElement('div'); this.container_.classList.add('i-amphtml-scrollable-carousel-container'); diff --git a/extensions/amp-carousel/0.1/slidescroll.js b/extensions/amp-carousel/0.1/slidescroll.js index 4113404cb997..c2871d7d9cda 100644 --- a/extensions/amp-carousel/0.1/slidescroll.js +++ b/extensions/amp-carousel/0.1/slidescroll.js @@ -20,7 +20,10 @@ import {BaseSlides} from './base-slides'; import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; import {bezierCurve} from '#core/data-structures/curve'; -import {closestAncestorElementBySelector} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + realChildElements, +} from '#core/dom/query'; import {createCustomEvent, listen} from '../../../src/event-helper'; import {dev, user} from '../../../src/log'; import {dict} from '#core/types/object'; @@ -174,7 +177,7 @@ export class AmpSlideScroll extends BaseSlides { this.element.classList.add('i-amphtml-slidescroll'); - this.slides_ = this.getRealChildren(); + this.slides_ = realChildElements(this.element); this.noOfSlides_ = this.slides_.length; diff --git a/extensions/amp-carousel/0.1/test/test-slidescroll.js b/extensions/amp-carousel/0.1/test/test-slidescroll.js index 51a41a263287..cc0f307a6242 100644 --- a/extensions/amp-carousel/0.1/test/test-slidescroll.js +++ b/extensions/amp-carousel/0.1/test/test-slidescroll.js @@ -19,7 +19,7 @@ import {ActionService} from '#service/action-impl'; import {ActionTrust} from '#core/constants/action-constants'; import {Services} from '#service'; import {createElementWithAttributes} from '#core/dom'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {user} from '../../../../src/log'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; diff --git a/extensions/amp-carousel/0.2/amp-carousel.js b/extensions/amp-carousel/0.2/amp-carousel.js index 2377a4d90c26..10224ca3bdcf 100644 --- a/extensions/amp-carousel/0.2/amp-carousel.js +++ b/extensions/amp-carousel/0.2/amp-carousel.js @@ -21,7 +21,10 @@ import {Carousel} from '../../amp-base-carousel/0.1/carousel.js'; import {CarouselEvents} from '../../amp-base-carousel/0.1/carousel-events'; import {ChildLayoutManager} from '../../amp-base-carousel/0.1/child-layout-manager'; import {Services} from '#service'; -import {closestAncestorElementBySelector} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + realChildElements, +} from '#core/dom/query'; import {computedStyle} from '#core/dom/style'; import {createCustomEvent, getDetail, listen} from '../../../src/event-helper'; import {dev, devAssert, userAssert} from '../../../src/log'; @@ -142,7 +145,7 @@ class AmpCarousel extends AMP.BaseElement { this.action_ = Services.actionServiceForDoc(this.element); const {element, win} = this; - const slides = this.getRealChildren(); + const slides = realChildElements(this.element); element.appendChild(this.renderContainerDom_()); this.scrollContainer_ = this.element.querySelector( diff --git a/extensions/amp-connatix-player/0.1/amp-connatix-player.js b/extensions/amp-connatix-player/0.1/amp-connatix-player.js index 5842ab668386..fe46d4684c9e 100644 --- a/extensions/amp-connatix-player/0.1/amp-connatix-player.js +++ b/extensions/amp-connatix-player/0.1/amp-connatix-player.js @@ -22,6 +22,7 @@ import {Deferred} from '#core/data-structures/promise'; import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dict} from '#core/types/object'; import { getConsentMetadata, @@ -30,7 +31,6 @@ import { getConsentPolicyState, } from '../../../src/consent'; import {getData} from '../../../src/event-helper'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import { observeContentSize, unobserveContentSize, @@ -292,7 +292,7 @@ export class AmpConnatixPlayer extends AMP.BaseElement { iframe.src = src; // applyFillContent so that frame covers the entire component. - this.applyFillContent(iframe, /* replacedContent */ true); + applyFillContent(iframe, /* replacedContent */ true); // append child iframe for element element.appendChild(iframe); diff --git a/extensions/amp-consent/0.1/amp-consent.js b/extensions/amp-consent/0.1/amp-consent.js index 1e59a2e73b5b..d43bc778ff9d 100644 --- a/extensions/amp-consent/0.1/amp-consent.js +++ b/extensions/amp-consent/0.1/amp-consent.js @@ -50,6 +50,7 @@ import {dict, hasOwn} from '#core/types/object'; import {getData} from '../../../src/event-helper'; import {getServicePromiseForDoc} from '../../../src/service-helpers'; import {isArray, isEnumValue, isObject} from '#core/types'; +import {realChildElements} from '#core/dom/query'; import {isExperimentOn} from '#experiments'; @@ -223,7 +224,7 @@ export class AmpConsent extends AMP.BaseElement { /** @type {string} */ (this.consentId_) ); - const children = this.getRealChildren(); + const children = realChildElements(this.element); for (let i = 0; i < children.length; i++) { const child = children[i]; toggle(child, false); diff --git a/extensions/amp-consent/0.1/test/test-amp-consent.js b/extensions/amp-consent/0.1/test/test-amp-consent.js index e9b49c96fa4e..438b18ef7854 100644 --- a/extensions/amp-consent/0.1/test/test-amp-consent.js +++ b/extensions/amp-consent/0.1/test/test-amp-consent.js @@ -29,7 +29,7 @@ import {ConsentStateManager} from '../consent-state-manager'; import {GEO_IN_GROUP} from '../../../amp-geo/0.1/amp-geo-in-group'; import {dev, user} from '../../../../src/log'; import {dict} from '#core/types/object'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import { registerServiceBuilder, resetServiceForTesting, diff --git a/extensions/amp-consent/0.1/test/test-consent-policy-manager.js b/extensions/amp-consent/0.1/test/test-consent-policy-manager.js index 839ecfb66faf..666b3d599c96 100644 --- a/extensions/amp-consent/0.1/test/test-consent-policy-manager.js +++ b/extensions/amp-consent/0.1/test/test-consent-policy-manager.js @@ -31,7 +31,7 @@ import { } from '../consent-policy-manager'; import {dict} from '#core/types/object'; import {expandPolicyConfig} from '../consent-config'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import { registerServiceBuilder, diff --git a/extensions/amp-consent/0.1/test/test-consent-state-manager.js b/extensions/amp-consent/0.1/test/test-consent-state-manager.js index 73eaf6f4afad..9d675ec6d1a9 100644 --- a/extensions/amp-consent/0.1/test/test-consent-state-manager.js +++ b/extensions/amp-consent/0.1/test/test-consent-state-manager.js @@ -24,7 +24,7 @@ import {CONSENT_STRING_TYPE} from '#core/constants/consent-state'; import {ConsentInstance, ConsentStateManager} from '../consent-state-manager'; import {Services} from '#service'; import {dev} from '../../../../src/log'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import { registerServiceBuilder, resetServiceForTesting, diff --git a/extensions/amp-consent/0.1/test/test-consent-ui.js b/extensions/amp-consent/0.1/test/test-consent-ui.js index 75eefeaa0964..d4b139b33b95 100644 --- a/extensions/amp-consent/0.1/test/test-consent-ui.js +++ b/extensions/amp-consent/0.1/test/test-consent-ui.js @@ -26,14 +26,14 @@ import {ConsentUI, consentUiClasses} from '../consent-ui'; import {Services} from '#service'; import {dict} from '#core/types/object'; import {elementByTag} from '#core/dom/query'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import { registerServiceBuilder, resetServiceForTesting, } from '../../../../src/service-helpers'; import {toggleExperiment} from '#experiments'; import {user} from '../../../../src/log'; -import {whenCalled} from '../../../../testing/test-helper.js'; +import {whenCalled} from '#testing/test-helper.js'; describes.realWin( 'consent-ui', diff --git a/extensions/amp-consent/0.1/test/test-linker-reader.js b/extensions/amp-consent/0.1/test/test-linker-reader.js index 9f2dfbb5eb32..0f8a48ca898c 100644 --- a/extensions/amp-consent/0.1/test/test-linker-reader.js +++ b/extensions/amp-consent/0.1/test/test-linker-reader.js @@ -15,7 +15,7 @@ */ import {ConsentLinkerReader} from '../linker-reader'; -import {mockWindowInterface} from '../../../../testing/test-helper'; +import {mockWindowInterface} from '#testing/test-helper'; describes.realWin('LinkerReader', {amp: true}, (env) => { let linkerReader; diff --git a/extensions/amp-consent/0.1/test/test-linker.js b/extensions/amp-consent/0.1/test/test-linker.js index 700b78784a6b..1f4d6a63b3f6 100644 --- a/extensions/amp-consent/0.1/test/test-linker.js +++ b/extensions/amp-consent/0.1/test/test-linker.js @@ -15,7 +15,7 @@ */ import {createLinker, parseLinker} from '../linker'; -import {mockWindowInterface} from '../../../../testing/test-helper'; +import {mockWindowInterface} from '#testing/test-helper'; const TAG = '[amp-consent/linker]'; diff --git a/extensions/amp-consent/0.1/test/test-tcf-api-command-manager.js b/extensions/amp-consent/0.1/test/test-tcf-api-command-manager.js index 082a2a9773c2..dea7d5a5d78b 100644 --- a/extensions/amp-consent/0.1/test/test-tcf-api-command-manager.js +++ b/extensions/amp-consent/0.1/test/test-tcf-api-command-manager.js @@ -15,8 +15,8 @@ */ import {TcfApiCommandManager} from '../tcf-api-command-manager'; -import {macroTask} from '../../../../testing/yield'; -import {mockWindowInterface} from '../../../../testing/test-helper'; +import {macroTask} from '#testing/yield'; +import {mockWindowInterface} from '#testing/test-helper'; import {user} from '../../../../src/log'; describes.realWin( diff --git a/extensions/amp-date-countdown/1.0/amp-date-countdown.css b/extensions/amp-date-countdown/1.0/amp-date-countdown.css new file mode 100644 index 000000000000..ec4b08955618 --- /dev/null +++ b/extensions/amp-date-countdown/1.0/amp-date-countdown.css @@ -0,0 +1,38 @@ +/** + * Copyright 2021 The AMP HTML Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Pre-upgrade: + * - display:block element + * - size-defined element + */ +amp-date-countdown { + display: block; + overflow: hidden; + position: relative; +} + +/* Pre-upgrade: size-defining element - hide text. */ +amp-date-countdown:not(.i-amphtml-built) { + color: transparent !important; +} + +/* Pre-upgrade: size-defining element - hide children. */ +amp-date-countdown:not(.i-amphtml-built) + > :not([placeholder]):not(.i-amphtml-svc) { + display: none; + content-visibility: hidden; +} diff --git a/extensions/amp-date-countdown/1.0/test/test-amp-date-countdown.js b/extensions/amp-date-countdown/1.0/test/test-amp-date-countdown.js index 467cc04f3d7c..fc8c91124254 100644 --- a/extensions/amp-date-countdown/1.0/test/test-amp-date-countdown.js +++ b/extensions/amp-date-countdown/1.0/test/test-amp-date-countdown.js @@ -16,7 +16,7 @@ import '../../../amp-mustache/0.2/amp-mustache'; import '../amp-date-countdown'; -import {waitFor} from '../../../../testing/test-helper.js'; +import {waitFor} from '#testing/test-helper.js'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; describes.realWin( diff --git a/extensions/amp-date-display/1.0/amp-date-display.css b/extensions/amp-date-display/1.0/amp-date-display.css new file mode 100644 index 000000000000..3781f6f1f925 --- /dev/null +++ b/extensions/amp-date-display/1.0/amp-date-display.css @@ -0,0 +1,38 @@ +/** + * Copyright 2021 The AMP HTML Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Pre-upgrade: + * - display:block element + * - size-defined element + */ +amp-date-display { + display: block; + overflow: hidden; + position: relative; +} + +/* Pre-upgrade: size-defining element - hide text. */ +amp-date-display:not(.i-amphtml-built) { + color: transparent !important; +} + +/* Pre-upgrade: size-defining element - hide children. */ +amp-date-display:not(.i-amphtml-built) + > :not([placeholder]):not(.i-amphtml-svc) { + display: none; + content-visibility: hidden; +} diff --git a/extensions/amp-date-display/1.0/test/test-amp-date-display.js b/extensions/amp-date-display/1.0/test/test-amp-date-display.js index 1480e1372efb..2278d7a271a3 100644 --- a/extensions/amp-date-display/1.0/test/test-amp-date-display.js +++ b/extensions/amp-date-display/1.0/test/test-amp-date-display.js @@ -18,7 +18,7 @@ import '../../../amp-mustache/0.2/amp-mustache'; import '../amp-date-display'; import {expect} from 'chai'; import {user} from '../../../../src/log'; -import {waitFor} from '../../../../testing/test-helper.js'; +import {waitFor} from '#testing/test-helper.js'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; describes.realWin( diff --git a/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-actions.js b/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-actions.js index 21b587831367..ee236b797d30 100644 --- a/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-actions.js +++ b/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-actions.js @@ -15,7 +15,7 @@ */ import * as fakeTimers from '@sinonjs/fake-timers'; -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; const config = describes.sandboxed.configure().ifChrome(); config.skip('amp-date-picker', {}, function () { diff --git a/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-init.js b/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-init.js index 5ea813910f04..207f5eb13a6b 100644 --- a/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-init.js +++ b/extensions/amp-date-picker/0.1/test/integration/test-integration-amp-date-picker-init.js @@ -15,7 +15,7 @@ */ import {AmpEvents} from '#core/constants/amp-events.js'; -import {createFixtureIframe} from '../../../../../testing/iframe.js'; +import {createFixtureIframe} from '#testing/iframe.js'; function checkElementUpgrade(element) { expect(element).to.have.class('i-amphtml-element'); diff --git a/extensions/amp-date-picker/0.1/test/integration/test-integration-dates-attributes.js b/extensions/amp-date-picker/0.1/test/integration/test-integration-dates-attributes.js index a95d86f64a60..5fa920d27e5b 100644 --- a/extensions/amp-date-picker/0.1/test/integration/test-integration-dates-attributes.js +++ b/extensions/amp-date-picker/0.1/test/integration/test-integration-dates-attributes.js @@ -16,7 +16,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {htmlFor} from '#core/dom/static-template'; -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; const config = describes.sandboxed.configure().ifChrome(); diff --git a/extensions/amp-date-picker/0.1/test/integration/test-integration-maximum-nights.js b/extensions/amp-date-picker/0.1/test/integration/test-integration-maximum-nights.js index febc3f5faa1b..32af28112b4a 100644 --- a/extensions/amp-date-picker/0.1/test/integration/test-integration-maximum-nights.js +++ b/extensions/amp-date-picker/0.1/test/integration/test-integration-maximum-nights.js @@ -16,7 +16,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {htmlFor} from '#core/dom/static-template'; -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; const config = describes.sandboxed.configure().ifChrome(); diff --git a/extensions/amp-delight-player/0.1/amp-delight-player.js b/extensions/amp-delight-player/0.1/amp-delight-player.js index 45792d27498b..09cfb57072bf 100644 --- a/extensions/amp-delight-player/0.1/amp-delight-player.js +++ b/extensions/amp-delight-player/0.1/amp-delight-player.js @@ -18,6 +18,7 @@ import {Deferred} from '#core/data-structures/promise'; import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; import {VideoAttributes, VideoEvents} from '../../../src/video-interface'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import { createFrameFor, objOrParseJson, @@ -35,7 +36,6 @@ import { import {getData, listen, listenOncePromise} from '../../../src/event-helper'; import {htmlFor} from '#core/dom/static-template'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import { observeWithSharedInOb, unobserveWithSharedInOb, @@ -238,7 +238,7 @@ class AmpDelightPlayer extends AMP.BaseElement { `; - this.applyFillContent(placeholder); + applyFillContent(placeholder); const src = `${this.baseURL_}/poster/${this.contentID_}`; placeholder.setAttribute('src', src); diff --git a/extensions/amp-embedly-card/0.1/amp-embedly-card-impl.js b/extensions/amp-embedly-card/0.1/amp-embedly-card-impl.js index b014810e95bf..f822544e097f 100644 --- a/extensions/amp-embedly-card/0.1/amp-embedly-card-impl.js +++ b/extensions/amp-embedly-card/0.1/amp-embedly-card-impl.js @@ -15,7 +15,7 @@ */ import {TAG as KEY_TAG} from './amp-embedly-key'; -import {Layout} from '#core/dom/layout'; +import {Layout, applyFillContent} from '#core/dom/layout'; import {Services} from '#service'; import {getIframe} from '../../../src/3p-frame'; import {listenFor} from '../../../src/iframe-helper'; @@ -87,7 +87,7 @@ export class AmpEmbedlyCard extends AMP.BaseElement { opt_is3P ); - this.applyFillContent(iframe); + applyFillContent(iframe); this.getVsync().mutate(() => { this.element.appendChild(iframe); }); diff --git a/extensions/amp-facebook-comments/0.1/amp-facebook-comments.js b/extensions/amp-facebook-comments/0.1/amp-facebook-comments.js index 779b3caaa42f..f68a0626bdb8 100644 --- a/extensions/amp-facebook-comments/0.1/amp-facebook-comments.js +++ b/extensions/amp-facebook-comments/0.1/amp-facebook-comments.js @@ -15,11 +15,11 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {createLoaderLogo} from '../../amp-facebook/0.1/facebook-loader'; import {dashToUnderline} from '#core/types/string'; import {getData, listen} from '../../../src/event-helper'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {isObject} from '#core/types'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; @@ -83,7 +83,7 @@ class AmpFacebookComments extends AMP.BaseElement { this.element.setAttribute('data-embed-as', 'comments'); const iframe = getIframe(this.win, this.element, TYPE); iframe.title = this.element.title || 'Facebook comments'; - this.applyFillContent(iframe); + applyFillContent(iframe); // Triggered by context.updateDimensions() inside the iframe. listenFor( iframe, diff --git a/extensions/amp-facebook-comments/0.1/test/test-amp-facebook-comments.js b/extensions/amp-facebook-comments/0.1/test/test-amp-facebook-comments.js index 4723edbb94d8..1a0422319e7b 100644 --- a/extensions/amp-facebook-comments/0.1/test/test-amp-facebook-comments.js +++ b/extensions/amp-facebook-comments/0.1/test/test-amp-facebook-comments.js @@ -16,7 +16,7 @@ import '../amp-facebook-comments'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {resetServiceForTesting} from '../../../../src/service-helpers'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; import {setDefaultBootstrapBaseUrlForTesting} from '../../../../src/3p-frame'; diff --git a/extensions/amp-facebook-comments/1.0/amp-facebook-comments.css b/extensions/amp-facebook-comments/1.0/amp-facebook-comments.css new file mode 100644 index 000000000000..162acdee6fe0 --- /dev/null +++ b/extensions/amp-facebook-comments/1.0/amp-facebook-comments.css @@ -0,0 +1,38 @@ +/** + * Copyright 2021 The AMP HTML Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Pre-upgrade: + * - display:block element + * - size-defined element + */ + amp-facebook-comments { + display: block; + overflow: hidden; + position: relative; +} + +/* Pre-upgrade: size-defining element - hide text. */ +amp-facebook-comments:not(.i-amphtml-built) { + color: transparent !important; +} + +/* Pre-upgrade: size-defining element - hide children. */ +amp-facebook-comments:not(.i-amphtml-built) + > :not([placeholder]):not(.i-amphtml-svc) { + display: none; + content-visibility: hidden; +} diff --git a/extensions/amp-facebook-comments/1.0/test/test-amp-facebook-comments.js b/extensions/amp-facebook-comments/1.0/test/test-amp-facebook-comments.js index 02e04f4e933e..182a97a4c16d 100644 --- a/extensions/amp-facebook-comments/1.0/test/test-amp-facebook-comments.js +++ b/extensions/amp-facebook-comments/1.0/test/test-amp-facebook-comments.js @@ -16,12 +16,12 @@ import '../amp-facebook-comments'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {resetServiceForTesting} from '../../../../src/service-helpers'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; import {setDefaultBootstrapBaseUrlForTesting} from '../../../../src/3p-frame'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-facebook-comments', diff --git a/extensions/amp-facebook-like/0.1/amp-facebook-like.js b/extensions/amp-facebook-like/0.1/amp-facebook-like.js index 1b746f8947b7..cae1d80b777a 100644 --- a/extensions/amp-facebook-like/0.1/amp-facebook-like.js +++ b/extensions/amp-facebook-like/0.1/amp-facebook-like.js @@ -15,10 +15,10 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dashToUnderline} from '#core/types/string'; import {getData, listen} from '../../../src/event-helper'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {isObject} from '#core/types'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; @@ -77,7 +77,7 @@ class AmpFacebookLike extends AMP.BaseElement { this.element.setAttribute('data-embed-as', 'like'); const iframe = getIframe(this.win, this.element, TYPE); iframe.title = this.element.title || 'Facebook like button'; - this.applyFillContent(iframe); + applyFillContent(iframe); // Triggered by context.updateDimensions() inside the iframe. listenFor( iframe, diff --git a/extensions/amp-facebook-like/1.0/test/test-amp-facebook-like.js b/extensions/amp-facebook-like/1.0/test/test-amp-facebook-like.js index 4c57bfa596dd..9abf150ea27d 100644 --- a/extensions/amp-facebook-like/1.0/test/test-amp-facebook-like.js +++ b/extensions/amp-facebook-like/1.0/test/test-amp-facebook-like.js @@ -16,12 +16,12 @@ import '../amp-facebook-like'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {resetServiceForTesting} from '../../../../src/service-helpers'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; import {setDefaultBootstrapBaseUrlForTesting} from '../../../../src/3p-frame'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-facebook-like', diff --git a/extensions/amp-facebook-page/0.1/amp-facebook-page.js b/extensions/amp-facebook-page/0.1/amp-facebook-page.js index bf20f299c4d2..b8a08f9215eb 100644 --- a/extensions/amp-facebook-page/0.1/amp-facebook-page.js +++ b/extensions/amp-facebook-page/0.1/amp-facebook-page.js @@ -15,11 +15,11 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {createLoaderLogo} from '../../amp-facebook/0.1/facebook-loader'; import {dashToUnderline} from '#core/types/string'; import {getData, listen} from '../../../src/event-helper'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {isObject} from '#core/types'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; @@ -83,7 +83,7 @@ class AmpFacebookPage extends AMP.BaseElement { this.element.setAttribute('data-embed-as', 'page'); const iframe = getIframe(this.win, this.element, TYPE); iframe.title = this.element.title || 'Facebook page'; - this.applyFillContent(iframe); + applyFillContent(iframe); // Triggered by context.updateDimensions() inside the iframe. listenFor( iframe, diff --git a/extensions/amp-facebook/0.1/amp-facebook.js b/extensions/amp-facebook/0.1/amp-facebook.js index b6d78d49309f..e2ff8c974183 100644 --- a/extensions/amp-facebook/0.1/amp-facebook.js +++ b/extensions/amp-facebook/0.1/amp-facebook.js @@ -15,12 +15,12 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {createLoaderLogo} from './facebook-loader'; import {dashToUnderline} from '#core/types/string'; import {getData, listen} from '../../../src/event-helper'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; import {getMode} from '../../../src/mode'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {isObject} from '#core/types'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; @@ -94,7 +94,7 @@ class AmpFacebook extends AMP.BaseElement { ); const iframe = getIframe(this.win, this.element, TYPE); iframe.title = this.element.title || 'Facebook'; - this.applyFillContent(iframe); + applyFillContent(iframe); if (this.element.hasAttribute('data-allowfullscreen')) { iframe.setAttribute('allowfullscreen', 'true'); } diff --git a/extensions/amp-facebook/1.0/test/test-amp-facebook.js b/extensions/amp-facebook/1.0/test/test-amp-facebook.js index 103bf25ebdc2..13d35a272ea5 100644 --- a/extensions/amp-facebook/1.0/test/test-amp-facebook.js +++ b/extensions/amp-facebook/1.0/test/test-amp-facebook.js @@ -16,13 +16,13 @@ import '../amp-facebook'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {facebook} from '#3p/facebook'; import {resetServiceForTesting} from '../../../../src/service-helpers'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; import {setDefaultBootstrapBaseUrlForTesting} from '../../../../src/3p-frame'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-facebook', diff --git a/extensions/amp-facebook/1.0/test/test-component.js b/extensions/amp-facebook/1.0/test/test-component.js index 57f7b1dbbf1a..01e48e07109d 100644 --- a/extensions/amp-facebook/1.0/test/test-component.js +++ b/extensions/amp-facebook/1.0/test/test-component.js @@ -20,7 +20,7 @@ import {WithAmpContext} from '#preact/context'; import {createRef} from '#preact'; import {mount} from 'enzyme'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.sandboxed('Facebook preact component', {}, (env) => { const href = diff --git a/extensions/amp-fit-text/0.1/amp-fit-text.js b/extensions/amp-fit-text/0.1/amp-fit-text.js index 7cd696f13f72..e57ce61ac38d 100644 --- a/extensions/amp-fit-text/0.1/amp-fit-text.js +++ b/extensions/amp-fit-text/0.1/amp-fit-text.js @@ -15,8 +15,13 @@ */ import {CSS} from '../../../build/amp-fit-text-0.1.css'; -import {getLengthNumeral, isLayoutSizeDefined} from '#core/dom/layout'; +import { + applyFillContent, + getLengthNumeral, + isLayoutSizeDefined, +} from '#core/dom/layout'; import {px, setStyle, setStyles} from '#core/dom/style'; +import {realChildNodes} from '#core/dom/query'; import {throttle} from '#core/types/function'; const TAG = 'amp-fit-text'; @@ -67,7 +72,7 @@ class AmpFitText extends AMP.BaseElement { /** @override */ buildCallback() { this.content_ = this.element.ownerDocument.createElement('div'); - this.applyFillContent(this.content_); + applyFillContent(this.content_); this.content_.classList.add('i-amphtml-fit-text-content'); setStyles(this.content_, {zIndex: 2}); @@ -86,7 +91,7 @@ class AmpFitText extends AMP.BaseElement { lineHeight: `${LINE_HEIGHT_EM_}em`, }); - this.getRealChildNodes().forEach((node) => { + realChildNodes(this.element).forEach((node) => { this.contentWrapper_.appendChild(node); }); this.updateMeasurerContent_(); diff --git a/extensions/amp-fit-text/1.0/test/test-amp-fit-text.js b/extensions/amp-fit-text/1.0/test/test-amp-fit-text.js index c6a91eb031a4..3b780825c909 100644 --- a/extensions/amp-fit-text/1.0/test/test-amp-fit-text.js +++ b/extensions/amp-fit-text/1.0/test/test-amp-fit-text.js @@ -20,7 +20,7 @@ import {createElementWithAttributes} from '#core/dom'; import {expect} from 'chai'; import {toggleExperiment} from '#experiments'; import {useStyles} from '../component.jss'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-fit-text component', diff --git a/extensions/amp-fit-text/1.0/test/test-component.js b/extensions/amp-fit-text/1.0/test/test-component.js index 821ff734ad73..0d0bde05e572 100644 --- a/extensions/amp-fit-text/1.0/test/test-component.js +++ b/extensions/amp-fit-text/1.0/test/test-component.js @@ -19,7 +19,7 @@ import {FitText, calculateFontSize, setOverflowStyle} from '../component'; import {computedStyle} from '#core/dom/style'; import {mount} from 'enzyme'; import {useStyles} from '../component.jss'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin('FitText preact component v1.0', {}, (env) => { let win; diff --git a/extensions/amp-form/0.1/test/integration/test-integration-form-verifiers.js b/extensions/amp-form/0.1/test/integration/test-integration-form-verifiers.js index bc2bfdcdcdf5..9c925cef3d64 100644 --- a/extensions/amp-form/0.1/test/integration/test-integration-form-verifiers.js +++ b/extensions/amp-form/0.1/test/integration/test-integration-form-verifiers.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; const RENDER_TIMEOUT = 15000; diff --git a/extensions/amp-form/0.1/test/integration/test-integration-form.js b/extensions/amp-form/0.1/test/integration/test-integration-form.js index ef9a195f2a68..0ad40db56f58 100644 --- a/extensions/amp-form/0.1/test/integration/test-integration-form.js +++ b/extensions/amp-form/0.1/test/integration/test-integration-form.js @@ -20,7 +20,7 @@ import {AmpMustache} from '../../../../amp-mustache/0.1/amp-mustache'; import {Services} from '#service'; import {installGlobalSubmitListenerForDoc} from '../../../../../src/document-submit'; import {listenOncePromise} from '../../../../../src/event-helper'; -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; import {registerExtendedTemplateForDoc} from '#service/template-impl'; import {stubElementsForDoc} from '#service/custom-element-registry'; diff --git a/extensions/amp-form/0.1/test/test-amp-form.js b/extensions/amp-form/0.1/test/test-amp-form.js index 90da61cdbed5..7cd37351789e 100644 --- a/extensions/amp-form/0.1/test/test-amp-form.js +++ b/extensions/amp-form/0.1/test/test-amp-form.js @@ -45,7 +45,7 @@ import { setReportValiditySupportedForTesting, } from '../form-validators'; import {user} from '../../../../src/log'; -import {whenCalled} from '../../../../testing/test-helper.js'; +import {whenCalled} from '#testing/test-helper.js'; describes.repeated( '', diff --git a/extensions/amp-fx-flying-carpet/0.1/amp-fx-flying-carpet.js b/extensions/amp-fx-flying-carpet/0.1/amp-fx-flying-carpet.js index d9c0cc331ef5..acea9f8e7c89 100644 --- a/extensions/amp-fx-flying-carpet/0.1/amp-fx-flying-carpet.js +++ b/extensions/amp-fx-flying-carpet/0.1/amp-fx-flying-carpet.js @@ -19,6 +19,7 @@ import {CommonSignals} from '#core/constants/common-signals'; import {Layout} from '#core/dom/layout'; import {Services} from '#service'; import {dev, userAssert} from '../../../src/log'; +import {realChildElements, realChildNodes} from '#core/dom/query'; import {setStyle} from '#core/dom/style'; const TAG = 'amp-fx-flying-carpet'; @@ -75,10 +76,10 @@ export class AmpFlyingCarpet extends AMP.BaseElement { const doc = this.element.ownerDocument; const container = doc.createElement('div'); - this.children_ = this.getRealChildren(); + this.children_ = realChildElements(this.element); this.container_ = container; - const childNodes = this.getRealChildNodes(); + const childNodes = realChildNodes(this.element); this.totalChildren_ = this.visibileChildren_(childNodes).length; const owners = Services.ownersForDoc(this.element); diff --git a/extensions/amp-gfycat/0.1/amp-gfycat.js b/extensions/amp-gfycat/0.1/amp-gfycat.js index 95b7608b4533..eedb5233dff4 100644 --- a/extensions/amp-gfycat/0.1/amp-gfycat.js +++ b/extensions/amp-gfycat/0.1/amp-gfycat.js @@ -17,6 +17,7 @@ import {Services} from '#service'; import {VideoEvents} from '../../../src/video-interface'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dev, userAssert} from '../../../src/log'; import { dispatchCustomEvent, @@ -25,7 +26,6 @@ import { } from '#core/dom'; import {getData, listen} from '../../../src/event-helper'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {propagateAttributes} from '#core/dom/propagate-attributes'; const TAG = 'amp-gfycat'; @@ -90,7 +90,7 @@ class AmpGfycat extends AMP.BaseElement { createPlaceholderCallback() { const placeholder = this.win.document.createElement('img'); const videoid = dev().assertString(this.videoid_); - this.applyFillContent(placeholder); + applyFillContent(placeholder); propagateAttributes(['alt', 'aria-label'], this.element, placeholder); placeholder.setAttribute('loading', 'lazy'); placeholder.setAttribute('placeholder', ''); @@ -154,7 +154,7 @@ class AmpGfycat extends AMP.BaseElement { iframe.setAttribute('frameborder', '0'); iframe.src = src; - this.applyFillContent(iframe); + applyFillContent(iframe); this.iframe_ = iframe; this.unlistenMessage_ = listen( diff --git a/extensions/amp-gist/0.1/amp-gist.js b/extensions/amp-gist/0.1/amp-gist.js index 13402b1155b1..5214f763732a 100644 --- a/extensions/amp-gist/0.1/amp-gist.js +++ b/extensions/amp-gist/0.1/amp-gist.js @@ -27,7 +27,7 @@ * */ -import {Layout} from '#core/dom/layout'; +import {Layout, applyFillContent} from '#core/dom/layout'; import {Services} from '#service'; import {getIframe} from '../../../src/3p-frame'; import {listenFor} from '../../../src/iframe-helper'; @@ -64,7 +64,7 @@ export class AmpGist extends AMP.BaseElement { /* the third parameter 'github' ties it to the 3p/github.js */ const iframe = getIframe(this.win, this.element, 'github'); iframe.title = this.element.title || 'Github gist'; - this.applyFillContent(iframe); + applyFillContent(iframe); // Triggered by window.context.requestResize() inside the iframe. listenFor( iframe, diff --git a/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-inline-suggestion-bar.js b/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-inline-suggestion-bar.js index 0bf97a246089..8444c2f73f67 100644 --- a/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-inline-suggestion-bar.js +++ b/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-inline-suggestion-bar.js @@ -21,7 +21,7 @@ import {Services} from '#service'; import {addAttributesToElement} from '#core/dom'; -import {isLayoutSizeDefined} from '#core/dom/layout'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; export class AmpGoogleAssistantInlineSuggestionBar extends AMP.BaseElement { /** @param {!AmpElement} element */ @@ -59,7 +59,7 @@ export class AmpGoogleAssistantInlineSuggestionBar extends AMP.BaseElement { }); // applyFillContent so that frame covers the entire component. - this.applyFillContent(iframe, /* replacedContent */ true); + applyFillContent(iframe, /* replacedContent */ true); this.element.appendChild(iframe); }); diff --git a/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-bar.js b/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-bar.js index ae8a480c6478..636842356a0d 100644 --- a/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-bar.js +++ b/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-bar.js @@ -22,7 +22,7 @@ import * as closure from '../../../third_party/closure-responding-channel/closure-bundle'; import {Services} from '#service'; import {addAttributesToElement} from '#core/dom'; -import {isLayoutSizeDefined} from '#core/dom/layout'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; export class AmpGoogleAssistantVoiceBar extends AMP.BaseElement { /** @param {!AmpElement} element */ @@ -58,7 +58,7 @@ export class AmpGoogleAssistantVoiceBar extends AMP.BaseElement { }); // applyFillContent so that frame covers the entire component. - this.applyFillContent(iframe, /* replacedContent */ true); + applyFillContent(iframe, /* replacedContent */ true); this.element.appendChild(iframe); }); diff --git a/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-button.js b/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-button.js index aad8ff7c7886..0693714ba96b 100644 --- a/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-button.js +++ b/extensions/amp-google-assistant-assistjs/0.1/amp-google-assistant-voice-button.js @@ -21,7 +21,7 @@ import {Services} from '#service'; import {addAttributesToElement} from '#core/dom'; -import {isLayoutSizeDefined} from '#core/dom/layout'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; export class AmpGoogleAssistantVoiceButton extends AMP.BaseElement { /** @param {!AmpElement} element */ @@ -57,7 +57,7 @@ export class AmpGoogleAssistantVoiceButton extends AMP.BaseElement { }); // applyFillContent so that frame covers the entire component. - this.applyFillContent(iframe, /* replacedContent */ true); + applyFillContent(iframe, /* replacedContent */ true); this.element.appendChild(iframe); }); diff --git a/extensions/amp-google-document-embed/0.1/amp-google-document-embed.js b/extensions/amp-google-document-embed/0.1/amp-google-document-embed.js index b11419e16b7b..010ce1a323fc 100644 --- a/extensions/amp-google-document-embed/0.1/amp-google-document-embed.js +++ b/extensions/amp-google-document-embed/0.1/amp-google-document-embed.js @@ -29,8 +29,8 @@ import {Services} from '#service'; import {addParamToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dev, userAssert} from '../../../src/log'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {propagateAttributes} from '#core/dom/propagate-attributes'; import {removeElement} from '#core/dom'; @@ -95,7 +95,7 @@ export class AmpDriveViewer extends AMP.BaseElement { iframe.src = this.getSrc_(this.element.getAttribute('src')); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); return this.loadPromise(iframe); } diff --git a/extensions/amp-hulu/0.1/amp-hulu.js b/extensions/amp-hulu/0.1/amp-hulu.js index 1497db51f18c..d1f9db2ba782 100644 --- a/extensions/amp-hulu/0.1/amp-hulu.js +++ b/extensions/amp-hulu/0.1/amp-hulu.js @@ -15,8 +15,8 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {devAssert, userAssert} from '../../../src/log'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {removeElement} from '#core/dom'; import {setIsMediaComponent} from '../../../src/video-interface'; @@ -52,7 +52,7 @@ class AmpHulu extends AMP.BaseElement { iframe.setAttribute('frameborder', '0'); iframe.setAttribute('allowfullscreen', 'true'); iframe.src = src; - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = iframe; diff --git a/extensions/amp-iframe/0.1/amp-iframe.js b/extensions/amp-iframe/0.1/amp-iframe.js index 7bdc2c064542..579879972b08 100644 --- a/extensions/amp-iframe/0.1/amp-iframe.js +++ b/extensions/amp-iframe/0.1/amp-iframe.js @@ -17,7 +17,11 @@ import {AMPDOC_SINGLETON_NAME} from '#core/constants/enums'; import {ActionTrust} from '#core/constants/action-constants'; import {IntersectionObserver3pHost} from '../../../src/utils/intersection-observer-3p-host'; -import {LayoutPriority, isLayoutSizeDefined} from '#core/dom/layout'; +import { + LayoutPriority, + applyFillContent, + isLayoutSizeDefined, +} from '#core/dom/layout'; import {MessageType} from '../../../src/3p-frame-messaging'; import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; @@ -408,7 +412,7 @@ export class AmpIframe extends AMP.BaseElement { this.iframe_ = /** @type {HTMLIFrameElement} */ (iframe); - this.applyFillContent(iframe); + applyFillContent(iframe); iframe.name = 'amp_iframe' + count++; if (this.isClickToPlay_) { diff --git a/extensions/amp-iframe/0.1/test/test-amp-iframe.js b/extensions/amp-iframe/0.1/test/test-amp-iframe.js index 54f62895bce0..3545128e7c80 100644 --- a/extensions/amp-iframe/0.1/test/test-amp-iframe.js +++ b/extensions/amp-iframe/0.1/test/test-amp-iframe.js @@ -22,10 +22,10 @@ import {Services} from '#service'; import {createElementWithAttributes} from '#core/dom'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {isAdLike} from '../../../../src/iframe-helper'; -import {macroTask} from '../../../../testing/yield'; -import {poll} from '../../../../testing/iframe'; +import {macroTask} from '#testing/yield'; +import {poll} from '#testing/iframe'; import {toggleExperiment} from '#experiments'; import {user} from '../../../../src/log'; diff --git a/extensions/amp-iframely/0.1/amp-iframely.js b/extensions/amp-iframely/0.1/amp-iframely.js index 2843ea19fe41..8d34bfc0d071 100644 --- a/extensions/amp-iframely/0.1/amp-iframely.js +++ b/extensions/amp-iframely/0.1/amp-iframely.js @@ -14,9 +14,9 @@ * limitations under the License. */ import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {createElementWithAttributes, removeElement} from '#core/dom'; import {getData, listen} from '../../../src/event-helper'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {measureIntersection} from '../../../src/utils/intersection'; import {omit} from '#core/types/object'; import {setStyle} from '#core/dom/style'; @@ -131,7 +131,7 @@ export class AmpIframely extends AMP.BaseElement { 'placeholder': '', } ); - this.applyFillContent(element); + applyFillContent(element); return element; } return null; @@ -148,7 +148,7 @@ export class AmpIframely extends AMP.BaseElement { ); this.src_ = addParamsToUrl(this.src_, this.options_); this.iframe_.src = this.src_; - this.applyFillContent(this.iframe_); + applyFillContent(this.iframe_); this.element.appendChild(this.iframe_); this.unlistener_ = listen(this.win, 'message', (event) => { diff --git a/extensions/amp-ima-video/0.1/amp-ima-video.js b/extensions/amp-ima-video/0.1/amp-ima-video.js index 28567fb4fb64..f0dc9d632619 100644 --- a/extensions/amp-ima-video/0.1/amp-ima-video.js +++ b/extensions/amp-ima-video/0.1/amp-ima-video.js @@ -20,6 +20,7 @@ import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; import {VideoEvents} from '../../../src/video-interface'; import {addUnsafeAllowAutoplay} from '../../../src/iframe-video'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {assertHttpsUrl} from '../../../src/url'; import {childElementsByTag} from '#core/dom/query'; import {dict} from '#core/types/object'; @@ -29,7 +30,6 @@ import {getData, listen} from '../../../src/event-helper'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; import {isEnumValue, isObject} from '#core/types'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import { observeContentSize, unobserveContentSize, @@ -216,7 +216,7 @@ class AmpImaVideo extends AMP.BaseElement { ); iframe.title = this.element.title || 'IMA video'; - this.applyFillContent(iframe); + applyFillContent(iframe); // This is temporary until M74 launches. // TODO(aghassemi, #21247) @@ -358,7 +358,7 @@ class AmpImaVideo extends AMP.BaseElement { img.src = poster; img.setAttribute('placeholder', ''); img.setAttribute('loading', 'lazy'); - this.applyFillContent(img); + applyFillContent(img); return img; } diff --git a/extensions/amp-ima-video/0.1/test/test-amp-ima-video.js b/extensions/amp-ima-video/0.1/test/test-amp-ima-video.js index caad82397579..d108cf22d2bf 100644 --- a/extensions/amp-ima-video/0.1/test/test-amp-ima-video.js +++ b/extensions/amp-ima-video/0.1/test/test-amp-ima-video.js @@ -16,7 +16,7 @@ import '../amp-ima-video'; import {htmlFor} from '#core/dom/static-template'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {waitForChildPromise} from '#core/dom'; describes.realWin( diff --git a/extensions/amp-ima-video/0.1/test/test-ima-video-internal.js b/extensions/amp-ima-video/0.1/test/test-ima-video-internal.js index 41dbdecfa8b7..b913cbece219 100644 --- a/extensions/amp-ima-video/0.1/test/test-ima-video-internal.js +++ b/extensions/amp-ima-video/0.1/test/test-ima-video-internal.js @@ -827,50 +827,51 @@ describes.realWin('UI loaded in frame by amp-ima-video', {}, (env) => { tag: adTagUrl, }); + const {elements} = imaVideoObj.getPropertiesForTesting(); + imaVideoObj.updateTime(0, 60); - expect(imaVideoObj.getPropertiesForTesting().timeDiv.textContent).to.eql( - '0:00 / 1:00' - ); - expect( - imaVideoObj.getPropertiesForTesting().progressLine.style.width - ).to.eql('0%'); - expect( - imaVideoObj.getPropertiesForTesting().progressMarkerDiv.style.left - ).to.eql('-1%'); + expect(elements.time.textContent).to.eql('0:00 / 1:00'); + expect(elements.progress).to.not.have.attribute('hidden'); + expect(elements.progress.getAttribute('aria-hidden')).to.equal('false'); + expect(elements.progressLine.style.width).to.eql('0%'); + expect(elements.progressMarker.style.left).to.eql('-1%'); + imaVideoObj.updateTime(30, 60); - expect(imaVideoObj.getPropertiesForTesting().timeDiv.textContent).to.eql( - '0:30 / 1:00' - ); - expect( - imaVideoObj.getPropertiesForTesting().progressLine.style.width - ).to.eql('50%'); - expect( - imaVideoObj.getPropertiesForTesting().progressMarkerDiv.style.left - ).to.eql('49%'); + expect(elements.time.textContent).to.eql('0:30 / 1:00'); + expect(elements.progress).to.not.have.attribute('hidden'); + expect(elements.progress.getAttribute('aria-hidden')).to.equal('false'); + expect(elements.progressLine.style.width).to.eql('50%'); + expect(elements.progressMarker.style.left).to.eql('49%'); + imaVideoObj.updateTime(60, 60); - expect(imaVideoObj.getPropertiesForTesting().timeDiv.textContent).to.eql( - '1:00 / 1:00' - ); - expect( - imaVideoObj.getPropertiesForTesting().progressLine.style.width - ).to.eql('100%'); - expect( - imaVideoObj.getPropertiesForTesting().progressMarkerDiv.style.left - ).to.eql('99%'); + expect(elements.time.textContent).to.eql('1:00 / 1:00'); + expect(elements.progress).to.not.have.attribute('hidden'); + expect(elements.progress.getAttribute('aria-hidden')).to.equal('false'); + expect(elements.progressLine.style.width).to.eql('100%'); + expect(elements.progressMarker.style.left).to.eql('99%'); + + const livestreamDuration = Infinity; + + // Compare against current progress state since livestreams should not change it. + const progressLineWidth = elements.progressLine.style.width; + const progressMarkerLeft = elements.progressMarker.style.left; + + imaVideoObj.updateTime(61, livestreamDuration); + expect(elements.time.textContent).to.eql('1:01'); + expect(elements.progress).to.have.attribute('hidden'); + expect(elements.progress.getAttribute('aria-hidden')).to.equal('true'); + expect(elements.progressLine.style.width).to.eql(progressLineWidth); + expect(elements.progressMarker.style.left).to.eql(progressMarkerLeft); + + imaVideoObj.updateTime(122, livestreamDuration); + expect(elements.time.textContent).to.eql('2:02'); + expect(elements.progress).to.have.attribute('hidden'); + expect(elements.progress.getAttribute('aria-hidden')).to.equal('true'); + expect(elements.progressLine.style.width).to.eql(progressLineWidth); + expect(elements.progressMarker.style.left).to.eql(progressMarkerLeft); }); it('formats time', () => { - const div = doc.createElement('div'); - div.setAttribute('id', 'c'); - doc.body.appendChild(div); - - imaVideoObj.imaVideo(win, { - width: 640, - height: 360, - src: srcUrl, - tag: adTagUrl, - }); - let formattedTime = imaVideoObj.formatTime(0); expect(formattedTime).to.eql('0:00'); formattedTime = imaVideoObj.formatTime(55); diff --git a/extensions/amp-image-lightbox/0.1/test/integration/test-amp-image-lightbox.js b/extensions/amp-image-lightbox/0.1/test/integration/test-amp-image-lightbox.js index c4213ccdb302..ef7b47b105a9 100644 --- a/extensions/amp-image-lightbox/0.1/test/integration/test-amp-image-lightbox.js +++ b/extensions/amp-image-lightbox/0.1/test/integration/test-amp-image-lightbox.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; describes.sandboxed .configure() diff --git a/extensions/amp-image-slider/0.1/amp-image-slider.js b/extensions/amp-image-slider/0.1/amp-image-slider.js index 82e882b18dcd..277c616b9fb9 100644 --- a/extensions/amp-image-slider/0.1/amp-image-slider.js +++ b/extensions/amp-image-slider/0.1/amp-image-slider.js @@ -29,6 +29,7 @@ import { observeWithSharedInOb, unobserveWithSharedInOb, } from '../../../src/viewport-observer'; +import {realChildElements} from '#core/dom/query'; import {setStyle} from '#core/dom/style'; const VALID_IMAGE_TAGNAMES = new Set(['AMP-IMG', 'IMG']); @@ -110,7 +111,7 @@ export class AmpImageSlider extends AMP.BaseElement { /** @override */ buildCallback() { - const children = this.getRealChildren(); + const children = realChildElements(this.element); for (const child of children) { if (VALID_IMAGE_TAGNAMES.has(child.tagName)) { diff --git a/extensions/amp-image-slider/0.1/test/integration/test-amp-image-slider.js b/extensions/amp-image-slider/0.1/test/integration/test-amp-image-slider.js index 9f9e13a38e59..d1e80cee6fbf 100644 --- a/extensions/amp-image-slider/0.1/test/integration/test-amp-image-slider.js +++ b/extensions/amp-image-slider/0.1/test/integration/test-amp-image-slider.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {createPointerEvent} from '../../../../../testing/test-helper'; +import {createPointerEvent} from '#testing/test-helper'; const t = describes.sandboxed.configure().ifChrome(); diff --git a/extensions/amp-image-viewer/0.1/amp-image-viewer.js b/extensions/amp-image-viewer/0.1/amp-image-viewer.js index 09234aacbe3b..43b744a1a61f 100644 --- a/extensions/amp-image-viewer/0.1/amp-image-viewer.js +++ b/extensions/amp-image-viewer/0.1/amp-image-viewer.js @@ -32,7 +32,11 @@ import {Services} from '#service'; import {WindowInterface} from '#core/window/interface'; import {bezierCurve} from '#core/data-structures/curve'; import {boundValue, distance, magnitude} from '#core/math'; -import {closestAncestorElementBySelector, elementByTag} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + elementByTag, + realChildElements, +} from '#core/dom/query'; import {continueMotion} from '../../../src/motion'; import {createCustomEvent, loadPromise} from '../../../src/event-helper'; import {dev, userAssert} from '../../../src/log'; @@ -131,7 +135,7 @@ export class AmpImageViewer extends AMP.BaseElement { /** @override */ buildCallback() { this.element.classList.add('i-amphtml-image-viewer'); - const children = this.getRealChildren(); + const children = realChildElements(this.element); userAssert( children.length == 1, diff --git a/extensions/amp-imgur/0.1/amp-imgur.js b/extensions/amp-imgur/0.1/amp-imgur.js index 519c13a105cc..e9995a3005f4 100644 --- a/extensions/amp-imgur/0.1/amp-imgur.js +++ b/extensions/amp-imgur/0.1/amp-imgur.js @@ -29,9 +29,9 @@ import {Deferred} from '#core/data-structures/promise'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {createElementWithAttributes, removeElement} from '#core/dom'; import {getData, listen} from '../../../src/event-helper'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {isObject} from '#core/types'; import {tryParseJson} from '#core/types/object/json'; import {user, userAssert} from '../../../src/log'; @@ -131,7 +131,7 @@ export class AmpImgur extends AMP.BaseElement { this.iframe_ = iframe; element.appendChild(iframe); - this.applyFillContent(iframe); + applyFillContent(iframe); // We're sure we've loaded when we receive the first message. const {promise, resolve} = new Deferred(); diff --git a/extensions/amp-inline-gallery/1.0/test/test-amp-inline-gallery.js b/extensions/amp-inline-gallery/1.0/test/test-amp-inline-gallery.js index 1575809421c6..58675574081f 100644 --- a/extensions/amp-inline-gallery/1.0/test/test-amp-inline-gallery.js +++ b/extensions/amp-inline-gallery/1.0/test/test-amp-inline-gallery.js @@ -22,7 +22,7 @@ import {createElementWithAttributes} from '#core/dom'; import {setStyles} from '#core/dom/style'; import {subscribe} from '../../../../src/context'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-inline-gallery', diff --git a/extensions/amp-inputmask/0.1/test/integration/test-integration-amp-inputmask.js b/extensions/amp-inputmask/0.1/test/integration/test-integration-amp-inputmask.js index c0ece94295a4..0187992b1abe 100644 --- a/extensions/amp-inputmask/0.1/test/integration/test-integration-amp-inputmask.js +++ b/extensions/amp-inputmask/0.1/test/integration/test-integration-amp-inputmask.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; import {simulateKeyboardInteraction} from './utils'; const config = describes.sandboxed.configure().ifChrome(); diff --git a/extensions/amp-instagram/0.1/amp-instagram.js b/extensions/amp-instagram/0.1/amp-instagram.js index 08de5ffaf1e9..3a5dea7296a8 100644 --- a/extensions/amp-instagram/0.1/amp-instagram.js +++ b/extensions/amp-instagram/0.1/amp-instagram.js @@ -37,8 +37,8 @@ import {CSS} from '../../../build/amp-instagram-0.1.css'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {getData, listen} from '../../../src/event-helper'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {isObject} from '#core/types'; import {removeElement} from '#core/dom'; import {setStyle} from '#core/dom/style'; @@ -137,7 +137,7 @@ export class AmpInstagram extends AMP.BaseElement { '/embed/' + this.captioned_ + '?cr=1&v=12'; - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); setStyle(iframe, 'opacity', 0); return (this.iframePromise_ = this.loadPromise(iframe).then(() => { diff --git a/extensions/amp-instagram/1.0/test/test-amp-instagram.js b/extensions/amp-instagram/1.0/test/test-amp-instagram.js index 3d16828ab069..9d2003784c7c 100644 --- a/extensions/amp-instagram/1.0/test/test-amp-instagram.js +++ b/extensions/amp-instagram/1.0/test/test-amp-instagram.js @@ -16,9 +16,9 @@ import '../amp-instagram'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-instagram-v1.0', diff --git a/extensions/amp-instagram/1.0/test/test-component.js b/extensions/amp-instagram/1.0/test/test-component.js index a94886e92e10..391da7c68ffc 100644 --- a/extensions/amp-instagram/1.0/test/test-component.js +++ b/extensions/amp-instagram/1.0/test/test-component.js @@ -19,7 +19,7 @@ import {Instagram} from '../component'; import {WithAmpContext} from '#preact/context'; import {createRef} from '#preact'; import {mount} from 'enzyme'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.sandboxed('Instagram preact component v1.0', {}, (env) => { it('Normal render', () => { diff --git a/extensions/amp-izlesene/0.1/amp-izlesene.js b/extensions/amp-izlesene/0.1/amp-izlesene.js index 379791e30763..f577ddef6708 100644 --- a/extensions/amp-izlesene/0.1/amp-izlesene.js +++ b/extensions/amp-izlesene/0.1/amp-izlesene.js @@ -17,10 +17,10 @@ import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {devAssert, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import {getDataParamsFromAttributes} from '#core/dom'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {setIsMediaComponent} from '../../../src/video-interface'; class AmpIzlesene extends AMP.BaseElement { @@ -104,7 +104,7 @@ class AmpIzlesene extends AMP.BaseElement { iframe.setAttribute('frameborder', '0'); iframe.setAttribute('allowfullscreen', 'true'); iframe.src = src; - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = iframe; diff --git a/extensions/amp-jwplayer/0.1/amp-jwplayer.js b/extensions/amp-jwplayer/0.1/amp-jwplayer.js index 57286bbd4121..b0999af3e535 100644 --- a/extensions/amp-jwplayer/0.1/amp-jwplayer.js +++ b/extensions/amp-jwplayer/0.1/amp-jwplayer.js @@ -27,6 +27,7 @@ import { objOrParseJson, redispatch, } from '../../../src/iframe-video'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dev, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import {disableScrollingOnIframe} from '../../../src/iframe-helper'; @@ -39,7 +40,6 @@ import { import {getData, listen} from '../../../src/event-helper'; import {getMode} from '../../../src/mode'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {once} from '#core/types/function'; import {propagateAttributes} from '#core/dom/propagate-attributes'; @@ -350,7 +350,7 @@ class AmpJWPlayer extends AMP.BaseElement { } const placeholder = this.win.document.createElement('img'); propagateAttributes(['aria-label'], this.element, placeholder); - this.applyFillContent(placeholder); + applyFillContent(placeholder); placeholder.setAttribute('placeholder', ''); placeholder.setAttribute('referrerpolicy', 'origin'); if (placeholder.hasAttribute('aria-label')) { diff --git a/extensions/amp-kaltura-player/0.1/amp-kaltura-player.js b/extensions/amp-kaltura-player/0.1/amp-kaltura-player.js index e1a1e028c166..9f31e3e1545b 100644 --- a/extensions/amp-kaltura-player/0.1/amp-kaltura-player.js +++ b/extensions/amp-kaltura-player/0.1/amp-kaltura-player.js @@ -17,9 +17,9 @@ import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dict} from '#core/types/object'; import {getDataParamsFromAttributes} from '#core/dom'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {propagateAttributes} from '#core/dom/propagate-attributes'; import {setIsMediaComponent} from '../../../src/video-interface'; import {userAssert} from '../../../src/log'; @@ -103,7 +103,7 @@ class AmpKaltura extends AMP.BaseElement { iframe.setAttribute('frameborder', '0'); iframe.setAttribute('allowfullscreen', 'true'); iframe.src = src; - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = /** @type {HTMLIFrameElement} */ (iframe); @@ -127,7 +127,7 @@ class AmpKaltura extends AMP.BaseElement { createPlaceholderCallback() { const placeholder = this.win.document.createElement('img'); propagateAttributes(['aria-label'], this.element, placeholder); - this.applyFillContent(placeholder); + applyFillContent(placeholder); placeholder.setAttribute('loading', 'lazy'); placeholder.setAttribute('placeholder', ''); placeholder.setAttribute('referrerpolicy', 'origin'); diff --git a/extensions/amp-lightbox-gallery/0.1/test/integration/test-amp-lightbox-gallery.js b/extensions/amp-lightbox-gallery/0.1/test/integration/test-amp-lightbox-gallery.js index 683dce9cb187..ec39b915c92b 100644 --- a/extensions/amp-lightbox-gallery/0.1/test/integration/test-amp-lightbox-gallery.js +++ b/extensions/amp-lightbox-gallery/0.1/test/integration/test-amp-lightbox-gallery.js @@ -15,7 +15,7 @@ */ import * as analytics from '../../../../../src/analytics'; -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; // TODO(cathyxz, #16822): This suite is flaky. describes.sandboxed.configure().skip('amp-lightbox-gallery', function () { diff --git a/extensions/amp-lightbox/0.1/amp-lightbox.js b/extensions/amp-lightbox/0.1/amp-lightbox.js index 70929252c4c3..4795b75768d7 100644 --- a/extensions/amp-lightbox/0.1/amp-lightbox.js +++ b/extensions/amp-lightbox/0.1/amp-lightbox.js @@ -22,6 +22,7 @@ import {Gestures} from '../../../src/gesture'; import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; import {SwipeXYRecognizer} from '../../../src/gesture-recognizers'; +import {applyFillContent} from '#core/dom/layout'; import {assertDoesNotContainDisplay} from '../../../src/assert-display'; import { computedStyle, @@ -39,6 +40,7 @@ import {dict, hasOwn} from '#core/types/object'; import {getMode} from '../../../src/mode'; import {htmlFor} from '#core/dom/static-template'; import {isInFie} from '../../../src/iframe-helper'; +import {realChildElements} from '#core/dom/query'; import {toArray} from '#core/types/array'; import {tryFocus} from '#core/dom'; import {unmountAll} from '../../../src/utils/resource-container-helper'; @@ -232,11 +234,11 @@ class AmpLightbox extends AMP.BaseElement { this.isScrollable_ = element.hasAttribute('scrollable'); - const children = this.getRealChildren(); + const children = realChildElements(this.element); this.container_ = element.ownerDocument.createElement('div'); if (!this.isScrollable_) { - this.applyFillContent(this.container_); + applyFillContent(this.container_); } element.appendChild(this.container_); diff --git a/extensions/amp-lightbox/0.1/test/test-amp-lightbox.js b/extensions/amp-lightbox/0.1/test/test-amp-lightbox.js index dea418757076..41e3d88262e2 100644 --- a/extensions/amp-lightbox/0.1/test/test-amp-lightbox.js +++ b/extensions/amp-lightbox/0.1/test/test-amp-lightbox.js @@ -20,7 +20,7 @@ import {ActionService} from '#service/action-impl'; import {ActionTrust} from '#core/constants/action-constants'; import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; -import {whenCalled} from '../../../../testing/test-helper.js'; +import {whenCalled} from '#testing/test-helper.js'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; describes.realWin( diff --git a/extensions/amp-lightbox/1.0/test/test-amp-lightbox.js b/extensions/amp-lightbox/1.0/test/test-amp-lightbox.js index 24542fd092fb..e94b5595a0e9 100644 --- a/extensions/amp-lightbox/1.0/test/test-amp-lightbox.js +++ b/extensions/amp-lightbox/1.0/test/test-amp-lightbox.js @@ -17,9 +17,9 @@ import '../amp-lightbox'; import {ActionInvocation} from '#service/action-impl'; import {ActionTrust, DEFAULT_ACTION} from '#core/constants/action-constants'; import {htmlFor} from '#core/dom/static-template'; -import {poll} from '../../../../testing/iframe'; +import {poll} from '#testing/iframe'; import {toggleExperiment} from '#experiments'; -import {whenCalled} from '../../../../testing/test-helper'; +import {whenCalled} from '#testing/test-helper'; describes.realWin( 'amp-lightbox:1.0', diff --git a/extensions/amp-list/0.1/amp-list.js b/extensions/amp-list/0.1/amp-list.js index 199aa145fce6..6405f4b3e3ff 100644 --- a/extensions/amp-list/0.1/amp-list.js +++ b/extensions/amp-list/0.1/amp-list.js @@ -26,6 +26,7 @@ import { import {Deferred} from '#core/data-structures/promise'; import { Layout, + applyFillContent, getLayoutClass, isLayoutSizeDefined, parseLayout, @@ -559,7 +560,7 @@ export class AmpList extends AMP.BaseElement { // to take the height of its children instead, // whereas fill-content forces height:0 if (!this.loadMoreEnabled_ && !this.enableManagedResizing_) { - this.applyFillContent(container, true); + applyFillContent(container, true); } return container; } diff --git a/extensions/amp-list/0.1/test/integration/test-amp-list.js b/extensions/amp-list/0.1/test/integration/test-amp-list.js index 440403466d53..d04e8fb49167 100644 --- a/extensions/amp-list/0.1/test/integration/test-amp-list.js +++ b/extensions/amp-list/0.1/test/integration/test-amp-list.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController} from '../../../../../testing/test-helper'; +import {BrowserController} from '#testing/test-helper'; const TIMEOUT = 15000; diff --git a/extensions/amp-list/0.1/test/test-amp-list-container.js b/extensions/amp-list/0.1/test/test-amp-list-container.js index 098353917193..463f09705f49 100644 --- a/extensions/amp-list/0.1/test/test-amp-list-container.js +++ b/extensions/amp-list/0.1/test/test-amp-list-container.js @@ -21,7 +21,7 @@ import { measureElementStub, measureMutateElementStub, mutateElementStub, -} from '../../../../testing/test-helper'; +} from '#testing/test-helper'; describes.realWin( 'amp-list layout container', diff --git a/extensions/amp-list/0.1/test/test-amp-list-load-more.js b/extensions/amp-list/0.1/test/test-amp-list-load-more.js index 8c631acb0f21..a53011d2a86b 100644 --- a/extensions/amp-list/0.1/test/test-amp-list-load-more.js +++ b/extensions/amp-list/0.1/test/test-amp-list-load-more.js @@ -21,7 +21,7 @@ import { measureElementStub, measureMutateElementStub, mutateElementStub, -} from '../../../../testing/test-helper'; +} from '#testing/test-helper'; import {toggleExperiment} from '#experiments'; const HAS_MORE_ITEMS_PAYLOAD = { diff --git a/extensions/amp-mathml/0.1/amp-mathml.js b/extensions/amp-mathml/0.1/amp-mathml.js index 753aaabcb174..a4cc3c737018 100644 --- a/extensions/amp-mathml/0.1/amp-mathml.js +++ b/extensions/amp-mathml/0.1/amp-mathml.js @@ -15,7 +15,7 @@ */ import {CSS} from '../../../build/amp-mathml-0.1.css'; -import {Layout} from '#core/dom/layout'; +import {Layout, applyFillContent} from '#core/dom/layout'; import {Services} from '#service'; import {getIframe} from '../../../src/3p-frame'; import {listenFor} from '../../../src/iframe-helper'; @@ -68,7 +68,7 @@ export class AmpMathml extends AMP.BaseElement { layoutCallback() { const iframe = getIframe(this.win, this.element, 'mathml'); iframe.title = this.element.title || 'MathML formula'; - this.applyFillContent(iframe); + applyFillContent(iframe); // Triggered by context.updateDimensions() inside the iframe. listenFor( iframe, diff --git a/extensions/amp-megaphone/0.1/amp-megaphone.js b/extensions/amp-megaphone/0.1/amp-megaphone.js index c5fa0f285d40..e7c6bfac168b 100644 --- a/extensions/amp-megaphone/0.1/amp-megaphone.js +++ b/extensions/amp-megaphone/0.1/amp-megaphone.js @@ -30,9 +30,9 @@ import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeFixed} from '#core/dom/layout'; import {dict} from '#core/types/object'; import {getData, listen} from '../../../src/event-helper'; -import {isLayoutSizeFixed} from '#core/dom/layout'; import {isObject} from '#core/types'; import {removeElement} from '#core/dom'; import {setIsMediaComponent} from '../../../src/video-interface'; @@ -109,7 +109,7 @@ class AmpMegaphone extends AMP.BaseElement { this.handleMegaphoneMessages_.bind(this) ); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = iframe; diff --git a/extensions/amp-next-page/0.1/test/test-amp-next-page.js b/extensions/amp-next-page/0.1/test/test-amp-next-page.js index 2a83a08d909f..5914b6afc81b 100644 --- a/extensions/amp-next-page/0.1/test/test-amp-next-page.js +++ b/extensions/amp-next-page/0.1/test/test-amp-next-page.js @@ -19,7 +19,7 @@ import {Services} from '#service'; import {VisibilityState} from '#core/constants/visibility-state'; import {getServicePromiseForDoc} from '../../../../src/service-helpers'; import {layoutRectLtwh} from '#core/math/layout-rect'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {setStyle} from '#core/dom/style'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-o2-player/0.1/amp-o2-player.js b/extensions/amp-o2-player/0.1/amp-o2-player.js index ff50cba88da3..dd92d033e126 100644 --- a/extensions/amp-o2-player/0.1/amp-o2-player.js +++ b/extensions/amp-o2-player/0.1/amp-o2-player.js @@ -18,12 +18,12 @@ import {CONSENT_POLICY_STATE} from '#core/constants/consent-state'; import {MessageType} from '../../../src/3p-frame-messaging'; import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dict} from '#core/types/object'; import { getConsentPolicyInfo, getConsentPolicyState, } from '../../../src/consent'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor} from '../../../src/iframe-helper'; import {setIsMediaComponent} from '../../../src/video-interface'; import {userAssert} from '../../../src/log'; @@ -133,7 +133,7 @@ class AmpO2Player extends AMP.BaseElement { iframe.setAttribute('allowfullscreen', 'true'); iframe.src = this.src_; this.iframe_ = /** @type {HTMLIFrameElement} */ (iframe); - this.applyFillContent(iframe); + applyFillContent(iframe); listenFor(iframe, MessageType.SEND_CONSENT_DATA, (data, source, origin) => { this.sendConsentData_(source, origin); diff --git a/extensions/amp-onetap-google/0.1/test/test-amp-onetap-google.js b/extensions/amp-onetap-google/0.1/test/test-amp-onetap-google.js index aff6575f7c60..29d552fe5293 100644 --- a/extensions/amp-onetap-google/0.1/test/test-amp-onetap-google.js +++ b/extensions/amp-onetap-google/0.1/test/test-amp-onetap-google.js @@ -21,7 +21,7 @@ import {BaseElement} from '../../../../src/base-element'; import {Services} from '#service'; import {createElementWithAttributes, waitForChild} from '#core/dom'; import {loadPromise} from '../../../../src/event-helper'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {user} from '../../../../src/log'; const TAG = 'amp-onetap-google'; diff --git a/extensions/amp-pan-zoom/0.1/amp-pan-zoom.js b/extensions/amp-pan-zoom/0.1/amp-pan-zoom.js index 5182264a252b..38b499817b57 100644 --- a/extensions/amp-pan-zoom/0.1/amp-pan-zoom.js +++ b/extensions/amp-pan-zoom/0.1/amp-pan-zoom.js @@ -41,6 +41,7 @@ import { unobserveContentSize, } from '#core/dom/size-observer'; import {px, scale, setStyles, translate} from '#core/dom/style'; +import {realChildElements} from '#core/dom/query'; const PAN_ZOOM_CURVE_ = bezierCurve(0.4, 0, 0.2, 1.4); const TAG = 'amp-pan-zoom'; @@ -168,7 +169,7 @@ export class AmpPanZoom extends AMP.BaseElement { /** @override */ buildCallback() { this.action_ = Services.actionServiceForDoc(this.element); - const children = this.getRealChildren(); + const children = realChildElements(this.element); userAssert( children.length == 1, diff --git a/extensions/amp-pan-zoom/0.1/test/integration/test-amp-pan-zoom.js b/extensions/amp-pan-zoom/0.1/test/integration/test-amp-pan-zoom.js index fe34abb49624..a926b3b66e13 100644 --- a/extensions/amp-pan-zoom/0.1/test/integration/test-amp-pan-zoom.js +++ b/extensions/amp-pan-zoom/0.1/test/integration/test-amp-pan-zoom.js @@ -15,7 +15,7 @@ */ import {AmpEvents} from '#core/constants/amp-events'; -import {createFixtureIframe} from '../../../../../testing/iframe'; +import {createFixtureIframe} from '#testing/iframe'; import {toggleExperiment} from '#experiments'; describes.sandboxed diff --git a/extensions/amp-pan-zoom/0.1/test/test-amp-pan-zoom.js b/extensions/amp-pan-zoom/0.1/test/test-amp-pan-zoom.js index 08020eb79430..c1b410398f67 100644 --- a/extensions/amp-pan-zoom/0.1/test/test-amp-pan-zoom.js +++ b/extensions/amp-pan-zoom/0.1/test/test-amp-pan-zoom.js @@ -16,7 +16,7 @@ import '../amp-pan-zoom'; import {Services} from '#service'; -import {createPointerEvent} from '../../../../testing/test-helper'; +import {createPointerEvent} from '#testing/test-helper'; import {htmlFor} from '#core/dom/static-template'; import {listenOncePromise} from '../../../../src/event-helper'; import {setStyles} from '#core/dom/style'; diff --git a/extensions/amp-playbuzz/0.1/amp-playbuzz.js b/extensions/amp-playbuzz/0.1/amp-playbuzz.js index 6844f4a7d175..a68a5bdb92ae 100644 --- a/extensions/amp-playbuzz/0.1/amp-playbuzz.js +++ b/extensions/amp-playbuzz/0.1/amp-playbuzz.js @@ -40,7 +40,7 @@ import * as events from '../../../src/event-helper'; import * as utils from './utils'; import {CSS} from '#build/amp-playbuzz-0.1.css.js'; -import {Layout} from '#core/dom/layout'; +import {Layout, applyFillContent} from '#core/dom/layout'; import {Services} from '#service'; import { assertAbsoluteHttpOrHttpsUrl, @@ -199,7 +199,7 @@ class AmpPlaybuzz extends AMP.BaseElement { this.element.appendChild(this.getOverflowElement_()); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); return (this.iframePromise_ = this.loadPromise(iframe).then(() => { diff --git a/extensions/amp-reach-player/0.1/amp-reach-player.js b/extensions/amp-reach-player/0.1/amp-reach-player.js index 31564f7df3e0..0647c26b6105 100644 --- a/extensions/amp-reach-player/0.1/amp-reach-player.js +++ b/extensions/amp-reach-player/0.1/amp-reach-player.js @@ -16,7 +16,7 @@ import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; -import {isLayoutSizeDefined} from '#core/dom/layout'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {setIsMediaComponent} from '../../../src/video-interface'; class AmpReachPlayer extends AMP.BaseElement { @@ -64,7 +64,7 @@ class AmpReachPlayer extends AMP.BaseElement { iframe.src = 'https://player-cdn.beachfrontmedia.com/playerapi/v1/frame/player/?embed_id=' + encodeURIComponent(embedId); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = iframe; diff --git a/extensions/amp-reddit/0.1/amp-reddit.js b/extensions/amp-reddit/0.1/amp-reddit.js index 2745e0dcf7c8..2a61d1641076 100644 --- a/extensions/amp-reddit/0.1/amp-reddit.js +++ b/extensions/amp-reddit/0.1/amp-reddit.js @@ -15,8 +15,8 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor} from '../../../src/iframe-helper'; import {userAssert} from '../../../src/log'; @@ -78,7 +78,7 @@ class AmpReddit extends AMP.BaseElement { allowFullscreen: true, }); iframe.title = this.element.title || 'Reddit'; - this.applyFillContent(iframe); + applyFillContent(iframe); listenFor( iframe, 'embed-size', diff --git a/extensions/amp-render/1.0/test/test-amp-render.js b/extensions/amp-render/1.0/test/test-amp-render.js index b0b3cbe007c9..fd031cf30f4b 100644 --- a/extensions/amp-render/1.0/test/test-amp-render.js +++ b/extensions/amp-render/1.0/test/test-amp-render.js @@ -24,7 +24,7 @@ import {ActionTrust} from '#core/constants/action-constants'; import {Services} from '#service'; import {htmlFor} from '#core/dom/static-template'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; describes.realWin( diff --git a/extensions/amp-render/1.0/test/test-component.js b/extensions/amp-render/1.0/test/test-component.js index 38d6949f2295..8a7258e3e9a0 100644 --- a/extensions/amp-render/1.0/test/test-component.js +++ b/extensions/amp-render/1.0/test/test-component.js @@ -16,7 +16,7 @@ import * as Preact from '#preact'; import {Render} from '../component'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {mount} from 'enzyme'; describes.sandboxed('Render 1.0 preact component', {}, () => { diff --git a/extensions/amp-riddle-quiz/0.1/amp-riddle-quiz.js b/extensions/amp-riddle-quiz/0.1/amp-riddle-quiz.js index f36b4910b8bf..65a2431ca202 100644 --- a/extensions/amp-riddle-quiz/0.1/amp-riddle-quiz.js +++ b/extensions/amp-riddle-quiz/0.1/amp-riddle-quiz.js @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {getData, listen} from './../../../src/event-helper'; import {isFiniteNumber, isObject} from '#core/types'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {removeElement} from '#core/dom'; import {userAssert} from '../../../src/log'; @@ -91,7 +91,7 @@ export class AmpRiddleQuiz extends AMP.BaseElement { iframe.src = 'https://www.riddle.com/a/iframe/' + encodeURIComponent(this.riddleId_); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); return this.loadPromise(iframe); diff --git a/extensions/amp-script/0.1/amp-script.js b/extensions/amp-script/0.1/amp-script.js index a8b17c300629..5c0c78795073 100644 --- a/extensions/amp-script/0.1/amp-script.js +++ b/extensions/amp-script/0.1/amp-script.js @@ -17,7 +17,7 @@ import * as WorkerDOM from '@ampproject/worker-dom/dist/amp-production/main.mjs'; import {CSS} from '../../../build/amp-script-0.1.css'; import {Deferred} from '#core/data-structures/promise'; -import {Layout, isLayoutSizeDefined} from '#core/dom/layout'; +import {Layout, applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {Purifier} from '#purifier/purifier'; import {Services} from '#service'; import {UserActivationTracker} from './user-activation-tracker'; @@ -28,6 +28,7 @@ import {dict, map} from '#core/types/object'; import {getElementServiceForDoc} from '../../../src/element-service'; import {getMode} from '../../../src/mode'; import {getService, registerServiceBuilder} from '../../../src/service-helpers'; +import {realChildElements} from '#core/dom/query'; import {rewriteAttributeValue} from '../../../src/url-rewrite'; import {tryParseJson} from '#core/types/object/json'; import {urls} from '../../../src/config'; @@ -234,9 +235,9 @@ export class AmpScript extends AMP.BaseElement { let container; if (this.element.sizerElement) { container = this.win.document.createElement('div'); - this.applyFillContent(container, true); + applyFillContent(container, /* replacedContent */ true); // Reparent all real children to the container. - const realChildren = this.getRealChildren(); + const realChildren = realChildElements(this.element); for (let i = 0; i < realChildren.length; i++) { container.appendChild(realChildren[i]); } diff --git a/extensions/amp-script/0.1/test/integration/test-amp-script.js b/extensions/amp-script/0.1/test/integration/test-amp-script.js index 4620ed8ea4b1..56dc75077ff0 100644 --- a/extensions/amp-script/0.1/test/integration/test-amp-script.js +++ b/extensions/amp-script/0.1/test/integration/test-amp-script.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import {BrowserController} from '../../../../../testing/test-helper'; -import {poll as classicPoll} from '../../../../../testing/iframe'; +import {BrowserController} from '#testing/test-helper'; +import {poll as classicPoll} from '#testing/iframe'; const TIMEOUT = 10000; diff --git a/extensions/amp-script/0.1/test/unit/test-amp-script.js b/extensions/amp-script/0.1/test/unit/test-amp-script.js index 68cf8855cdc6..2ba0cf22130a 100644 --- a/extensions/amp-script/0.1/test/unit/test-amp-script.js +++ b/extensions/amp-script/0.1/test/unit/test-amp-script.js @@ -21,7 +21,7 @@ import { SanitizerImpl, StorageLocation, } from '../../amp-script'; -import {FakeWindow} from '../../../../../testing/fake-dom'; +import {FakeWindow} from '#testing/fake-dom'; import {Services} from '#service'; import { registerServiceBuilderForDoc, diff --git a/extensions/amp-selector/1.0/test/test-amp-selector.js b/extensions/amp-selector/1.0/test/test-amp-selector.js index ef7b77e6fda7..aac9ed0b908d 100644 --- a/extensions/amp-selector/1.0/test/test-amp-selector.js +++ b/extensions/amp-selector/1.0/test/test-amp-selector.js @@ -18,7 +18,7 @@ import {ActionInvocation} from '#service/action-impl'; import {ActionTrust} from '#core/constants/action-constants'; import {htmlFor} from '#core/dom/static-template'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-selector:1.0', diff --git a/extensions/amp-sidebar/0.1/amp-sidebar.js b/extensions/amp-sidebar/0.1/amp-sidebar.js index 7615960b5f6d..2e0b517d0f74 100644 --- a/extensions/amp-sidebar/0.1/amp-sidebar.js +++ b/extensions/amp-sidebar/0.1/amp-sidebar.js @@ -23,7 +23,10 @@ import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; import {SwipeDef, SwipeXRecognizer} from '../../../src/gesture-recognizers'; import {Toolbar} from './toolbar'; -import {closestAncestorElementBySelector} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + realChildElements, +} from '#core/dom/query'; import {createCustomEvent} from '../../../src/event-helper'; import {debounce} from '#core/types/function'; import {descendsFromStory} from '../../../src/utils/story'; @@ -452,7 +455,7 @@ export class AmpSidebar extends AMP.BaseElement { */ updateForOpened_(trust) { // On open sidebar - const children = this.getRealChildren(); + const children = realChildElements(this.element); const owners = Services.ownersForDoc(this.element); owners.scheduleLayout(this.element, children); owners.scheduleResume(this.element, children); @@ -502,7 +505,7 @@ export class AmpSidebar extends AMP.BaseElement { toggle(this.getMaskElement_(), /* display */ false); Services.ownersForDoc(this.element).schedulePause( this.element, - this.getRealChildren() + realChildElements(this.element) ); this.triggerEvent_(SidebarEvents.CLOSE, trust); diff --git a/extensions/amp-sidebar/0.1/test/integration/test-amp-sidebar.js b/extensions/amp-sidebar/0.1/test/integration/test-amp-sidebar.js index b3eab341cce7..1ca14cf6736d 100644 --- a/extensions/amp-sidebar/0.1/test/integration/test-amp-sidebar.js +++ b/extensions/amp-sidebar/0.1/test/integration/test-amp-sidebar.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; describes.sandboxed .configure() diff --git a/extensions/amp-sidebar/0.1/test/test-amp-sidebar.js b/extensions/amp-sidebar/0.1/test/test-amp-sidebar.js index 20b54754ace6..2c7b58409aa5 100644 --- a/extensions/amp-sidebar/0.1/test/test-amp-sidebar.js +++ b/extensions/amp-sidebar/0.1/test/test-amp-sidebar.js @@ -20,7 +20,7 @@ import {ActionService} from '#service/action-impl'; import {ActionTrust} from '#core/constants/action-constants'; import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; -import {assertScreenReaderElement} from '../../../../testing/test-helper'; +import {assertScreenReaderElement} from '#testing/test-helper'; import {clearModalStack, getModalStackLength} from '../../../../src/modal'; import {createElementWithAttributes} from '#core/dom'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; diff --git a/extensions/amp-sidebar/0.1/test/test-toolbar.js b/extensions/amp-sidebar/0.1/test/test-toolbar.js index 884c38be7828..56e049197182 100644 --- a/extensions/amp-sidebar/0.1/test/test-toolbar.js +++ b/extensions/amp-sidebar/0.1/test/test-toolbar.js @@ -18,7 +18,7 @@ import {AmpDocSingle} from '#service/ampdoc-impl'; import {Services} from '#service'; import {Toolbar} from '../toolbar'; import {adopt} from '../../../../src/runtime'; -import {createIframePromise} from '../../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {toArray} from '#core/types/array'; adopt(window); diff --git a/extensions/amp-sidebar/0.2/amp-sidebar.js b/extensions/amp-sidebar/0.2/amp-sidebar.js index c9371821667c..4621d118e000 100644 --- a/extensions/amp-sidebar/0.2/amp-sidebar.js +++ b/extensions/amp-sidebar/0.2/amp-sidebar.js @@ -23,7 +23,10 @@ import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; import {SwipeDef, SwipeXRecognizer} from '../../../src/gesture-recognizers'; import {Toolbar} from './toolbar'; -import {closestAncestorElementBySelector} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + realChildElements, +} from '#core/dom/query'; import {createCustomEvent} from '../../../src/event-helper'; import {debounce} from '#core/types/function'; import {descendsFromStory} from '../../../src/utils/story'; @@ -450,7 +453,7 @@ export class AmpSidebar extends AMP.BaseElement { */ updateForOpened_(trust) { // On open sidebar - const children = this.getRealChildren(); + const children = realChildElements(this.element); const owners = Services.ownersForDoc(this.element); owners.scheduleLayout(this.element, children); owners.scheduleResume(this.element, children); @@ -501,7 +504,7 @@ export class AmpSidebar extends AMP.BaseElement { toggle(this.getMaskElement_(), /* display */ false); Services.ownersForDoc(this.element).schedulePause( this.element, - this.getRealChildren() + realChildElements(this.element) ); // TODO(#25080): update history manipulation based on resolution of this issue. if (this.historyId_ != -1) { diff --git a/extensions/amp-sidebar/0.2/test/integration/test-amp-sidebar.js b/extensions/amp-sidebar/0.2/test/integration/test-amp-sidebar.js index b3eab341cce7..1ca14cf6736d 100644 --- a/extensions/amp-sidebar/0.2/test/integration/test-amp-sidebar.js +++ b/extensions/amp-sidebar/0.2/test/integration/test-amp-sidebar.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {poll} from '../../../../../testing/iframe'; +import {poll} from '#testing/iframe'; describes.sandboxed .configure() diff --git a/extensions/amp-sidebar/0.2/test/test-amp-sidebar.js b/extensions/amp-sidebar/0.2/test/test-amp-sidebar.js index 98437f37887f..c4b2af390ceb 100644 --- a/extensions/amp-sidebar/0.2/test/test-amp-sidebar.js +++ b/extensions/amp-sidebar/0.2/test/test-amp-sidebar.js @@ -19,7 +19,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {ActionTrust} from '#core/constants/action-constants'; import {Keys} from '#core/constants/key-codes'; import {Services} from '#service'; -import {assertScreenReaderElement} from '../../../../testing/test-helper'; +import {assertScreenReaderElement} from '#testing/test-helper'; import {clearModalStack, getModalStackLength} from '../../../../src/modal'; import {createElementWithAttributes} from '#core/dom'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-sidebar/0.2/test/test-toolbar.js b/extensions/amp-sidebar/0.2/test/test-toolbar.js index b7b85fdb4bf1..ea1a8a0e113b 100644 --- a/extensions/amp-sidebar/0.2/test/test-toolbar.js +++ b/extensions/amp-sidebar/0.2/test/test-toolbar.js @@ -17,7 +17,7 @@ import {AmpDocSingle} from '#service/ampdoc-impl'; import {Services} from '#service'; import {Toolbar} from '../toolbar'; -import {createIframePromise} from '../../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {toArray} from '#core/types/array'; describes.realWin('amp-sidebar - toolbar', {}, (env) => { diff --git a/extensions/amp-sidebar/1.0/base-element.js b/extensions/amp-sidebar/1.0/base-element.js index 0270c6fe98ad..e19b1d09c3ca 100644 --- a/extensions/amp-sidebar/1.0/base-element.js +++ b/extensions/amp-sidebar/1.0/base-element.js @@ -20,6 +20,7 @@ import {PreactBaseElement} from '#preact/base-element'; import {Sidebar} from './component'; import {dict} from '#core/types/object'; import {pauseAll} from '../../../src/utils/resource-container-helper'; +import {realChildNodes} from '#core/dom/query'; import {toggle} from '#core/dom/style'; import {toggleAttribute} from '#core/dom'; import {useToolbarHook} from './sidebar-toolbar-hook'; @@ -50,7 +51,7 @@ export class BaseElement extends PreactBaseElement { /** @override */ updatePropsForRendering(props) { - this.getRealChildNodes().map((child) => { + realChildNodes(this.element).map((child) => { if ( child.nodeName === 'NAV' && child.hasAttribute('toolbar') && diff --git a/extensions/amp-sidebar/1.0/test/test-amp-sidebar.js b/extensions/amp-sidebar/1.0/test/test-amp-sidebar.js index 49aa85b49faf..01e49473b382 100644 --- a/extensions/amp-sidebar/1.0/test/test-amp-sidebar.js +++ b/extensions/amp-sidebar/1.0/test/test-amp-sidebar.js @@ -19,7 +19,7 @@ import {ActionTrust} from '#core/constants/action-constants'; import {createElementWithAttributes} from '#core/dom'; import {htmlFor} from '#core/dom/static-template'; import {toggleExperiment} from '#experiments'; -import {waitFor, whenCalled} from '../../../../testing/test-helper'; +import {waitFor, whenCalled} from '#testing/test-helper'; describes.realWin( 'amp-sidebar:1.0', diff --git a/extensions/amp-social-share/1.0/amp-social-share.js b/extensions/amp-social-share/1.0/amp-social-share.js index c3ce99c32ee7..3695876fab49 100644 --- a/extensions/amp-social-share/1.0/amp-social-share.js +++ b/extensions/amp-social-share/1.0/amp-social-share.js @@ -14,11 +14,10 @@ * limitations under the License. */ +import {BaseElement} from './base-element'; import {CSS} from '../../../build/amp-social-share-1.0.css'; import {Layout} from '#core/dom/layout'; -import {PreactBaseElement} from '#preact/base-element'; import {Services} from '#service'; -import {SocialShare} from './social-share'; import {addParamsToUrl} from '../../../src/url'; import {dict} from '#core/types/object'; import {getDataParamsFromAttributes} from '#core/dom'; @@ -32,6 +31,12 @@ import {userAssert} from '../../../src/log'; /** @const {string} */ const TAG = 'amp-social-share'; +/** @const {!JsonObject} */ +const DEFAULT_RESPONSIVE_DIMENSIONS = dict({ + 'width': '100%', + 'height': '100%', +}); + /** * @private * @param {!Element} element @@ -123,7 +128,7 @@ const updateTypeConfig = (element, mutations, prevTypeValue) => { return typeConfig; }; -class AmpSocialShare extends PreactBaseElement { +class AmpSocialShare extends BaseElement { /** @param {!AmpElement} element */ constructor(element) { super(element); @@ -144,14 +149,9 @@ class AmpSocialShare extends PreactBaseElement { this.element.classList.add(`amp-social-share-${this.ampSocialShareType_}`); this.renderWithHrefAndTarget_(typeConfig); - const responsive = - this.element.getAttribute('layout') === Layout.RESPONSIVE && '100%'; - return dict({ - 'width': responsive || this.element.getAttribute('width'), - 'height': responsive || this.element.getAttribute('height'), - 'color': 'currentColor', - 'background': 'inherit', - }); + if (this.element.getAttribute('layout') === Layout.RESPONSIVE) { + return DEFAULT_RESPONSIVE_DIMENSIONS; + } } /** @override */ @@ -225,25 +225,6 @@ class AmpSocialShare extends PreactBaseElement { } } -/** @override */ -AmpSocialShare['Component'] = SocialShare; - -/** @override */ -AmpSocialShare['layoutSizeDefined'] = true; - -/** @override */ -AmpSocialShare['delegatesFocus'] = true; - -/** @override */ -AmpSocialShare['props'] = { - 'children': {passthroughNonEmpty: true}, - 'tabIndex': {attr: 'tabindex'}, - 'type': {attr: 'type'}, -}; - -/** @override */ -AmpSocialShare['usesShadowDom'] = true; - AMP.extension(TAG, '1.0', (AMP) => { AMP.registerElement(TAG, AmpSocialShare, CSS); }); diff --git a/extensions/amp-social-share/1.0/base-element.js b/extensions/amp-social-share/1.0/base-element.js new file mode 100644 index 000000000000..7e75bda493c5 --- /dev/null +++ b/extensions/amp-social-share/1.0/base-element.js @@ -0,0 +1,47 @@ +/** + * Copyright 2020 The AMP HTML Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {PreactBaseElement} from '#preact/base-element'; +import {SocialShare} from './component'; + +export class BaseElement extends PreactBaseElement {} + +/** @override */ +BaseElement['Component'] = SocialShare; + +/** @override */ +BaseElement['layoutSizeDefined'] = true; + +/** @override */ +BaseElement['delegatesFocus'] = true; + +/** @override */ +BaseElement['props'] = { + 'children': {passthroughNonEmpty: true}, + 'height': {attr: 'height'}, + 'tabIndex': {attr: 'tabindex'}, + 'type': {attr: 'type'}, + 'width': {attr: 'width'}, +}; + +/** @override */ +BaseElement['staticProps'] = { + 'color': 'currentColor', + 'background': 'inherit', +}; + +/** @override */ +BaseElement['usesShadowDom'] = true; diff --git a/extensions/amp-social-share/1.0/social-share.js b/extensions/amp-social-share/1.0/component.js similarity index 97% rename from extensions/amp-social-share/1.0/social-share.js rename to extensions/amp-social-share/1.0/component.js index 144d90717389..a12d85202973 100644 --- a/extensions/amp-social-share/1.0/social-share.js +++ b/extensions/amp-social-share/1.0/component.js @@ -14,7 +14,6 @@ * limitations under the License. */ -import * as CSS from './social-share.css'; import * as Preact from '#preact'; import {Keys} from '#core/constants/key-codes'; import {SocialShareIcon} from './social-share-svgs'; @@ -25,7 +24,7 @@ import {getSocialConfig} from './social-share-config'; import {openWindowDialog} from '../../../src/open-window-dialog'; import {parseQueryString} from '#core/types/string/url'; import {useResourcesNotify} from '#preact/utils'; -import {useStyles} from './social-share.jss'; +import {useStyles} from './component.jss'; const NAME = 'SocialShare'; const DEFAULT_WIDTH = 60; @@ -34,7 +33,7 @@ const DEFAULT_TARGET = '_blank'; const WINDOW_FEATURES = 'resizable,scrollbars,width=640,height=480'; /** - * @param {!SocialSharePropsDef} props + * @param {!SocialShareDef.Props} props * @return {PreactDef.Renderable} */ export function SocialShare({ @@ -110,7 +109,6 @@ function processChildren(type, children, color, background) { return children; } else { const typeConfig = getSocialConfig(type) || {}; - const baseStyle = CSS.BASE_STYLE; const iconStyle = dict({ 'color': color || typeConfig.defaultColor, 'backgroundColor': background || typeConfig.defaultBackgroundColor, @@ -119,7 +117,6 @@ function processChildren(type, children, color, background) { { let storeService; diff --git a/extensions/amp-story-auto-ads/0.1/test/test-amp-story-auto-ads.js b/extensions/amp-story-auto-ads/0.1/test/test-amp-story-auto-ads.js index 738cc4cfac52..1c8a4da22b03 100644 --- a/extensions/amp-story-auto-ads/0.1/test/test-amp-story-auto-ads.js +++ b/extensions/amp-story-auto-ads/0.1/test/test-amp-story-auto-ads.js @@ -32,7 +32,7 @@ import { import {NavigationDirection} from '../../../amp-story/1.0/amp-story-page'; import {Services} from '#service'; import {StoryAdPage} from '../story-ad-page'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {registerServiceBuilder} from '../../../../src/service-helpers'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page-manager.js b/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page-manager.js index 73497e797b95..752d35e354e4 100644 --- a/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page-manager.js +++ b/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page-manager.js @@ -19,7 +19,7 @@ import {AmpStory} from '../../../amp-story/1.0/amp-story'; import {InsertionState, StoryAdPageManager} from '../story-ad-page-manager'; import {StoryAdPage} from '../story-ad-page'; import {getServiceForDoc} from '../../../../src/service-helpers'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; // TODO(ccordry): add tests for analytics events. describes.realWin('StoryAdPageManager', {amp: true}, (env) => { diff --git a/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page.js b/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page.js index c1b7bd2931df..245a67b4faf3 100644 --- a/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page.js +++ b/extensions/amp-story-auto-ads/0.1/test/test-story-ad-page.js @@ -29,7 +29,7 @@ import {StoryAdAutoAdvance} from '#experiments/story-ad-auto-advance'; import {StoryAdLocalization} from '../story-ad-localization'; import {StoryAdPage} from '../story-ad-page'; import {forceExperimentBranch} from '#experiments'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; const NOOP = () => {}; diff --git a/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-binary-poll.js b/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-binary-poll.js index 6a194b6a3860..fee5d6ade075 100644 --- a/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-binary-poll.js +++ b/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-binary-poll.js @@ -23,7 +23,7 @@ import { addConfigToInteractive, getMockInteractiveData, } from './test-amp-story-interactive'; -import {measureMutateElementStub} from '../../../../testing/test-helper'; +import {measureMutateElementStub} from '#testing/test-helper'; import {registerServiceBuilder} from '../../../../src/service-helpers'; describes.realWin( diff --git a/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-poll.js b/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-poll.js index 07f443080998..b5ebf4a5c2a8 100644 --- a/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-poll.js +++ b/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive-poll.js @@ -23,7 +23,7 @@ import { addConfigToInteractive, getMockInteractiveData, } from './test-amp-story-interactive'; -import {measureMutateElementStub} from '../../../../testing/test-helper'; +import {measureMutateElementStub} from '#testing/test-helper'; import {registerServiceBuilder} from '../../../../src/service-helpers'; describes.realWin( diff --git a/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive.js b/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive.js index a98677464e5d..941f564267a7 100644 --- a/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive.js +++ b/extensions/amp-story-interactive/0.1/test/test-amp-story-interactive.js @@ -33,7 +33,7 @@ import {StoryAnalyticsService} from '../../../amp-story/1.0/story-analytics'; import {dict} from '#core/types/object'; import {getBackendSpecs} from '../interactive-disclaimer'; import {htmlFor} from '#core/dom/static-template'; -import {measureMutateElementStub} from '../../../../testing/test-helper'; +import {measureMutateElementStub} from '#testing/test-helper'; import {registerServiceBuilder} from '../../../../src/service-helpers'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-story-panning-media/amp-story-panning-media.md b/extensions/amp-story-panning-media/amp-story-panning-media.md index 48fafde87518..7fbeec439b58 100644 --- a/extensions/amp-story-panning-media/amp-story-panning-media.md +++ b/extensions/amp-story-panning-media/amp-story-panning-media.md @@ -68,7 +68,7 @@ Use the `amp-story-panning-media` to transition an image between pages. The comp Add the following script tag to the head of your Web Story: ```html - ``` #### Configuration diff --git a/extensions/amp-story/1.0/page-advancement.js b/extensions/amp-story/1.0/page-advancement.js index 9270f63f1312..c41d05c0d11c 100644 --- a/extensions/amp-story/1.0/page-advancement.js +++ b/extensions/amp-story/1.0/page-advancement.js @@ -752,8 +752,10 @@ export class ManualAdvancement extends AdvancementConfig { * @private */ getStoryPageRect_() { + const uiState = this.storeService_.get(StateProperty.UI_STATE); if ( - this.storeService_.get(StateProperty.UI_STATE) !== UIType.DESKTOP_PANELS + uiState !== UIType.DESKTOP_PANELS && + uiState !== UIType.DESKTOP_ONE_PANEL ) { return this.element_.getLayoutBox(); } else { diff --git a/extensions/amp-story/1.0/test/integration/test-amp-story-affiliate-link.js b/extensions/amp-story/1.0/test/integration/test-amp-story-affiliate-link.js index 8378f89d412a..33ed4f83d3af 100644 --- a/extensions/amp-story/1.0/test/integration/test-amp-story-affiliate-link.js +++ b/extensions/amp-story/1.0/test/integration/test-amp-story-affiliate-link.js @@ -14,10 +14,7 @@ * limitations under the License. */ -import { - BrowserController, - RequestBank, -} from '../../../../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; const t = describes.sandboxed.configure().skipSafari().skipEdge(); diff --git a/extensions/amp-story/1.0/test/test-amp-story-media-query-service.js b/extensions/amp-story/1.0/test/test-amp-story-media-query-service.js index 294982dc8d27..347162dc21b1 100644 --- a/extensions/amp-story/1.0/test/test-amp-story-media-query-service.js +++ b/extensions/amp-story/1.0/test/test-amp-story-media-query-service.js @@ -15,7 +15,7 @@ */ import {AmpStoryMediaQueryService} from '../amp-story-media-query-service'; -import {poll} from '../../../../testing/iframe'; +import {poll} from '#testing/iframe'; describes.realWin('amp-story-media-query-service', {amp: true}, (env) => { let mediaQueryService; diff --git a/extensions/amp-story/1.0/test/test-amp-story.js b/extensions/amp-story/1.0/test/test-amp-story.js index 441f29799fe3..66a2d8da38ba 100644 --- a/extensions/amp-story/1.0/test/test-amp-story.js +++ b/extensions/amp-story/1.0/test/test-amp-story.js @@ -36,7 +36,7 @@ import {VisibilityState} from '#core/constants/visibility-state'; import {createElementWithAttributes} from '#core/dom'; import {registerServiceBuilder} from '../../../../src/service-helpers'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; // Represents the correct value of KeyboardEvent.which for the Right Arrow const KEYBOARD_EVENT_WHICH_RIGHT_ARROW = 39; diff --git a/extensions/amp-stream-gallery/1.0/test/test-amp-stream-gallery.js b/extensions/amp-stream-gallery/1.0/test/test-amp-stream-gallery.js index b2b825bdbf1a..ffa4018c7a9b 100644 --- a/extensions/amp-stream-gallery/1.0/test/test-amp-stream-gallery.js +++ b/extensions/amp-stream-gallery/1.0/test/test-amp-stream-gallery.js @@ -18,12 +18,12 @@ import '../amp-stream-gallery'; import {ActionInvocation} from '#service/action-impl'; import {ActionTrust} from '#core/constants/action-constants'; import {createElementWithAttributes, waitForChildPromise} from '#core/dom'; -import {poll} from '../../../../testing/iframe'; +import {poll} from '#testing/iframe'; import {setStyles} from '#core/dom/style'; import {toArray} from '#core/types/array'; import {toggleExperiment} from '#experiments'; import {useStyles} from '../../../amp-base-carousel/1.0/component.jss'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-stream-gallery', diff --git a/extensions/amp-social-share/1.0/social-share.css.js b/extensions/amp-timeago/1.0/amp-timeago.css similarity index 51% rename from extensions/amp-social-share/1.0/social-share.css.js rename to extensions/amp-timeago/1.0/amp-timeago.css index 62dd9cc8bd42..360b541f4af3 100644 --- a/extensions/amp-social-share/1.0/social-share.css.js +++ b/extensions/amp-timeago/1.0/amp-timeago.css @@ -1,5 +1,5 @@ /** - * Copyright 2020 The AMP HTML Authors. All Rights Reserved. + * Copyright 2021 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,24 @@ * limitations under the License. */ -export const BASE_STYLE = { - 'textDecoration': 'none', - 'cursor': 'pointer', - 'position': 'relative', -}; +/* + * Pre-upgrade: + * - display:block element + * - size-defined element + */ +amp-timeago { + display: block; + overflow: hidden; + position: relative; +} + +/* Pre-upgrade: size-defining element - hide text. */ +amp-timeago:not(.i-amphtml-built) { + color: transparent !important; +} + +/* Pre-upgrade: size-defining element - hide children. */ +amp-timeago:not(.i-amphtml-built) > :not([placeholder]):not(.i-amphtml-svc) { + display: none; + content-visibility: hidden; +} diff --git a/extensions/amp-timeago/1.0/test/test-amp-timeago.js b/extensions/amp-timeago/1.0/test/test-amp-timeago.js index 6dcd6a8a0fcb..bfc4bc00d39f 100644 --- a/extensions/amp-timeago/1.0/test/test-amp-timeago.js +++ b/extensions/amp-timeago/1.0/test/test-amp-timeago.js @@ -15,7 +15,7 @@ */ import '../amp-timeago'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper.js'; +import {waitFor} from '#testing/test-helper.js'; describes.realWin( 'amp-timeago 1.0', diff --git a/extensions/amp-timeago/1.0/test/test-component.js b/extensions/amp-timeago/1.0/test/test-component.js index 5c1f2024b3c4..73f51dc95211 100644 --- a/extensions/amp-timeago/1.0/test/test-component.js +++ b/extensions/amp-timeago/1.0/test/test-component.js @@ -17,7 +17,7 @@ import * as Preact from '#preact'; import {Timeago} from '../component'; import {mount} from 'enzyme'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin('Timeago 1.0 preact component', {}, (env) => { function getTime(wrapper) { diff --git a/extensions/amp-truncate-text/0.1/amp-truncate-text.js b/extensions/amp-truncate-text/0.1/amp-truncate-text.js index 20a2d3831d18..299e16718d72 100644 --- a/extensions/amp-truncate-text/0.1/amp-truncate-text.js +++ b/extensions/amp-truncate-text/0.1/amp-truncate-text.js @@ -17,7 +17,10 @@ import {CSS} from '../../../build/amp-truncate-text-0.1.css'; import {Services} from '#service'; import {CSS as ShadowCSS} from '../../../build/amp-truncate-text-shadow-0.1.css'; -import {closestAncestorElementBySelector} from '#core/dom/query'; +import { + closestAncestorElementBySelector, + realChildNodes, +} from '#core/dom/query'; import {createShadowRoot} from './shadow-utils'; import {dev} from '../../../src/log'; import {htmlFor} from '#core/dom/static-template'; @@ -146,7 +149,7 @@ export class AmpTruncateText extends AMP.BaseElement { this.persistentSlot_.appendChild(el); } ); - this.getRealChildNodes().forEach((node) => { + realChildNodes(this.element).forEach((node) => { defaultSlot.appendChild(node); }); diff --git a/extensions/amp-twitter/0.1/amp-twitter.js b/extensions/amp-twitter/0.1/amp-twitter.js index 61e8e509a1fd..938c99c36bb7 100644 --- a/extensions/amp-twitter/0.1/amp-twitter.js +++ b/extensions/amp-twitter/0.1/amp-twitter.js @@ -16,9 +16,9 @@ import {MessageType} from '../../../src/3p-frame-messaging'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {getIframe, preloadBootstrap} from '../../../src/3p-frame'; import {htmlFor} from '#core/dom/static-template'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; @@ -101,7 +101,7 @@ class AmpTwitter extends AMP.BaseElement { allowFullscreen: true, }); iframe.title = this.element.title || 'Twitter'; - this.applyFillContent(iframe); + applyFillContent(iframe); this.updateForLoadingState_(); listenFor( iframe, diff --git a/extensions/amp-twitter/1.0/amp-twitter.css b/extensions/amp-twitter/1.0/amp-twitter.css new file mode 100644 index 000000000000..fb64405c4ae1 --- /dev/null +++ b/extensions/amp-twitter/1.0/amp-twitter.css @@ -0,0 +1,37 @@ +/** + * Copyright 2021 The AMP HTML Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Pre-upgrade: + * - display:block element + * - size-defined element + */ +amp-twitter { + display: block; + overflow: hidden; + position: relative; +} + +/* Pre-upgrade: size-defining element - hide text. */ +amp-twitter:not(.i-amphtml-built) { + color: transparent !important; +} + +/* Pre-upgrade: size-defining element - hide children. */ +amp-twitter:not(.i-amphtml-built) > :not([placeholder]):not(.i-amphtml-svc) { + display: none; + content-visibility: hidden; +} diff --git a/extensions/amp-twitter/1.0/test/test-amp-twitter.js b/extensions/amp-twitter/1.0/test/test-amp-twitter.js index 526fc3dc2996..eed71423b540 100644 --- a/extensions/amp-twitter/1.0/test/test-amp-twitter.js +++ b/extensions/amp-twitter/1.0/test/test-amp-twitter.js @@ -16,10 +16,10 @@ import '../amp-twitter'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-twitter-v1.0', diff --git a/extensions/amp-twitter/1.0/test/test-component.js b/extensions/amp-twitter/1.0/test/test-component.js index ac30cb94e7c8..9facfeb281af 100644 --- a/extensions/amp-twitter/1.0/test/test-component.js +++ b/extensions/amp-twitter/1.0/test/test-component.js @@ -20,7 +20,7 @@ import {WithAmpContext} from '#preact/context'; import {createRef} from '#preact'; import {mount} from 'enzyme'; import {serializeMessage} from '../../../../src/3p-frame-messaging'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.sandboxed('Twitter preact component v1.0', {}, (env) => { it('should render', () => { diff --git a/extensions/amp-user-notification/0.1/test/test-amp-user-notification.js b/extensions/amp-user-notification/0.1/test/test-amp-user-notification.js index 58984a251fc7..b50cb5294914 100644 --- a/extensions/amp-user-notification/0.1/test/test-amp-user-notification.js +++ b/extensions/amp-user-notification/0.1/test/test-amp-user-notification.js @@ -20,7 +20,7 @@ import { } from '../amp-user-notification'; import {GEO_IN_GROUP} from '../../../amp-geo/0.1/amp-geo-in-group'; import {Services} from '#service'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import { registerServiceBuilder, resetServiceForTesting, diff --git a/extensions/amp-video-docking/0.1/amp-video-docking.js b/extensions/amp-video-docking/0.1/amp-video-docking.js index d398e511d373..7d1afc68b44d 100644 --- a/extensions/amp-video-docking/0.1/amp-video-docking.js +++ b/extensions/amp-video-docking/0.1/amp-video-docking.js @@ -29,6 +29,7 @@ import { import {Services} from '#service'; import {VideoDockingEvents, pointerCoords} from './events'; import {applyBreakpointClassname} from './breakpoints'; +import {applyFillContent} from '#core/dom/layout'; import { calculateLeftJustifiedX, calculateRightJustifiedX, @@ -1009,8 +1010,8 @@ export class VideoDocking { toggle(shadowLayer, true); toggle(overlay, true); - video.applyFillContent(this.getPlaceholderRefs_()['poster']); - video.applyFillContent(placeholderBackground); + applyFillContent(this.getPlaceholderRefs_()['poster']); + applyFillContent(placeholderBackground); this.setPosterImage_(video); element.appendChild(placeholderBackground); diff --git a/extensions/amp-video-docking/0.1/test/test-amp-video-docking.js b/extensions/amp-video-docking/0.1/test/test-amp-video-docking.js index 2bda623d6176..c2e2d6246b93 100644 --- a/extensions/amp-video-docking/0.1/test/test-amp-video-docking.js +++ b/extensions/amp-video-docking/0.1/test/test-amp-video-docking.js @@ -57,7 +57,6 @@ describes.realWin('video docking', {amp: true}, (env) => { const impl = { element, mutateElement: (cb) => tryResolve(cb), - applyFillContent: env.sandbox.spy(), }; stubLayoutBox(impl, defaultLayoutRect); return impl; @@ -271,16 +270,12 @@ describes.realWin('video docking', {amp: true}, (env) => { await docking.placeAt_(video, x, y, scale, step, transitionDurationMs); expect( - video.applyFillContent.withArgs( - videoLayerElement('.amp-video-docked-placeholder-background') - ) - ).to.have.been.calledOnce; + videoLayerElement('.amp-video-docked-placeholder-background') + ).to.have.class('i-amphtml-fill-content'); expect( - video.applyFillContent.withArgs( - videoLayerElement('.amp-video-docked-placeholder-background-poster') - ) - ).to.have.been.calledOnce; + videoLayerElement('.amp-video-docked-placeholder-background-poster') + ).to.have.class('i-amphtml-fill-content'); }); it('styles and transforms elements into docked area', async () => { diff --git a/extensions/amp-video-iframe/0.1/amp-video-iframe.js b/extensions/amp-video-iframe/0.1/amp-video-iframe.js index b9961d46a137..057b88615161 100644 --- a/extensions/amp-video-iframe/0.1/amp-video-iframe.js +++ b/extensions/amp-video-iframe/0.1/amp-video-iframe.js @@ -29,6 +29,7 @@ import { } from '../../../src/iframe-video'; import {Services} from '#service'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dev, devAssert, user, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import { @@ -44,7 +45,6 @@ import {getConsentDataToForward} from '../../../src/consent'; import {getData, listen} from '../../../src/event-helper'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; import {isFullscreenElement} from '#core/dom/fullscreen'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {measureIntersection} from '../../../src/utils/intersection'; import {once} from '#core/types/function'; @@ -200,7 +200,7 @@ class AmpVideoIframe extends AMP.BaseElement { img.src = addDataParamsToUrl(poster, element); img.setAttribute('loading', 'lazy'); img.setAttribute('placeholder', ''); - this.applyFillContent(img); + applyFillContent(img); return img; } diff --git a/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js b/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js index 9358f7bd36f8..4b15ae77ae9c 100644 --- a/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js +++ b/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js @@ -18,9 +18,9 @@ import '../amp-video-iframe'; import {Services} from '#service'; import {VideoEvents} from '../../../../src/video-interface'; import {createElementWithAttributes} from '#core/dom'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {listenOncePromise} from '../../../../src/event-helper'; -import {macroTask} from '../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {whenUpgradedToCustomElement} from '../../../../src/amp-element-helpers'; describes.realWin( diff --git a/extensions/amp-video-iframe/1.0/test/test-amp-video-iframe.js b/extensions/amp-video-iframe/1.0/test/test-amp-video-iframe.js index 5bd91a50360f..94105576d3a1 100644 --- a/extensions/amp-video-iframe/1.0/test/test-amp-video-iframe.js +++ b/extensions/amp-video-iframe/1.0/test/test-amp-video-iframe.js @@ -18,7 +18,7 @@ import '../amp-video-iframe'; import {dispatchCustomEvent} from '#core/dom'; import {htmlFor} from '#core/dom/static-template'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-video-iframe-v1.0', diff --git a/extensions/amp-video/0.1/amp-video.js b/extensions/amp-video/0.1/amp-video.js index 4e8010d7c3af..b32aeba3c4dc 100644 --- a/extensions/amp-video/0.1/amp-video.js +++ b/extensions/amp-video/0.1/amp-video.js @@ -20,6 +20,7 @@ import {Services} from '#service'; import {VideoEvents} from '../../../src/video-interface'; import {VisibilityState} from '#core/constants/visibility-state'; import {addParamsToUrl} from '../../../src/url'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import { childElement, childElementByTag, @@ -42,7 +43,6 @@ import {getBitrateManager} from './flexible-bitrate'; import {getMode} from '../../../src/mode'; import {htmlFor} from '#core/dom/static-template'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listen, listenOncePromise} from '../../../src/event-helper'; import {mutedOrUnmutedEvent} from '../../../src/iframe-video'; import {propagateAttributes} from '../../../src/core/dom/propagate-attributes'; @@ -246,7 +246,7 @@ export class AmpVideo extends AMP.BaseElement { /* opt_removeMissingAttrs */ true ); this.installEventHandlers_(); - this.applyFillContent(this.video_, true); + applyFillContent(this.video_, true); propagateObjectFitStyles(this.element, this.video_); element.appendChild(this.video_); @@ -782,7 +782,7 @@ export class AmpVideo extends AMP.BaseElement { 'background-position': 'center', }); poster.classList.add('i-amphtml-android-poster-bug'); - this.applyFillContent(poster); + applyFillContent(poster); element.appendChild(poster); } diff --git a/extensions/amp-video/0.1/test/test-amp-video.js b/extensions/amp-video/0.1/test/test-amp-video.js index 8bf252ff6abd..f747f9a95fd0 100644 --- a/extensions/amp-video/0.1/test/test-amp-video.js +++ b/extensions/amp-video/0.1/test/test-amp-video.js @@ -20,7 +20,7 @@ import {VideoEvents} from '../../../../src/video-interface'; import {VisibilityState} from '#core/constants/visibility-state'; import {dispatchCustomEvent} from '#core/dom'; import {installPerformanceService} from '#service/performance-impl'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {listenOncePromise} from '../../../../src/event-helper'; import {toggleExperiment} from '#experiments'; diff --git a/extensions/amp-video/1.0/test/test-amp-video.js b/extensions/amp-video/1.0/test/test-amp-video.js index 3449d21283cc..296f08d10509 100644 --- a/extensions/amp-video/1.0/test/test-amp-video.js +++ b/extensions/amp-video/1.0/test/test-amp-video.js @@ -18,7 +18,7 @@ import '../amp-video'; import {dispatchCustomEvent} from '#core/dom'; import {htmlFor} from '#core/dom/static-template'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-video-v1.0', diff --git a/extensions/amp-vimeo/1.0/test/test-amp-vimeo.js b/extensions/amp-vimeo/1.0/test/test-amp-vimeo.js index 24d20cf7cec6..e5d62a1b1dd2 100644 --- a/extensions/amp-vimeo/1.0/test/test-amp-vimeo.js +++ b/extensions/amp-vimeo/1.0/test/test-amp-vimeo.js @@ -17,7 +17,7 @@ import '../amp-vimeo'; import {htmlFor} from '#core/dom/static-template'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-vimeo-v1.0', diff --git a/extensions/amp-vine/0.1/amp-vine.js b/extensions/amp-vine/0.1/amp-vine.js index 8b2f168d179a..015942e7c1e5 100644 --- a/extensions/amp-vine/0.1/amp-vine.js +++ b/extensions/amp-vine/0.1/amp-vine.js @@ -16,7 +16,7 @@ import {PauseHelper} from '#core/dom/video/pause-helper'; import {Services} from '#service'; -import {isLayoutSizeDefined} from '#core/dom/layout'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {userAssert} from '../../../src/log'; class AmpVine extends AMP.BaseElement { @@ -67,7 +67,7 @@ class AmpVine extends AMP.BaseElement { iframe.src = 'https://vine.co/v/' + encodeURIComponent(vineid) + '/embed/simple'; - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); this.iframe_ = iframe; diff --git a/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js b/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js index 5b64d12cefa5..bc9586cbe73c 100644 --- a/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js +++ b/extensions/amp-viqeo-player/0.1/amp-viqeo-player.js @@ -16,7 +16,7 @@ */ import {Deferred} from '#core/data-structures/promise'; -import {Layout, isLayoutSizeDefined} from '#core/dom/layout'; +import {Layout, applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {Services} from '#service'; import {VideoAttributes, VideoEvents} from '../../../src/video-interface'; import {dev, userAssert} from '../../../src/log'; @@ -153,7 +153,7 @@ class AmpViqeoPlayer extends AMP.BaseElement { return this.mutateElement(() => { this.element.appendChild(iframe); this.iframe_ = iframe; - this.applyFillContent(iframe); + applyFillContent(iframe); }).then(() => { return this.playerReadyPromise_; }); @@ -206,7 +206,7 @@ class AmpViqeoPlayer extends AMP.BaseElement { createPlaceholderCallback() { const placeholder = this.element.ownerDocument.createElement('img'); propagateAttributes(['aria-label'], this.element, placeholder); - this.applyFillContent(placeholder); + applyFillContent(placeholder); placeholder.setAttribute('loading', 'lazy'); placeholder.setAttribute('placeholder', ''); placeholder.setAttribute('referrerpolicy', 'origin'); diff --git a/extensions/amp-viz-vega/0.1/amp-viz-vega.js b/extensions/amp-viz-vega/0.1/amp-viz-vega.js index 42cbcdec932f..0b9aac92ce38 100644 --- a/extensions/amp-viz-vega/0.1/amp-viz-vega.js +++ b/extensions/amp-viz-vega/0.1/amp-viz-vega.js @@ -17,13 +17,13 @@ import * as dom from '#core/dom'; import {CSS} from '../../../build/amp-viz-vega-0.1.css'; import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {assertHttpsUrl} from '../../../src/url'; import {childElementsByTag} from '#core/dom/query'; import {dev, devAssert, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import {isExperimentOn} from '#experiments'; import {isFiniteNumber, isObject} from '#core/types'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import { observeContentSize, @@ -155,7 +155,7 @@ export class AmpVizVega extends AMP.BaseElement { initialize_() { this.container_ = this.element.ownerDocument.createElement('div'); - this.applyFillContent(this.container_, true); + applyFillContent(this.container_, true); this.element.appendChild(this.container_); } diff --git a/extensions/amp-vk/0.1/amp-vk.js b/extensions/amp-vk/0.1/amp-vk.js index c76c33292fcf..d9de6349a969 100644 --- a/extensions/amp-vk/0.1/amp-vk.js +++ b/extensions/amp-vk/0.1/amp-vk.js @@ -22,7 +22,7 @@ const EmbedType = { POLL: 'poll', }; -import {Layout} from '#core/dom/layout'; +import {Layout, applyFillContent} from '#core/dom/layout'; import {Services} from '#service'; import {addParamsToUrl, appendEncodedParamStringToUrl} from '../../../src/url'; import {dict} from '#core/types/object'; @@ -225,7 +225,7 @@ export class AmpVk extends AMP.BaseElement { iframe.setAttribute('frameborder', '0'); iframe.setAttribute('allowfullscreen', 'true'); - this.applyFillContent(iframe); + applyFillContent(iframe); this.element.appendChild(iframe); return this.loadPromise(iframe); diff --git a/extensions/amp-yotpo/0.1/amp-yotpo.js b/extensions/amp-yotpo/0.1/amp-yotpo.js index 22aa7ccba7e5..a7aacb2d4b39 100644 --- a/extensions/amp-yotpo/0.1/amp-yotpo.js +++ b/extensions/amp-yotpo/0.1/amp-yotpo.js @@ -15,8 +15,8 @@ */ import {Services} from '#service'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {getIframe} from '../../../src/3p-frame'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {listenFor} from '../../../src/iframe-helper'; import {removeElement} from '#core/dom'; import {userAssert} from '../../../src/log'; @@ -85,7 +85,7 @@ export class AmpYotpo extends AMP.BaseElement { layoutCallback() { const iframe = getIframe(this.win, this.element, 'yotpo'); iframe.title = this.element.title || 'Yotpo widget'; - this.applyFillContent(iframe); + applyFillContent(iframe); const unlisten = listenFor( iframe, diff --git a/extensions/amp-youtube/0.1/amp-youtube.js b/extensions/amp-youtube/0.1/amp-youtube.js index d8f8eb1100a4..19ccc09beb99 100644 --- a/extensions/amp-youtube/0.1/amp-youtube.js +++ b/extensions/amp-youtube/0.1/amp-youtube.js @@ -28,6 +28,7 @@ import { originMatches, redispatch, } from '../../../src/iframe-video'; +import {applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {dev, userAssert} from '../../../src/log'; import {dict} from '#core/types/object'; import { @@ -43,7 +44,6 @@ import { import {getData, listen} from '../../../src/event-helper'; import {htmlFor} from '#core/dom/static-template'; import {installVideoManagerForDoc} from '#service/video-manager-impl'; -import {isLayoutSizeDefined} from '#core/dom/layout'; import {propagateAttributes} from '#core/dom/propagate-attributes'; import {setStyles} from '#core/dom/style'; @@ -516,7 +516,7 @@ class AmpYoutube extends AMP.BaseElement { } else { imgPlaceholder.setAttribute('alt', 'Loading video'); } - this.applyFillContent(imgPlaceholder); + applyFillContent(imgPlaceholder); // Because sddefault.jpg isn't available for all videos, we try to load // it and fallback to hqdefault.jpg. diff --git a/extensions/amp-youtube/0.1/test/test-amp-youtube.js b/extensions/amp-youtube/0.1/test/test-amp-youtube.js index 0a46a924b771..2e5aa76c4b77 100644 --- a/extensions/amp-youtube/0.1/test/test-amp-youtube.js +++ b/extensions/amp-youtube/0.1/test/test-amp-youtube.js @@ -17,7 +17,7 @@ import '../amp-youtube'; import {Services} from '#service'; import {VideoEvents} from '../../../../src/video-interface'; -import {installResizeObserverStub} from '../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {listenOncePromise} from '../../../../src/event-helper'; const EXAMPLE_VIDEOID = 'mGENRKrdoGY'; diff --git a/extensions/amp-youtube/1.0/test/test-amp-youtube.js b/extensions/amp-youtube/1.0/test/test-amp-youtube.js index cab11f513149..88a5352be893 100644 --- a/extensions/amp-youtube/1.0/test/test-amp-youtube.js +++ b/extensions/amp-youtube/1.0/test/test-amp-youtube.js @@ -17,9 +17,9 @@ import '../amp-youtube'; import {createElementWithAttributes} from '#core/dom'; -import {doNotLoadExternalResourcesInTest} from '../../../../testing/iframe'; +import {doNotLoadExternalResourcesInTest} from '#testing/iframe'; import {toggleExperiment} from '#experiments'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'amp-youtube-v1.0', diff --git a/src/base-element.js b/src/base-element.js index e3444b05d7fe..fe6add699b25 100644 --- a/src/base-element.js +++ b/src/base-element.js @@ -824,46 +824,6 @@ export class BaseElement { this.element.renderStarted(); } - /** - * Returns the original nodes of the custom element without any service nodes - * that could have been added for markup. These nodes can include Text, - * Comment and other child nodes. - * @return {!Array} - * @public @final - */ - getRealChildNodes() { - return this.element.getRealChildNodes(); - } - - /** - * Returns the original children of the custom element without any service - * nodes that could have been added for markup. - * @return {!Array} - * @public @final - */ - getRealChildren() { - return this.element.getRealChildren(); - } - - /** - * Configures the supplied element to have a "fill content" layout. The - * exact interpretation of "fill content" depends on the element's layout. - * - * If `opt_replacedContent` is specified, it indicates whether the "replaced - * content" styling should be applied. Replaced content is not allowed to - * have its own paddings or border. - * - * @param {!Element} element - * @param {boolean=} opt_replacedContent - * @public @final - */ - applyFillContent(element, opt_replacedContent) { - element.classList.add('i-amphtml-fill-content'); - if (opt_replacedContent) { - element.classList.add('i-amphtml-replaced-content'); - } - } - /** * Returns the viewport within which the element operates. * @return {!./service/viewport/viewport-interface.ViewportInterface} diff --git a/src/core/dom/layout.js b/src/core/dom/layout.js index 088c8ce52ee6..703dd64726f8 100644 --- a/src/core/dom/layout.js +++ b/src/core/dom/layout.js @@ -19,8 +19,8 @@ * details. */ -import {devAssertElement, userAssert} from '#core/assert'; import {isFiniteNumber} from '#core/types'; +import {userAssert} from '#core/assert'; /** * @enum {string} @@ -144,23 +144,6 @@ export function isLayoutSizeFixed(layout) { return layout == Layout.FIXED || layout == Layout.FIXED_HEIGHT; } -/** - * Whether the tag is an internal (service) AMP tag. - * @param {!Node|string} nodeOrTagName - * @return {boolean} - */ -export function isInternalElement(nodeOrTagName) { - /** @type string */ - let tagName; - if (typeof nodeOrTagName == 'string') { - tagName = nodeOrTagName; - } else if (nodeOrTagName.nodeType === Node.ELEMENT_NODE) { - tagName = devAssertElement(nodeOrTagName).tagName; - } - - return !!tagName && tagName.toLowerCase().startsWith('i-'); -} - /** * Parses the CSS length value. If no units specified, the assumed value is * "px". Returns undefined in case of parsing error. @@ -264,3 +247,21 @@ export function isIframeVideoPlayerComponent(tagName) { } return videoPlayerTagNameRe.test(tagName); } + +/** + * Configures the supplied element to have a "fill content" layout. The + * exact interpretation of "fill content" depends on the element's layout. + * + * If `opt_replacedContent` is specified, it indicates whether the "replaced + * content" styling should be applied. Replaced content is not allowed to + * have its own paddings or border. + * + * @param {!Element} element + * @param {boolean=} opt_replacedContent + */ +export function applyFillContent(element, opt_replacedContent) { + element.classList.add('i-amphtml-fill-content'); + if (opt_replacedContent) { + element.classList.add('i-amphtml-replaced-content'); + } +} diff --git a/src/core/dom/query.js b/src/core/dom/query.js index 95df69781c9b..7226f2e0cd7f 100644 --- a/src/core/dom/query.js +++ b/src/core/dom/query.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {devAssert} from '#core/assert'; +import {devAssert, devAssertElement} from '#core/assert'; import {isScopeSelectorSupported, prependSelectorsWith} from './css-selectors'; /** @fileoverview Helper functions for DOM queries. */ @@ -331,3 +331,64 @@ export function elementByTag(element, tagName) { assertIsName(tagName); return element./*OK*/ querySelector(tagName); } + +/** + * Returns the original nodes of the custom element without any service + * nodes that could have been added for markup. These nodes can include + * Text, Comment and other child nodes. + * + * @param {!Node} element + * @return {!Array} + */ +export function realChildNodes(element) { + return childNodes(element, (node) => !isInternalOrServiceNode(node)); +} + +/** + * Returns the original children of the custom element without any service + * nodes that could have been added for markup. + * + * @param {!Element} element + * @return {!Array} + */ +export function realChildElements(element) { + return childElements(element, (element) => !isInternalOrServiceNode(element)); +} + +/** + * Returns "true" for internal AMP nodes or for placeholder elements. + * @param {!Node} node + * @return {boolean} + */ +export function isInternalOrServiceNode(node) { + if (isInternalElement(node)) { + return true; + } + if (node.nodeType !== Node.ELEMENT_NODE) { + return false; + } + devAssertElement(node); + + return ( + node.hasAttribute('placeholder') || + node.hasAttribute('fallback') || + node.hasAttribute('overflow') + ); +} + +/** + * Whether the tag is an internal (service) AMP tag. + * @param {!Node|string} nodeOrTagName + * @return {boolean} + */ +function isInternalElement(nodeOrTagName) { + /** @type string */ + let tagName; + if (typeof nodeOrTagName == 'string') { + tagName = nodeOrTagName; + } else if (nodeOrTagName.nodeType === Node.ELEMENT_NODE) { + tagName = devAssertElement(nodeOrTagName).tagName; + } + + return !!tagName && tagName.toLowerCase().startsWith('i-'); +} diff --git a/src/custom-element.js b/src/custom-element.js index 10674d948632..fddb14c51247 100644 --- a/src/custom-element.js +++ b/src/custom-element.js @@ -19,12 +19,7 @@ import * as query from './core/dom/query'; import {AmpEvents} from './core/constants/amp-events'; import {CommonSignals} from './core/constants/common-signals'; import {ElementStub} from './element-stub'; -import { - Layout, - LayoutPriority, - isInternalElement, - isLoadingAllowed, -} from './core/dom/layout'; +import {Layout, LayoutPriority, isLoadingAllowed} from './core/dom/layout'; import {MediaQueryProps} from './core/dom/media-query-props'; import {ReadyState} from './core/constants/ready-state'; import {ResourceState} from './service/resource'; @@ -1896,30 +1891,6 @@ function createBaseCustomElementClass(win, elementConnectedCallback) { return purposes?.replace(/\s+/g, '')?.split(','); } - /** - * Returns the original nodes of the custom element without any service - * nodes that could have been added for markup. These nodes can include - * Text, Comment and other child nodes. - * @return {!Array} - * @package @final - */ - getRealChildNodes() { - return query.childNodes(this, (node) => !isInternalOrServiceNode(node)); - } - - /** - * Returns the original children of the custom element without any service - * nodes that could have been added for markup. - * @return {!Array} - * @package @final - */ - getRealChildren() { - return query.childElements( - this, - (element) => !isInternalOrServiceNode(element) - ); - } - /** * Returns an optional placeholder element for this custom element. * @return {?Element} @@ -2042,7 +2013,7 @@ function createBaseCustomElementClass(win, elementConnectedCallback) { this.hasAttribute('noloading') || (laidOut && !force) || !isLoadingAllowed(this) || - isInternalOrServiceNode(this) + query.isInternalOrServiceNode(this) ) { return false; } @@ -2171,26 +2142,6 @@ function assertNotTemplate(element) { devAssert(!element.isInTemplate_, 'Must never be called in template'); } -/** - * Returns "true" for internal AMP nodes or for placeholder elements. - * @param {!Node} node - * @return {boolean} - */ -function isInternalOrServiceNode(node) { - if (isInternalElement(node)) { - return true; - } - if ( - node.tagName && - (node.hasAttribute('placeholder') || - node.hasAttribute('fallback') || - node.hasAttribute('overflow')) - ) { - return true; - } - return false; -} - /** * Creates a new custom element class prototype. * diff --git a/src/iframe-video.js b/src/iframe-video.js index 04952f109eec..15581576c2dd 100644 --- a/src/iframe-video.js +++ b/src/iframe-video.js @@ -15,6 +15,7 @@ */ import {Services} from './service'; import {VideoEvents} from './video-interface'; +import {applyFillContent} from '#core/dom/layout'; import {dev} from './log'; import {dispatchCustomEvent} from './core/dom'; import {htmlFor} from './core/dom/static-template'; @@ -95,7 +96,7 @@ export function createFrameFor(video, src, opt_name, opt_sandbox) { frame.src = Services.urlForDoc(element).assertHttpsUrl(src, element); - video.applyFillContent(frame); + applyFillContent(frame); element.appendChild(frame); return frame; diff --git a/src/preact/base-element.js b/src/preact/base-element.js index 06ef9d9f2049..ec6c7ed98a50 100644 --- a/src/preact/base-element.js +++ b/src/preact/base-element.js @@ -19,7 +19,7 @@ import {ActionTrust} from '#core/constants/action-constants'; import {AmpEvents} from '#core/constants/amp-events'; import {CanPlay, CanRender, LoadingProp} from '../context/contextprops'; import {Deferred} from '#core/data-structures/promise'; -import {Layout, isLayoutSizeDefined} from '#core/dom/layout'; +import {Layout, applyFillContent, isLayoutSizeDefined} from '#core/dom/layout'; import {Loading} from '#core/loading-instructions'; import {MediaQueryProps} from '#core/dom/media-query-props'; import {PauseHelper} from '#core/dom/video/pause-helper'; @@ -33,7 +33,12 @@ import { setParent, subscribe, } from '../context'; -import {childElementByAttr, childElementByTag, matches} from '#core/dom/query'; +import { + childElementByAttr, + childElementByTag, + matches, + realChildNodes, +} from '#core/dom/query'; import { createElementWithAttributes, dispatchCustomEvent, @@ -48,7 +53,6 @@ import {hydrate, render} from './index'; import {installShadowStyle} from '../shadow-embed'; import {isElement} from '#core/types'; import {sequentialIdGenerator} from '#core/math/id-generator'; -import {toArray} from '#core/types/array'; /** * The following combinations are allowed. @@ -658,7 +662,7 @@ export class PreactBaseElement extends AMP.BaseElement { } else { const container = doc.createElement('i-amphtml-c'); this.container_ = container; - this.applyFillContent(container); + applyFillContent(container); if (!isDetached) { this.element.appendChild(container); } @@ -1083,9 +1087,7 @@ function parsePropDefs(Ctor, props, propDefs, element, mediaQueryProps) { // as separate properties. Thus in a carousel the plain "children" are // slides, and the "arrowNext" children are passed via a "arrowNext" // property. - const nodes = element.getRealChildNodes - ? element.getRealChildNodes() - : toArray(element.childNodes); + const nodes = realChildNodes(element); for (let i = 0; i < nodes.length; i++) { const childElement = nodes[i]; const match = matchChild(childElement, propDefs); @@ -1157,7 +1159,7 @@ function parsePropDefs(Ctor, props, propDefs, element, mediaQueryProps) { devAssert(Ctor['usesShadowDom']); // Use lazy loading inside the passthrough by default due to too many // elements. - value = element.getRealChildNodes().every(IS_EMPTY_TEXT_NODE) + value = realChildNodes(element).every(IS_EMPTY_TEXT_NODE) ? null : []; } else if (def.attr) { diff --git a/test/fixtures/e2e/amp-video/analytics-triggers.html b/test/fixtures/e2e/amp-video/analytics-triggers.html index d7a0fda1a9be..2c092c8c31b6 100644 --- a/test/fixtures/e2e/amp-video/analytics-triggers.html +++ b/test/fixtures/e2e/amp-video/analytics-triggers.html @@ -3,6 +3,7 @@ amp-video + diff --git a/test/integration/test-actions.js b/test/integration/test-actions.js index f4e89b706871..76ec9260dc0c 100644 --- a/test/integration/test-actions.js +++ b/test/integration/test-actions.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import {BrowserController} from '../../testing/test-helper'; -import {poll} from '../../testing/iframe.js'; +import {BrowserController} from '#testing/test-helper'; +import {poll} from '#testing/iframe.js'; describes.integration( 'on="..."', diff --git a/test/integration/test-amp-ad-3p.js b/test/integration/test-amp-ad-3p.js index 8d7a6497b259..f5b25543dee3 100644 --- a/test/integration/test-amp-ad-3p.js +++ b/test/integration/test-amp-ad-3p.js @@ -17,7 +17,7 @@ import {ADS_INITIAL_INTERSECTION_EXP} from '#experiments/ads-initial-intersection-exp'; import {Services} from '#service'; import {createCustomEvent} from '../../src/event-helper'; -import {createFixtureIframe, poll} from '../../testing/iframe'; +import {createFixtureIframe, poll} from '#testing/iframe'; import {forceExperimentBranch} from '#experiments'; import {installPlatformService} from '#service/platform-impl'; import {layoutRectLtwh} from '#core/math/layout-rect'; diff --git a/test/integration/test-amp-ad-doubleclick.js b/test/integration/test-amp-ad-doubleclick.js index f6e3bcc06d62..94f6634952f0 100644 --- a/test/integration/test-amp-ad-doubleclick.js +++ b/test/integration/test-amp-ad-doubleclick.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {createFixtureIframe, poll, pollForLayout} from '../../testing/iframe'; +import {createFixtureIframe, poll, pollForLayout} from '#testing/iframe'; describes.sandboxed .configure() diff --git a/test/integration/test-amp-ad-type-custom.js b/test/integration/test-amp-ad-type-custom.js index bc6df2d7d9ba..c4e0863c5f90 100644 --- a/test/integration/test-amp-ad-type-custom.js +++ b/test/integration/test-amp-ad-type-custom.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController} from '../../testing/test-helper'; +import {BrowserController} from '#testing/test-helper'; describes.integration( 'amp-ad type=custom', diff --git a/test/integration/test-amp-analytics.js b/test/integration/test-amp-analytics.js index 525390a41661..e2b9d978521b 100644 --- a/test/integration/test-amp-analytics.js +++ b/test/integration/test-amp-analytics.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController, RequestBank} from '../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; import {parseQueryString} from '#core/types/string/url'; // TODO(wg-analytics): These tests time out on Firefox and Safari. diff --git a/test/integration/test-amp-bind.js b/test/integration/test-amp-bind.js index d6727cde6f59..5472e61a5d6e 100644 --- a/test/integration/test-amp-bind.js +++ b/test/integration/test-amp-bind.js @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {BrowserController} from '../../testing/test-helper'; -import {poll as classicPoll} from '../../testing/iframe'; +import {BrowserController} from '#testing/test-helper'; +import {poll as classicPoll} from '#testing/iframe'; const TIMEOUT = 10000; diff --git a/test/integration/test-amp-img.js b/test/integration/test-amp-img.js index 863082b52bc9..0dd8d71e5721 100644 --- a/test/integration/test-amp-img.js +++ b/test/integration/test-amp-img.js @@ -20,7 +20,7 @@ import { createFixtureIframe, expectBodyToBecomeVisible, poll, -} from '../../testing/iframe.js'; +} from '#testing/iframe.js'; describes.sandboxed .configure() diff --git a/test/integration/test-amp-pixel.js b/test/integration/test-amp-pixel.js index c5c5c69d168b..461240078d25 100644 --- a/test/integration/test-amp-pixel.js +++ b/test/integration/test-amp-pixel.js @@ -15,7 +15,7 @@ */ import {AmpPixel} from '#builtins/amp-pixel/amp-pixel'; -import {BrowserController, RequestBank} from '../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; import {createElementWithAttributes} from '#core/dom'; describes.sandboxed('amp-pixel', {}, function () { diff --git a/test/integration/test-amp-recaptcha-input.js b/test/integration/test-amp-recaptcha-input.js index 3c4a844b4e80..e9c1a9df04f8 100644 --- a/test/integration/test-amp-recaptcha-input.js +++ b/test/integration/test-amp-recaptcha-input.js @@ -14,9 +14,9 @@ * limitations under the License. */ -import {BrowserController, RequestBank} from '../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; import {Deferred} from '#core/data-structures/promise'; -import {poll} from '../../testing/iframe'; +import {poll} from '#testing/iframe'; // TODO(wg-components): These tests are broken on Firefox (as of v77). They // also fail on Safari. diff --git a/test/integration/test-amp-skimlinks.js b/test/integration/test-amp-skimlinks.js index 2b6b7be513e5..edb8e70eaed9 100644 --- a/test/integration/test-amp-skimlinks.js +++ b/test/integration/test-amp-skimlinks.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController, RequestBank} from '../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; import {PLATFORM_NAME} from '../../extensions/amp-skimlinks/0.1/constants'; import {parseQueryString} from '#core/types/string/url'; diff --git a/test/integration/test-amp-story-analytics.js b/test/integration/test-amp-story-analytics.js index 7b4b5fbb6fbf..7f00c3df85fa 100644 --- a/test/integration/test-amp-story-analytics.js +++ b/test/integration/test-amp-story-analytics.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController, RequestBank} from '../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; import {parseQueryString} from '#core/types/string/url'; const config = describes.sandboxed.configure().skipEdge().skipSafari(); diff --git a/test/integration/test-amphtml-ads.js b/test/integration/test-amphtml-ads.js index f0e2ccb9c28b..b8bc0e16351b 100644 --- a/test/integration/test-amphtml-ads.js +++ b/test/integration/test-amphtml-ads.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import {RequestBank} from '../../testing/test-helper'; -import {maybeSwitchToCompiledJs} from '../../testing/iframe'; +import {RequestBank} from '#testing/test-helper'; +import {maybeSwitchToCompiledJs} from '#testing/iframe'; import {parseQueryString} from '#core/types/string/url'; import {xhrServiceForTesting} from '#service/xhr-impl'; diff --git a/test/integration/test-boilerplates.js b/test/integration/test-boilerplates.js index 43ca30ff46d8..b183ed008f2e 100644 --- a/test/integration/test-boilerplates.js +++ b/test/integration/test-boilerplates.js @@ -14,12 +14,9 @@ * limitations under the License. */ -import { - createFixtureIframe, - expectBodyToBecomeVisible, -} from '../../testing/iframe'; +import {createFixtureIframe, expectBodyToBecomeVisible} from '#testing/iframe'; import {getStyle} from '#core/dom/style'; -import {isAnimationNone} from '../../testing/test-helper'; +import {isAnimationNone} from '#testing/test-helper'; const timeout = window.ampTestRuntimeConfig.mochaTimeout; diff --git a/test/integration/test-configuration.js b/test/integration/test-configuration.js index 304938a44c34..cb865670d685 100644 --- a/test/integration/test-configuration.js +++ b/test/integration/test-configuration.js @@ -15,7 +15,7 @@ */ import {AmpEvents} from '#core/constants/amp-events'; -import {createFixtureIframe} from '../../testing/iframe.js'; +import {createFixtureIframe} from '#testing/iframe.js'; describes.sandboxed('Configuration', {}, function () { let fixture; diff --git a/test/integration/test-css.js b/test/integration/test-css.js index 7e4e12c0c6be..112810ea2ad6 100644 --- a/test/integration/test-css.js +++ b/test/integration/test-css.js @@ -19,7 +19,7 @@ import {computedStyle} from '#core/dom/style.js'; import { createFixtureIframe, expectBodyToBecomeVisible, -} from '../../testing/iframe.js'; +} from '#testing/iframe.js'; describes.sandboxed.configure().run('CSS', {}, () => { it('should include height of [overflow] child in size before build', async () => { diff --git a/test/integration/test-double-loading.js b/test/integration/test-double-loading.js index fadb09437894..4675ccbdd1cb 100644 --- a/test/integration/test-double-loading.js +++ b/test/integration/test-double-loading.js @@ -15,7 +15,7 @@ */ import {AmpEvents} from '#core/constants/amp-events.js'; -import {createFixtureIframe} from '../../testing/iframe.js'; +import {createFixtureIframe} from '#testing/iframe.js'; function checkElementUpgrade(element) { expect(element).to.have.class('i-amphtml-element'); diff --git a/test/integration/test-errors.js b/test/integration/test-errors.js index 2ace5725cc78..fd84cad94e38 100644 --- a/test/integration/test-errors.js +++ b/test/integration/test-errors.js @@ -18,7 +18,7 @@ import { createFixtureIframe, expectBodyToBecomeVisible, poll, -} from '../../testing/iframe.js'; +} from '#testing/iframe.js'; /** @const {number} */ const TIMEOUT = window.ampTestRuntimeConfig.mochaTimeout; diff --git a/test/integration/test-extensions-loading.js b/test/integration/test-extensions-loading.js index 5242ca128210..705a964e27ed 100644 --- a/test/integration/test-extensions-loading.js +++ b/test/integration/test-extensions-loading.js @@ -15,7 +15,7 @@ */ import {AmpEvents} from '#core/constants/amp-events'; -import {createFixtureIframe} from '../../testing/iframe'; +import {createFixtureIframe} from '#testing/iframe'; // Checks if an amp element gets upgraded. function checkElementUpgrade(element) { diff --git a/test/integration/test-position-observer.js b/test/integration/test-position-observer.js index d1aece798f5a..b70bce2fd5a9 100644 --- a/test/integration/test-position-observer.js +++ b/test/integration/test-position-observer.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {poll} from '../../testing/iframe'; +import {poll} from '#testing/iframe'; //TODO(aghassemi,#10878): Run in all platforms. //TODO(aghasemi, #10877): in-a-box, FIE integration tests. diff --git a/test/integration/test-released.js b/test/integration/test-released.js index 8a21167f72f1..30a71bddd674 100644 --- a/test/integration/test-released.js +++ b/test/integration/test-released.js @@ -18,7 +18,7 @@ import { createFixtureIframe, expectBodyToBecomeVisible, pollForLayout, -} from '../../testing/iframe.js'; +} from '#testing/iframe.js'; describes.sandboxed('released components: ', {}, function () { runTest.call(this, false); diff --git a/test/integration/test-shadow-amp.js b/test/integration/test-shadow-amp.js index d31ab24bc128..6726e8380a2d 100644 --- a/test/integration/test-shadow-amp.js +++ b/test/integration/test-shadow-amp.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {BrowserController} from '../../testing/test-helper'; +import {BrowserController} from '#testing/test-helper'; describes.integration( 'AMP shadow v0', diff --git a/test/integration/test-shadow-dom-element.js b/test/integration/test-shadow-dom-element.js index 574be16cf6b5..0305a5c33b67 100644 --- a/test/integration/test-shadow-dom-element.js +++ b/test/integration/test-shadow-dom-element.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {createFixtureIframe} from '../../testing/iframe'; +import {createFixtureIframe} from '#testing/iframe'; import {toggleExperiment} from '#experiments'; import {whenUpgradedToCustomElement} from '../../src/amp-element-helpers'; diff --git a/test/integration/test-toggle-display.js b/test/integration/test-toggle-display.js index 9ff8d41954c2..a12649c89ee1 100644 --- a/test/integration/test-toggle-display.js +++ b/test/integration/test-toggle-display.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController} from '../../testing/test-helper'; +import {BrowserController} from '#testing/test-helper'; import {setInitialDisplay, toggle} from '#core/dom/style'; describes.integration diff --git a/test/integration/test-user-error-reporting.js b/test/integration/test-user-error-reporting.js index 37a349289836..29e7626ac8ad 100644 --- a/test/integration/test-user-error-reporting.js +++ b/test/integration/test-user-error-reporting.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {BrowserController, RequestBank} from '../../testing/test-helper'; +import {BrowserController, RequestBank} from '#testing/test-helper'; // TODO(zhouyx, #11459): Unskip the test on Safari and Firefox. const t = describes.sandboxed.configure().skipSafari().skipFirefox().skipEdge(); diff --git a/test/integration/test-video-players-helper.js b/test/integration/test-video-players-helper.js index 61c50b752432..4c830f23660f 100644 --- a/test/integration/test-video-players-helper.js +++ b/test/integration/test-video-players-helper.js @@ -24,7 +24,7 @@ import { createFixtureIframe, expectBodyToBecomeVisible, poll, -} from '../../testing/iframe'; +} from '#testing/iframe'; import {detectIsAutoplaySupported} from '#core/dom/video'; import {getData, listenOncePromise} from '../../src/event-helper'; import {removeElement} from '#core/dom'; diff --git a/test/unit/3p/test-3p-messaging.js b/test/unit/3p/test-3p-messaging.js index f4a923d04e0a..3a8a8cc681d6 100644 --- a/test/unit/3p/test-3p-messaging.js +++ b/test/unit/3p/test-3p-messaging.js @@ -15,7 +15,7 @@ */ import {Services} from '#service'; -import {createIframePromise} from '../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {listenParent} from '#3p/messaging'; import {postMessage} from '../../../src/iframe-helper'; diff --git a/test/unit/ads/test-adplugg.js b/test/unit/ads/test-adplugg.js index 40ee29612898..82ef7ca651df 100644 --- a/test/unit/ads/test-adplugg.js +++ b/test/unit/ads/test-adplugg.js @@ -15,7 +15,7 @@ */ import {adplugg} from '#ads/vendors/adplugg'; -import {createIframePromise} from '../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; describes.fakeWin('amp-ad-adplugg-impl', {}, (env) => { let win; diff --git a/test/unit/ads/test-aduptech.js b/test/unit/ads/test-aduptech.js index 1a5e93d34b51..76b85ab7109e 100644 --- a/test/unit/ads/test-aduptech.js +++ b/test/unit/ads/test-aduptech.js @@ -19,7 +19,7 @@ import { ADUPTECH_ELEMENT_ID, aduptech, } from '#ads/vendors/aduptech'; -import {createIframePromise} from '../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; describes.fakeWin('amp-ad-aduptech-impl', {}, (env) => { let win; diff --git a/test/unit/ads/test-csa.js b/test/unit/ads/test-csa.js index 03295c084765..d179a8eb8de9 100644 --- a/test/unit/ads/test-csa.js +++ b/test/unit/ads/test-csa.js @@ -22,7 +22,7 @@ import { csa, resizeIframe, } from '#ads/vendors/csa'; -import {createIframePromise} from '../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; function getAds(type) { const generic = {ampSlotIndex: '0', height: 300, type: 'csa'}; diff --git a/test/unit/ads/test-ssp.js b/test/unit/ads/test-ssp.js index 6b098fccb20d..8f2274fef06f 100644 --- a/test/unit/ads/test-ssp.js +++ b/test/unit/ads/test-ssp.js @@ -15,7 +15,7 @@ */ import * as _3p from '#3p/3p'; -import {createIframePromise} from '../../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import { handlePosition, handlePositionResponsive, diff --git a/test/unit/core/dom/stream/test-response.js b/test/unit/core/dom/stream/test-response.js index f9e538dfcf7b..29b4a4088078 100644 --- a/test/unit/core/dom/stream/test-response.js +++ b/test/unit/core/dom/stream/test-response.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {macroTask} from '../../../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {streamResponseToWriter} from '#core/dom/stream'; const chunk1 = ` diff --git a/test/unit/core/dom/test-media-query-props.js b/test/unit/core/dom/test-media-query-props.js index 351b3e2c571b..d43286f86db2 100644 --- a/test/unit/core/dom/test-media-query-props.js +++ b/test/unit/core/dom/test-media-query-props.js @@ -15,7 +15,7 @@ */ import {MediaQueryProps} from '#core/dom/media-query-props'; -import {waitFor} from '../../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin( 'DOM - MediaQueryProps', diff --git a/test/unit/core/dom/test-query.js b/test/unit/core/dom/test-query.js index 37d948d2db4c..169e535d1d02 100644 --- a/test/unit/core/dom/test-query.js +++ b/test/unit/core/dom/test-query.js @@ -15,6 +15,7 @@ */ import * as query from '#core/dom/query'; +import {createElementWithAttributes} from '#core/dom'; import {isElement} from '#core/types'; import {loadPromise} from '../../../../src/event-helper'; import {setScopeSelectorSupportedForTesting} from '#core/dom/css-selectors'; @@ -70,6 +71,39 @@ describes.sandboxed('DOM - query helpers', {}, (env) => { ).to.deep.equal([element1, element2]); }); + describe('realChildElements and realChildNodes', () => { + let element; + beforeEach(() => { + element = document.createElement('div'); + }); + + it('realChildElements should return nothing', () => { + expect(query.realChildNodes(element).length).to.equal(0); + expect(query.realChildElements(element).length).to.equal(0); + }); + + it('realChildElements should return content-only nodes', () => { + const createWithAttr = (attr) => + createElementWithAttributes(document, 'div', {[attr]: ''}); + + element.appendChild(document.createElement('i-amp-service')); + element.appendChild(createWithAttr('placeholder')); + element.appendChild(createWithAttr('fallback')); + element.appendChild(createWithAttr('overflow')); + element.appendChild(document.createTextNode('abc')); + element.appendChild(document.createElement('content')); + + const nodes = query.realChildNodes(element); + expect(nodes.length).to.equal(2); + expect(nodes[0].textContent).to.equal('abc'); + expect(nodes[1].tagName.toLowerCase()).to.equal('content'); + + const elements = query.realChildElements(element); + expect(elements.length).to.equal(1); + expect(elements[0].tagName.toLowerCase()).to.equal('content'); + }); + }); + describe('matches', () => { let div, img1, iframe, ampEl; beforeEach(() => { diff --git a/test/unit/core/dom/video/test-pause-helper.js b/test/unit/core/dom/video/test-pause-helper.js index b0f1a57b13a2..04cb06b89fbf 100644 --- a/test/unit/core/dom/video/test-pause-helper.js +++ b/test/unit/core/dom/video/test-pause-helper.js @@ -15,7 +15,7 @@ */ import {PauseHelper} from '#core/dom/video/pause-helper'; -import {installResizeObserverStub} from '../../../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; describes.realWin('DOM - video - PauseHelper', {}, (env) => { let win, doc; diff --git a/test/unit/inabox/test-inabox-resources.js b/test/unit/inabox/test-inabox-resources.js index 3c8e3b6e0669..f0c011321c38 100644 --- a/test/unit/inabox/test-inabox-resources.js +++ b/test/unit/inabox/test-inabox-resources.js @@ -16,7 +16,7 @@ import {Deferred} from '#core/data-structures/promise'; import {InaboxResources} from '#inabox/inabox-resources'; import {ResourceState} from '#service/resource'; -import {macroTask} from '../../../testing/yield'; +import {macroTask} from '#testing/yield'; import {toggleExperiment} from '#experiments'; describes.realWin('inabox-resources', {amp: true}, (env) => { diff --git a/test/unit/preact/test-base-element-mapping.js b/test/unit/preact/test-base-element-mapping.js index ad9357d555f6..8ef5c2cf96db 100644 --- a/test/unit/preact/test-base-element-mapping.js +++ b/test/unit/preact/test-base-element-mapping.js @@ -20,9 +20,9 @@ import {Slot} from '#preact/slot'; import {createElementWithAttributes} from '#core/dom'; import {htmlFor} from '#core/dom/static-template'; import {omit} from '#core/types/object'; -import {testElementR1} from '../../../testing/element-v1'; +import {testElementR1} from '#testing/element-v1'; import {upgradeOrRegisterElement} from '#service/custom-element-registry'; -import {waitFor} from '../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; const spec = {amp: true, frameStyle: {width: '300px'}}; diff --git a/test/unit/preact/test-base-element-runtime.js b/test/unit/preact/test-base-element-runtime.js index 6efe6390e093..163dc810dc69 100644 --- a/test/unit/preact/test-base-element-runtime.js +++ b/test/unit/preact/test-base-element-runtime.js @@ -21,12 +21,12 @@ import {Slot} from '#preact/slot'; import {forwardRef} from '#preact/compat'; import {getSchedulerForDoc} from '#service/scheduler'; import {htmlFor} from '#core/dom/static-template'; -import {installResizeObserverStub} from '../../../testing/resize-observer-stub'; +import {installResizeObserverStub} from '#testing/resize-observer-stub'; import {removeElement} from '#core/dom'; import {subscribe} from '../../../src/context'; import {upgradeOrRegisterElement} from '#service/custom-element-registry'; import {useAmpContext, useLoading} from '#preact/context'; -import {waitFor} from '../../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin('PreactBaseElement', {amp: true}, (env) => { let win, doc, html; diff --git a/test/unit/test-3p-environment.js b/test/unit/test-3p-environment.js index 41240d96b1ca..02a595ce6eef 100644 --- a/test/unit/test-3p-environment.js +++ b/test/unit/test-3p-environment.js @@ -16,7 +16,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {Services} from '#service'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {loadPromise} from '../../src/event-helper'; import {manageWin, setInViewportForTesting} from '#3p/environment'; diff --git a/test/unit/test-action.js b/test/unit/test-action.js index 264987541f2d..f349b883d702 100644 --- a/test/unit/test-action.js +++ b/test/unit/test-action.js @@ -30,7 +30,7 @@ import {AmpDocSingle} from '#service/ampdoc-impl'; import {Keys} from '#core/constants/key-codes'; import {createCustomEvent} from '../../src/event-helper'; import {htmlFor} from '#core/dom/static-template'; -import {whenCalled} from '../../testing/test-helper.js'; +import {whenCalled} from '#testing/test-helper.js'; /** * @return {!ActionService} diff --git a/test/unit/test-ad-helper.js b/test/unit/test-ad-helper.js index 94c6a2527658..88d8b6bf48fa 100644 --- a/test/unit/test-ad-helper.js +++ b/test/unit/test-ad-helper.js @@ -15,7 +15,7 @@ */ import {computedStyle} from '#core/dom/style'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {getAdContainer, isAdPositionAllowed} from '../../src/ad-helper'; describes.sandboxed('ad-helper', {}, () => { diff --git a/test/unit/test-amp-img-intrinsic.js b/test/unit/test-amp-img-intrinsic.js index 3c91e504e073..e5fd3c6b9663 100644 --- a/test/unit/test-amp-img-intrinsic.js +++ b/test/unit/test-amp-img-intrinsic.js @@ -14,10 +14,10 @@ * limitations under the License. */ -import {BrowserController} from '../../testing/test-helper'; +import {BrowserController} from '#testing/test-helper'; import {applyStaticLayout} from '../../src/static-layout'; import {createElementWithAttributes} from '#core/dom'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {installImg} from '#builtins/amp-img/amp-img'; import {toArray} from '#core/types/array'; diff --git a/test/unit/test-amp-img-v1.js b/test/unit/test-amp-img-v1.js index b93f8fb8f85d..59edb20fc650 100644 --- a/test/unit/test-amp-img-v1.js +++ b/test/unit/test-amp-img-v1.js @@ -18,7 +18,7 @@ import {AmpImg} from '#builtins/amp-img/amp-img'; import {BaseElement} from '../../src/base-element'; import {Layout, LayoutPriority} from '#core/dom/layout'; import {createElementWithAttributes, dispatchCustomEvent} from '#core/dom'; -import {testElementR1} from '../../testing/element-v1'; +import {testElementR1} from '#testing/element-v1'; describes.realWin('amp-img R1', {amp: true}, (env) => { let win, doc; diff --git a/test/unit/test-amp-img.js b/test/unit/test-amp-img.js index e509825b31bc..e39270496a2c 100644 --- a/test/unit/test-amp-img.js +++ b/test/unit/test-amp-img.js @@ -23,7 +23,7 @@ import {BaseElement} from '../../src/base-element'; import {Layout, LayoutPriority} from '#core/dom/layout'; import {Services} from '#service'; import {createCustomEvent} from '../../src/event-helper'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; describes.sandboxed('amp-img', {}, (env) => { let sandbox; diff --git a/test/unit/test-amp-story-player.js b/test/unit/test-amp-story-player.js index 5a2d0fc5af4f..58c566b705f6 100644 --- a/test/unit/test-amp-story-player.js +++ b/test/unit/test-amp-story-player.js @@ -20,7 +20,7 @@ import {Messaging} from '@ampproject/viewer-messaging'; import {PageScroller} from '../../src/amp-story-player/page-scroller'; import {expect} from 'chai'; import {listenOncePromise} from '../../src/event-helper'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin('AmpStoryPlayer', {amp: false}, (env) => { let win; diff --git a/test/unit/test-ampdoc.js b/test/unit/test-ampdoc.js index 18102f3e5851..17633c05686f 100644 --- a/test/unit/test-ampdoc.js +++ b/test/unit/test-ampdoc.js @@ -35,7 +35,7 @@ import { registerServiceBuilderForDoc, setParentWindow, } from '../../src/service-helpers'; -import {waitFor} from '../../testing/test-helper'; +import {waitFor} from '#testing/test-helper'; describes.realWin('AmpDocService', {}, (env) => { let doc, win; diff --git a/test/unit/test-cache-cid-api.js b/test/unit/test-cache-cid-api.js index 7179e7e0962f..dc36a6bcc6d8 100644 --- a/test/unit/test-cache-cid-api.js +++ b/test/unit/test-cache-cid-api.js @@ -17,7 +17,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {CacheCidApi} from '#service/cache-cid-api'; import {installTimerService} from '#service/timer-impl'; -import {mockServiceForDoc, stubService} from '../../testing/test-helper'; +import {mockServiceForDoc, stubService} from '#testing/test-helper'; describes.realWin('cacheCidApi', {amp: true}, (env) => { let ampdoc; diff --git a/test/unit/test-cid-api.js b/test/unit/test-cid-api.js index 9675db338d26..25945aa76123 100644 --- a/test/unit/test-cid-api.js +++ b/test/unit/test-cid-api.js @@ -16,7 +16,7 @@ import {GoogleCidApi} from '#service/cid-api'; import {getCookie, setCookie} from '../../src/cookies'; -import {mockWindowInterface, stubService} from '../../testing/test-helper'; +import {mockWindowInterface, stubService} from '#testing/test-helper'; describes.realWin('test-cid-api', {amp: true}, (env) => { let win; diff --git a/test/unit/test-cid.js b/test/unit/test-cid.js index 16cd6f222fb2..42887c688aba 100644 --- a/test/unit/test-cid.js +++ b/test/unit/test-cid.js @@ -33,13 +33,13 @@ import {installExtensionsService} from '#service/extensions-impl'; import {installPlatformService} from '#service/platform-impl'; import {installTimerService} from '#service/timer-impl'; import {installViewerServiceForDoc} from '#service/viewer-impl'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; import {parseUrlDeprecated} from '../../src/url'; import { registerServiceBuilder, resetServiceForTesting, } from '../../src/service-helpers'; -import {stubServiceForDoc} from '../../testing/test-helper'; +import {stubServiceForDoc} from '#testing/test-helper'; const DAY = 24 * 3600 * 1000; diff --git a/test/unit/test-custom-element.js b/test/unit/test-custom-element.js index 322c2175f2e0..c128ace0c11f 100644 --- a/test/unit/test-custom-element.js +++ b/test/unit/test-custom-element.js @@ -1978,29 +1978,6 @@ describes.realWin('CustomElement Service Elements', {amp: true}, (env) => { return child; } - it('getRealChildren should return nothing', () => { - expect(element.getRealChildNodes().length).to.equal(0); - expect(element.getRealChildren().length).to.equal(0); - }); - - it('getRealChildren should return content-only nodes', () => { - element.appendChild(doc.createElement('i-amp-service')); - element.appendChild(createWithAttr('placeholder')); - element.appendChild(createWithAttr('fallback')); - element.appendChild(createWithAttr('overflow')); - element.appendChild(doc.createTextNode('abc')); - element.appendChild(doc.createElement('content')); - - const nodes = element.getRealChildNodes(); - expect(nodes.length).to.equal(2); - expect(nodes[0].textContent).to.equal('abc'); - expect(nodes[1].tagName.toLowerCase()).to.equal('content'); - - const elements = element.getRealChildren(); - expect(elements.length).to.equal(1); - expect(elements[0].tagName.toLowerCase()).to.equal('content'); - }); - it('getPlaceholder should return nothing', () => { expect(element.getPlaceholder()).to.be.null; }); diff --git a/test/unit/test-document-info.js b/test/unit/test-document-info.js index df51954dea47..6fa14ad78a1c 100644 --- a/test/unit/test-document-info.js +++ b/test/unit/test-document-info.js @@ -17,7 +17,7 @@ import * as CID from '#service/cid-impl'; import {Services} from '#service'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {installDocService} from '#service/ampdoc-impl'; import {installDocumentInfoServiceForDoc} from '#service/document-info-impl'; diff --git a/test/unit/test-element-service.js b/test/unit/test-element-service.js index 93eebb99aca2..ed013c6b5eb8 100644 --- a/test/unit/test-element-service.js +++ b/test/unit/test-element-service.js @@ -15,7 +15,7 @@ */ import * as fakeTimers from '@sinonjs/fake-timers'; -import {FakeWindow} from '../../testing/fake-dom'; +import {FakeWindow} from '#testing/fake-dom'; import {Services} from '#service'; import {createElementWithAttributes} from '#core/dom'; import { diff --git a/test/unit/test-extension-analytics.js b/test/unit/test-extension-analytics.js index 54cb324dab10..b379c8a3fd56 100644 --- a/test/unit/test-extension-analytics.js +++ b/test/unit/test-extension-analytics.js @@ -26,7 +26,7 @@ import { registerServiceBuilderForDoc, resetServiceForTesting, } from '../../src/service-helpers'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; import {registerElement} from '#service/custom-element-registry'; /* eslint-disable react-hooks/rules-of-hooks */ diff --git a/test/unit/test-fixed-layer.js b/test/unit/test-fixed-layer.js index 1ba353fb28b1..b11776b0d258 100644 --- a/test/unit/test-fixed-layer.js +++ b/test/unit/test-fixed-layer.js @@ -16,7 +16,7 @@ import {AmpDocSingle, installDocService} from '#service/ampdoc-impl'; import {Animation} from '../../src/animation'; -import {FakeMutationObserver, FakeWindow} from '../../testing/fake-dom'; +import {FakeMutationObserver, FakeWindow} from '#testing/fake-dom'; import {FixedLayer} from '#service/fixed-layer'; import {Services} from '#service'; import {endsWith} from '#core/types/string'; diff --git a/test/unit/test-friendly-iframe-embed.js b/test/unit/test-friendly-iframe-embed.js index a8318ae9dc8c..329ebf4fc051 100644 --- a/test/unit/test-friendly-iframe-embed.js +++ b/test/unit/test-friendly-iframe-embed.js @@ -18,7 +18,7 @@ import {AmpDocFie} from '#service/ampdoc-impl'; import {BaseElement} from '../../src/base-element'; import {Deferred} from '#core/data-structures/promise'; import {ElementStub} from '../../src/element-stub'; -import {FakeWindow} from '../../testing/fake-dom'; +import {FakeWindow} from '#testing/fake-dom'; import { FriendlyIframeEmbed, Installers, @@ -37,7 +37,7 @@ import { setParentWindow, } from '../../src/service-helpers'; import {installExtensionsService} from '#service/extensions-impl'; -import {isAnimationNone} from '../../testing/test-helper'; +import {isAnimationNone} from '#testing/test-helper'; import {layoutRectLtwh} from '#core/math/layout-rect'; import {loadPromise} from '../../src/event-helper'; import {resetScheduledElementForTesting} from '#service/custom-element-registry'; diff --git a/test/unit/test-hidden-observer.js b/test/unit/test-hidden-observer.js index 29ca3e15c30e..61ee47fdc318 100644 --- a/test/unit/test-hidden-observer.js +++ b/test/unit/test-hidden-observer.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import {FakeMutationObserver} from '../../testing/fake-dom'; +import {FakeMutationObserver} from '#testing/fake-dom'; import {Services} from '#service'; describes.fakeWin( diff --git a/test/unit/test-iframe-helper.js b/test/unit/test-iframe-helper.js index 062f344ee8c7..90b818c377cf 100644 --- a/test/unit/test-iframe-helper.js +++ b/test/unit/test-iframe-helper.js @@ -14,7 +14,7 @@ * limitations under the License. */ import * as IframeHelper from '../../src/iframe-helper'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {generateSentinel} from '../../src/3p-frame'; describes.sandboxed diff --git a/test/unit/test-iframe-stub.js b/test/unit/test-iframe-stub.js index 6bf11f889648..54555f076bf8 100644 --- a/test/unit/test-iframe-stub.js +++ b/test/unit/test-iframe-stub.js @@ -14,10 +14,7 @@ * limitations under the License. */ -import { - createIframeWithMessageStub, - expectPostMessage, -} from '../../testing/iframe'; +import {createIframeWithMessageStub, expectPostMessage} from '#testing/iframe'; describes.sandboxed .configure() diff --git a/test/unit/test-impression.js b/test/unit/test-impression.js index 9a3a27cf087a..2d9c50da344f 100644 --- a/test/unit/test-impression.js +++ b/test/unit/test-impression.js @@ -26,7 +26,7 @@ import { resetTrackImpressionPromiseForTesting, shouldAppendExtraParams, } from '../../src/impression'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; import {toggleExperiment} from '#experiments'; describes.realWin('impression', {amp: true}, (env) => { diff --git a/test/unit/test-input.js b/test/unit/test-input.js index 9ced9dfbf395..a1e8bfb66380 100644 --- a/test/unit/test-input.js +++ b/test/unit/test-input.js @@ -16,7 +16,7 @@ import {Input} from '../../src/input'; import {installTimerService} from '#service/timer-impl.js'; -import {stubService} from '../../testing/test-helper'; +import {stubService} from '#testing/test-helper'; describes.sandboxed('Input', {}, (env) => { let clock; diff --git a/test/unit/test-navigation.js b/test/unit/test-navigation.js index d900b9721c4d..172208b26cc0 100644 --- a/test/unit/test-navigation.js +++ b/test/unit/test-navigation.js @@ -19,7 +19,7 @@ import {Services} from '#service'; import {addParamToUrl} from '../../src/url'; import {createElementWithAttributes} from '#core/dom'; import {installUrlReplacementsServiceForDoc} from '#service/url-replacements-impl'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; import {maybeExpandUrlParamsForTesting} from '#service/navigation'; describes.sandboxed('Navigation', {}, () => { diff --git a/test/unit/test-notification-ui-manager.js b/test/unit/test-notification-ui-manager.js index da9dcbe3f400..2250884daaf1 100644 --- a/test/unit/test-notification-ui-manager.js +++ b/test/unit/test-notification-ui-manager.js @@ -14,7 +14,7 @@ * limitations under the License. */ import {NotificationUiManager} from '#service/notification-ui-manager'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin('NotificationUiManager', {amp: 1}, (env) => { describe('Notification UI Manager', () => { diff --git a/test/unit/test-position-observer.js b/test/unit/test-position-observer.js index 4f1a5e5d928b..daff2aa9f0da 100644 --- a/test/unit/test-position-observer.js +++ b/test/unit/test-position-observer.js @@ -19,7 +19,7 @@ import {PositionObserver} from '#service/position-observer/position-observer-imp import {PositionObserverFidelity} from '#service/position-observer/position-observer-worker'; import {Services} from '#service'; import {layoutRectLtwh} from '#core/math/layout-rect'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; import {setStyles} from '#core/dom/style'; describes.realWin('PositionObserver', {amp: 1}, (env) => { diff --git a/test/unit/test-preconnect.js b/test/unit/test-preconnect.js index e78706e447fb..9c764ea78481 100644 --- a/test/unit/test-preconnect.js +++ b/test/unit/test-preconnect.js @@ -16,7 +16,7 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import {Services} from '#service'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import { installPreconnectService, preconnectToOrigin, diff --git a/test/unit/test-render-delaying-services.js b/test/unit/test-render-delaying-services.js index ef9fc7fba567..08b21be88ee5 100644 --- a/test/unit/test-render-delaying-services.js +++ b/test/unit/test-render-delaying-services.js @@ -16,12 +16,12 @@ import * as fakeTimers from '@sinonjs/fake-timers'; import * as service from '../../src/service-helpers'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import { hasRenderDelayingServices, waitForServices, } from '../../src/render-delaying-services'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.sandboxed('waitForServices', {}, (env) => { let win; diff --git a/test/unit/test-scheduler.js b/test/unit/test-scheduler.js index 1fedbc28a6ed..a4d3c52e72d1 100644 --- a/test/unit/test-scheduler.js +++ b/test/unit/test-scheduler.js @@ -19,7 +19,7 @@ import {LayoutPriority} from '#core/dom/layout'; import {READY_SCAN_SIGNAL} from '#service/resources-interface'; import {Scheduler} from '#service/scheduler'; import {createElementWithAttributes} from '#core/dom'; -import {installIntersectionObserverStub} from '../../testing/intersection-observer-stub'; +import {installIntersectionObserverStub} from '#testing/intersection-observer-stub'; describes.realWin('Scheduler', {amp: true}, (env) => { let win, doc, ampdoc; diff --git a/test/unit/test-standard-actions.js b/test/unit/test-standard-actions.js index 5f9acef7390a..d146d95ccd00 100644 --- a/test/unit/test-standard-actions.js +++ b/test/unit/test-standard-actions.js @@ -24,7 +24,7 @@ import { import {cidServiceForDocForTesting} from '#service/cid-impl'; import {htmlFor} from '#core/dom/static-template'; import {installHistoryServiceForDoc} from '#service/history-impl'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; import {toggle} from '#core/dom/style'; import {user} from '../../src/log'; diff --git a/test/unit/test-style-installer.js b/test/unit/test-style-installer.js index ccd5ca1d9c61..9ea25dfd925b 100644 --- a/test/unit/test-style-installer.js +++ b/test/unit/test-style-installer.js @@ -22,7 +22,7 @@ import {createShadowRoot} from '../../src/shadow-embed'; import {getStyle} from '#core/dom/style'; import {installPerformanceService} from '#service/performance-impl'; import {installPlatformService} from '#service/platform-impl'; -import {isAnimationNone} from '../../testing/test-helper'; +import {isAnimationNone} from '#testing/test-helper'; import {setShadowDomSupportedVersionForTesting} from '#core/dom/web-components'; describes.sandboxed('Styles', {}, () => { diff --git a/test/unit/test-url-replacements.js b/test/unit/test-url-replacements.js index 8fa6c338c794..5d49b918a673 100644 --- a/test/unit/test-url-replacements.js +++ b/test/unit/test-url-replacements.js @@ -24,15 +24,12 @@ import { markElementScheduledForTesting, resetScheduledElementForTesting, } from '#service/custom-element-registry'; -import { - mockWindowInterface, - stubServiceForDoc, -} from '../../testing/test-helper'; +import {mockWindowInterface, stubServiceForDoc} from '#testing/test-helper'; import {Observable} from '#core/data-structures/observable'; import {Services} from '#service'; import {cidServiceForDocForTesting} from '#service/cid-impl'; -import {createIframePromise} from '../../testing/iframe'; +import {createIframePromise} from '#testing/iframe'; import {installActivityServiceForTesting} from '../../extensions/amp-analytics/0.1/activity-impl'; import {installCryptoService} from '#service/crypto-impl'; import {installDocService} from '#service/ampdoc-impl'; diff --git a/test/unit/test-viewer-cid-api.js b/test/unit/test-viewer-cid-api.js index c78e6012b0af..0139db6e650e 100644 --- a/test/unit/test-viewer-cid-api.js +++ b/test/unit/test-viewer-cid-api.js @@ -16,7 +16,7 @@ import {ViewerCidApi} from '#service/viewer-cid-api'; import {dict} from '#core/types/object'; -import {mockServiceForDoc} from '../../testing/test-helper'; +import {mockServiceForDoc} from '#testing/test-helper'; describes.realWin('viewerCidApi', {amp: true}, (env) => { let ampdoc; diff --git a/test/unit/test-yield.js b/test/unit/test-yield.js index 4d3207e26944..94b4d0984891 100644 --- a/test/unit/test-yield.js +++ b/test/unit/test-yield.js @@ -14,7 +14,7 @@ * limitations under the License. */ import * as fakeTimers from '@sinonjs/fake-timers'; -import {macroTask} from '../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin('yield', {}, (env) => { let win; diff --git a/test/unit/url-expander/test-expander.js b/test/unit/url-expander/test-expander.js index e195f2ce8e6d..e0f591bd73fd 100644 --- a/test/unit/url-expander/test-expander.js +++ b/test/unit/url-expander/test-expander.js @@ -16,7 +16,7 @@ import {Expander} from '#service/url-expander/expander'; import {GlobalVariableSource} from '#service/url-replacements-impl'; -import {macroTask} from '../../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.realWin( 'Expander', diff --git a/test/unit/utils/test-dom-transform-stream.js b/test/unit/utils/test-dom-transform-stream.js index 88fb5752a867..6ceee571e481 100644 --- a/test/unit/utils/test-dom-transform-stream.js +++ b/test/unit/utils/test-dom-transform-stream.js @@ -15,7 +15,7 @@ */ import {DomTransformStream} from '../../../src/utils/dom-tranform-stream'; -import {macroTask} from '../../../testing/yield'; +import {macroTask} from '#testing/yield'; describes.fakeWin('DomTransformStream', {amp: true}, (env) => { async function flush() { diff --git a/jsconfig.json b/tsconfig.json similarity index 77% rename from jsconfig.json rename to tsconfig.json index 2f0b236560cb..1e57e2789a8d 100644 --- a/jsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "allowJs": true, "baseUrl": ".", "paths": { "#3p/*": ["./3p/*"], @@ -13,7 +14,10 @@ "#polyfills/*": ["./src/polyfills/*"], "#preact/*": ["./src/preact/*"], "#purifier/*": ["./src/purifier/*"], - "#service/*": ["./src/service/*"] + "#service/*": ["./src/service/*"], + + "#test/*": ["./test/*"], + "#testing/*": ["./testing/*"] } } } diff --git a/validator/build.py b/validator/build.py index 07a5fb449e50..69b0884613dc 100755 --- a/validator/build.py +++ b/validator/build.py @@ -286,7 +286,8 @@ def CompileWithClosure(js_files, definitions, entry_points, output_file): """ cmd = [ - 'java', '-jar', '../node_modules/@ampproject/google-closure-compiler-java/compiler.jar', + 'java', '-jar', + '../node_modules/@ampproject/google-closure-compiler-java/compiler.jar', '--language_out=ES5_STRICT', '--dependency_mode=PRUNE', '--js_output_file=%s' % output_file ] diff --git a/validator/js/engine/htmlparser-interface.js b/validator/js/engine/htmlparser-interface.js index 94c66e66c1d0..84ca7b047cd1 100644 --- a/validator/js/engine/htmlparser-interface.js +++ b/validator/js/engine/htmlparser-interface.js @@ -16,7 +16,7 @@ */ goog.module('amp.htmlparser.interface'); -const googArray = goog.require('goog.array'); + /** * @param {string} str The string to lower case. @@ -110,7 +110,7 @@ const ParsedHtmlTag = class { this.attrs_.push(attr); } // Sort the attribute array by (lower case) name. - googArray.sort(this.attrs_, function(a, b) { + this.attrs_.sort(function(a, b) { if (a.name > b.name) { return 1; } diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 07d0a9362c58..77637f8e914c 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -5112,100 +5112,101 @@ error_specificity { code: WARNING_EXTENSION_DEPRECATED_VERSION specificity: 17 } error_specificity { code: NON_LTS_SCRIPT_AFTER_LTS specificity: 18 } error_specificity { code: LTS_SCRIPT_AFTER_NON_LTS specificity: 19 } error_specificity { code: INCORRECT_SCRIPT_RELEASE_VERSION specificity: 20 } -error_specificity { code: DISALLOWED_TAG specificity: 21 } -error_specificity { code: DISALLOWED_ATTR specificity: 22 } -error_specificity { code: INVALID_ATTR_VALUE specificity: 23 } -error_specificity { code: DUPLICATE_ATTRIBUTE specificity: 24 } -error_specificity { code: ATTR_VALUE_REQUIRED_BY_LAYOUT specificity: 25 } -error_specificity { code: MANDATORY_ATTR_MISSING specificity: 26 } -error_specificity { code: MANDATORY_ONEOF_ATTR_MISSING specificity: 27 } -error_specificity { code: MANDATORY_ANYOF_ATTR_MISSING specificity: 28 } -error_specificity { code: ATTR_REQUIRED_BUT_MISSING specificity: 29 } -error_specificity { code: DUPLICATE_UNIQUE_TAG specificity: 30 } -error_specificity { code: DUPLICATE_UNIQUE_TAG_WARNING specificity: 31 } -error_specificity { code: STYLESHEET_TOO_LONG specificity: 32 } -error_specificity { code: STYLESHEET_AND_INLINE_STYLE_TOO_LONG specificity: 33 } -error_specificity { code: INLINE_STYLE_TOO_LONG specificity: 34 } -error_specificity { code: INLINE_SCRIPT_TOO_LONG specificity: 35 } -error_specificity { code: CSS_SYNTAX_INVALID_AT_RULE specificity: 36 } +error_specificity { code: DISALLOWED_AMP_DOMAIN specificity: 21 } +error_specificity { code: DISALLOWED_TAG specificity: 22 } +error_specificity { code: DISALLOWED_ATTR specificity: 23 } +error_specificity { code: INVALID_ATTR_VALUE specificity: 24 } +error_specificity { code: DUPLICATE_ATTRIBUTE specificity: 25 } +error_specificity { code: ATTR_VALUE_REQUIRED_BY_LAYOUT specificity: 26 } +error_specificity { code: MANDATORY_ATTR_MISSING specificity: 27 } +error_specificity { code: MANDATORY_ONEOF_ATTR_MISSING specificity: 28 } +error_specificity { code: MANDATORY_ANYOF_ATTR_MISSING specificity: 29 } +error_specificity { code: ATTR_REQUIRED_BUT_MISSING specificity: 30 } +error_specificity { code: DUPLICATE_UNIQUE_TAG specificity: 31 } +error_specificity { code: DUPLICATE_UNIQUE_TAG_WARNING specificity: 32 } +error_specificity { code: STYLESHEET_TOO_LONG specificity: 33 } +error_specificity { code: STYLESHEET_AND_INLINE_STYLE_TOO_LONG specificity: 34 } +error_specificity { code: INLINE_STYLE_TOO_LONG specificity: 35 } +error_specificity { code: INLINE_SCRIPT_TOO_LONG specificity: 36 } +error_specificity { code: CSS_SYNTAX_INVALID_AT_RULE specificity: 37 } error_specificity { - code: MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE specificity: 37 -} -error_specificity { code: INVALID_PROPERTY_VALUE_IN_ATTR_VALUE specificity: 38 } -error_specificity { code: DISALLOWED_PROPERTY_IN_ATTR_VALUE specificity: 39 } -error_specificity { code: MUTUALLY_EXCLUSIVE_ATTRS specificity: 40 } -error_specificity { code: UNESCAPED_TEMPLATE_IN_ATTR_VALUE specificity: 41 } -error_specificity { code: TEMPLATE_PARTIAL_IN_ATTR_VALUE specificity: 42 } -error_specificity { code: TEMPLATE_IN_ATTR_NAME specificity: 43 } + code: MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE specificity: 38 +} +error_specificity { code: INVALID_PROPERTY_VALUE_IN_ATTR_VALUE specificity: 39 } +error_specificity { code: DISALLOWED_PROPERTY_IN_ATTR_VALUE specificity: 40 } +error_specificity { code: MUTUALLY_EXCLUSIVE_ATTRS specificity: 41 } +error_specificity { code: UNESCAPED_TEMPLATE_IN_ATTR_VALUE specificity: 42 } +error_specificity { code: TEMPLATE_PARTIAL_IN_ATTR_VALUE specificity: 43 } +error_specificity { code: TEMPLATE_IN_ATTR_NAME specificity: 44 } error_specificity { - code: INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT specificity: 44 -} -error_specificity { code: MISSING_LAYOUT_ATTRIBUTES specificity: 45 } -error_specificity { code: IMPLIED_LAYOUT_INVALID specificity: 46 } -error_specificity { code: SPECIFIED_LAYOUT_INVALID specificity: 47 } -error_specificity { code: ATTR_DISALLOWED_BY_IMPLIED_LAYOUT specificity: 48 } -error_specificity { code: ATTR_DISALLOWED_BY_SPECIFIED_LAYOUT specificity: 49 } -error_specificity { code: DUPLICATE_DIMENSION specificity: 50 } -error_specificity { code: DISALLOWED_RELATIVE_URL specificity: 51 } -error_specificity { code: MISSING_URL specificity: 52 } -error_specificity { code: DISALLOWED_DOMAIN specificity: 53 } -error_specificity { code: INVALID_URL_PROTOCOL specificity: 54 } -error_specificity { code: INVALID_URL specificity: 55 } -error_specificity { code: DISALLOWED_STYLE_ATTR specificity: 56 } -error_specificity { code: CSS_SYNTAX_STRAY_TRAILING_BACKSLASH specificity: 57 } -error_specificity { code: CSS_SYNTAX_UNTERMINATED_COMMENT specificity: 58 } -error_specificity { code: CSS_SYNTAX_UNTERMINATED_STRING specificity: 59 } -error_specificity { code: CSS_SYNTAX_BAD_URL specificity: 60 } + code: INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT specificity: 45 +} +error_specificity { code: MISSING_LAYOUT_ATTRIBUTES specificity: 46 } +error_specificity { code: IMPLIED_LAYOUT_INVALID specificity: 47 } +error_specificity { code: SPECIFIED_LAYOUT_INVALID specificity: 48 } +error_specificity { code: ATTR_DISALLOWED_BY_IMPLIED_LAYOUT specificity: 49 } +error_specificity { code: ATTR_DISALLOWED_BY_SPECIFIED_LAYOUT specificity: 50 } +error_specificity { code: DUPLICATE_DIMENSION specificity: 51 } +error_specificity { code: DISALLOWED_RELATIVE_URL specificity: 52 } +error_specificity { code: MISSING_URL specificity: 53 } +error_specificity { code: DISALLOWED_DOMAIN specificity: 54 } +error_specificity { code: INVALID_URL_PROTOCOL specificity: 55 } +error_specificity { code: INVALID_URL specificity: 56 } +error_specificity { code: DISALLOWED_STYLE_ATTR specificity: 57 } +error_specificity { code: CSS_SYNTAX_STRAY_TRAILING_BACKSLASH specificity: 58 } +error_specificity { code: CSS_SYNTAX_UNTERMINATED_COMMENT specificity: 59 } +error_specificity { code: CSS_SYNTAX_UNTERMINATED_STRING specificity: 60 } +error_specificity { code: CSS_SYNTAX_BAD_URL specificity: 61 } error_specificity { - code: CSS_SYNTAX_EOF_IN_PRELUDE_OF_QUALIFIED_RULE specificity: 61 + code: CSS_SYNTAX_EOF_IN_PRELUDE_OF_QUALIFIED_RULE specificity: 62 } -error_specificity { code: CSS_SYNTAX_INVALID_DECLARATION specificity: 62 } -error_specificity { code: CSS_SYNTAX_INCOMPLETE_DECLARATION specificity: 63 } -error_specificity { code: CSS_SYNTAX_ERROR_IN_PSEUDO_SELECTOR specificity: 64 } -error_specificity { code: CSS_SYNTAX_MISSING_SELECTOR specificity: 65 } -error_specificity { code: CSS_SYNTAX_NOT_A_SELECTOR_START specificity: 66 } +error_specificity { code: CSS_SYNTAX_INVALID_DECLARATION specificity: 63 } +error_specificity { code: CSS_SYNTAX_INCOMPLETE_DECLARATION specificity: 64 } +error_specificity { code: CSS_SYNTAX_ERROR_IN_PSEUDO_SELECTOR specificity: 65 } +error_specificity { code: CSS_SYNTAX_MISSING_SELECTOR specificity: 66 } +error_specificity { code: CSS_SYNTAX_NOT_A_SELECTOR_START specificity: 67 } error_specificity { - code: CSS_SYNTAX_UNPARSED_INPUT_REMAINS_IN_SELECTOR specificity: 67 -} -error_specificity { code: CSS_SYNTAX_MISSING_URL specificity: 68 } -error_specificity { code: CSS_SYNTAX_DISALLOWED_DOMAIN specificity: 69 } -error_specificity { code: CSS_SYNTAX_INVALID_URL specificity: 70 } -error_specificity { code: CSS_SYNTAX_INVALID_URL_PROTOCOL specificity: 71 } -error_specificity { code: CSS_SYNTAX_DISALLOWED_RELATIVE_URL specificity: 72 } -error_specificity { code: INCORRECT_NUM_CHILD_TAGS specificity: 73 } -error_specificity { code: DISALLOWED_CHILD_TAG_NAME specificity: 74 } -error_specificity { code: DISALLOWED_FIRST_CHILD_TAG_NAME specificity: 75 } -error_specificity { code: CSS_SYNTAX_INVALID_ATTR_SELECTOR specificity: 76 } + code: CSS_SYNTAX_UNPARSED_INPUT_REMAINS_IN_SELECTOR specificity: 68 +} +error_specificity { code: CSS_SYNTAX_MISSING_URL specificity: 69 } +error_specificity { code: CSS_SYNTAX_DISALLOWED_DOMAIN specificity: 70 } +error_specificity { code: CSS_SYNTAX_INVALID_URL specificity: 71 } +error_specificity { code: CSS_SYNTAX_INVALID_URL_PROTOCOL specificity: 72 } +error_specificity { code: CSS_SYNTAX_DISALLOWED_RELATIVE_URL specificity: 73 } +error_specificity { code: INCORRECT_NUM_CHILD_TAGS specificity: 74 } +error_specificity { code: DISALLOWED_CHILD_TAG_NAME specificity: 75 } +error_specificity { code: DISALLOWED_FIRST_CHILD_TAG_NAME specificity: 76 } +error_specificity { code: CSS_SYNTAX_INVALID_ATTR_SELECTOR specificity: 77 } error_specificity { - code: CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT specificity: 77 + code: CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT specificity: 78 } -error_specificity { code: MANDATORY_REFERENCE_POINT_MISSING specificity: 78 } -error_specificity { code: DUPLICATE_REFERENCE_POINT specificity: 79 } -error_specificity { code: TAG_REFERENCE_POINT_CONFLICT specificity: 80 } +error_specificity { code: MANDATORY_REFERENCE_POINT_MISSING specificity: 79 } +error_specificity { code: DUPLICATE_REFERENCE_POINT specificity: 80 } +error_specificity { code: TAG_REFERENCE_POINT_CONFLICT specificity: 81 } error_specificity { code: CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT_SINGULAR - specificity: 81 + specificity: 82 } -error_specificity { code: CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE specificity: 82 } +error_specificity { code: CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE specificity: 83 } error_specificity { code: CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE_WITH_HINT - specificity: 83 + specificity: 84 } error_specificity { code: CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE - specificity: 84 + specificity: 85 } error_specificity { code: CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH - specificity: 85 + specificity: 86 } error_specificity { code: CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION - specificity: 86 + specificity: 87 } error_specificity { code: BASE_TAG_MUST_PRECEED_ALL_URLS - specificity: 87 + specificity: 88 } error_specificity { code: DISALLOWED_SCRIPT_TAG specificity: 102 } error_specificity { code: GENERAL_DISALLOWED_TAG specificity: 103 } @@ -5339,6 +5340,10 @@ error_formats { format: "The script version for '%1' is a %2 version which mismatches " "with the first script on the page using the %3 version." } +error_formats { + code: DISALLOWED_AMP_DOMAIN + format: "The script tag includes an invalid AMP domain in the src attribute." +} error_formats { code: NON_LTS_SCRIPT_AFTER_LTS format: "'%1' must use the LTS version to correspond with the first script " diff --git a/validator/validator.pb.go b/validator/validator.pb.go index a6a754f95246..5ef223d3ea15 100644 --- a/validator/validator.pb.go +++ b/validator/validator.pb.go @@ -16,8 +16,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.16.0 +// protoc-gen-go v1.25.0-devel +// protoc v3.12.4 // source: validator.proto // Package defines Validator protobuffers. This is a package comment required by @@ -29,6 +29,7 @@ package amp_validator import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -42,6 +43,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // These two fields specify that values from one AttrSpec refer to values from // another AttrSpec elsewhere on the page; validator will verify the // references are not "dangling". These references may appear before or after @@ -707,7 +712,7 @@ func (ValidationError_Severity) EnumDescriptor() ([]byte, []int) { return file_validator_proto_rawDescGZIP(), []int{26, 0} } -// NEXT AVAILABLE TAG: 121 +// NEXT AVAILABLE TAG: 122 type ValidationError_Code int32 const ( @@ -723,6 +728,7 @@ const ( ValidationError_NON_LTS_SCRIPT_AFTER_LTS ValidationError_Code = 112 ValidationError_LTS_SCRIPT_AFTER_NON_LTS ValidationError_Code = 113 ValidationError_INCORRECT_SCRIPT_RELEASE_VERSION ValidationError_Code = 119 + ValidationError_DISALLOWED_AMP_DOMAIN ValidationError_Code = 121 ValidationError_ATTR_REQUIRED_BUT_MISSING ValidationError_Code = 61 ValidationError_DISALLOWED_TAG ValidationError_Code = 2 ValidationError_GENERAL_DISALLOWED_TAG ValidationError_Code = 51 @@ -846,6 +852,7 @@ var ( 112: "NON_LTS_SCRIPT_AFTER_LTS", 113: "LTS_SCRIPT_AFTER_NON_LTS", 119: "INCORRECT_SCRIPT_RELEASE_VERSION", + 121: "DISALLOWED_AMP_DOMAIN", 61: "ATTR_REQUIRED_BUT_MISSING", 2: "DISALLOWED_TAG", 51: "GENERAL_DISALLOWED_TAG", @@ -964,6 +971,7 @@ var ( "NON_LTS_SCRIPT_AFTER_LTS": 112, "LTS_SCRIPT_AFTER_NON_LTS": 113, "INCORRECT_SCRIPT_RELEASE_VERSION": 119, + "DISALLOWED_AMP_DOMAIN": 121, "ATTR_REQUIRED_BUT_MISSING": 61, "DISALLOWED_TAG": 2, "GENERAL_DISALLOWED_TAG": 51, @@ -4927,7 +4935,7 @@ var file_validator_proto_rawDesc = []byte{ 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x24, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x13, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x22, 0x8b, 0x22, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x4e, 0x10, 0x00, 0x22, 0xa6, 0x22, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x4a, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, @@ -4953,7 +4961,7 @@ var file_validator_proto_rawDesc = []byte{ 0x6c, 0x75, 0x65, 0x22, 0x38, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x22, 0xe1, 0x1e, + 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x22, 0xfc, 0x1e, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x54, 0x4d, 0x4c, @@ -4976,297 +4984,298 @@ var file_validator_proto_rawDesc = []byte{ 0x50, 0x54, 0x5f, 0x41, 0x46, 0x54, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x4c, 0x54, 0x53, 0x10, 0x71, 0x12, 0x24, 0x0a, 0x20, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x5f, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x5f, 0x56, - 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x77, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x54, 0x54, 0x52, - 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x4d, 0x49, - 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x3d, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x49, 0x53, 0x41, 0x4c, - 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x47, - 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, - 0x44, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x33, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x53, 0x41, 0x4c, - 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x5f, 0x54, 0x41, 0x47, - 0x10, 0x58, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, - 0x5f, 0x41, 0x54, 0x54, 0x52, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x53, 0x41, 0x4c, - 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x52, - 0x10, 0x51, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x54, - 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x55, - 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, - 0x45, 0x10, 0x5e, 0x12, 0x21, 0x0a, 0x1d, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, - 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x4c, 0x41, - 0x59, 0x4f, 0x55, 0x54, 0x10, 0x1b, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, - 0x47, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, - 0x54, 0x45, 0x53, 0x10, 0x69, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, - 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, - 0x16, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x4c, - 0x41, 0x59, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x1a, 0x12, - 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x54, 0x54, - 0x52, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x20, 0x0a, 0x1c, 0x4d, - 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x5f, 0x41, - 0x54, 0x54, 0x52, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x1c, 0x12, 0x20, 0x0a, - 0x1c, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x4e, 0x59, 0x4f, 0x46, - 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x68, 0x12, - 0x17, 0x0a, 0x13, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x49, 0x4d, - 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x3c, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x55, 0x50, 0x4c, - 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x54, 0x41, 0x47, - 0x10, 0x06, 0x12, 0x20, 0x0a, 0x1c, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, - 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, - 0x4e, 0x47, 0x10, 0x4d, 0x12, 0x14, 0x0a, 0x10, 0x57, 0x52, 0x4f, 0x4e, 0x47, 0x5f, 0x50, 0x41, - 0x52, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, - 0x59, 0x4c, 0x45, 0x53, 0x48, 0x45, 0x45, 0x54, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, - 0x47, 0x10, 0x32, 0x12, 0x28, 0x0a, 0x24, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x53, 0x48, 0x45, 0x45, - 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x59, - 0x4c, 0x45, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x10, 0x66, 0x12, 0x19, 0x0a, - 0x15, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x54, 0x4f, - 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x10, 0x67, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x4c, 0x49, - 0x4e, 0x45, 0x5f, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, - 0x4e, 0x47, 0x10, 0x76, 0x12, 0x28, 0x0a, 0x24, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, - 0x59, 0x5f, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, - 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x10, 0x09, 0x12, 0x1b, - 0x0a, 0x17, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x56, 0x49, 0x4f, 0x4c, 0x41, 0x54, 0x45, 0x53, - 0x5f, 0x44, 0x45, 0x4e, 0x59, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x1e, 0x12, 0x24, 0x0a, 0x20, 0x4e, - 0x4f, 0x4e, 0x5f, 0x57, 0x48, 0x49, 0x54, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x43, 0x44, - 0x41, 0x54, 0x41, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x45, 0x44, 0x10, - 0x52, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4a, 0x53, 0x4f, - 0x4e, 0x5f, 0x43, 0x44, 0x41, 0x54, 0x41, 0x10, 0x6a, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x45, 0x50, - 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x10, 0x0b, 0x12, 0x12, - 0x0a, 0x0e, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x54, 0x41, 0x47, - 0x10, 0x0c, 0x12, 0x2e, 0x0a, 0x2a, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, - 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, - 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, - 0x10, 0x0e, 0x12, 0x28, 0x0a, 0x24, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x52, - 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x49, 0x4e, 0x5f, - 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0f, 0x12, 0x0f, 0x0a, 0x0b, - 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x23, 0x12, 0x0f, 0x0a, - 0x0b, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x24, 0x12, 0x18, - 0x0a, 0x14, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x5f, 0x50, 0x52, - 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x10, 0x25, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x53, 0x41, - 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x3e, 0x12, - 0x1b, 0x0a, 0x17, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x52, 0x45, - 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x31, 0x12, 0x25, 0x0a, 0x21, - 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, - 0x52, 0x54, 0x59, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, - 0x45, 0x10, 0x10, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x55, 0x54, 0x55, 0x41, 0x4c, 0x4c, 0x59, 0x5f, - 0x45, 0x58, 0x43, 0x4c, 0x55, 0x53, 0x49, 0x56, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x53, 0x10, - 0x11, 0x12, 0x24, 0x0a, 0x20, 0x55, 0x4e, 0x45, 0x53, 0x43, 0x41, 0x50, 0x45, 0x44, 0x5f, 0x54, - 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, - 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x12, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x45, 0x4d, 0x50, 0x4c, - 0x41, 0x54, 0x45, 0x5f, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x49, 0x4e, 0x5f, 0x41, - 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x13, 0x12, 0x19, 0x0a, 0x15, 0x54, - 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, - 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x14, 0x12, 0x2b, 0x0a, 0x27, 0x49, 0x4e, 0x43, 0x4f, 0x4e, 0x53, - 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x53, 0x5f, 0x46, 0x4f, 0x52, - 0x5f, 0x57, 0x49, 0x44, 0x54, 0x48, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x48, 0x45, 0x49, 0x47, 0x48, - 0x54, 0x10, 0x15, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, - 0x44, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x41, 0x4e, 0x43, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x10, 0x17, - 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x4c, 0x41, - 0x53, 0x54, 0x5f, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x59, 0x12, 0x1a, - 0x0a, 0x16, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x54, 0x41, 0x47, 0x5f, - 0x41, 0x4e, 0x43, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x10, 0x1f, 0x12, 0x24, 0x0a, 0x20, 0x4d, 0x41, - 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x41, 0x4e, 0x43, 0x45, - 0x53, 0x54, 0x4f, 0x52, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x48, 0x49, 0x4e, 0x54, 0x10, 0x20, - 0x12, 0x25, 0x0a, 0x21, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, - 0x57, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x5f, 0x4c, - 0x41, 0x59, 0x4f, 0x55, 0x54, 0x10, 0x21, 0x12, 0x27, 0x0a, 0x23, 0x41, 0x54, 0x54, 0x52, 0x5f, - 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x10, 0x22, - 0x12, 0x1c, 0x0a, 0x18, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x55, - 0x4d, 0x5f, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x10, 0x38, 0x12, 0x20, - 0x0a, 0x1c, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x49, 0x4e, 0x5f, - 0x4e, 0x55, 0x4d, 0x5f, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x10, 0x55, - 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x43, - 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x39, 0x12, - 0x23, 0x0a, 0x1f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x46, 0x49, - 0x52, 0x53, 0x54, 0x5f, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x4e, 0x41, - 0x4d, 0x45, 0x10, 0x3a, 0x12, 0x20, 0x0a, 0x1c, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, - 0x45, 0x44, 0x5f, 0x4d, 0x41, 0x4e, 0x55, 0x46, 0x41, 0x43, 0x54, 0x55, 0x52, 0x45, 0x44, 0x5f, - 0x42, 0x4f, 0x44, 0x59, 0x10, 0x40, 0x12, 0x2e, 0x0a, 0x2a, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, - 0x54, 0x41, 0x47, 0x5f, 0x44, 0x4f, 0x45, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x41, 0x54, - 0x49, 0x53, 0x46, 0x59, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, - 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x42, 0x12, 0x25, 0x0a, 0x21, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, - 0x4f, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, - 0x49, 0x4e, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x43, 0x12, 0x1d, 0x0a, - 0x19, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, - 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x44, 0x12, 0x24, 0x0a, 0x20, - 0x54, 0x41, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, - 0x54, 0x4f, 0x5f, 0x48, 0x41, 0x56, 0x45, 0x5f, 0x53, 0x49, 0x42, 0x4c, 0x49, 0x4e, 0x47, 0x53, - 0x10, 0x57, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x41, 0x47, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, - 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x4c, 0x49, - 0x43, 0x54, 0x10, 0x45, 0x12, 0x37, 0x0a, 0x33, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, - 0x47, 0x5f, 0x44, 0x4f, 0x45, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x41, 0x54, 0x49, 0x53, - 0x46, 0x59, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, 0x49, - 0x4e, 0x54, 0x5f, 0x53, 0x49, 0x4e, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x46, 0x12, 0x22, 0x0a, - 0x1e, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x4d, 0x55, 0x53, 0x54, 0x5f, 0x50, - 0x52, 0x45, 0x43, 0x45, 0x45, 0x44, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x55, 0x52, 0x4c, 0x53, 0x10, - 0x4e, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x52, 0x45, 0x51, + 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x77, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x53, 0x41, + 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x41, 0x4d, 0x50, 0x5f, 0x44, 0x4f, 0x4d, 0x41, 0x49, + 0x4e, 0x10, 0x79, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x52, 0x45, 0x51, 0x55, + 0x49, 0x52, 0x45, 0x44, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, + 0x10, 0x3d, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, + 0x5f, 0x54, 0x41, 0x47, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, + 0x4c, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x41, 0x47, + 0x10, 0x33, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, + 0x5f, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x58, 0x12, 0x13, 0x0a, + 0x0f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, + 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, + 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x10, 0x51, 0x12, 0x16, 0x0a, + 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, + 0x4c, 0x55, 0x45, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x10, 0x5e, 0x12, 0x21, + 0x0a, 0x1d, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x52, 0x45, 0x51, + 0x55, 0x49, 0x52, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x10, + 0x1b, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x41, 0x59, + 0x4f, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x53, 0x10, 0x69, + 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x5f, 0x4c, 0x41, 0x59, 0x4f, + 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x16, 0x12, 0x1c, 0x0a, 0x18, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, + 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x1a, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, + 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4d, 0x49, 0x53, + 0x53, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, + 0x4f, 0x52, 0x59, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x1c, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x41, 0x4e, 0x44, + 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x4e, 0x59, 0x4f, 0x46, 0x5f, 0x41, 0x54, 0x54, 0x52, + 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x68, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x55, + 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x49, 0x4d, 0x45, 0x4e, 0x53, 0x49, 0x4f, + 0x4e, 0x10, 0x3c, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x5f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x06, 0x12, 0x20, 0x0a, + 0x1c, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x51, 0x55, + 0x45, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x4d, 0x12, + 0x14, 0x0a, 0x10, 0x57, 0x52, 0x4f, 0x4e, 0x47, 0x5f, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x5f, + 0x54, 0x41, 0x47, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x53, 0x48, + 0x45, 0x45, 0x54, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x10, 0x32, 0x12, 0x28, + 0x0a, 0x24, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x53, 0x48, 0x45, 0x45, 0x54, 0x5f, 0x41, 0x4e, 0x44, + 0x5f, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x54, 0x4f, + 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x10, 0x66, 0x12, 0x19, 0x0a, 0x15, 0x49, 0x4e, 0x4c, 0x49, + 0x4e, 0x45, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, + 0x47, 0x10, 0x67, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x43, + 0x52, 0x49, 0x50, 0x54, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x10, 0x76, 0x12, + 0x28, 0x0a, 0x24, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x43, 0x44, 0x41, + 0x54, 0x41, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x4f, 0x52, 0x5f, 0x49, 0x4e, + 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x10, 0x09, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x44, 0x41, + 0x54, 0x41, 0x5f, 0x56, 0x49, 0x4f, 0x4c, 0x41, 0x54, 0x45, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x59, + 0x4c, 0x49, 0x53, 0x54, 0x10, 0x1e, 0x12, 0x24, 0x0a, 0x20, 0x4e, 0x4f, 0x4e, 0x5f, 0x57, 0x48, + 0x49, 0x54, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x45, + 0x4e, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x45, 0x44, 0x10, 0x52, 0x12, 0x16, 0x0a, 0x12, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x43, 0x44, 0x41, + 0x54, 0x41, 0x10, 0x6a, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, + 0x45, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x10, 0x0b, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x45, 0x50, + 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x0c, 0x12, 0x2e, 0x0a, + 0x2a, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, + 0x52, 0x54, 0x59, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x46, 0x52, 0x4f, 0x4d, + 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0e, 0x12, 0x28, 0x0a, + 0x24, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, + 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, + 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x0f, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x49, 0x53, 0x53, 0x49, + 0x4e, 0x47, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x23, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x24, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, + 0x4c, 0x10, 0x25, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, + 0x44, 0x5f, 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x3e, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x49, + 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x56, + 0x45, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x31, 0x12, 0x25, 0x0a, 0x21, 0x44, 0x49, 0x53, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x49, + 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x10, 0x12, 0x1c, + 0x0a, 0x18, 0x4d, 0x55, 0x54, 0x55, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x45, 0x58, 0x43, 0x4c, 0x55, + 0x53, 0x49, 0x56, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x53, 0x10, 0x11, 0x12, 0x24, 0x0a, 0x20, + 0x55, 0x4e, 0x45, 0x53, 0x43, 0x41, 0x50, 0x45, 0x44, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, + 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, + 0x10, 0x12, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x5f, 0x50, + 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x56, + 0x41, 0x4c, 0x55, 0x45, 0x10, 0x13, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, + 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, + 0x14, 0x12, 0x2b, 0x0a, 0x27, 0x49, 0x4e, 0x43, 0x4f, 0x4e, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, + 0x54, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x53, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x57, 0x49, 0x44, 0x54, + 0x48, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x48, 0x45, 0x49, 0x47, 0x48, 0x54, 0x10, 0x15, 0x12, 0x1b, + 0x0a, 0x17, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x41, 0x47, + 0x5f, 0x41, 0x4e, 0x43, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x10, 0x17, 0x12, 0x1c, 0x0a, 0x18, 0x4d, + 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x5f, 0x43, 0x48, + 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x59, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x4e, + 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x41, 0x4e, 0x43, 0x45, 0x53, + 0x54, 0x4f, 0x52, 0x10, 0x1f, 0x12, 0x24, 0x0a, 0x20, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, + 0x52, 0x59, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x41, 0x4e, 0x43, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x5f, + 0x57, 0x49, 0x54, 0x48, 0x5f, 0x48, 0x49, 0x4e, 0x54, 0x10, 0x20, 0x12, 0x25, 0x0a, 0x21, 0x41, + 0x54, 0x54, 0x52, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x42, + 0x59, 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, + 0x10, 0x21, 0x12, 0x27, 0x0a, 0x23, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x10, 0x22, 0x12, 0x1c, 0x0a, 0x18, 0x49, + 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x55, 0x4d, 0x5f, 0x43, 0x48, 0x49, + 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x10, 0x38, 0x12, 0x20, 0x0a, 0x1c, 0x49, 0x4e, 0x43, + 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x49, 0x4e, 0x5f, 0x4e, 0x55, 0x4d, 0x5f, 0x43, + 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x10, 0x55, 0x12, 0x1d, 0x0a, 0x19, 0x44, + 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, + 0x54, 0x41, 0x47, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x39, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x49, + 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x5f, 0x43, + 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x3a, 0x12, + 0x20, 0x0a, 0x1c, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x4d, 0x41, + 0x4e, 0x55, 0x46, 0x41, 0x43, 0x54, 0x55, 0x52, 0x45, 0x44, 0x5f, 0x42, 0x4f, 0x44, 0x59, 0x10, + 0x40, 0x12, 0x2e, 0x0a, 0x2a, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x44, + 0x4f, 0x45, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x41, 0x54, 0x49, 0x53, 0x46, 0x59, 0x5f, + 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, + 0x42, 0x12, 0x25, 0x0a, 0x21, 0x4d, 0x41, 0x4e, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x52, + 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x5f, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x43, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x55, 0x50, 0x4c, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, + 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x44, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x41, 0x47, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x4f, 0x5f, 0x48, 0x41, + 0x56, 0x45, 0x5f, 0x53, 0x49, 0x42, 0x4c, 0x49, 0x4e, 0x47, 0x53, 0x10, 0x57, 0x12, 0x20, 0x0a, + 0x1c, 0x54, 0x41, 0x47, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, + 0x4f, 0x49, 0x4e, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x4c, 0x49, 0x43, 0x54, 0x10, 0x45, 0x12, + 0x37, 0x0a, 0x33, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x44, 0x4f, 0x45, + 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x41, 0x54, 0x49, 0x53, 0x46, 0x59, 0x5f, 0x52, 0x45, + 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x5f, 0x53, 0x49, + 0x4e, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x46, 0x12, 0x22, 0x0a, 0x1e, 0x42, 0x41, 0x53, 0x45, + 0x5f, 0x54, 0x41, 0x47, 0x5f, 0x4d, 0x55, 0x53, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x45, 0x45, + 0x44, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x55, 0x52, 0x4c, 0x53, 0x10, 0x4e, 0x12, 0x1e, 0x0a, 0x1a, + 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, + 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x53, 0x12, 0x23, 0x0a, 0x1f, + 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x10, - 0x53, 0x12, 0x23, 0x0a, 0x1f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, - 0x47, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, - 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x61, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x58, 0x10, 0x56, - 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x54, 0x46, 0x38, - 0x10, 0x60, 0x12, 0x20, 0x0a, 0x1c, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x53, - 0x49, 0x5a, 0x45, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, - 0x45, 0x44, 0x10, 0x6c, 0x12, 0x11, 0x0a, 0x0d, 0x44, 0x45, 0x56, 0x5f, 0x4d, 0x4f, 0x44, 0x45, - 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x6d, 0x12, 0x25, 0x0a, 0x21, 0x41, 0x4d, 0x50, 0x5f, 0x45, - 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, - 0x49, 0x43, 0x54, 0x5f, 0x43, 0x53, 0x53, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x10, 0x78, 0x12, 0x16, - 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x4d, - 0x41, 0x54, 0x43, 0x48, 0x10, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, - 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x54, 0x5f, - 0x52, 0x55, 0x4c, 0x45, 0x10, 0x1d, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, - 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x59, 0x5f, 0x54, 0x52, 0x41, 0x49, 0x4c, - 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x10, 0x26, 0x12, - 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x55, 0x4e, - 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, - 0x4e, 0x54, 0x10, 0x27, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, - 0x41, 0x58, 0x5f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x44, 0x5f, - 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x28, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x53, 0x53, 0x5f, - 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x42, 0x41, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x29, - 0x12, 0x2f, 0x0a, 0x2b, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, - 0x4f, 0x46, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x4c, 0x55, 0x44, 0x45, 0x5f, 0x4f, 0x46, - 0x5f, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, - 0x2a, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, - 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x10, 0x2b, 0x12, 0x25, 0x0a, 0x21, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, - 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x44, - 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x2c, 0x12, 0x27, 0x0a, 0x23, - 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x53, 0x45, 0x55, 0x44, 0x4f, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, - 0x54, 0x4f, 0x52, 0x10, 0x2d, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, - 0x54, 0x41, 0x58, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x45, 0x4c, 0x45, - 0x43, 0x54, 0x4f, 0x52, 0x10, 0x2e, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, - 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, - 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x2f, 0x12, 0x31, 0x0a, 0x2d, 0x43, - 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x55, 0x4e, 0x50, 0x41, 0x52, 0x53, - 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x52, 0x45, 0x4d, 0x41, 0x49, 0x4e, 0x53, - 0x5f, 0x49, 0x4e, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x10, 0x30, 0x12, 0x1a, - 0x0a, 0x16, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x4d, 0x49, 0x53, - 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x34, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x53, - 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, - 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x35, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, - 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, - 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x10, 0x36, 0x12, 0x20, 0x0a, 0x1c, 0x43, - 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, - 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x3f, 0x12, 0x26, 0x0a, - 0x22, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, - 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, - 0x55, 0x52, 0x4c, 0x10, 0x37, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, - 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, - 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x10, 0x3b, 0x12, 0x1f, 0x0a, 0x1b, 0x43, - 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x10, 0x5a, 0x12, 0x26, 0x0a, 0x22, + 0x61, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x4f, + 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x58, 0x10, 0x56, 0x12, 0x10, 0x0a, 0x0c, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x54, 0x46, 0x38, 0x10, 0x60, 0x12, 0x20, 0x0a, + 0x1c, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x4c, + 0x49, 0x4d, 0x49, 0x54, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x6c, 0x12, + 0x11, 0x0a, 0x0d, 0x44, 0x45, 0x56, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, + 0x10, 0x6d, 0x12, 0x25, 0x0a, 0x21, 0x41, 0x4d, 0x50, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, + 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x5f, 0x43, + 0x53, 0x53, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x10, 0x78, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x41, 0x4c, + 0x55, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x4d, 0x49, 0x53, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x10, + 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x54, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, + 0x1d, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, + 0x53, 0x54, 0x52, 0x41, 0x59, 0x5f, 0x54, 0x52, 0x41, 0x49, 0x4c, 0x49, 0x4e, 0x47, 0x5f, 0x42, + 0x41, 0x43, 0x4b, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x10, 0x26, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, + 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x4d, 0x49, + 0x4e, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x27, 0x12, + 0x22, 0x0a, 0x1e, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x55, 0x4e, + 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, + 0x47, 0x10, 0x28, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, + 0x58, 0x5f, 0x42, 0x41, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x29, 0x12, 0x2f, 0x0a, 0x2b, 0x43, + 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x4f, 0x46, 0x5f, 0x49, 0x4e, + 0x5f, 0x50, 0x52, 0x45, 0x4c, 0x55, 0x44, 0x45, 0x5f, 0x4f, 0x46, 0x5f, 0x51, 0x55, 0x41, 0x4c, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, 0x2a, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x4e, 0x4f, 0x4c, 0x49, - 0x53, 0x54, 0x10, 0x5f, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, - 0x41, 0x58, 0x5f, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x52, 0x55, 0x4c, - 0x45, 0x5f, 0x48, 0x41, 0x53, 0x5f, 0x4e, 0x4f, 0x5f, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x5b, 0x12, 0x40, 0x0a, 0x3c, 0x43, 0x53, 0x53, 0x5f, 0x53, - 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, - 0x5f, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, - 0x4d, 0x55, 0x53, 0x54, 0x5f, 0x42, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x4b, - 0x45, 0x59, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x10, 0x5c, 0x12, 0x32, 0x0a, 0x2e, 0x43, 0x53, 0x53, - 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, - 0x45, 0x44, 0x5f, 0x4b, 0x45, 0x59, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x49, - 0x44, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x10, 0x5d, 0x12, 0x24, 0x0a, - 0x20, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x4d, 0x41, 0x4c, 0x46, - 0x4f, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x5f, 0x51, 0x55, 0x45, 0x52, - 0x59, 0x10, 0x62, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, - 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x4d, 0x45, 0x44, - 0x49, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x63, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x53, 0x53, - 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, - 0x45, 0x44, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, - 0x10, 0x64, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, - 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, - 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x10, 0x72, 0x12, 0x26, 0x0a, 0x22, 0x43, - 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, - 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x53, 0x45, 0x55, 0x44, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, - 0x53, 0x10, 0x73, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, - 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x53, 0x45, - 0x55, 0x44, 0x4f, 0x5f, 0x45, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x74, 0x12, 0x28, 0x0a, - 0x24, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, - 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, - 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x47, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, - 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, - 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x41, 0x4e, 0x54, 0x10, 0x75, 0x12, 0x1a, 0x0a, 0x16, - 0x43, 0x53, 0x53, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x53, 0x53, 0x49, 0x56, 0x45, 0x4c, 0x59, 0x5f, - 0x4e, 0x45, 0x53, 0x54, 0x45, 0x44, 0x10, 0x6b, 0x12, 0x32, 0x0a, 0x2e, 0x43, 0x53, 0x53, 0x5f, + 0x49, 0x44, 0x5f, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x2b, + 0x12, 0x25, 0x0a, 0x21, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, + 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x2c, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x53, 0x53, 0x5f, 0x53, + 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x5f, 0x50, + 0x53, 0x45, 0x55, 0x44, 0x4f, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x10, 0x2d, + 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x10, + 0x2e, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x53, + 0x54, 0x41, 0x52, 0x54, 0x10, 0x2f, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, + 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x55, 0x4e, 0x50, 0x41, 0x52, 0x53, 0x45, 0x44, 0x5f, 0x49, 0x4e, + 0x50, 0x55, 0x54, 0x5f, 0x52, 0x45, 0x4d, 0x41, 0x49, 0x4e, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x53, + 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x10, 0x30, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x53, 0x53, + 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x5f, + 0x55, 0x52, 0x4c, 0x10, 0x34, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, + 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x10, + 0x35, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x55, 0x52, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x54, + 0x4f, 0x43, 0x4f, 0x4c, 0x10, 0x36, 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, + 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, + 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x3f, 0x12, 0x26, 0x0a, 0x22, 0x43, 0x53, 0x53, 0x5f, + 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, + 0x44, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x37, + 0x12, 0x24, 0x0a, 0x20, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x53, 0x45, 0x4c, 0x45, + 0x43, 0x54, 0x4f, 0x52, 0x10, 0x3b, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, + 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x52, 0x4f, + 0x50, 0x45, 0x52, 0x54, 0x59, 0x10, 0x5a, 0x12, 0x26, 0x0a, 0x22, 0x43, 0x53, 0x53, 0x5f, 0x53, + 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x52, + 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x4e, 0x4f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x5f, 0x12, + 0x31, 0x0a, 0x2d, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x51, 0x55, + 0x41, 0x4c, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x48, 0x41, 0x53, + 0x5f, 0x4e, 0x4f, 0x5f, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x53, + 0x10, 0x5b, 0x12, 0x40, 0x0a, 0x3c, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, + 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x51, 0x55, 0x41, 0x4c, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x4d, 0x55, 0x53, 0x54, 0x5f, + 0x42, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x46, 0x52, 0x41, + 0x4d, 0x45, 0x10, 0x5c, 0x12, 0x32, 0x0a, 0x2e, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, + 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x4b, 0x45, + 0x59, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x4b, 0x45, + 0x59, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x10, 0x5d, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x53, 0x53, 0x5f, + 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x4d, 0x41, 0x4c, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x44, + 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x62, 0x12, 0x24, + 0x0a, 0x20, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, + 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x10, 0x63, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, + 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x4d, 0x45, + 0x44, 0x49, 0x41, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x10, 0x64, 0x12, 0x27, 0x0a, + 0x23, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, + 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x5f, 0x53, 0x45, 0x4c, 0x45, + 0x43, 0x54, 0x4f, 0x52, 0x10, 0x72, 0x12, 0x26, 0x0a, 0x22, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, + 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, + 0x50, 0x53, 0x45, 0x55, 0x44, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x10, 0x73, 0x12, 0x28, + 0x0a, 0x24, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, + 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x53, 0x45, 0x55, 0x44, 0x4f, 0x5f, 0x45, + 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x74, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, - 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x48, 0x49, 0x4e, 0x54, 0x10, 0x48, 0x12, 0x31, 0x0a, 0x2d, + 0x10, 0x47, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, + 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x49, 0x4d, 0x50, 0x4f, + 0x52, 0x54, 0x41, 0x4e, 0x54, 0x10, 0x75, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x53, 0x53, 0x5f, 0x45, + 0x58, 0x43, 0x45, 0x53, 0x53, 0x49, 0x56, 0x45, 0x4c, 0x59, 0x5f, 0x4e, 0x45, 0x53, 0x54, 0x45, + 0x44, 0x10, 0x6b, 0x12, 0x32, 0x0a, 0x2e, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, + 0x58, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x4f, + 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x57, 0x49, 0x54, 0x48, + 0x5f, 0x48, 0x49, 0x4e, 0x54, 0x10, 0x48, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x53, 0x53, 0x5f, 0x53, + 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x44, + 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x49, 0x4e, + 0x5f, 0x41, 0x54, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, 0x49, 0x12, 0x30, 0x0a, 0x2c, 0x43, 0x53, + 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, + 0x59, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x54, 0x4f, 0x47, + 0x45, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x10, 0x4a, 0x12, 0x2e, 0x0a, 0x2a, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x45, - 0x52, 0x54, 0x59, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, 0x44, 0x5f, 0x57, - 0x49, 0x54, 0x48, 0x49, 0x4e, 0x5f, 0x41, 0x54, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, 0x49, 0x12, - 0x30, 0x0a, 0x2c, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, - 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x45, - 0x44, 0x5f, 0x54, 0x4f, 0x47, 0x45, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x10, - 0x4a, 0x12, 0x2e, 0x0a, 0x2a, 0x43, 0x53, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, - 0x50, 0x52, 0x4f, 0x50, 0x45, 0x52, 0x54, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, - 0x53, 0x5f, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, - 0x4b, 0x22, 0x6d, 0x0a, 0x10, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x69, 0x74, 0x79, - 0x22, 0x5e, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, - 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x22, 0x5d, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x53, 0x65, 0x74, 0x52, 0x03, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0xa7, 0x01, 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x6d, 0x70, - 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x14, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x5f, 0x69, 0x66, 0x5f, 0x75, 0x6e, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x12, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x55, 0x6e, - 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x22, 0xa5, 0x04, 0x0a, 0x10, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3e, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x36, - 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x52, 0x54, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x53, 0x5f, 0x51, 0x55, 0x41, + 0x4c, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x4b, 0x22, 0x6d, 0x0a, 0x10, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x69, 0x74, 0x79, + 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x06, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x31, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x3a, 0x02, 0x2d, 0x31, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x12, 0x73, 0x70, 0x65, - 0x63, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x02, 0x2d, 0x31, 0x52, 0x10, 0x73, 0x70, 0x65, 0x63, 0x46, - 0x69, 0x6c, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x13, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01, 0x30, 0x52, 0x12, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x27, 0x0a, 0x0f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x12, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, - 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x16, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, - 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x69, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x69, 0x74, 0x79, 0x22, 0x5e, 0x0a, 0x0b, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5d, 0x0a, 0x11, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x32, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, + 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x74, + 0x74, 0x72, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x52, + 0x03, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x14, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x69, 0x66, 0x5f, 0x75, + 0x6e, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x52, 0x12, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x66, 0x55, 0x6e, 0x73, 0x61, 0x74, 0x69, 0x73, + 0x66, 0x69, 0x65, 0x64, 0x22, 0xa5, 0x04, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x6d, 0x70, 0x2e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x6d, 0x70, 0x2e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x73, 0x12, 0x31, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x72, + 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x02, 0x2d, + 0x31, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x12, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x3a, 0x02, 0x2d, 0x31, 0x52, 0x10, 0x73, 0x70, 0x65, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x3a, 0x01, 0x30, 0x52, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, + 0x6d, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x79, + 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x65, 0x74, + 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x12, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x16, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x6d, 0x70, 0x2e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x14, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x14, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x29, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, - 0x04, 0x50, 0x41, 0x53, 0x53, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c, 0x10, - 0x02, 0x42, 0x21, 0x5a, 0x1f, 0x2e, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x22, 0x29, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x41, 0x53, 0x53, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x02, 0x42, 0x21, 0x5a, 0x1f, + 0x2e, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x3b, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, } var ( diff --git a/validator/validator.proto b/validator/validator.proto index bc47c57f3356..5acb9b7be6f3 100644 --- a/validator/validator.proto +++ b/validator/validator.proto @@ -862,7 +862,7 @@ message ValidationError { // DO NOT REASSIGN the previously used values 2, 3. } optional Severity severity = 6 [default = ERROR]; - // NEXT AVAILABLE TAG: 121 + // NEXT AVAILABLE TAG: 122 enum Code { UNKNOWN_CODE = 0; INVALID_DOCTYPE_HTML = 111; @@ -876,6 +876,7 @@ message ValidationError { NON_LTS_SCRIPT_AFTER_LTS = 112; LTS_SCRIPT_AFTER_NON_LTS = 113; INCORRECT_SCRIPT_RELEASE_VERSION = 119; + DISALLOWED_AMP_DOMAIN = 121; ATTR_REQUIRED_BUT_MISSING = 61; DISALLOWED_TAG = 2; GENERAL_DISALLOWED_TAG = 51;