Title: [115271] trunk/Source/WebKit/mac
- Revision
- 115271
- Author
- bda...@apple.com
- Date
- 2012-04-25 18:11:42 -0700 (Wed, 25 Apr 2012)
Log 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]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/mac/ChangeLog (115270 => 115271)
--- trunk/Source/WebKit/mac/ChangeLog 2012-04-26 01:07:35 UTC (rev 115270)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-04-26 01:11:42 UTC (rev 115271)
@@ -1,3 +1,21 @@
+2012-04-25 Beth Dakin <bda...@apple.com>
+
+ 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]):
+
2012-04-24 Alexis Menard <alexis.men...@openbossa.org>
Replace occurences of style selector from variables and methods names by style resolver.
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (115270 => 115271)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2012-04-26 01:07:35 UTC (rev 115270)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2012-04-26 01:11:42 UTC (rev 115271)
@@ -846,6 +846,7 @@
_private = [[WebViewPrivate alloc] init];
[self _commonInitializationWithFrameName:frameName groupName:groupName];
[self setMaintainsBackForwardList: YES];
+ _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
return self;
}
@@ -3964,6 +3965,7 @@
_private->hostWindow = [hostWindow retain];
for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
[[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
+ _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
}
- (NSWindow *)hostWindow
@@ -5664,13 +5666,18 @@
return _private->customDeviceScaleFactor;
NSWindow *window = [self window];
+ NSWindow *hostWindow = [self hostWindow];
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
if (window)
return [window backingScaleFactor];
+ if (hostWindow)
+ return [hostWindow backingScaleFactor];
return [[NSScreen mainScreen] backingScaleFactor];
#else
if (window)
return [window userSpaceScaleFactor];
+ if (hostWindow)
+ return [hostWindow userSpaceScaleFactor];
return [[NSScreen mainScreen] userSpaceScaleFactor];
#endif
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes