Bug 145022

Summary: Add a layout mode that scales down the view to try to fit the document
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, dino, mitz, sam, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch dino: review+

Description Tim Horton 2015-05-14 15:11:10 PDT
Add a layout mode that scales down the view to try to fit the document
Comment 1 Tim Horton 2015-05-14 15:11:38 PDT
Created attachment 253149 [details]
Patch
Comment 2 Dean Jackson 2015-05-14 15:15:25 PDT
Comment on attachment 253149 [details]
Patch

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

> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:278
> +    const int maximumDocumentWidthForScaling = 1440;
> +    const float minimumViewScale = 0.1;

Aren't these defined elsewhere?

> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:304
> +        viewScale = (float)viewWidth / (float)documentWidth;

Can documentWidth ever be zero?
Comment 3 Tim Horton 2015-05-14 15:17:54 PDT
(In reply to comment #2)
> Comment on attachment 253149 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253149&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:278
> > +    const int maximumDocumentWidthForScaling = 1440;
> > +    const float minimumViewScale = 0.1;
> 
> Aren't these defined elsewhere?

Not for this mechanism, no.

> > Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:304
> > +        viewScale = (float)viewWidth / (float)documentWidth;
> 
> Can documentWidth ever be zero?

Probably. We should probably not even try to do anything in that case. Will fix. Thanks!
Comment 4 Tim Horton 2015-05-14 15:48:14 PDT
https://trac.webkit.org/changeset/184358