Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (92977 => 92978)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-08-12 18:42:25 UTC (rev 92977)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-08-12 18:43:36 UTC (rev 92978)
@@ -1,5 +1,22 @@
2011-08-12 Fady Samuel <[email protected]>
+ Chromium's WebKit API should use floats instead of doubles for zoom to match WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=66089
+
+ Reviewed by Darin Fisher.
+
+ * public/WebView.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::zoomLevel):
+ (WebKit::WebViewImpl::setZoomLevel):
+ (WebKit::WebViewImpl::zoomLimitsChanged):
+ (WebKit::WebViewImpl::fullFramePluginZoomLevelChanged):
+ (WebKit::WebView::zoomLevelToZoomFactor):
+ (WebKit::WebView::zoomFactorToZoomLevel):
+ * src/WebViewImpl.h:
+
+2011-08-12 Fady Samuel <[email protected]>
+
Refactoring of PopupMenuChromium
https://bugs.webkit.org/show_bug.cgi?id=66009
Modified: trunk/Source/WebKit/chromium/public/WebView.h (92977 => 92978)
--- trunk/Source/WebKit/chromium/public/WebView.h 2011-08-12 18:42:25 UTC (rev 92977)
+++ trunk/Source/WebKit/chromium/public/WebView.h 2011-08-12 18:43:36 UTC (rev 92978)
@@ -182,7 +182,7 @@
// of 300% and 50% of original size, respectively. Only plugins use
// non whole-numbers, since they might choose to have specific zoom level so
// that fixed-width content is fit-to-page-width, for example.
- virtual double zoomLevel() = 0;
+ virtual float zoomLevel() const = 0;
// Changes the zoom level to the specified level, clamping at the limits
// noted above, and returns the current zoom level after applying the
@@ -192,16 +192,16 @@
// page will be zoomed. You can only have either text zoom or full page zoom
// at one time. Changing the mode while the page is zoomed will have odd
// effects.
- virtual double setZoomLevel(bool textOnly, double zoomLevel) = 0;
+ virtual float setZoomLevel(bool textOnly, float zoomLevel) = 0;
// Updates the zoom limits for this view.
- virtual void zoomLimitsChanged(double minimumZoomLevel,
- double maximumZoomLevel) = 0;
+ virtual void zoomLimitsChanged(float minimumZoomLevel,
+ float maximumZoomLevel) = 0;
// Helper functions to convert between zoom level and zoom factor. zoom
// factor is zoom percent / 100, so 300% = 3.0.
- WEBKIT_EXPORT static double zoomLevelToZoomFactor(double zoomLevel);
- WEBKIT_EXPORT static double zoomFactorToZoomLevel(double factor);
+ WEBKIT_EXPORT static float zoomLevelToZoomFactor(float zoomLevel);
+ WEBKIT_EXPORT static float zoomFactorToZoomLevel(float factor);
// Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y).
// scalePage() magnifies and shrinks a page without affecting layout.
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (92977 => 92978)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-08-12 18:42:25 UTC (rev 92977)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-08-12 18:43:36 UTC (rev 92978)
@@ -1781,12 +1781,12 @@
}
}
-double WebViewImpl::zoomLevel()
+float WebViewImpl::zoomLevel() const
{
return m_zoomLevel;
}
-double WebViewImpl::setZoomLevel(bool textOnly, double zoomLevel)
+float WebViewImpl::setZoomLevel(bool textOnly, float zoomLevel)
{
if (zoomLevel < m_minimumZoomLevel)
m_zoomLevel = m_minimumZoomLevel;
@@ -1800,7 +1800,7 @@
if (pluginContainer)
pluginContainer->plugin()->setZoomLevel(m_zoomLevel, textOnly);
else {
- float zoomFactor = static_cast<float>(zoomLevelToZoomFactor(m_zoomLevel));
+ float zoomFactor = zoomLevelToZoomFactor(m_zoomLevel);
if (textOnly)
frame->setPageAndTextZoomFactors(1, zoomFactor);
else
@@ -1809,15 +1809,15 @@
return m_zoomLevel;
}
-void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel,
- double maximumZoomLevel)
+void WebViewImpl::zoomLimitsChanged(float minimumZoomLevel,
+ float maximumZoomLevel)
{
m_minimumZoomLevel = minimumZoomLevel;
m_maximumZoomLevel = maximumZoomLevel;
m_client->zoomLimitsChanged(m_minimumZoomLevel, m_maximumZoomLevel);
}
-void WebViewImpl::fullFramePluginZoomLevelChanged(double zoomLevel)
+void WebViewImpl::fullFramePluginZoomLevelChanged(float zoomLevel)
{
if (zoomLevel == m_zoomLevel)
return;
@@ -1826,12 +1826,12 @@
m_client->zoomLevelChanged();
}
-double WebView::zoomLevelToZoomFactor(double zoomLevel)
+float WebView::zoomLevelToZoomFactor(float zoomLevel)
{
return pow(textSizeMultiplierRatio, zoomLevel);
}
-double WebView::zoomFactorToZoomLevel(double factor)
+float WebView::zoomFactorToZoomLevel(float factor)
{
// Since factor = 1.2^level, level = log(factor) / log(1.2)
return log(factor) / log(textSizeMultiplierRatio);
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (92977 => 92978)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2011-08-12 18:42:25 UTC (rev 92977)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2011-08-12 18:43:36 UTC (rev 92978)
@@ -151,10 +151,10 @@
virtual void setInitialFocus(bool reverse);
virtual void clearFocusedNode();
virtual void scrollFocusedNodeIntoView();
- virtual double zoomLevel();
- virtual double setZoomLevel(bool textOnly, double zoomLevel);
- virtual void zoomLimitsChanged(double minimumZoomLevel,
- double maximumZoomLevel);
+ virtual float zoomLevel() const;
+ virtual float setZoomLevel(bool textOnly, float zoomLevel);
+ virtual void zoomLimitsChanged(float minimumZoomLevel,
+ float maximumZoomLevel);
virtual void scalePage(float scaleFactor, WebPoint origin);
virtual void performMediaPlayerAction(
const WebMediaPlayerAction& action,
@@ -394,7 +394,7 @@
// zoom level has been updated. The plugin should only call this function
// if the zoom change was triggered by the browser, it's only needed in case
// a plugin can update its own zoom, say because of its own UI.
- void fullFramePluginZoomLevelChanged(double zoomLevel);
+ void fullFramePluginZoomLevelChanged(float zoomLevel);
#if ENABLE(GESTURE_RECOGNIZER)
void resetGestureRecognizer();
@@ -493,11 +493,11 @@
// Keeps track of the current zoom level. 0 means no zoom, positive numbers
// mean zoom in, negative numbers mean zoom out.
- double m_zoomLevel;
+ float m_zoomLevel;
- double m_minimumZoomLevel;
+ float m_minimumZoomLevel;
- double m_maximumZoomLevel;
+ float m_maximumZoomLevel;
bool m_contextMenuAllowed;