Title: [100532] branches/safari-534.53-branch/Source

Diff

Modified: branches/safari-534.53-branch/Source/WebKit/mac/ChangeLog (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit/mac/ChangeLog	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit/mac/ChangeLog	2011-11-17 01:08:49 UTC (rev 100532)
@@ -1,5 +1,25 @@
 2011-11-16  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 94122
+
+    2011-08-30  Beth Dakin  <bda...@apple.com>
+
+            https://bugs.webkit.org/show_bug.cgi?id=67150
+            Would like API to use a custom device scale factor for a particular WebView/WKView
+            -and corresponding-
+            <rdar://problem/10041016>
+
+            Reviewed by Darin Adler.
+
+            New API is _setOverrideBackingScaleFactor:(CGFloat)
+            * WebView/WebView.mm:
+            (-[WebView _setOverrideBackingScaleFactor:]):
+            (-[WebView _deviceScaleFactor]):
+            * WebView/WebViewData.h:
+            * WebView/WebViewPrivate.h:
+
+2011-11-16  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 99315 
 
     2011-08-18  Adam Roben  <aro...@apple.com>

Modified: branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebView.mm (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebView.mm	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebView.mm	2011-11-17 01:08:49 UTC (rev 100532)
@@ -2832,6 +2832,16 @@
     return view->fixedLayoutSize();
 }
 
+- (void)_setOverrideBackingScaleFactor:(CGFloat)overrideScaleFactor
+{
+    float oldScaleFactor = [self _deviceScaleFactor];
+
+    _private->overrideBackingScaleFactor = overrideScaleFactor;
+
+    if (oldScaleFactor != [self _deviceScaleFactor])
+        _private->page->setDeviceScaleFactor(overrideScaleFactor);
+}
+
 - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(NSUInteger)limit
 {
     return [self countMatchesForText:string options:(caseFlag ? 0 : WebFindOptionsCaseInsensitive) highlight:highlight limit:limit markMatches:YES];
@@ -5583,7 +5593,10 @@
 
 - (float)_deviceScaleFactor
 {
-    NSWindow *window = [self window]; 
+    if (_private->overrideBackingScaleFactor != 0)
+        return _private->overrideBackingScaleFactor;
+
+    NSWindow *window = [self window];
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     if (window)
         return [window backingScaleFactor];

Modified: branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebViewData.h (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebViewData.h	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebViewData.h	2011-11-17 01:08:49 UTC (rev 100532)
@@ -189,5 +189,7 @@
 
     BOOL interactiveFormValidationEnabled;
     int validationMessageTimerMagnification;
+
+    float overrideBackingScaleFactor;
 }
 @end

Modified: branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebViewPrivate.h (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebViewPrivate.h	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebViewPrivate.h	2011-11-17 01:08:49 UTC (rev 100532)
@@ -559,6 +559,8 @@
 - (BOOL)_useFixedLayout;
 - (NSSize)_fixedLayoutSize;
 
+- (void)_setOverrideBackingScaleFactor:(CGFloat)overrideScaleFactor;
+
 // Deprecated. Use the methods in pending public above instead.
 - (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit;
 - (WebNSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;

Modified: branches/safari-534.53-branch/Source/WebKit2/ChangeLog (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit2/ChangeLog	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit2/ChangeLog	2011-11-17 01:08:49 UTC (rev 100532)
@@ -1,5 +1,30 @@
 2011-11-16  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 94122
+
+    2011-08-30  Beth Dakin  <bda...@apple.com>
+
+            https://bugs.webkit.org/show_bug.cgi?id=67150
+            Would like API to use a custom device scale factor for a particular WebView/WKView
+            -and corresponding-
+            <rdar://problem/10041016>
+
+            Reviewed by Darin Adler.
+
+            New API is setOverrideBackingScaleFactor() on WKPage
+            * UIProcess/API/C/WKPage.cpp:
+            (WKPageGetOverrideBackingScaleFactor):
+            (WKPageSetOverrideBackingScaleFactor):
+            * UIProcess/API/C/WKPage.h:
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::WebPageProxy):
+            (WebKit::WebPageProxy::deviceScaleFactor):
+            (WebKit::WebPageProxy::setOverrideBackingScaleFactor):
+            * UIProcess/WebPageProxy.h:
+            (WebKit::WebPageProxy::overrideBackingScaleFactor):
+
+2011-11-16  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 99315 
 
     2011-08-18  Adam Roben  <aro...@apple.com>

Modified: branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2011-11-17 01:08:49 UTC (rev 100532)
@@ -259,6 +259,16 @@
     return toImpl(pageRef)->textZoomFactor();
 }
 
+double WKPageGetOverrideBackingScaleFactor(WKPageRef pageRef)
+{
+    return toImpl(pageRef)->overrideBackingScaleFactor();
+}
+
+void WKPageSetOverrideBackingScaleFactor(WKPageRef pageRef, double overrideScaleFactor)
+{
+    toImpl(pageRef)->setOverrideBackingScaleFactor(overrideScaleFactor);
+}
+
 bool WKPageSupportsTextZoom(WKPageRef pageRef)
 {
     return toImpl(pageRef)->supportsTextZoom();

Modified: branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/C/WKPage.h (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/C/WKPage.h	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/C/WKPage.h	2011-11-17 01:08:49 UTC (rev 100532)
@@ -327,6 +327,9 @@
 WK_EXPORT WKDataRef WKPageCopySessionState(WKPageRef page, void* context, WKPageSessionStateFilterCallback urlAllowedCallback);
 WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKDataRef sessionStateData);
 
+WK_EXPORT double WKPageGetOverrideBackingScaleFactor(WKPageRef page);
+WK_EXPORT void WKPageSetOverrideBackingScaleFactor(WKPageRef page, double overrideScaleFactor);
+
 WK_EXPORT bool WKPageSupportsTextZoom(WKPageRef page);
 WK_EXPORT double WKPageGetTextZoomFactor(WKPageRef page);
 WK_EXPORT void WKPageSetTextZoomFactor(WKPageRef page, double zoomFactor);

Modified: branches/safari-534.53-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-11-17 01:08:49 UTC (rev 100532)
@@ -125,6 +125,7 @@
     , m_pageZoomFactor(1)
     , m_pageScaleFactor(1)
     , m_deviceScaleFactor(1)
+    , m_overrideBackingScaleFactor(0)
     , m_drawsBackground(true)
     , m_drawsTransparentBackground(false)
     , m_areMemoryCacheClientCallsEnabled(true)
@@ -1157,6 +1158,29 @@
     m_drawingArea->deviceScaleFactorDidChange();
 }
 
+float WebPageProxy::deviceScaleFactor() const
+{
+    if (m_overrideBackingScaleFactor)
+        return m_overrideBackingScaleFactor;
+    return m_deviceScaleFactor;
+}
+
+void WebPageProxy::setOverrideBackingScaleFactor(float overrideScaleFactor)
+{
+    if (!isValid())
+        return;
+
+    if (m_overrideBackingScaleFactor == overrideScaleFactor)
+        return;
+
+    float oldScaleFactor = deviceScaleFactor();
+
+    m_overrideBackingScaleFactor = overrideScaleFactor;
+
+    if (deviceScaleFactor() != oldScaleFactor)
+        m_drawingArea->deviceScaleFactorDidChange();
+}
+
 void WebPageProxy::setUseFixedLayout(bool fixed)
 {
     if (!isValid())

Modified: branches/safari-534.53-branch/Source/WebKit2/UIProcess/WebPageProxy.h (100531 => 100532)


--- branches/safari-534.53-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2011-11-17 01:02:30 UTC (rev 100531)
+++ branches/safari-534.53-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2011-11-17 01:08:49 UTC (rev 100532)
@@ -362,8 +362,11 @@
     double pageScaleFactor() const { return m_pageScaleFactor; }
 
     void setDeviceScaleFactor(float);
-    float deviceScaleFactor() const { return m_deviceScaleFactor; }
+    float deviceScaleFactor() const;
 
+    void setOverrideBackingScaleFactor(float);
+    float overrideBackingScaleFactor() const { return m_overrideBackingScaleFactor; }
+
     void setUseFixedLayout(bool);
     void setFixedLayoutSize(const WebCore::IntSize&);
     bool useFixedLayout() const { return m_useFixedLayout; };
@@ -831,6 +834,7 @@
     double m_pageZoomFactor;
     double m_pageScaleFactor;
     float m_deviceScaleFactor;
+    float m_overrideBackingScaleFactor;
 
     bool m_drawsBackground;
     bool m_drawsTransparentBackground;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to