New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 649849 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Resize event not firing for off-screen iframe

Reported by garland....@gmail.com, Sep 23 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

Steps to reproduce the problem:
1. Create page with onresize event on the body element writing message to log.
2. Create parent page that loads that child page in an iframe with CSS "position: absolute, top: 0, left: -1000px; width: 100px;". This iframe will be hidden from view by virtue of being positioned far to the left of the screen.
3. In javascript on parent page, change iframe width to 50px.

What is the expected behavior?
The resize event of the child page should fire, writing message to log.

What went wrong?
The resize event is not triggered by the change to the width of the iframe.

Did this work before? Yes Prior to 2016-09-15, it worked for many years.

Chrome version: 53.0.2785.116  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

If the iframe is visible on the screen, the event fires. The problem seems to be related to the iframe being positioned off the screen. This worked correctly in Chrome in the past and currently works in Edge.
 

Comment 1 by kojii@chromium.org, Sep 26 2016

Cc: kojii@chromium.org
Components: -Blink Blink>DOM
Labels: Needs-Feedback
Could you please create a reproducing HTML and attach to this issue? That'll help our investigations.
After further investigation, I believe I have isolated the issue. The problem only occurs when the source of the off-screen iframe is under a different domain than the parent page. In my case, one included the www prefix on the domain while the other did not. As stated before, this problem does not occur if the iframe is visible, and it does not occur in IE, Edge, Firefox, or Safari, even if the iframe is off-screen. 

In the attached example, the problem will occur if the src of the child iframe is a different domain than the parent page. For my testing, I had the src of the iframe set to my domain without a www prefix but loaded the parent frame in the browser using the domain with the www prefix (both point to the same server location).
649849-parent.html
518 bytes View Download
649849-child.html
112 bytes View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 4 2016

Labels: -Needs-Feedback Needs-Review
Owner: kojii@chromium.org
Thank you for providing more feedback. Adding requester "kojii@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by kojii@chromium.org, Oct 5 2016

Labels: -Via-Wizard -Needs-Review -Arch-x86_64
Owner: ----
Thank you for creating the test case, this helps our investigation a lot.

Labeling so that the team can triage.

Comment 5 by tkent@chromium.org, Oct 7 2016

Components: -Blink>DOM Blink>Layout Blink>HTML>IFrame
Labels: -Type-Bug Needs-Bisect Type-Bug-Regression

Comment 6 by drott@chromium.org, Oct 10 2016

Cc: mkwst@chromium.org drott@chromium.org
Owner: lfg@chromium.org
Status: Assigned (was: Unconfirmed)
lfg@, could you take a look or re-triage?
Cc: kkaluri@chromium.org
Labels: Needs-Feedback
@garland.pope, These are the steps I performed to reproduce the issue.

1) Downloaded both parent and child html files and placed them in same folder.
2)Opened the both html files with chrome version 53.0.2785.116 and opened the console for both web pages.
3) In the parent.html console, i found the following Error Message "Failed to load resource: the http://differentdomain.com/649849-child.html 
server responded with a status of 404 (Not Found)" 

4) In the child.html console, i found the following message "iFrame was resized"

5) whenever i manually resized the child.html, the count beside "iFrame was resized" is increasing

6)But when i click on the "Resize iFrame" button in parent.html, the count in the child.html console page is not increasing 

Is this is the issue you are mentioning???

Please Let Us know.

Thank You... 
Parent.png
13.1 KB View Download
Child.png
8.2 KB View Download

Comment 8 by lfg@chromium.org, Oct 11 2016

Cc: lfg@chromium.org
Owner: skyos...@chromium.org
+skyostil, is that related to the work to disable rendering on off-screen iframes?

Yes, it sounds like offscreen rendering pipeline throttling is the culprit here.

I would argue that this is working as intended: why should we tell an offscreen iframe about resizes given that nothing it will draw as a response will end up on the screen?

Note that as a workaround you can make the offscreen frame have a size of 0x0.
Status: WontFix (was: Assigned)
Tentatively marking WontFix. Please reopen if there's a reason to do something different here.
+kkaluri: 

The intention was for you to change "http://differentdomain.com" to a domain different from the one used to access the parent page but that does contain the child page. For me, they are both in the same physical folder, and both www.abcde.com and abcde.com point to that folder. I load the parent page from www.abcde.com while having the iframe loaded from abcde.com (without the www). The point is that the child page is coming from a different domain than the parent. There is no need to open the child page in its own browser window.

+skyostil:

Thanks for looking into this issue.

This behavior is different from every other major browser. Is it intended to be? Are there standards that suggest this is the correct behavior?

Here's my understanding of what's happening:

1) If the iframe is off screen but has the same domain as the main page, the resize event is triggered.
2) If the iframe is on screen (even sized to 1x1 with no border so that it's effectively invisible), the resize event is triggered, even if the domain is different.
3) But if the iframe is off screen AND has a different domain, the event is not triggered.

So you ARE triggering the event when the domain matches, even though nothing it will draw as a result will end up on the screen. And you ARE triggering the event if the size is 1x1, even though nothing it will draw as a result will end up on the screen. So the lack of a visible rendering change doesn't seem to be a justification for not triggering the event in this case, since it is triggered in other cases with no visible change. The size of the iframe IS changed, even if the user is not able to observe the change with his eyes. So it seems to me that the event should be triggered as it has always been in Chrome up to now.

BTW, I could not get the event to trigger when the iframe was sized to 0x0. It had to be at least 1x1, and its location had to be visible on the screen, not even further down on the page, accessible by scrolling. I actually had to scroll down to bring the empty space the iframe was occupying onto the screen to get the event to fire.
#11: That's right, we have some (somewhat arbitrary) exceptions to the throttling rules. These basically exist to avoid breaking existing sites that rely a specific behavior. Other browsers which do similar throttling (e.g., Safari, Firefox) have more or less the same failsafes, although Chrome is the only browser which completely suspends rendering-related events; the others mainly throttle them to a very low rate.

You can read more about this behavior here: https://github.com/WICG/interventions/issues/8

Re: 0x0 frames, sorry for not mentioning it earlier but I think that override might only be in Chrome M54+ at this point.

Sign in to add a comment