⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 187286 in webkit


Ignore:
Timestamp:
Jul 23, 2015, 9:16:02 PM (11 years ago)
Author:
Alan Bujtas
Message:

[iOS] REGRESSION (187131): Loading CuteOverload zooms in to the top left corner.
https://bugs.webkit.org/show_bug.cgi?id=147251
rdar://problem/21953359

Calling zoomToRect() should result in essentially the same zoom scale as if we
called setZoomScale with the new page scale factor.

Reviewed by Benjamin Poulain.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _didCommitLayerTree:]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r187282 r187286  
     12015-07-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        [iOS] REGRESSION (187131): Loading CuteOverload zooms in to the top left corner.
     4        https://bugs.webkit.org/show_bug.cgi?id=147251
     5        rdar://problem/21953359
     6
     7        Calling zoomToRect() should result in essentially the same zoom scale as if we
     8        called setZoomScale with the new page scale factor.
     9 
     10        Reviewed by Benjamin Poulain.
     11
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13        (-[WKWebView _didCommitLayerTree:]):
     14
    1152015-07-23  Matthew Daiter  <mdaiter@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r187272 r187286  
    968968            if (!oldUnobscuredContentRect.isEmpty() && oldUnobscuredContentRect.y() < 1) {
    969969                CGFloat relativeHorizontalPosition = oldUnobscuredContentRect.x() / oldUnobscuredContentRect.width();
    970                 CGPoint newTopLeft = [self _adjustedContentOffset: { relativeHorizontalPosition * newContentSize.width, 0 }];
     970                CGPoint newTopLeft = { relativeHorizontalPosition * newContentSize.width, 0 };
    971971                CGSize scrollViewSize = [_scrollView bounds].size;
    972                 CGSize rectToZoomSize = CGSizeMake(scrollViewSize.width * newPageScaleFactor, scrollViewSize.height * newPageScaleFactor);
     972                CGSize rectToZoomSize = CGSizeMake(scrollViewSize.width / newPageScaleFactor, scrollViewSize.height / newPageScaleFactor);
    973973                [_scrollView zoomToRect: { newTopLeft, rectToZoomSize } animated:NO];
     974                ASSERT(areEssentiallyEqualAsFloat(newPageScaleFactor, contentZoomScale(self)));
    974975            } else
    975976                [_scrollView setZoomScale:newPageScaleFactor];
Note: See TracChangeset for help on using the changeset viewer.