[amp-fit-text:1.0] Use ResizeObserver for content changes#28496
[amp-fit-text:1.0] Use ResizeObserver for content changes#28496caroqliu merged 6 commits intoampproject:masterfrom
Conversation
|
Ok. This looks super simple. Even simpler than before. But does this work? |
I tested with resizing the dimensions on the container by modifying the computed dimensions from the Chrome Developer Tools. I also tested with resizing the contents by appending and removing text nodes in the DOM. I did this in both the AMP example document and the Preact Storybook sample. :) Is there anything else you think would be useful here? |
This sounds awesome. The only confirmation I'm really looking for is a test like this:
|
Here is what I did:
It appears that the style modification in (2) does not cause a record on the I then moved the Finally I set However both before and after the inclusion of Perhaps even worse, it appears to be inconsistently firing when toggling the tldr; We can only modify to the extent that we can consistently reproduce (1) and (2) in your manual test confirmation but not (3). |
|
Note: This feature also addresses some a11y implications: #29556 |
|
Updated some merge conflicts with the |
…#28496) * Observe measurerRef * Set and observe a nested `contentRef` div with `height: min-content` * Move `height: min-content` to css * Use `ContainWrapper` preset refs * Place in css file





Instead of
useEffectforchildrenprop. Partial for #28281