Bug 145022 - Add a layout mode that scales down the view to try to fit the document
Summary: Add a layout mode that scales down the view to try to fit the document
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-14 15:11 PDT by Tim Horton
Modified: 2015-05-14 15:48 PDT (History)
6 users (show)

See Also:


Attachments
Patch (22.28 KB, patch)
2015-05-14 15:11 PDT, Tim Horton
dino: 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-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