Bug 138472 - Preview views often misplaced inside popover
Summary: Preview views often misplaced inside popover
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-06 12:50 PST by Beth Dakin
Modified: 2014-11-06 13:03 PST (History)
4 users (show)

See Also:


Attachments
Patch (9.21 KB, patch)
2014-11-06 12:54 PST, Beth Dakin
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2014-11-06 12:50:45 PST
Preview views often misplaced inside popover
Comment 1 Beth Dakin 2014-11-06 12:54:03 PST
Created attachment 241126 [details]
Patch
Comment 2 Beth Dakin 2014-11-06 12:57:09 PST
rdar://problem/18898712
Comment 3 Tim Horton 2014-11-06 12:57:55 PST
Comment on attachment 241126 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:366
> +    return maxHortizontalTargetSizePreservingAspectRatio;

horizontal is spelled wrong here.
Comment 4 Anders Carlsson 2014-11-06 12:59:06 PST
> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:328
> +- (BOOL)_targetSize:(NSSize)targetSize fitsInAvailableSpace:(NSSize)availableSpace
> +{
> +    return targetSize.width <= availableSpace.width && targetSize.height <= availableSpace.height;
> +}

I think this should just be a static C function

bool targetSizeFitsInAvailableSpace(NSSize targetSize, NSSize availableSpace) 
{
}

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:359
> +    FloatRect maxHortizontalTargetSizePreservingAspectRatioRect = largestRectWithAspectRatioInsideRect(aspectRatio, FloatRect(0, 0, maxSpaceAvailableOnXEdge.width, maxSpaceAvailableOnXEdge.height));

Hortizontal! (Tim Hortizontal)
Comment 5 Beth Dakin 2014-11-06 13:03:55 PST
http://trac.webkit.org/changeset/175710