Bug 145321 - Avoid doing an extra layout in some cases while doing scale-to-fit
Summary: Avoid doing an extra layout in some cases while doing scale-to-fit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-22 14:44 PDT by Tim Horton
Modified: 2015-05-22 16:00 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.07 KB, patch)
2015-05-22 14:44 PDT, Tim Horton
bdakin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2015-05-22 14:44:23 PDT
Avoid doing an extra layout in some cases while doing scale-to-fit
Comment 1 Tim Horton 2015-05-22 14:44:43 PDT
Created attachment 253607 [details]
Patch
Comment 2 Tim Horton 2015-05-22 14:49:36 PDT
http://trac.webkit.org/changeset/184797
Comment 3 Said Abou-Hallawa 2015-05-22 15:49:16 PDT
Comment on attachment 253607 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253607&action=review

> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:318
> +        m_isScalingViewToFitDocument = true;

Why do we have to add this new flag? Down in this block we setFixedLayoutSize() with the scaled width. Can't we use the following condition to check whether we are in scaling mode or not:

m_webPage.fixedLayoutSize().width() < m_lastDocumentSizeForScaleToFit.width()
Comment 4 Tim Horton 2015-05-22 16:00:43 PDT
(In reply to comment #3)
> Comment on attachment 253607 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253607&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:318
> > +        m_isScalingViewToFitDocument = true;
> 
> Why do we have to add this new flag? Down in this block we
> setFixedLayoutSize() with the scaled width. Can't we use the following
> condition to check whether we are in scaling mode or not:
> 
> m_webPage.fixedLayoutSize().width() < m_lastDocumentSizeForScaleToFit.width()

Originally there were other cases (page load for example) that would cause the flag to get un-set, but that is no longer the case. Possible we could do something better, but it's nice to be explicit, too.