From 6549bb8a362e73a654f5e006f766882cbd74d710 Mon Sep 17 00:00:00 2001 From: Dima Voytenko Date: Mon, 22 Feb 2021 09:49:04 -0800 Subject: [PATCH] Support display observer in the lightbox (#32701) * Display observer in nested fixed overlays * Support display observer in the lightbox * cleanup * docs * fix types * minor * Combine observers and containers together * eager reset of container observations * shortcircuit --- examples/amp-lightbox.amp.html | 9 + extensions/amp-lightbox/0.1/amp-lightbox.js | 6 + src/utils/display-observer.js | 320 +++++++++++++++++--- test/unit/utils/test-display-observer.js | 240 ++++++++++++++- 4 files changed, 523 insertions(+), 52 deletions(-) diff --git a/examples/amp-lightbox.amp.html b/examples/amp-lightbox.amp.html index 7e1c8628e567..f232cb5e9464 100644 --- a/examples/amp-lightbox.amp.html +++ b/examples/amp-lightbox.amp.html @@ -39,6 +39,7 @@ + @@ -76,6 +77,14 @@

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. 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.

+
+ +