NEW 53546
When frame flattening is on iframe outside viewport is not flattened
https://bugs.webkit.org/show_bug.cgi?id=53546
Summary When frame flattening is on iframe outside viewport is not flattened
Misha
Reported 2011-02-01 15:56:16 PST
When frame flattening is on and page has an iframe which is partially visible or not visible at all this iframe is not flattened and contentsSize() reports incorrect value. To reproduce enable the frame flattening, make the window small enough and load attached example. Depending on the size of your window iframe will be partially visible or not visible at all. When you scroll you can see that it's not flattened.
Attachments
test case (1.14 KB, text/html)
2011-02-01 15:56 PST, Misha
no flags
patch (1.51 KB, patch)
2011-02-02 12:52 PST, Misha
eric: review-
test case (1.13 KB, text/html)
2011-02-24 07:34 PST, Misha
no flags
Misha
Comment 1 2011-02-01 15:56:53 PST
Created attachment 80844 [details] test case
Misha
Comment 2 2011-02-01 17:16:46 PST
It's the same issue Kenneth has seen in https://bugs.webkit.org/show_bug.cgi?id=36798#c35 What I found is that in bool RenderIFrame::flattenFrame() in the bottom we do return absoluteBoundingBoxRect().intersects(IntRect(IntPoint(0, 0), view->contentsSize())); the comment says: // Do not flatten offscreen inner frames during frame flattening. Firts of all during first layout content size is not set yet, so the result will be false. Second, what was the intent? Why we don't want to flatten iframe which are outside viewport? Should I just remove this line and return true?
Kenneth Rohde Christiansen
Comment 3 2011-02-02 01:31:19 PST
This was done so on purpose as pages uses offscreen iframes for some things. Not doing this broke lala.com (im not sure it still does). I am pretty sure there is a layout test that tests this.
Misha
Comment 4 2011-02-02 12:52:41 PST
Created attachment 80954 [details] patch I'm proposing the fix for the issue. If contents size is empty we cannot check if the iframe is off screen so let's do flattening.
Misha
Comment 5 2011-02-02 13:09:34 PST
It looks like it will be always the situation when some sites are broken when frame flattening is on. I think it's just the nature of this feature - we just forcefully changing layout of the page. So why we don't want to flatten offscreen iframes? (with submitted patch we still don't, but I'm wondering) Another question is how frame flattening can and should co-exist with overflow:hidden of the parent.
Yael
Comment 6 2011-02-09 06:17:11 PST
(In reply to comment #4) > Created an attachment (id=80954) [details] > patch > > I'm proposing the fix for the issue. If contents size is empty we cannot check if the iframe is off screen so let's do flattening. I am not sure this is really fixing a bug. The next round of layout will pick up the content and will flatten it.
Misha
Comment 7 2011-02-09 09:33:13 PST
(In reply to comment #6) > I am not sure this is really fixing a bug. The next round of layout will pick up the content and will flatten it. Well, next round of layout will go through the frame flattening but for some reasons it doesn't affect contents size. I'm looking now why contents size are not getting changed. In the same time I still don't understand why we want to "break" original layout for "normal" iframes, but don't want to do it for off screen ones.
Misha
Comment 8 2011-02-16 13:15:08 PST
I noticed that when load is happening for the first time iframe is getting flattened correctly. But if I do page reload after that it doesn't go through frame flattening. So __IF__ layoutWithFlattening() is invoked everything is ok. The issues is that layoutWithFlattening() is not invoked all the time because flattenFrame() returns false because contentsSize is not set yet. It looks like during initial page load we go through extra round of layout. I think it happens because iframe content arrives later (through posted network reply event) and when it happens another layout is triggered which goes through layoutWithFlattening(). When we do page reload the code path is different and we have one layout less. Antti, Kenneth, any idea what would be the correct approach to fix the issue?
Ademar Reis
Comment 9 2011-02-23 05:27:11 PST
Is this targeted at 2.1/2.1.x? (please add it to the meta-bug if that's the case).
Suresh Voruganti
Comment 10 2011-02-23 06:04:33 PST
(In reply to comment #9) > Is this targeted at 2.1/2.1.x? (please add it to the meta-bug if that's the case). This is targeted for 2.1.x
Misha
Comment 11 2011-02-23 11:11:53 PST
I noticed that the issue is not reproducible on the trunk anymore but still is repro on QtWebkit 2.1.x (with Yeal fix for https://bugs.webkit.org/show_bug.cgi?id=52449). Looking now what change in trunk makes the difference.
Eric Seidel (no email)
Comment 12 2011-02-24 02:48:11 PST
Comment on attachment 80954 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=80954&action=review How do we test this? > Source/WebCore/ChangeLog:6 > +During initial layout when frame flattening is on contents size is not set yet. Becuase of this the check that the frame is not offscreen is failing and flattenFrame() returns false which cause layout go without frame flattening. Indent? and maybe a little wrapping :)
Misha
Comment 13 2011-02-24 07:34:43 PST
Created attachment 83654 [details] test case removed absolute positioning ov the div. This test case works on the trunk but failing on QtWebkit 2.1.x
Misha
Comment 14 2011-02-24 07:40:51 PST
(In reply to comment #12) > (From update of attachment 80954 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=80954&action=review > > How do we test this? > > > Source/WebCore/ChangeLog:6 > > +During initial layout when frame flattening is on contents size is not set yet. Becuase of this the check that the frame is not offscreen is failing and flattenFrame() returns false which cause layout go without frame flattening. > > Indent? and maybe a little wrapping :) The test case is attached. The blue div should be shown 1000px by 1400px. The patch doesn't make sense now as it work on the trunk, but we need to identify the change that need to be pulled from trunk to QtWebkit 2.1.x
Caio Marcelo de Oliveira Filho
Comment 15 2011-03-11 08:46:25 PST
(In reply to comment #14) > The patch doesn't make sense now as it work on the trunk, but we need to identify the change that need to be pulled from trunk to QtWebkit 2.1.x Misha, any progress on this?
Misha
Comment 16 2011-03-11 09:51:24 PST
(In reply to comment #15) > (In reply to comment #14) > > The patch doesn't make sense now as it work on the trunk, but we need to identify the change that need to be pulled from trunk to QtWebkit 2.1.x > > Misha, any progress on this? Unfortunately not. I was busy doing other things. All I know that on trunk we have at least one layout more but it were quite a few changes in the layout logic since qtwebkit 2.1.x has been branched.I'll try to spend some time nex week on it. On the other hand I'm not sure if it makes sense now.
Joel Parks
Comment 17 2011-05-19 06:19:40 PDT
no longer blocking 50925 per Misha email
Simon Fraser (smfr)
Comment 18 2011-05-26 11:15:19 PDT
Bug 61491 is related.
Ahmad Saleem
Comment 19 2023-05-13 04:02:09 PDT
Attached testcase behave similar in all browsers (Chrome Canary 115, Firefox Nightly 115 & STP169). 1) Shows scrollbar (horizontal & vertical) 2) Scrollable in both directions If I missed anything, please highlight else I think we can close it. Thanks!
Note You need to log in before you can comment on or make changes to this bug.