Fix border around desktop amp-story-pages.#26449
Fix border around desktop amp-story-pages.#26449gmajoulet merged 4 commits intoampproject:masterfrom
Conversation
| 'style', | ||
| `--story-page-vh: ${px(state.vh)};` + | ||
| `--story-page-vw: ${px(state.vw)};` + | ||
| `--story-page-50vw: ${px(state.fiftyVw)};` + |
There was a problem hiding this comment.
I know it will be asymmetric with the other ones, but can we make this --i-amphtml-story-page-50vw, since this is internal-facing for a very specific purpose?
| } | ||
|
|
||
| /** @override */ | ||
| onMeasureChanged() { |
There was a problem hiding this comment.
Do you know to what extent calls to this method are throttled/debounced?
There was a problem hiding this comment.
I couldn't find an obvious answer reading the code, maybe @jridgewell would know?
There was a problem hiding this comment.
They're not. It's called every time Resources measures it, and the measurements are different than the last time.
|
|
||
| /** @override */ | ||
| onMeasureChanged() { | ||
| if (!this.isFirstPage_) { |
There was a problem hiding this comment.
Can you add a comment here with what you wrote on your description?
"Only measures from the first story page, that always gets built because of the prerendering optimizations we have (even with branching)"
09fa5ca to
35c4257
Compare
35c4257 to
4ce4983
Compare
* master: (62 commits) 📦 Update dependency fetch-mock to v8.3.2 (ampproject#26491) Revert 'Move mutator implementations out to a standalone service' (ampproject#26479) Fix syntax error (ampproject#26481) Add pespective back. (ampproject#26486) More user friendly errors in layout.js (ampproject#26448) ✨ Start logging AMP URL on SwG Pages (ampproject#26480) Fix border around desktop amp-story-pages. (ampproject#26449) Fix Story tests. (ampproject#26464) ✨ Performance Measurement Chrome Extension (ampproject#26333) amp-consent restrict iframe fullScreen if no focus (ampproject#26461) Add performance benchmark task (ampproject#26026) ♻️ amp-script: emit warning if zero height and width. (ampproject#26444) ✨ Launch minimal-wrapper native CEv1 (ampproject#26360) ♻️ Lint: include externs (round 2) (ampproject#26446) amp-script: Create 'fill content' container for responsive/fluid (ampproject#26400) amp-consent remove cmp iframe focus (ampproject#26437) Disable macro-after-long-task in inabox. (ampproject#26459) Launch layoutbox-invalidate-on-scroll (ampproject#26430) Add amp-ad support for ByPlay (ampproject#25663) 🏗 Add specific RTV opt-in to experiments.html (ampproject#26434) ...
--story-page--*CSS variables toamp-story-pageonMeasureChanged()runtime method to know when theamp-story-pageactually gets resizedonMeasureChanged()is called afterbuildCallbackbut beforelayoutCallback, so the story can't be marked as rendered before the CSS variables are set, as it waits for the first page to be fully loaded. Also works perfectly with prerendering (no jump)translateand remove the unwanted border aroundamp-story-pageelements on desktopDemo
Fixes #16626