Clear up scale factor terminology
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Aug 2011 13:43:29 +0000 (13:43 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Aug 2011 13:43:29 +0000 (13:43 +0000)
WebKit by and large deals with two scale factors: one intrinsic to the device on which the
software is running, and one that is per-Page and can be controlled via API calls. This
patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
code use those names. It should introduce no behavior changes.

Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
device scale factor

Reviewed by Simon Fraser.

Source/WebCore:

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
Removed an unused member. This is unrelated to this patch.

* css/MediaQueryEvaluator.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLCanvasElement.h:
* loader/EmptyClients.h:
* page/Chrome.cpp:
* page/Chrome.h:
* page/ChromeClient.h:
* page/DOMWindow.cpp:
* page/Frame.cpp:
* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* rendering/RenderInline.cpp:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.cpp:

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
* src/ChromeClientImpl.h:

Source/WebKit/efl:

* WebCoreSupport/ChromeClientEfl.cpp:
* WebCoreSupport/ChromeClientEfl.h:

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp:
* WebCoreSupport/ChromeClientGtk.h:

Source/WebKit/haiku:

* WebCoreSupport/ChromeClientHaiku.cpp:
* WebCoreSupport/ChromeClientHaiku.h:

Source/WebKit/mac:

* Misc/WebNSControlExtras.m:
(-[NSControl sizeToFitAndAdjustWindowHeight]): Updated this function to use more modern
AppKit scale factor terminology. (This is unrelated to the rest of the patch.)

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:

Source/WebKit/qt:

* WebCoreSupport/ChromeClientQt.cpp:
* WebCoreSupport/ChromeClientQt.h:

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
* WebCoreSupport/WebChromeClient.h:

Source/WebKit/wince:

* WebCoreSupport/ChromeClientWinCE.cpp:
* WebCoreSupport/ChromeClientWinCE.h:

Source/WebKit/wx:

* WebKitSupport/ChromeClientWx.cpp:
* WebKitSupport/ChromeClientWx.h:

Source/WebKit2:

* Shared/UpdateInfo.cpp:
* Shared/UpdateInfo.h:
* Shared/WebPageCreationParameters.cpp:
* Shared/WebPageCreationParameters.h:
* UIProcess/API/C/WKPage.cpp:
* UIProcess/API/efl/PageClientImpl.cpp:
* UIProcess/API/efl/PageClientImpl.h:
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
* UIProcess/BackingStore.cpp:
* UIProcess/BackingStore.h:
* UIProcess/DrawingAreaProxyImpl.cpp:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPopupMenuProxy.h:
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
* UIProcess/gtk/WebPopupMenuProxyGtk.h:
* UIProcess/mac/BackingStoreMac.mm:
* UIProcess/mac/WebPageProxyMac.mm:
* UIProcess/mac/WebPopupMenuProxyMac.h:
* UIProcess/mac/WebPopupMenuProxyMac.mm:
* UIProcess/qt/WebPopupMenuProxyQt.h:
* UIProcess/win/WebPopupMenuProxyWin.h:
* UIProcess/win/WebView.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
* WebProcess/WebPage/ca/LayerTreeHostCA.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93040 268f45cc-cd09-0410-ab3c-d52691b4dbfc

90 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLCanvasElement.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebNSControlExtras.m
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/UpdateInfo.cpp
Source/WebKit2/Shared/UpdateInfo.h
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/BackingStore.cpp
Source/WebKit2/UIProcess/BackingStore.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/WebPopupMenuProxy.h
Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h
Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.h
Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm
Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.h
Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.h
Source/WebKit2/UIProcess/win/WebView.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h

index 0657dae8f9029244e0e453c80928165309c3717b..f0f31b01370f5860ca57782741009312c533e942 100644 (file)
@@ -1,3 +1,42 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        Removed an unused member. This is unrelated to this patch.
+
+        * css/MediaQueryEvaluator.cpp:
+        * html/HTMLCanvasElement.cpp:
+        * html/HTMLCanvasElement.h:
+        * loader/EmptyClients.h:
+        * page/Chrome.cpp:
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * page/DOMWindow.cpp:
+        * page/Frame.cpp:
+        * page/Frame.h:
+        * platform/graphics/GraphicsLayer.cpp:
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/GraphicsLayerClient.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        * rendering/RenderInline.cpp:
+        * rendering/RenderLayerBacking.cpp:
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerCompositor.cpp:
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderObject.cpp:
+
 2011-08-15  Oliver Varga  <Varga.Oliver@stud.u-szeged.hu>
 
         Reviewed by Nikolas Zimmermann.
index ccc6f843ee5238431c6aac22a79686645af3d7c1..d709b23dff0a03852e382be6973e2dd4dbd23014 100644 (file)
@@ -291,9 +291,9 @@ static bool device_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle*, F
 static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
 {
     if (value)
-        return value->isPrimitiveValue() && compareValue(frame->page()->chrome()->scaleFactor(), static_cast<CSSPrimitiveValue*>(value)->getFloatValue(), op);
+        return value->isPrimitiveValue() && compareValue(frame->page()->chrome()->deviceScaleFactor(), static_cast<CSSPrimitiveValue*>(value)->getFloatValue(), op);
 
-    return frame->page()->chrome()->scaleFactor() != 0;
+    return frame->page()->chrome()->deviceScaleFactor() != 0;
 }
 
 static bool gridMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
index d6378ced0b200dbdb055002ebd376e7bd7843333..cc9cd21eb88045fdd5805f9f9809a76f4a3905a0 100644 (file)
@@ -79,7 +79,7 @@ HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document* doc
     , m_size(DefaultWidth, DefaultHeight)
     , m_rendererIsCanvas(false)
     , m_ignoreReset(false)
-    , m_pageScaleFactor(document->frame() ? document->frame()->page()->chrome()->scaleFactor() : 1)
+    , m_deviceScaleFactor(document->frame() ? document->frame()->page()->chrome()->deviceScaleFactor() : 1)
     , m_originClean(true)
     , m_hasCreatedImageBuffer(false)
 {
@@ -382,10 +382,10 @@ PassRefPtr<ImageData> HTMLCanvasElement::getImageData()
 IntRect HTMLCanvasElement::convertLogicalToDevice(const FloatRect& logicalRect) const
 {
     // Prevent under/overflow by ensuring the rect's bounds stay within integer-expressible range
-    int left = clampToInteger(floorf(logicalRect.x() * m_pageScaleFactor));
-    int top = clampToInteger(floorf(logicalRect.y() * m_pageScaleFactor));
-    int right = clampToInteger(ceilf(logicalRect.maxX() * m_pageScaleFactor));
-    int bottom = clampToInteger(ceilf(logicalRect.maxY() * m_pageScaleFactor));
+    int left = clampToInteger(floorf(logicalRect.x() * m_deviceScaleFactor));
+    int top = clampToInteger(floorf(logicalRect.y() * m_deviceScaleFactor));
+    int right = clampToInteger(ceilf(logicalRect.maxX() * m_deviceScaleFactor));
+    int bottom = clampToInteger(ceilf(logicalRect.maxY() * m_deviceScaleFactor));
 
     return IntRect(IntPoint(left, top), convertToValidDeviceSize(right - left, bottom - top));
 }
@@ -393,8 +393,8 @@ IntRect HTMLCanvasElement::convertLogicalToDevice(const FloatRect& logicalRect)
 IntSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize& logicalSize) const
 {
     // Prevent overflow by ensuring the rect's bounds stay within integer-expressible range
-    float width = clampToInteger(ceilf(logicalSize.width() * m_pageScaleFactor));
-    float height = clampToInteger(ceilf(logicalSize.height() * m_pageScaleFactor));
+    float width = clampToInteger(ceilf(logicalSize.width() * m_deviceScaleFactor));
+    float height = clampToInteger(ceilf(logicalSize.height() * m_deviceScaleFactor));
     return convertToValidDeviceSize(width, height);
 }
 
index 664defc15e3ccd317af331b96e806919a0f6989c..0535dcf41001f39fbb1320dc27e9fd92a7f4148e 100644 (file)
@@ -153,7 +153,7 @@ private:
     bool m_ignoreReset;
     FloatRect m_dirtyRect;
 
-    float m_pageScaleFactor;
+    float m_deviceScaleFactor;
     bool m_originClean;
 
     // m_createdImageBuffer means we tried to malloc the buffer.  We didn't necessarily get it.
index ac430a57ba91dfa1cf1870bccb4057f4e86d0056..952507e4e388746871fa74ce33ac20801c457cd7 100644 (file)
@@ -93,7 +93,7 @@ public:
 
     virtual FloatRect pageRect() { return FloatRect(); }
 
-    virtual float scaleFactor() { return 1.f; }
+    virtual float deviceScaleFactor() { return 1.f; }
 
     virtual void focus() { }
     virtual void unfocus() { }
index 5b47f199e380f92c0846d78fc3ae8668ad9d0a31..efec62edeb8de32057b63aad480f2512b9b67160 100644 (file)
@@ -151,9 +151,9 @@ FloatRect Chrome::pageRect() const
     return m_client->pageRect();
 }
 
-float Chrome::scaleFactor()
+float Chrome::deviceScaleFactor()
 {
-    return m_client->scaleFactor();
+    return m_client->deviceScaleFactor();
 }
 
 void Chrome::focus() const
index 2ed6e7226799cabdbedb37a9d6dbc99a197087ef..67777ad05475242cc5575825bbe23f1701173492 100644 (file)
@@ -97,7 +97,7 @@ namespace WebCore {
 
         FloatRect pageRect() const;
         
-        float scaleFactor();
+        float deviceScaleFactor();
 
         void focus() const;
         void unfocus() const;
index 17f7906a8e469475408b42a565ed5fc9966c950e..84c377405b3bcc1a1875a236c4e099a037cfcd58 100644 (file)
@@ -88,7 +88,7 @@ namespace WebCore {
         
         virtual FloatRect pageRect() = 0;
         
-        virtual float scaleFactor() = 0;
+        virtual float deviceScaleFactor() = 0;
     
         virtual void focus() = 0;
         virtual void unfocus() = 0;
index 6ca5b37d21b962a1db2b0a06e63e906bb67d3f2d..b85f1eaa32b16497f44da3ceece26df46077acc0 100644 (file)
@@ -1342,7 +1342,7 @@ double DOMWindow::devicePixelRatio() const
     if (!page)
         return 0.0;
 
-    return page->chrome()->scaleFactor();
+    return page->chrome()->deviceScaleFactor();
 }
 
 #if ENABLE(DATABASE)
index f3aae300b352feff5bd71234f9414aa524c92308..c546136dd140f32d3c01f4f9bb06da0585fae085 100644 (file)
@@ -1064,14 +1064,14 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
 }
 
 #if USE(ACCELERATED_COMPOSITING)
-void Frame::pageScaleFactorChanged(float scale)
+void Frame::deviceOrPageScaleFactorChanged()
 {
     for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
-        child->pageScaleFactorChanged(scale);
+        child->deviceOrPageScaleFactorChanged();
 
     RenderView* root = contentRenderer();
     if (root && root->compositor())
-        root->compositor()->pageScaleFactorChanged();
+        root->compositor()->deviceOrPageScaleFactorChanged();
 }
 #endif
 
@@ -1090,7 +1090,7 @@ void Frame::scalePage(float scale, const IntPoint& origin)
         document->recalcStyle(Node::Force);
 
 #if USE(ACCELERATED_COMPOSITING)
-        pageScaleFactorChanged(scale);
+        deviceOrPageScaleFactorChanged();
 #endif
     }
 
index 6486c06f0a1df053e42559481fb621410b21727e..d73a0a8d1b9f5afe7090c531bcdd7617ed04afa6 100644 (file)
@@ -218,7 +218,7 @@ namespace WebCore {
         void lifeSupportTimerFired(Timer<Frame>*);
 
 #if USE(ACCELERATED_COMPOSITING)
-        void pageScaleFactorChanged(float);
+        void deviceOrPageScaleFactorChanged();
 #endif
 
         HashSet<FrameDestructionObserver*> m_destructionObservers;
index 6ac2a5b20567029607c5cad1007d76f1a1ba7c1d..2f8a8e261b4bb1be1a7a7b66dff9a3c51e0b3f09 100644 (file)
@@ -224,20 +224,20 @@ void GraphicsLayer::removeFromParent()
     }
 }
 
-void GraphicsLayer::notePageScaleFactorChangedIncludingDescendants()
+void GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants()
 {
-    pageScaleFactorChanged();
+    deviceOrPageScaleFactorChanged();
 
     if (m_maskLayer)
-        m_maskLayer->pageScaleFactorChanged();
+        m_maskLayer->deviceOrPageScaleFactorChanged();
 
     if (m_replicaLayer)
-        m_replicaLayer->notePageScaleFactorChangedIncludingDescendants();
+        m_replicaLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
 
     const Vector<GraphicsLayer*>& childLayers = children();
     size_t numChildren = childLayers.size();
     for (size_t i = 0; i < numChildren; ++i)
-        childLayers[i]->notePageScaleFactorChangedIncludingDescendants();
+        childLayers[i]->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
 }
 
 void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
index 856056af9b7ce3d5963a1611924263788a263e2d..17a2fd7bc89bb9db93043a575a6c33892d6df072 100644 (file)
@@ -357,10 +357,10 @@ public:
     bool appliesPageScale() const { return m_appliesPageScale; }
 
     float pageScaleFactor() const { return m_client ? m_client->pageScaleFactor() : 1; }
-    float backingScaleFactor() const { return m_client ? m_client->backingScaleFactor() : 1; }
+    float deviceScaleFactor() const { return m_client ? m_client->deviceScaleFactor() : 1; }
 
-    virtual void pageScaleFactorChanged() { }
-    void notePageScaleFactorChangedIncludingDescendants();
+    virtual void deviceOrPageScaleFactorChanged() { }
+    void noteDeviceOrPageScaleFactorChangedIncludingDescendants();
 
     // Some compositing systems may do internal batching to synchronize compositing updates
     // with updates drawn into the window. These methods flush internal batched state on this layer
index f66b36240d6c0c61c6ea4b619ba2dbf05a5116e8..dbe6f6f01c670ce6eddb73dc13fc53a55c855107 100644 (file)
@@ -65,7 +65,7 @@ public:
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const { }
 
     // Multiplier for backing store size, related to high DPI.
-    virtual float backingScaleFactor() const { return 1; }
+    virtual float deviceScaleFactor() const { return 1; }
     // Page scale factor.
     virtual float pageScaleFactor() const { return 1; }
 
index 37793490d1c3a15e2bd38997f41f54801b51e89c..62527f50ce8386e06eca58a60b4114efd19df78d 100644 (file)
@@ -53,7 +53,6 @@ MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation(MediaPlayer* play
     , m_networkState(MediaPlayer::Empty)
     , m_readyState(MediaPlayer::HaveNothing)
     , m_preload(MediaPlayer::Auto)
-    , m_scaleFactor(1, 1)
     , m_cachedMaxTimeLoaded(0)
     , m_cachedMaxTimeSeekable(0)
     , m_cachedDuration(invalidTime())
index c8fae3deb9d822ded362305553d8e54a85eaeabd..2b08daac21bb063e68e611e8106f3a4e256f39e9 100644 (file)
@@ -254,7 +254,6 @@ private:
 
     String m_assetURL;
     MediaPlayer::Preload m_preload;
-    FloatSize m_scaleFactor;
 
     IntSize m_cachedNaturalSize;
     mutable float m_cachedMaxTimeLoaded;
index 4d03bd385ae13f3bfa76860bf166e047fee47624..e059e96cfa80e42b981486b19b4385cdb20337ae 100644 (file)
@@ -2047,7 +2047,7 @@ void GraphicsLayerCA::updateContentsScale(float pageScaleFactor, const FloatPoin
     if (needTiledLayer != m_usingTiledLayer)
         swapFromOrToTiledLayer(needTiledLayer, pageScaleFactor, positionRelativeToBase);
 
-    float contentsScale = clampedContentsScaleForScale(pageScaleFactor * backingScaleFactor());
+    float contentsScale = clampedContentsScaleForScale(pageScaleFactor * deviceScaleFactor());
     
     m_layer->setContentsScale(contentsScale);
     if (drawsContent())
@@ -2102,7 +2102,7 @@ bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
     if (!m_drawsContent || !m_allowTiledLayer)
         return false;
 
-    float contentsScale = pageScaleFactor * backingScaleFactor();
+    float contentsScale = pageScaleFactor * deviceScaleFactor();
 
     // FIXME: catch zero-size height or width here (or earlier)?
     return m_size.width() * contentsScale > cMaxPixelDimension || m_size.height() * contentsScale > cMaxPixelDimension;
index fbaed12744af8ed0e58d2a524955fd9e3cdbc449..6a255abd8e23408e2b3be43dcde26d6ad5d27251 100644 (file)
@@ -1539,10 +1539,10 @@ void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
         region.bounds.setY(absPos.y() + region.bounds.y());
 
         if (frame()) {
-            float pageScaleFactor = frame()->page()->chrome()->scaleFactor();
-            if (pageScaleFactor != 1.0f) {
-                region.bounds.scale(pageScaleFactor);
-                region.clip.scale(pageScaleFactor);
+            float deviceScaleFactor = frame()->page()->chrome()->deviceScaleFactor();
+            if (deviceScaleFactor != 1.0f) {
+                region.bounds.scale(deviceScaleFactor);
+                region.clip.scale(deviceScaleFactor);
             }
         }
 
index aabfb130d5954ae49d609dff50780d22e4326227..33a280e1fccf8a7de61edf73c7e70c39da066bdd 100644 (file)
@@ -1253,9 +1253,9 @@ float RenderLayerBacking::pageScaleFactor() const
     return compositor()->pageScaleFactor();
 }
 
-float RenderLayerBacking::backingScaleFactor() const
+float RenderLayerBacking::deviceScaleFactor() const
 {
-    return compositor()->backingScaleFactor();
+    return compositor()->deviceScaleFactor();
 }
 
 void RenderLayerBacking::didCommitChangesForLayer(const GraphicsLayer*) const
index de6db4683d63e6bd5cccc9f4413a4381814c2eb9..656069eb5979f74e5cf8b92381c6c21639e6bcab 100644 (file)
@@ -128,7 +128,7 @@ public:
 
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clip);
 
-    virtual float backingScaleFactor() const;
+    virtual float deviceScaleFactor() const;
     virtual float pageScaleFactor() const;
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const;
 
index 78cce389114ec6408a6153baa6012099cbc0d642..c378b2a84aa06cae9e854ef89adac729edde2ab9 100644 (file)
@@ -1553,7 +1553,7 @@ void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gr
     }
 }
 
-float RenderLayerCompositor::backingScaleFactor() const
+float RenderLayerCompositor::deviceScaleFactor() const
 {
     Frame* frame = m_renderView->frameView()->frame();
     if (!frame)
@@ -1561,7 +1561,7 @@ float RenderLayerCompositor::backingScaleFactor() const
     Page* page = frame->page();
     if (!page)
         return 1;
-    return page->chrome()->scaleFactor();
+    return page->chrome()->deviceScaleFactor();
 }
 
 float RenderLayerCompositor::pageScaleFactor() const
@@ -1901,7 +1901,7 @@ bool RenderLayerCompositor::layerHas3DContent(const RenderLayer* layer) const
     return false;
 }
 
-void RenderLayerCompositor::pageScaleFactorChanged()
+void RenderLayerCompositor::deviceOrPageScaleFactorChanged()
 {
     // Start at the RenderView's layer, since that's where the scale is applied.
     RenderLayer* viewLayer = m_renderView->layer();
@@ -1909,7 +1909,7 @@ void RenderLayerCompositor::pageScaleFactorChanged()
         return;
 
     if (GraphicsLayer* rootLayer = viewLayer->backing()->graphicsLayer())
-        rootLayer->notePageScaleFactorChangedIncludingDescendants();
+        rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
 }
 
 } // namespace WebCore
index b2bc997e73965e875f456589de05d3080e7f58e4..65decc55e43db838c294efd198d6cf3a5c20717c 100644 (file)
@@ -186,13 +186,13 @@ public:
     bool compositorShowDebugBorders() const { return m_showDebugBorders; }
     bool compositorShowRepaintCounter() const { return m_showRepaintCounter; }
 
-    virtual float backingScaleFactor() const;
+    virtual float deviceScaleFactor() const;
     virtual float pageScaleFactor() const;
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const;
     
     bool keepLayersPixelAligned() const;
 
-    void pageScaleFactorChanged();
+    void deviceOrPageScaleFactorChanged();
 
     GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
index e46108f4c7a4a2720ac282af90346b16efb3fa1d..d6c88a0296711de384bbf8e9515920bee535145c 100644 (file)
@@ -2369,10 +2369,10 @@ void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
         region.bounds.setY(absPos.y() + styleRegion.offset.top().value());
 
         if (frame()) {
-            float pageScaleFactor = frame()->page()->chrome()->scaleFactor();
-            if (pageScaleFactor != 1.0f) {
-                region.bounds.scale(pageScaleFactor);
-                region.clip.scale(pageScaleFactor);
+            float deviceScaleFactor = frame()->page()->chrome()->deviceScaleFactor();
+            if (deviceScaleFactor != 1.0f) {
+                region.bounds.scale(deviceScaleFactor);
+                region.clip.scale(deviceScaleFactor);
             }
         }
 
index f05420c8f562411d75249fbe8126acb924992c38..abc8ed58974ae407f99298a52dbf68b5f73e660e 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * src/ChromeClientImpl.cpp:
+        * src/ChromeClientImpl.h:
+
 2011-08-12  Fady Samuel  <fsamuel@chromium.org>
 
         Refactoring of PopupMenuChromium For Readability and Maintainability
index 0b21c9b9f3d945ecbb55d8535ba97afe4bc3406d..a07dfb5f015448fa82b4bdc0a09b9ffcb6f28ab6 100644 (file)
@@ -205,9 +205,9 @@ FloatRect ChromeClientImpl::pageRect()
     return windowRect();
 }
 
-float ChromeClientImpl::scaleFactor()
+float ChromeClientImpl::deviceScaleFactor()
 {
-    // This is supposed to return the scale factor of the web page. It looks like
+    // This is supposed to return the scale factor of the device. It looks like
     // the implementor of the graphics layer is responsible for doing most of the
     // operations associated with scaling. However, this value is used ins some
     // cases by WebCore. For example, this is used as a scaling factor in canvas
index 7111c4f5f8a4800328ec1e61155f5b488777b792..7139e1ffbdafa56dd18fec893511f76dd20b1e87 100644 (file)
@@ -65,7 +65,7 @@ public:
     virtual void setWindowRect(const WebCore::FloatRect&);
     virtual WebCore::FloatRect windowRect();
     virtual WebCore::FloatRect pageRect();
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
     virtual void focus();
     virtual void unfocus();
     virtual bool canTakeFocus(WebCore::FocusDirection);
index cfacc738ca12090b9dd44b6a2a207be9c66d6325..465b5fd75f57dd4ea2c62c6993c67b6fc9d92b43 100755 (executable)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/ChromeClientEfl.cpp:
+        * WebCoreSupport/ChromeClientEfl.h:
+
 2011-08-12  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         [EFL] Fix after r91815 - restore changes from r91659.
index f7c4cd5160cd79cf14a5b051b5a8771f5cfe4e78..cadea80530b6e2ece2e79fa0edf03d44fc9576dd 100644 (file)
@@ -128,7 +128,7 @@ FloatRect ChromeClientEfl::pageRect()
     return ewk_view_page_rect_get(m_view);
 }
 
-float ChromeClientEfl::scaleFactor()
+float ChromeClientEfl::deviceScaleFactor()
 {
     notImplemented();
     return 1.0;
index 75f9f4974edd3fb6f956e922dfb852462e290236..fc726b90529dd9a2d8d4018db41c9224b914e1e6 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     virtual FloatRect pageRect();
 
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
 
     virtual void focus();
     virtual void unfocus();
index fb97fe5800309dce7cc82bdf17410bb9818ae744..3e336028d88d2dce7cb112cef7300e348f602686 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ChromeClientGtk.h:
+
 2011-08-11  Gustavo Noronha Silva  <gns@gnome.org>
 
         Add the javascript core dynamic library for gtk-doc's introspection helper.
index 71f448bdec64847abe0157e7a30270f7ca795ded..4fc790afb568e223d74491e94a6f83e5e878676f 100644 (file)
@@ -137,7 +137,7 @@ FloatRect ChromeClient::pageRect()
     return IntRect(allocation.x, allocation.y, allocation.width, allocation.height);
 }
 
-float ChromeClient::scaleFactor()
+float ChromeClient::deviceScaleFactor()
 {
     // Not implementable
     return 1.0;
index 754ba953d673e1b556f9036c1e4120b5417b2df1..e58a7cdb46a29f27fad9bbebdc2ddeb5ccde3039 100644 (file)
@@ -48,7 +48,7 @@ namespace WebKit {
 
         virtual WebCore::FloatRect pageRect();
 
-        virtual float scaleFactor();
+        virtual float deviceScaleFactor();
 
         virtual void focus();
         virtual void unfocus();
index 02a5f0099147db7604c072ae3d6fd22cd372c91d..356abdec7b584e218de1e4f6ed7236afd80b6e5a 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/ChromeClientHaiku.cpp:
+        * WebCoreSupport/ChromeClientHaiku.h:
+
 2011-08-03  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: remove Node parameter from the InspectorClient::highlight
index 81e5a80b8124dd9f3b21db9558fd97e1f6733477..224869ba99ea595559cb2573fedb535067d71663 100644 (file)
@@ -78,7 +78,7 @@ FloatRect ChromeClientHaiku::pageRect()
     return FloatRect(0, 0, 200, 200);
 }
 
-float ChromeClientHaiku::scaleFactor()
+float ChromeClientHaiku::deviceScaleFactor()
 {
     notImplemented();
     return 1.0;
index a88b82550ce0f7b5b7d18e6263686099c2e75316..eb2c4ef7afe458fe94d73a7a925fca1c0d3a976f 100644 (file)
@@ -51,7 +51,7 @@ namespace WebCore {
 
         virtual FloatRect pageRect();
 
-        virtual float scaleFactor();
+        virtual float deviceScaleFactor();
 
         virtual void focus();
         virtual void unfocus();
index 741293524e960228e542625e72b42008e08a2676..1f1123ab1e9ae0bfbf79e22efb53c727946b9e60 100644 (file)
@@ -1,3 +1,24 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * Misc/WebNSControlExtras.m:
+        (-[NSControl sizeToFitAndAdjustWindowHeight]): Updated this function to use more modern
+        AppKit scale factor terminology. (This is unrelated to the rest of the patch.)
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+
 2011-08-13  Dan Bernstein  <mitz@apple.com>
 
         Changed the value of WebKitShowsToolTipOverTruncatedTextPreferenceKey to match the naming everywhere else.
index dc91e2333ae174602f36a92792893cad7588abbe..6edf84f6bb20d9a0231c0d99089734b3ba7b2f1d 100644 (file)
     NSWindow *window = [self window];
     NSRect windowFrame = [window frame];
 
-    CGFloat userSpaceScaleFactor;
+    CGFloat backingScaleFactor;
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-    userSpaceScaleFactor = [window backingScaleFactor];
+    backingScaleFactor = [window backingScaleFactor];
 #else
-    userSpaceScaleFactor = [window userSpaceScaleFactor];
+    backingScaleFactor = [window userSpaceScaleFactor];
 #endif
 
-    windowFrame.size.height += heightDelta * userSpaceScaleFactor;
+    windowFrame.size.height += heightDelta * backingScaleFactor;
     [window setFrame:windowFrame display:NO];
 }
 
index cdc8049118b1148cf223535843b2a09d375d22ae..bd95d477c98cf2ee9fee7f8650a7560fc1393eb5 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     virtual WebCore::FloatRect pageRect();
 
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
 
     virtual void focus();
     virtual void unfocus();
index 438ab58cb46a79b7991dc328ef9197f62b2a265a..a495ce2be20ea4e456cff87922f09fbbf8130117 100644 (file)
@@ -176,7 +176,7 @@ FloatRect WebChromeClient::pageRect()
     return [m_webView frame];
 }
 
-float WebChromeClient::scaleFactor()
+float WebChromeClient::deviceScaleFactor()
 {
     NSWindow *window = [m_webView window];
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
index ed6c5780011bb6ca1bb3a2a093931679bf947682..040a471615393f988008fbd5f2e31c8a57bde304 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        * WebCoreSupport/ChromeClientQt.h:
+
 2011-08-12  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
 
         [Qt] Add test for correct order of load signals in QWebPage
index 5e367add25bff3e8e7d846611c9689156d54359a..fd7b910a0e47a9463d6bdf2771586fae6d2c02d0 100644 (file)
@@ -146,7 +146,7 @@ FloatRect ChromeClientQt::pageRect()
     return FloatRect(QRectF(QPointF(0, 0), m_webPage->viewportSize()));
 }
 
-float ChromeClientQt::scaleFactor()
+float ChromeClientQt::deviceScaleFactor()
 {
     if (!m_webPage)
         return 1;
index db36f6e9df6e39eb43b7421064850020e58f4c98..1fd3cd20f107e7d4de7f2f6805dd4dab8b855375 100644 (file)
@@ -68,7 +68,7 @@ public:
 
     virtual FloatRect pageRect();
 
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
 
     virtual void focus();
     virtual void unfocus();
index 607fb7a5e2b4ac72bffc01d08671067d3b566689..6e1d8329fc6aaeb62db349ef7ce3c14d808a8dc2 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        * WebCoreSupport/WebChromeClient.h:
+
 2011-08-13  Dan Bernstein  <mitz@apple.com>
 
         Changed the value of WebKitShowsToolTipOverTruncatedTextPreferenceKey to match the naming everywhere else.
index 9d34dc69d73c3294f8116d474382ee51561b1d12..a7053f2766d3dd5a5a96452a1cde596fd6b57d3b 100644 (file)
@@ -118,7 +118,7 @@ FloatRect WebChromeClient::pageRect()
     return rect;
 }
 
-float WebChromeClient::scaleFactor()
+float WebChromeClient::deviceScaleFactor()
 {
     // Windows doesn't support UI scaling.
     return 1.0;
index 68a095ba7aa77d6287226680e336f44734ffed04..0e222b86e956eb7c1558cc647f8ba02eb8551dcf 100644 (file)
@@ -49,7 +49,7 @@ public:
     
     virtual WebCore::FloatRect pageRect();
     
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
 
     virtual void focus();
     virtual void unfocus();
index 7260ddacfe56ebf6163fc21f61a31fff494418c5..5a6701a2f72a25894247a371dd60133c23dab421 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/ChromeClientWinCE.cpp:
+        * WebCoreSupport/ChromeClientWinCE.h:
+
 2011-08-03  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: remove Node parameter from the InspectorClient::highlight
index ff262acca023a69f1110d107dd81feb554c8fbef..8fb32a3103361dcfc7c042689c30242edf9bbe98 100644 (file)
@@ -70,7 +70,7 @@ FloatRect ChromeClientWinCE::pageRect()
     return windowRect();
 }
 
-float ChromeClientWinCE::scaleFactor()
+float ChromeClientWinCE::deviceScaleFactor()
 {
     return 1.0;
 }
index 8d35ec0956427c6520b3304cb3b107b1db7293e9..03f72f05c98c2460f612f4be7e7500ac67f6bfdb 100644 (file)
@@ -43,7 +43,7 @@ public:
 
     virtual WebCore::FloatRect pageRect();
 
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
 
     virtual void focus();
     virtual void unfocus();
index 146c82818d284def294dc316d845b840f0b2337b..893bfd44f0d97a827a4188c2665d59f06b05b24a 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        * WebKitSupport/ChromeClientWx.h:
+
 2011-08-05  Anders Carlsson  <andersca@apple.com>
 
         Remove PluginHalter
index 79969518b42cd311d9f2411861faae5cef6e6c5c..345a6e3c2c55449973fd770156f3e9ec82aed5ec 100644 (file)
@@ -107,7 +107,7 @@ FloatRect ChromeClientWx::pageRect()
     return FloatRect();
 }
 
-float ChromeClientWx::scaleFactor()
+float ChromeClientWx::deviceScaleFactor()
 {
     notImplemented();
     return 1.0;
index b5d4c1093fb7ba00404eecbbdf533f3d8833a642..981b18d2713648816f41a41c067e0c40ee4970bc 100644 (file)
@@ -48,7 +48,7 @@ public:
 
     virtual FloatRect pageRect();
 
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
 
     virtual void focus();
     virtual void unfocus();
index 2bb75c950e4f026da0f3b8fc4b81cc10d2590b25..55fd8834dd7c6cb80721416869827d9db8f3d49c 100644 (file)
@@ -1,3 +1,56 @@
+2011-08-10  Adam Roben  <aroben@apple.com>
+
+        Clear up scale factor terminology
+
+        WebKit by and large deals with two scale factors: one intrinsic to the device on which the
+        software is running, and one that is per-Page and can be controlled via API calls. This
+        patch names the former "deviceScaleFactor" and the latter "pageScaleFactor", and makes the
+        code use those names. It should introduce no behavior changes.
+
+        Fixes <http://webkit.org/b/55787> WebKit uses multiple conflicting names to refer to the
+        device scale factor
+
+        Reviewed by Simon Fraser.
+
+        * Shared/UpdateInfo.cpp:
+        * Shared/UpdateInfo.h:
+        * Shared/WebPageCreationParameters.cpp:
+        * Shared/WebPageCreationParameters.h:
+        * UIProcess/API/C/WKPage.cpp:
+        * UIProcess/API/efl/PageClientImpl.cpp:
+        * UIProcess/API/efl/PageClientImpl.h:
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        * UIProcess/BackingStore.cpp:
+        * UIProcess/BackingStore.h:
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebPopupMenuProxy.h:
+        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
+        * UIProcess/gtk/WebPopupMenuProxyGtk.h:
+        * UIProcess/mac/BackingStoreMac.mm:
+        * UIProcess/mac/WebPageProxyMac.mm:
+        * UIProcess/mac/WebPopupMenuProxyMac.h:
+        * UIProcess/mac/WebPopupMenuProxyMac.mm:
+        * UIProcess/qt/WebPopupMenuProxyQt.h:
+        * UIProcess/win/WebPopupMenuProxyWin.h:
+        * UIProcess/win/WebView.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        * WebProcess/WebPage/FindController.cpp:
+        * WebProcess/WebPage/WebPage.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
+        * WebProcess/WebPage/ca/LayerTreeHostCA.h:
+
 2011-08-13  Sam Weinig  <sam@webkit.org>
 
         Remove unused variables from WKFullScreenWindowController.h
index 61ba62dd61c9ddc08699cd0c32750aa70ff0800d..36a1c63f4714984df6ce2f93a1a7a72c059b8a76 100644 (file)
@@ -33,7 +33,7 @@ namespace WebKit {
 void UpdateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
     encoder->encode(viewSize);
-    encoder->encode(scaleFactor);
+    encoder->encode(deviceScaleFactor);
     encoder->encode(scrollRect);
     encoder->encode(scrollOffset);
     encoder->encode(updateRectBounds);
@@ -45,7 +45,7 @@ bool UpdateInfo::decode(CoreIPC::ArgumentDecoder* decoder, UpdateInfo& result)
 {
     if (!decoder->decode(result.viewSize))
         return false;
-    if (!decoder->decode(result.scaleFactor))
+    if (!decoder->decode(result.deviceScaleFactor))
         return false;
     if (!decoder->decode(result.scrollRect))
         return false;
index 485145d304aee15ce0063190bedda3eff17b3257..3017bbeff772b5707c9f53dc1a6eecfac0496614 100644 (file)
@@ -48,7 +48,7 @@ public:
 
     // The size of the web view.
     WebCore::IntSize viewSize;
-    float scaleFactor;
+    float deviceScaleFactor;
 
     // The rect and delta to be scrolled.
     WebCore::IntRect scrollRect;
index c5dff58f7568eaf8213ebe808745621e470555c7..574b205e6127a8f9739e3b707f541a3504676851 100644 (file)
@@ -51,7 +51,7 @@ void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) const
     encoder->encode(highestUsedBackForwardItemID);
     encoder->encode(canRunBeforeUnloadConfirmPanel);
     encoder->encode(canRunModal);
-    encoder->encode(userSpaceScaleFactor);
+    encoder->encode(deviceScaleFactor);
 
 #if PLATFORM(MAC)
     encoder->encode(isSmartInsertDeleteEnabled);
@@ -100,7 +100,7 @@ bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebPag
         return false;
     if (!decoder->decode(parameters.canRunModal))
         return false;
-    if (!decoder->decode(parameters.userSpaceScaleFactor))
+    if (!decoder->decode(parameters.deviceScaleFactor))
         return false;
 
 #if PLATFORM(MAC)
index 5fb152f90bdd9044bf6283f762bda016f7f0d8e2..b5559b235f3c223ebe4ae037ae7c6d47be5742de 100644 (file)
@@ -71,7 +71,7 @@ struct WebPageCreationParameters {
     bool canRunBeforeUnloadConfirmPanel;
     bool canRunModal;
 
-    float userSpaceScaleFactor;
+    float deviceScaleFactor;
 
 #if PLATFORM(MAC)
     bool isSmartInsertDeleteEnabled;
index 0de10ef9c1fb92115a50790c4be73730bc39d110..94e87b977e5d70a30105097bb4cb7f01658bd878 100644 (file)
@@ -286,12 +286,12 @@ void WKPageSetPageAndTextZoomFactors(WKPageRef pageRef, double pageZoomFactor, d
 
 void WKPageSetScaleFactor(WKPageRef pageRef, double scale, WKPoint origin)
 {
-    toImpl(pageRef)->scaleWebView(scale, toIntPoint(origin));
+    toImpl(pageRef)->scalePage(scale, toIntPoint(origin));
 }
 
 double WKPageGetScaleFactor(WKPageRef pageRef)
 {
-    return toImpl(pageRef)->viewScaleFactor();
+    return toImpl(pageRef)->pageScaleFactor();
 }
 
 void WKPageSetUseFixedLayout(WKPageRef pageRef, bool fixed)
index 769dcd63b5697bbcd2458bcd61e3727913978bf2..3dde2eb298920efdef3783af607f397929b5c52c 100644 (file)
@@ -255,7 +255,7 @@ void PageClientImpl::countStringMatchesInCustomRepresentation(const String&, Fin
     notImplemented();
 }
 
-float PageClientImpl::userSpaceScaleFactor() const
+float PageClientImpl::deviceScaleFactor() const
 {
     return 0.0;
 }
index fe6b573a781966398a5bdde71b66928fac443d3d..88585404754fcfa3b863e048cf6f0437dc454843 100644 (file)
@@ -98,7 +98,7 @@ private:
     virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
     virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
 
-    virtual float userSpaceScaleFactor() const;
+    virtual float deviceScaleFactor() const;
 
 private:
     RefPtr<WebPageProxy> m_page;
index 61bab4dfec0f8bb7b4098b618ea74aedf6ce1f53..76968696933f44f82230aef2336d69b6209d7ded 100644 (file)
@@ -84,7 +84,7 @@ private:
     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut);
     virtual void didChangeScrollbarsForMainFrame() const;
     virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
-    virtual float userSpaceScaleFactor() const { return 1; }
+    virtual float deviceScaleFactor() const { return 1; }
     virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&);
     virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
     virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
index dc1ada11248c81f61a4a18ad08f78d5f494ca6f4..056469b07657ee5b530dbb959ca164cff4e0823c 100644 (file)
@@ -120,7 +120,7 @@ private:
     virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel);
     virtual void recordAutocorrectionResponse(WebCore::EditorClient::AutocorrectionResponseType, const String& replacedString, const String& replacementString);
 
-    virtual float userSpaceScaleFactor() const;
+    virtual float deviceScaleFactor() const;
     
     virtual WKView* wkView() const { return m_wkView; }
 
index e2dda2a7e450f2406cc613a3284171356f756f6a..b12d0e8b8bacdb94bc0f40a4dced555dc333ef8f 100644 (file)
@@ -462,7 +462,7 @@ void PageClientImpl::recordAutocorrectionResponse(EditorClient::AutocorrectionRe
 #endif
 }
 
-float PageClientImpl::userSpaceScaleFactor() const
+float PageClientImpl::deviceScaleFactor() const
 {
     NSWindow *window = [m_wkView window];
 #if !defined(BUILDING_ON_SNOW_LEOPARD)
index 093f6ccdc62f31b45b8349a9755a0906d5c7c6e2..30ec8e629146fc3b28c9f383aa6b4a5426684209 100644 (file)
@@ -33,14 +33,14 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size, float scaleFactor, WebPageProxy* webPageProxy)
+PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size, float deviceScaleFactor, WebPageProxy* webPageProxy)
 {
-    return adoptPtr(new BackingStore(size, scaleFactor, webPageProxy));
+    return adoptPtr(new BackingStore(size, deviceScaleFactor, webPageProxy));
 }
 
-BackingStore::BackingStore(const IntSize& size, float scaleFactor, WebPageProxy* webPageProxy)
+BackingStore::BackingStore(const IntSize& size, float deviceScaleFactor, WebPageProxy* webPageProxy)
     : m_size(size)
-    , m_scaleFactor(scaleFactor)
+    , m_deviceScaleFactor(deviceScaleFactor)
     , m_webPageProxy(webPageProxy)
 {
     ASSERT(!m_size.isEmpty());
@@ -60,7 +60,7 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
 
 #if !ASSERT_DISABLED
     IntSize updateSize = updateInfo.updateRectBounds.size();
-    updateSize.scale(m_scaleFactor);
+    updateSize.scale(m_deviceScaleFactor);
     ASSERT(bitmap->size() == updateSize);
 #endif
     
index cc8dd1572367bfc6ac25e44ff99b498a0aa64c2d..08409b1e01afdc4ac55dc72c6ac21b6bb06e5464 100644 (file)
@@ -60,11 +60,11 @@ class BackingStore {
     WTF_MAKE_NONCOPYABLE(BackingStore);
 
 public:
-    static PassOwnPtr<BackingStore> create(const WebCore::IntSize&, float scaleFactor, WebPageProxy*);
+    static PassOwnPtr<BackingStore> create(const WebCore::IntSize&, float deviceScaleFactor, WebPageProxy*);
     ~BackingStore();
 
     const WebCore::IntSize& size() const { return m_size; }
-    float scaleFactor() const { return m_scaleFactor; }
+    float deviceScaleFactor() const { return m_deviceScaleFactor; }
 
 #if PLATFORM(MAC)
     typedef CGContextRef PlatformGraphicsContext;
@@ -80,13 +80,13 @@ public:
     void incorporateUpdate(const UpdateInfo&);
 
 private:
-    BackingStore(const WebCore::IntSize&, float scaleFactor, WebPageProxy*);
+    BackingStore(const WebCore::IntSize&, float deviceScaleFactor, WebPageProxy*);
 
     void incorporateUpdate(ShareableBitmap*, const UpdateInfo&);
     void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
 
     WebCore::IntSize m_size;
-    float m_scaleFactor;
+    float m_deviceScaleFactor;
     WebPageProxy* m_webPageProxy;
 
 #if PLATFORM(MAC)
index 352fb1d935ea747af3fa9f7654a225bf12136fa8..09fbe38ba21364e30fa3b9f164da2661bb6a0b88 100644 (file)
@@ -205,7 +205,7 @@ void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreState
 #endif
 
     // If we have a backing store the right size, reuse it.
-    if (m_backingStore && (m_backingStore->size() != updateInfo.viewSize || m_backingStore->scaleFactor() != updateInfo.scaleFactor))
+    if (m_backingStore && (m_backingStore->size() != updateInfo.viewSize || m_backingStore->deviceScaleFactor() != updateInfo.deviceScaleFactor))
         m_backingStore = nullptr;
     incorporateUpdate(updateInfo);
 }
@@ -242,7 +242,7 @@ void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
         return;
 
     if (!m_backingStore)
-        m_backingStore = BackingStore::create(updateInfo.viewSize, updateInfo.scaleFactor, m_webPageProxy);
+        m_backingStore = BackingStore::create(updateInfo.viewSize, updateInfo.deviceScaleFactor, m_webPageProxy);
 
     m_backingStore->incorporateUpdate(updateInfo);
 
index 71562956f8fba1ebb62d76780d0b1566da67e0b7..88ddb315852d92ba09885da868ae7dd6ed8c7b1b 100644 (file)
@@ -186,7 +186,7 @@ public:
     virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned maxMatchCount) = 0;
     virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned maxMatchCount) = 0;
 
-    virtual float userSpaceScaleFactor() const = 0;
+    virtual float deviceScaleFactor() const = 0;
 };
 
 } // namespace WebKit
index a9728ebe92818fe625e6563054c9cbdcce59704b..104a68cbe6dee9b7785b6684c9721ed1145d4b8e 100644 (file)
@@ -152,7 +152,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
     , m_backForwardList(WebBackForwardList::create(this))
     , m_textZoomFactor(1)
     , m_pageZoomFactor(1)
-    , m_viewScaleFactor(1)
+    , m_pageScaleFactor(1)
     , m_drawsBackground(true)
     , m_drawsTransparentBackground(false)
     , m_areMemoryCacheClientCallsEnabled(true)
@@ -1206,12 +1206,12 @@ void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZ
     process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID); 
 }
 
-void WebPageProxy::scaleWebView(double scale, const IntPoint& origin)
+void WebPageProxy::scalePage(double scale, const IntPoint& origin)
 {
     if (!isValid())
         return;
 
-    process()->send(Messages::WebPage::ScaleWebView(scale, origin), m_pageID);
+    process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
 }
 
 void WebPageProxy::setUseFixedLayout(bool fixed)
@@ -1240,9 +1240,9 @@ void WebPageProxy::setFixedLayoutSize(const IntSize& size)
     process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
 }
 
-void WebPageProxy::viewScaleFactorDidChange(double scaleFactor)
+void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
 {
-    m_viewScaleFactor = scaleFactor;
+    m_pageScaleFactor = scaleFactor;
 }
 
 void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsEnabled)
@@ -2387,7 +2387,7 @@ void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, co
 
     RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
 
-    protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_viewScaleFactor, items, data, selectedIndex);
+    protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_pageScaleFactor, items, data, selectedIndex);
     protectedActivePopupMenu->invalidate();
     protectedActivePopupMenu = 0;
 }
@@ -3081,7 +3081,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
     parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
     parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
     parameters.canRunModal = m_uiClient.canRunModal();
-    parameters.userSpaceScaleFactor = m_pageClient->userSpaceScaleFactor();
+    parameters.deviceScaleFactor = m_pageClient->deviceScaleFactor();
 
 #if PLATFORM(MAC)
     parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
index e0e25ed42ec422d9d72764f467ac5951cab2a8ee..b7ff1fcc507d40766df4b1e60d579aa9797f7f22 100644 (file)
@@ -383,8 +383,8 @@ public:
     void setPageZoomFactor(double);
     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
 
-    void scaleWebView(double scale, const WebCore::IntPoint& origin);
-    double viewScaleFactor() const { return m_viewScaleFactor; }
+    void scalePage(double scale, const WebCore::IntPoint& origin);
+    double pageScaleFactor() const { return m_pageScaleFactor; }
 
     void setUseFixedLayout(bool);
     void setFixedLayoutSize(const WebCore::IntSize&);
@@ -407,7 +407,7 @@ public:
     void makeFirstResponder();
 #endif
 
-    void viewScaleFactorDidChange(double);
+    void pageScaleFactorDidChange(double);
 
     void setMemoryCacheClientCallsEnabled(bool);
 
@@ -858,7 +858,7 @@ private:
 
     double m_textZoomFactor;
     double m_pageZoomFactor;
-    double m_viewScaleFactor;
+    double m_pageScaleFactor;
 
     bool m_drawsBackground;
     bool m_drawsTransparentBackground;
index a9f505a3d7674ca45f79c32569711a2504211d5a..06d0e2ab608477502cad1f9a9f2ea82927686a5b 100644 (file)
@@ -135,7 +135,7 @@ messages -> WebPageProxy {
     ComputedPagesCallback(Vector<WebCore::IntRect> pageRects, double totalScaleFactorForPrinting, uint64_t callbackID)
     ValidateCommandCallback(WTF::String command, bool isEnabled, int32_t state, uint64_t callbackID)
 
-    ViewScaleFactorDidChange(double scaleFactor)
+    PageScaleFactorDidChange(double scaleFactor)
 
 #if PLATFORM(GTK)
     # Support for GTK+ platform keybindings
index 0af88804beb98f708ef279fc030dd8e3e707e17d..bcb1cf4c92dec3700ba56b9aeefd5293df1ba1e0 100644 (file)
@@ -59,7 +59,7 @@ public:
     {
     }
 
-    virtual void showPopupMenu(const WebCore::IntRect& rect, WebCore::TextDirection, double scaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData&, int32_t selectedIndex) = 0;
+    virtual void showPopupMenu(const WebCore::IntRect& rect, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData&, int32_t selectedIndex) = 0;
     virtual void hidePopupMenu() = 0;
 
     void invalidate() { m_client = 0; }
index 73e49e2bb6482ec6c5825cb471179ed2493c1c2b..18bd03870dd641ee5e7fea08bd27b6d96ca10ee1 100644 (file)
@@ -64,7 +64,7 @@ GtkAction* WebPopupMenuProxyGtk::createGtkActionForMenuItem(const WebPopupItem&
     return action;
 }
 
-void WebPopupMenuProxyGtk::showPopupMenu(const IntRect& rect, TextDirection textDirection, double scaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData& data, int32_t selectedIndex)
+void WebPopupMenuProxyGtk::showPopupMenu(const IntRect& rect, TextDirection textDirection, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData& data, int32_t selectedIndex)
 {
     if (m_popup)
         m_popup->clear();
index 9f4170630006db5f7ead8af5fb5dcec209e73b11..9399ec11f79b13bcd8eab76ffc280ecd36248a36 100644 (file)
@@ -38,7 +38,7 @@ public:
     }
     ~WebPopupMenuProxyGtk();
 
-    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double scaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
+    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
     virtual void hidePopupMenu();
 
 private:
index 4d9a2dcc34d82cb6334140ed61af75ee8f72f362..646962f7e660f32ff11a1137b23530e59177f6b7 100644 (file)
@@ -109,7 +109,7 @@ void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo&
         IntRect srcRect = updateRect;
         srcRect.move(-updateRectLocation.x(), -updateRectLocation.y());
 
-        bitmap->paint(graphicsContext, updateInfo.scaleFactor, updateRect.location(), srcRect);
+        bitmap->paint(graphicsContext, updateInfo.deviceScaleFactor, updateRect.location(), srcRect);
     }
 }
 
index 00522e1b6659271ffa8d845686ee727652860989..cebddbc6f453c1ae1e48af93e23bbf07c6b78c1f 100644 (file)
@@ -318,7 +318,7 @@ void WebPageProxy::setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled)
 
 void WebPageProxy::didPerformDictionaryLookup(const String& text, const DictionaryPopupInfo& dictionaryPopupInfo)
 {
-    m_pageClient->didPerformDictionaryLookup(text, m_viewScaleFactor, dictionaryPopupInfo);
+    m_pageClient->didPerformDictionaryLookup(text, m_pageScaleFactor, dictionaryPopupInfo);
 }
     
 void WebPageProxy::registerWebProcessAccessibilityToken(const CoreIPC::DataReference& data)
index fda52191d2ae4620a6f183e85526736276ee345d..ad22e0a81a3bec0fa7b09c5278a8139aa1704cc9 100644 (file)
@@ -44,7 +44,7 @@ public:
     }
     ~WebPopupMenuProxyMac();
 
-    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double scaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
+    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
     virtual void hidePopupMenu();
 
 private:
index d13a2a71c3d9282c04006f4e14efdbc6ecac9352..30e2e2087f6124d60f05bcf80e76d9687ba3c36d 100644 (file)
@@ -90,12 +90,12 @@ void WebPopupMenuProxyMac::populate(const Vector<WebPopupItem>& items, NSFont *f
     }
 }
 
-void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection textDirection, double scaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData& data, int32_t selectedIndex)
+void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection textDirection, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData& data, int32_t selectedIndex)
 {
     NSFont *font;
     if (data.fontInfo.fontAttributeDictionary) {
         NSFontDescriptor *fontDescriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:(NSDictionary *)data.fontInfo.fontAttributeDictionary.get()];
-        font = [NSFont fontWithDescriptor:fontDescriptor size:((scaleFactor != 1) ? [fontDescriptor pointSize] * scaleFactor : 0)];
+        font = [NSFont fontWithDescriptor:fontDescriptor size:((pageScaleFactor != 1) ? [fontDescriptor pointSize] * pageScaleFactor : 0)];
     } else
         font = [NSFont menuFontOfSize:0];
 
index e7197d5c5f85b224a720e72a6c7d0b3952fcde2e..9230debb909f1ce09f566b572858defe0f894de7 100644 (file)
@@ -38,7 +38,7 @@ public:
     }
     ~WebPopupMenuProxyQt();
 
-    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double scaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
+    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
     virtual void hidePopupMenu();
 
 private:
index c225c2774a4b1202d91bd2ba8e827ee44b7d25a5..b7c4d6d2937f2d82580892350dab9809e17794f2 100644 (file)
@@ -48,7 +48,7 @@ public:
     }
     ~WebPopupMenuProxyWin();
 
-    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double scaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
+    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
     virtual void hidePopupMenu();
 
     bool setFocusedIndex(int index, bool hotTracking = false);
index 57900e884a4ca35f4ead37bdfa20c91d5dc6665f..90ae604a1ce52986b6e2a19a57f8ce2ad92621c0 100644 (file)
@@ -173,7 +173,7 @@ private:
     virtual void displayView();
     virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
     virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
-    virtual float userSpaceScaleFactor() const { return 1; }
+    virtual float deviceScaleFactor() const { return 1; }
     
     virtual WebCore::IntSize viewSize();
     virtual bool isViewWindowActive();
index 30e0d226ccb48ff87321b44c6642548167190140..9f1973395a6fc103cab8f0a259264e105bc37859 100644 (file)
@@ -183,7 +183,7 @@ void WKBundlePageSetPageZoomFactor(WKBundlePageRef pageRef, double zoomFactor)
 
 void WKBundlePageSetScaleAtOrigin(WKBundlePageRef pageRef, double scale, WKPoint origin)
 {
-    toImpl(pageRef)->scaleWebView(scale, toIntPoint(origin));
+    toImpl(pageRef)->scalePage(scale, toIntPoint(origin));
 }
 
 WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef pageRef)
index c2c93bbb851f174cd51cbf3373f301869e49bddb..a92d5a732f1e146c2d0e26c53829714f4b8fc5a9 100644 (file)
@@ -116,9 +116,9 @@ FloatRect WebChromeClient::pageRect()
     return FloatRect(FloatPoint(), m_page->size());
 }
 
-float WebChromeClient::scaleFactor()
+float WebChromeClient::deviceScaleFactor()
 {
-    return m_page->userSpaceScaleFactor();
+    return m_page->deviceScaleFactor();
 }
 
 void WebChromeClient::focus()
index 638c6a327e21a92a90df6c13e0c3955b7e309f00..9420b14d07e44ac934d4e46338b3762932e81cc0 100644 (file)
@@ -57,7 +57,7 @@ private:
     
     virtual WebCore::FloatRect pageRect();
     
-    virtual float scaleFactor();
+    virtual float deviceScaleFactor();
     
     virtual void focus();
     virtual void unfocus();
index 3bc8ad247ed40d2e06b2adf28891ff5ffe3636bd..336c229c04921a7281279bb5380e595d41744b14 100644 (file)
@@ -444,7 +444,7 @@ void WebFrameLoaderClient::dispatchDidCommitLoad()
     // Only restore the scale factor for standard frame loads (of the main frame).
     if (m_frame->isMainFrame() && m_frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard) {
         if (m_frame->coreFrame()->pageScaleFactor() != 1)
-            webPage->scaleWebView(1, IntPoint());
+            webPage->scalePage(1, IntPoint());
     }
 }
 
@@ -1060,7 +1060,7 @@ void WebFrameLoaderClient::restoreViewState()
 {
     // Inform the UI process of the scale factor.
     double scaleFactor = m_frame->coreFrame()->loader()->history()->currentItem()->pageScaleFactor();
-    m_frame->page()->send(Messages::WebPageProxy::ViewScaleFactorDidChange(scaleFactor));
+    m_frame->page()->send(Messages::WebPageProxy::PageScaleFactorDidChange(scaleFactor));
 
     // FIXME: This should not be necessary. WebCore should be correctly invalidating
     // the view on restores from the back/forward cache.
index 731d7aeb6b15578f6577da9e69ebdbacc1ba06be..d1ee2785b42f5ddc7397eca88550c2c1c8c8333a 100644 (file)
@@ -357,7 +357,7 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState()
 
     if (m_isPaintingSuspended || m_layerTreeHost) {
         updateInfo.viewSize = m_webPage->size();
-        updateInfo.scaleFactor = m_webPage->userSpaceScaleFactor();
+        updateInfo.deviceScaleFactor = m_webPage->deviceScaleFactor();
 
         if (m_layerTreeHost) {
             layerTreeContext = m_layerTreeHost->layerTreeContext();
@@ -464,7 +464,7 @@ void DrawingAreaImpl::exitAcceleratedCompositingMode()
     UpdateInfo updateInfo;
     if (m_isPaintingSuspended) {
         updateInfo.viewSize = m_webPage->size();
-        updateInfo.scaleFactor = m_webPage->userSpaceScaleFactor();
+        updateInfo.deviceScaleFactor = m_webPage->deviceScaleFactor();
     } else
         display(updateInfo);
 
@@ -615,13 +615,13 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
         return;
 
     updateInfo.viewSize = m_webPage->size();
-    updateInfo.scaleFactor = m_webPage->userSpaceScaleFactor();
+    updateInfo.deviceScaleFactor = m_webPage->deviceScaleFactor();
 
     IntRect bounds = m_dirtyRegion.bounds();
     ASSERT(m_webPage->bounds().contains(bounds));
 
     IntSize bitmapSize = bounds.size();
-    bitmapSize.scale(m_webPage->userSpaceScaleFactor());
+    bitmapSize.scale(m_webPage->deviceScaleFactor());
     RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bitmapSize, ShareableBitmap::SupportsAlpha);
     if (!bitmap)
         return;
@@ -644,7 +644,7 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
     m_scrollOffset = IntSize();
 
     OwnPtr<GraphicsContext> graphicsContext = createGraphicsContext(bitmap.get());
-    graphicsContext->scale(FloatSize(m_webPage->userSpaceScaleFactor(), m_webPage->userSpaceScaleFactor()));
+    graphicsContext->scale(FloatSize(m_webPage->deviceScaleFactor(), m_webPage->deviceScaleFactor()));
 
     updateInfo.updateRectBounds = bounds;
 
index 3003db56bb054c606701ecd29739fbb5efd1f478..02d84ac29537a53e404291fc3eaf3872c53f3ea0 100644 (file)
@@ -177,7 +177,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
     selectedFrame->selection()->getClippedVisibleTextRectangles(textRects);
 
     IntSize backingStoreSize = selectionRect.size();
-    backingStoreSize.scale(m_webPage->userSpaceScaleFactor());
+    backingStoreSize.scale(m_webPage->deviceScaleFactor());
 
     // Create a backing store and paint the find indicator text into it.
     RefPtr<ShareableBitmap> findIndicatorTextBackingStore = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha);
@@ -185,7 +185,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
         return false;
     
     OwnPtr<GraphicsContext> graphicsContext = findIndicatorTextBackingStore->createGraphicsContext();
-    graphicsContext->scale(FloatSize(m_webPage->userSpaceScaleFactor(), m_webPage->userSpaceScaleFactor()));
+    graphicsContext->scale(FloatSize(m_webPage->deviceScaleFactor(), m_webPage->deviceScaleFactor()));
 
     IntRect paintRect = selectionRect;
     paintRect.move(selectedFrame->view()->frameRect().x(), selectedFrame->view()->frameRect().y());
@@ -212,7 +212,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
         textRectsInSelectionRectCoordinates.append(textRectInSelectionRectCoordinates);
     }            
     
-    m_webPage->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->userSpaceScaleFactor(), handle, !isShowingOverlay));
+    m_webPage->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->deviceScaleFactor(), handle, !isShowingOverlay));
     m_isShowingFindIndicator = true;
 
     return true;
@@ -224,7 +224,7 @@ void FindController::hideFindIndicator()
         return;
 
     ShareableBitmap::Handle handle;
-    m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), m_webPage->userSpaceScaleFactor(), handle, false));
+    m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), m_webPage->deviceScaleFactor(), handle, false));
     m_isShowingFindIndicator = false;
 }
 
index 2ee184fadc134d7dfae0daadae289901107020d5..542db5f70cfb4aa06da4fbba943335b86826d57e 100644 (file)
@@ -186,7 +186,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     , m_canRunBeforeUnloadConfirmPanel(parameters.canRunBeforeUnloadConfirmPanel)
     , m_canRunModal(parameters.canRunModal)
     , m_isRunningModal(false)
-    , m_userSpaceScaleFactor(parameters.userSpaceScaleFactor)
+    , m_deviceScaleFactor(parameters.deviceScaleFactor)
     , m_cachedMainFrameIsPinnedToLeftSide(false)
     , m_cachedMainFrameIsPinnedToRightSide(false)
     , m_isShowingContextMenu(false)
@@ -769,17 +769,17 @@ void WebPage::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFa
     return frame->setPageAndTextZoomFactors(static_cast<float>(pageZoomFactor), static_cast<float>(textZoomFactor));
 }
 
-void WebPage::scaleWebView(double scale, const IntPoint& origin)
+void WebPage::scalePage(double scale, const IntPoint& origin)
 {
     Frame* frame = m_mainFrame->coreFrame();
     if (!frame)
         return;
     frame->scalePage(scale, origin);
 
-    send(Messages::WebPageProxy::ViewScaleFactorDidChange(scale));
+    send(Messages::WebPageProxy::PageScaleFactorDidChange(scale));
 }
 
-double WebPage::viewScaleFactor() const
+double WebPage::pageScaleFactor() const
 {
     Frame* frame = m_mainFrame->coreFrame();
     if (!frame)
index 95f4dc7ca299264ae7b1bc26d2df6071e8c03197..78ab5303deb8e136b24cd811dd1ad59b4ad7fa26 100644 (file)
@@ -241,8 +241,8 @@ public:
     void setPageZoomFactor(double);
     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
 
-    void scaleWebView(double scale, const WebCore::IntPoint& origin);
-    double viewScaleFactor() const;
+    void scalePage(double scale, const WebCore::IntPoint& origin);
+    double pageScaleFactor() const;
 
     void setUseFixedLayout(bool);
     void setFixedLayoutSize(const WebCore::IntSize&);
@@ -409,7 +409,7 @@ public:
 
     void runModal();
 
-    float userSpaceScaleFactor() const { return m_userSpaceScaleFactor; }
+    float deviceScaleFactor() const { return m_deviceScaleFactor; }
 
     void setMemoryCacheMessagesEnabled(bool);
 
@@ -664,7 +664,7 @@ private:
     bool m_canRunModal;
     bool m_isRunningModal;
 
-    float m_userSpaceScaleFactor;
+    float m_deviceScaleFactor;
 
     bool m_cachedMainFrameIsPinnedToLeftSide;
     bool m_cachedMainFrameIsPinnedToRightSide;
index 022e5b9a127204cff9c7c520d84990bd6262b1e4..3b49e1e6160d507a856d238c348f093f8df78f38 100644 (file)
@@ -111,7 +111,7 @@ messages -> WebPage {
     SetPageZoomFactor(double zoomFactor)
     SetTextZoomFactor(double zoomFactor)
 
-    ScaleWebView(double scale, WebCore::IntPoint origin)
+    ScalePage(double scale, WebCore::IntPoint origin)
 
     SetUseFixedLayout(bool fixed)
     SetFixedLayoutSize(WebCore::IntSize size)
index d56419660c4725d8e7ee1d6549a0ded75d4b7284..135a1d005f3390ecc659a2f0b39704dbf6bfaa1d 100644 (file)
@@ -206,9 +206,9 @@ bool LayerTreeHostCA::showRepaintCounter() const
     return m_webPage->corePage()->settings()->showRepaintCounter();
 }
 
-float LayerTreeHostCA::backingScaleFactor() const
+float LayerTreeHostCA::deviceScaleFactor() const
 {
-    return m_webPage->userSpaceScaleFactor();
+    return m_webPage->deviceScaleFactor();
 }
 
 void LayerTreeHostCA::performScheduledLayerFlush()
index c9b6652b2add4177a9e89e6f198af5e4822ec083..ee75b45b4369e5501763d8f8f4c649817deddf53 100644 (file)
@@ -74,7 +74,7 @@ private:
     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
     virtual bool showDebugBorders() const;
     virtual bool showRepaintCounter() const;
-    virtual float backingScaleFactor() const;
+    virtual float deviceScaleFactor() const;
     virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { }
 
     // LayerTreeHostCA