ResizeObserver doesn't always fire changes
Reported by
christop...@gmx.com,
Oct 23 2016
|
||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36 Vivaldi/1.5.641.13
Steps to reproduce the problem:
1. make a ResizeObserver listen to changes of the body on YouTube:
if (window.ResizeObserver)
{
let resize_observer = new ResizeObserver(function(){ console.log("resized"); });
resize_observer.observe(document.body);
}
2. click "Show more" in the comments section of any video
What is the expected behavior?
ResizeObserver firing -> "resized" in console
What went wrong?
nothing happens although body's dimensions obviously changed
Did this work before? No
Chrome version: 54.0.2840.59 Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
--enable-blink-features=ResizeObserver flag and Chromium 54 required
,
Oct 23 2016
Why are Google's pages always using such ugly and tricky special cases...? Is there any way to get the real size of the document then?
,
Oct 24 2016
resize_observer.observe(window["body-container"])
,
Oct 24 2016
Sure. I meant a way that works across all pages. This code belongs to an extension that needs to know the page's dimensions. ;)
,
Oct 24 2016
Thanks l446240525 for helping out. > Is there any way to get the real size of the document then? The hard part is defining "real size". What part of the document is the real doc?
,
Oct 24 2016
I get your point. I was excited that ResizeObserver finally seemed to void the need for all those hacks trying to find the scrollable area of a page. Looks like it just isn't that savior I thought it was after all... :/ |
||
►
Sign in to add a comment |
||
Comment 1 by l446240525@gmail.com
, Oct 23 2016Actually <body>'s dimensions doesn't change because of: html, body, #body-container { height: 100%; }