Bug 70552 - iframes seem to occasionally doubly scale or scale incorrectly when pageScaleFactor != 1.0
Summary: iframes seem to occasionally doubly scale or scale incorrectly when pageScale...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fady Samuel
URL:
Keywords:
Depends on:
Blocks: 68075 70559
  Show dependency treegraph
 
Reported: 2011-10-20 15:33 PDT by Fady Samuel
Modified: 2011-10-27 14:09 PDT (History)
5 users (show)

See Also:


Attachments
Reduction (714 bytes, application/zip)
2011-10-25 16:11 PDT, Fady Samuel
no flags Details
Fixed Reduction (718 bytes, application/zip)
2011-10-25 16:18 PDT, Fady Samuel
no flags Details
Patch (6.50 KB, patch)
2011-10-27 11:01 PDT, Fady Samuel
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fady Samuel 2011-10-20 15:33:17 PDT
Please attempt to scale this page to repo. Notice that the top Ad is not always correctly scaled.
Comment 1 Fady Samuel 2011-10-25 16:11:35 PDT
Created attachment 112420 [details]
Reduction

I've attached a reduction for this bug. This happens on Chromium Linux (with fixed layout and scaling enabled locally) and may or may not repo on other platforms (not tested yet):

1. Open up iframe-content-scaling-bug.html.
2. Change the scale factor of the page
3. Reload

The two green boxes should be the same size, but the green box in the iframe ends up double scaling.
Comment 2 Fady Samuel 2011-10-25 16:18:09 PDT
Created attachment 112422 [details]
Fixed Reduction
Comment 3 Fady Samuel 2011-10-26 08:14:37 PDT
I'm beginning to suspect this bug and this bug: https://bugs.webkit.org/show_bug.cgi?id=70632 might be related because this reduction is causing Chromium to crash occasionally.
Comment 4 Fady Samuel 2011-10-26 14:05:07 PDT
I believe I have a fix for this:

Changing:

documentStyle->setPageScaleTransform(document->page() ? document->page()->pageScaleFactor() : 1); 

to

documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);  

in CSSStyleSelector::styleForDocument

fixes the issue. Now I just have to come up with an automated layout test for this.
Comment 5 Fady Samuel 2011-10-27 06:51:21 PDT
(In reply to comment #4)
> I believe I have a fix for this:
> 
> Changing:
> 
> documentStyle->setPageScaleTransform(document->page() ? document->page()->pageScaleFactor() : 1); 
> 
> to
> 
> documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);  
> 
> in CSSStyleSelector::styleForDocument
> 
> fixes the issue. Now I just have to come up with an automated layout test for this.

It seems it's difficult to write an automated layout test to repo this issue. I can only repro it in the browser if I reload the page after I set the page scale factor.
Comment 6 Fady Samuel 2011-10-27 11:01:25 PDT
Created attachment 112710 [details]
Patch
Comment 7 WebKit Review Bot 2011-10-27 14:09:41 PDT
Comment on attachment 112710 [details]
Patch

Clearing flags on attachment: 112710

Committed r98637: <http://trac.webkit.org/changeset/98637>
Comment 8 WebKit Review Bot 2011-10-27 14:09:46 PDT
All reviewed patches have been landed.  Closing bug.