Bug 145321

Summary: Avoid doing an extra layout in some cases while doing scale-to-fit
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, sam, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bdakin: review+

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.