RESOLVED FIXED Bug 66244
Cached pages don't fully update when going back after changing the display scale factor
https://bugs.webkit.org/show_bug.cgi?id=66244
Summary Cached pages don't fully update when going back after changing the display sc...
Adam Roben (:aroben)
Reported 2011-08-15 11:58:53 PDT
To reproduce: 1. Go to data:text/html,This%20is%20some%20text 2. Go to about:blank 3. Change your display's scale factor 4. Click Back The text is blurry because it hasn't been redrawn at the new scale factor. Ew!
Attachments
Patch (6.02 KB, patch)
2011-08-23 16:01 PDT, Beth Dakin
darin: review+
Radar WebKit Bug Importer
Comment 1 2011-08-15 11:59:20 PDT
Beth Dakin
Comment 2 2011-08-23 15:36:36 PDT
Adam's original steps actually don't reproduce a bug any more, but there is still a bug here. Re-titling to reflect the remaining issues. Here are steps to reproduce the remaining issue: 1. Go to data:text/html,%3C!DOCTYPEhtml%3E%3Cstyle%3E@media(-webkit-min-device-pixel-ratio:2)%7Bspan::after%7Bcontent:'2'!important;%7D%7Dspan::after%7Bcontent:'1';%7D%3C/style%3EDevice%20pixel%20ratio:%20%3Cspan%3E%3C/span%3E 2. Go to about:blank 3. Change your display's scale factor 4. Click Back The displayed scale factor is not appropriately updated to reflect the new scale factor.
Beth Dakin
Comment 3 2011-08-23 16:01:19 PDT
Created attachment 104923 [details] Patch Here's a patch!
Darin Adler
Comment 4 2011-08-23 16:10:59 PDT
Comment on attachment 104923 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=104923&action=review Patch seems OK. Could be improved a bit. > Source/WebCore/page/Frame.cpp:1068 > + pageCache()->markPagesForFullStyleRecalc(); This will run a bit too often. It runs for the top level frame and then runs again for each subframe. That means we’ll run through the page cache over and over again. No need to do that. Also, this does more work than needed as I mention below. > Source/WebCore/page/Page.cpp:601 > + pageCache()->markPagesForFullStyleRecalc(); This does more work than it has to. Items in the page cache might be for the back/forward in other windows that have a different scale factor. It’s overkill to do it on all the pages in the page cache. Instead we could iterate the back/forward list and do it only for the history items found there.
Beth Dakin
Comment 5 2011-08-23 17:30:20 PDT
I revised the patch to address Darin's comments and got an in-person review. Committed with revision 93669.
Adam Roben (:aroben)
Comment 6 2011-08-24 07:46:56 PDT
Nice! It would be great to write a regression test for this. You could probably base it on this one: <http://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm?rev=93451>. I'd be happy to help with writing such a test.
Note You need to log in before you can comment on or make changes to this bug.