From a7c7fdf71e3d6a4c7f83d28130c094c195986560 Mon Sep 17 00:00:00 2001
From: Justin Ridgewell Scrollable Lightbox
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.
-
-
diff --git a/examples/image-lightbox.amp.html b/examples/image-lightbox.amp.html index 2b908c612cee8..25e861cf1ba8f 100644 --- a/examples/image-lightbox.amp.html +++ b/examples/image-lightbox.amp.html @@ -22,13 +22,6 @@
- - diff --git a/extensions/amp-anim/0.1/amp-anim.js b/extensions/amp-anim/0.1/amp-anim.js index 7f3dab9cb7c3c..47205b27615cb 100644 --- a/extensions/amp-anim/0.1/amp-anim.js +++ b/extensions/amp-anim/0.1/amp-anim.js @@ -22,7 +22,6 @@ import { observeWithSharedInOb, unobserveWithSharedInOb, } from '../../../src/viewport-observer'; -import {propagateAttributes} from '../../../src/core/dom/propagate-attributes'; import {propagateObjectFitStyles} from '../../../src/style'; const TAG = 'amp-anim'; @@ -56,7 +55,7 @@ export class AmpAnim extends AMP.BaseElement { buildCallback() { this.img_ = new Image(); this.img_.setAttribute('decoding', 'async'); - propagateAttributes(BUILD_ATTRIBUTES, this.element, this.img_); + this.propagateAttributes(BUILD_ATTRIBUTES, this.img_); this.applyFillContent(this.img_, true); propagateObjectFitStyles(this.element, this.img_); @@ -89,9 +88,8 @@ export class AmpAnim extends AMP.BaseElement { const img = dev().assertElement(this.img_); // Remove missing attributes to remove the placeholder srcset if none is // specified on the element. - propagateAttributes( + this.propagateAttributes( LAYOUT_ATTRIBUTES, - this.element, img, /* opt_removeMissingAttrs */ true ); diff --git a/extensions/amp-audio/0.1/amp-audio.js b/extensions/amp-audio/0.1/amp-audio.js index 92baf1cf74734..9491dfaeba9fc 100644 --- a/extensions/amp-audio/0.1/amp-audio.js +++ b/extensions/amp-audio/0.1/amp-audio.js @@ -28,7 +28,6 @@ import {closestAncestorElementBySelector} from '../../../src/dom'; import {dev, user} from '../../../src/log'; import {getMode} from '../../../src/mode'; import {listen} from '../../../src/event-helper'; -import {propagateAttributes} from '../../../src/core/dom/propagate-attributes'; import {setIsMediaComponent} from '../../../src/video-interface'; import {triggerAnalyticsEvent} from '../../../src/analytics'; @@ -86,11 +85,7 @@ export class AmpAudio extends AMP.BaseElement { if (src !== undefined) { assertHttpsUrl(src, this.element); } - propagateAttributes( - ['src', 'loop', 'controlsList'], - this.element, - this.audio_ - ); + this.propagateAttributes(['src', 'loop', 'controlsList'], this.audio_); } const artist = mutations['artist']; @@ -124,7 +119,7 @@ export class AmpAudio extends AMP.BaseElement { if (src) { assertHttpsUrl(src, this.element); } - propagateAttributes( + this.propagateAttributes( [ 'src', 'preload', @@ -136,7 +131,6 @@ export class AmpAudio extends AMP.BaseElement { 'aria-labelledby', 'controlsList', ], - this.element, audio ); diff --git a/extensions/amp-auto-lightbox/0.1/amp-auto-lightbox.js b/extensions/amp-auto-lightbox/0.1/amp-auto-lightbox.js index 11748995f7e2b..c3a989d23ced9 100644 --- a/extensions/amp-auto-lightbox/0.1/amp-auto-lightbox.js +++ b/extensions/amp-auto-lightbox/0.1/amp-auto-lightbox.js @@ -32,7 +32,6 @@ import { whenUpgradedToCustomElement, } from '../../../src/dom'; import {dev} from '../../../src/log'; -import {loadPromise} from '../../../src/event-helper'; import {measureIntersectionNoRoot} from '../../../src/utils/intersection-no-root'; import {toArray} from '../../../src/core/types/array'; import {tryParseJson} from '../../../src/core/types/object/json'; @@ -115,23 +114,25 @@ const META_OG_TYPE = 'meta[property="og:type"]'; const NOOP = () => {}; +/** + * For better minification. + * @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc + * @return {!Document|!ShadowRoot} + */ +const getRootNode = (ampdoc) => ampdoc.getRootNode(); + /** @visibleForTesting */ export class Criteria { /** * @param {!Element} element - * @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc * @param {number} renderWidth * @param {number} renderHeight * @return {boolean} */ - static meetsAll(element, ampdoc, renderWidth, renderHeight) { + static meetsAll(element, renderWidth, renderHeight) { return ( - Criteria.meetsSizingCriteria( - element, - ampdoc, - renderWidth, - renderHeight - ) && Criteria.meetsTreeShapeCriteria(element) + Criteria.meetsSizingCriteria(element, renderWidth, renderHeight) && + Criteria.meetsTreeShapeCriteria(element) ); } @@ -154,18 +155,17 @@ export class Criteria { /** * @param {!Element} element - * @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc * @param {number} renderWidth * @param {number} renderHeight * @return {boolean} */ - static meetsSizingCriteria(element, ampdoc, renderWidth, renderHeight) { - const {naturalWidth, naturalHeight} = getMaxNaturalDimensions( - dev().assertElement(element.querySelector('img') || element) + static meetsSizingCriteria(element, renderWidth, renderHeight) { + const {naturalHeight, naturalWidth} = getMaxNaturalDimensions( + dev().assertElement(element.querySelector('img')) ); - const viewport = Services.viewportForDoc(ampdoc); - const {width: vw, height: vh} = viewport.getSize(); + const viewport = Services.viewportForDoc(element); + const {height: vh, width: vw} = viewport.getSize(); return meetsSizingCriteria( renderWidth, @@ -273,16 +273,11 @@ function markAsVisited(candidate) { } /** - * @param {!ArrayHUGE PADDING
- -NO labels; NO whatever modifications
NO labels; NO whatever modifications using ImageElements
-Labels with NO positioning rules specified (default to both top left)
Labels with NO positioning rules specified (default to both top left) using ImageElements
-Labels with positioning rules specified (both should be at the center)
Labels with positioning rules specified (both should be at the center) using ImageElements
-Has alt
on amp-img
s. ARIA order: [label content], [alt text if present], left/right image
Has alt
on amp-img
s. ARIA order: [label content], [alt text if present], left/right image using ImageElements
Disable default viewport behavior (hint would NOT reappear after the slider interacted, out of viewport, and then back into viewport)
Disable default viewport behavior (hint would NOT reappear after the slider interacted, out of viewport, and then back into viewport) using ImageElements
-Fully customized hint (replace with triangles)
Fully customized hint (replace with triangles) using ImageElements
-Actions
seekTo
test (currently, seekTo
is not considered as user interaction)
Actions
seekTo
test (currently, seekTo
is not considered as user interaction) using ImageElements
Set initial-slider-position
to 0.3
Set initial-slider-position
to 0.3 using ImageElements
Set step-size
to 0.2
Set step-size
to 0.2 using ImageElements