Changeset 115271 in webkit


Ignore:
Timestamp:
Apr 25, 2012 6:11:42 PM (12 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=84913
WebKit 1: Initialize deviceScaleFactor on creation of the WebView
-and corresponding-
<rdar://problem/11322716>

Reviewed by Darin Adler.

Before this patch, we weren't setting the deviceScaleFactor until
viewDidMoveToWindow which is quite late for background tabs. setHostWindow will
happen early on though. For applications that don't use host windows, also set it
from _initWithFrame.

  • WebView/WebView.mm:

(-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]):
(-[WebView setHostWindow:]):
(-[WebView _deviceScaleFactor]):

Location:
trunk/Source/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r115136 r115271  
     12012-04-25  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=84913
     4        WebKit 1: Initialize deviceScaleFactor on creation of the WebView
     5        -and corresponding-
     6        <rdar://problem/11322716>
     7
     8        Reviewed by Darin Adler.
     9
     10        Before this patch, we weren't setting the deviceScaleFactor until
     11        viewDidMoveToWindow which is quite late for background tabs. setHostWindow will
     12        happen early on though. For applications that don't use host windows, also set it
     13        from _initWithFrame.
     14        * WebView/WebView.mm:
     15        (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]):
     16        (-[WebView setHostWindow:]):
     17        (-[WebView _deviceScaleFactor]):
     18
    1192012-04-24  Alexis Menard  <alexis.menard@openbossa.org>
    220
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r115005 r115271  
    847847    [self _commonInitializationWithFrameName:frameName groupName:groupName];
    848848    [self setMaintainsBackForwardList: YES];
     849    _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
    849850    return self;
    850851}
     
    39653966    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
    39663967        [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
     3968    _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
    39673969}
    39683970
     
    56655667
    56665668    NSWindow *window = [self window];
     5669    NSWindow *hostWindow = [self hostWindow];
    56675670#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    56685671    if (window)
    56695672        return [window backingScaleFactor];
     5673    if (hostWindow)
     5674        return [hostWindow backingScaleFactor];
    56705675    return [[NSScreen mainScreen] backingScaleFactor];
    56715676#else
    56725677    if (window)
    56735678        return [window userSpaceScaleFactor];
     5679    if (hostWindow)
     5680        return [hostWindow userSpaceScaleFactor];
    56745681    return [[NSScreen mainScreen] userSpaceScaleFactor];
    56755682#endif
Note: See TracChangeset for help on using the changeset viewer.