From 7ab77b0c0dd881dc59b17f3851520c74a7cafce1 Mon Sep 17 00:00:00 2001 From: Dima Voytenko Date: Fri, 16 Sep 2016 14:32:08 -0700 Subject: [PATCH] Remove amp-ife-test --- extensions/amp-ife-test/0.1/amp-ife-test.js | 89 --------------------- gulpfile.js | 2 - test/manual/amp-image-lightbox.amp.html | 32 ++------ 3 files changed, 7 insertions(+), 116 deletions(-) delete mode 100644 extensions/amp-ife-test/0.1/amp-ife-test.js diff --git a/extensions/amp-ife-test/0.1/amp-ife-test.js b/extensions/amp-ife-test/0.1/amp-ife-test.js deleted file mode 100644 index eecb556efe253..0000000000000 --- a/extensions/amp-ife-test/0.1/amp-ife-test.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright 2016 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 {ampdocFor} from '../../../src/ampdoc'; -import {installFriendlyIframeEmbed} from '../../../src/friendly-iframe-embed'; -import {isLayoutSizeDefined} from '../../../src/layout'; - -/** @const */ -const TAG = 'amp-ife-test'; - -// DO NOT SUBMIT: This class is to simply demonstrate how a friendly iframe -// is created. -class AmpIfeTest extends AMP.BaseElement { - - /** @override */ - isLayoutSupported(layout) { - return isLayoutSizeDefined(layout); - } - - /** @override */ - buildCallback() { - const template = this.element.querySelector('template') || - this.element.querySelector('script') - /** @const @private {string} */ - this.htmlContent_ = template./*OK*/innerHTML; - - /** @const @private {!Element} */ - this.container_ = this.element.ownerDocument.createElement('div'); - this.applyFillContent(this.container_); - this.element.appendChild(this.container_); - - /** @private {?HTMLIFrameElement} */ - this.iframe_ = null; - } - - /** @override */ - layoutCallback() { - const iframe = this.element.ownerDocument.createElement('iframe'); - this.iframe_ = iframe; - this.applyFillContent(iframe); - - iframe.setAttribute('frameborder', '0'); - iframe.setAttribute('allowfullscreen', ''); - iframe.setAttribute('allowtransparency', ''); - iframe.setAttribute('scrolling', 'no'); - - const embedPromise = installFriendlyIframeEmbed(iframe, this.container_, { - url: 'https://acme.org/embed&1', - html: this.htmlContent_, - extensionIds: ['amp-image-lightbox'], - fonts: ['https://fonts.googleapis.com/css?family=Roboto'], - }); - return embedPromise.then(embed => { - this.embed_ = embed; - - // Run some tests. - const ampdocService = ampdocFor(this.win); - const ampdoc = ampdocService.getAmpDoc(this.element); - - const img = iframe.contentWindow.document.querySelector('amp-img'); - const ampdoc2 = ampdocService.getAmpDoc(img); - console./*OK*/error('AMPDOC2: ', ampdoc2, ampdoc2 == ampdoc); - - const layoutRect = this.getViewport().getLayoutRect(img); - console./*OK*/error('layoutRect: ', layoutRect.top, layoutRect); - - setTimeout(() => { - console./*OK*/error('REMOVE IFRAME'); - this.container_.removeChild(iframe); - this.embed_.destroy(); - }, 5000); - }); - } -} - -AMP.registerElement(TAG, AmpIfeTest); diff --git a/gulpfile.js b/gulpfile.js index e816f168f060e..8621676517ea2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -101,8 +101,6 @@ declareExtension('amp-vine', '0.1', false, 'NO_TYPE_CHECK'); declareExtension('amp-viz-vega', '0.1', true, 'NO_TYPE_CHECK'); declareExtension('amp-google-vrview-image', '0.1', false, 'NO_TYPE_CHECK'); declareExtension('amp-youtube', '0.1', false); -// DO NOT SUBMIT: to demo API only. -declareExtension('amp-ife-test', '0.1', false, 'NO_TYPE_CHECK'); /** * @param {string} name diff --git a/test/manual/amp-image-lightbox.amp.html b/test/manual/amp-image-lightbox.amp.html index a9f05151272e7..c22a27eda3e77 100644 --- a/test/manual/amp-image-lightbox.amp.html +++ b/test/manual/amp-image-lightbox.amp.html @@ -7,8 +7,6 @@ - - - - -
This is inside the friendly iframe
- - - - - -

Lorem ipsum dolor sit amet, has nisl nihil convenire et, vim at aeque inermis reprehendunt. Propriae tincidunt id nec, elit nusquam te mea, ius noster platonem in. Mea an idque minim, sit sale deleniti apeirian et. Omnium legendos tractatos cu mea. Vix in stet dolorem accusamus. Iisque rationibus consetetur in cum, quo unum nulla legere ut. Simul numquam saperet no sit.