-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ amp-story-desktop-one-panel
Background blur MVP
#34974
✨ amp-story-desktop-one-panel
Background blur MVP
#34974
Conversation
Hey @gmajoulet, @newmuis! These files were changed:
|
* @return {?Element} An img element or null. | ||
*/ | ||
getBiggestImage_(pageElement) { | ||
const getSize = (el) => el && el.offsetWidth * el.offsetHeight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this solution of getting the biggest img!
The one worry I have is offsetWidth/Heigh
triggering relayout/paint.
To work around it, I suggest we query the amp-img
instead of the img
, and use getLayoutBox()
that returns cached measurements from the AMP runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like getLayoutBox
is being deprecated and checks wont pass with it:
https://app.circleci.com/pipelines/github/ampproject/amphtml/12123/workflows/fbc193e8-aff0-49b9-89d5-081efcc40a61/jobs/193397?invite=true#step-111-99
I2D:
#31540
I wonder what a good alternative would be.
Co-authored-by: Gabriel Majoulet <gmajoulet@google.com>
cc @rsimha for OWNERS on |
Contributes to #34764
Fixes #34960 #34967 #34962 #34959
An
AmpStoryBackgroundBlur
class with MVP methods.Demo