https://bugs.webkit.org/show_bug.cgi?id=58013
Patch by Kentaro Hara <haraken@google.com> on 2011-08-03
Reviewed by Darin Fisher.
Implemented EventSender.scalePageBy(f, x, y), which scales a page by a factor of f
and then sets a scroll position to (x, y). Enabled the tests that had been waiting
for the implementation of EventSender.scalePageBy(f, x, y).
Source/WebKit/chromium:
Tests: compositing/scaling/tiled-layer-recursion.html
fast/repaint/scale-page-shrink.html
fast/dom/Element/scale-page-client-rects.html
fast/dom/Range/scale-page-client-rects.html
fast/events/scroll-in-scaled-page-with-overflow-hidden.html
fast/dom/Element/scale-page-bounding-client-rect.html
fast/dom/Range/scale-page-bounding-client-rect.html
* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::scalePage): A wrapper method for scalePage() in WebCore.
* src/WebViewImpl.h:
Tools:
Tests: compositing/scaling/tiled-layer-recursion.html
fast/repaint/scale-page-shrink.html
fast/dom/Element/scale-page-client-rects.html
fast/dom/Range/scale-page-client-rects.html
fast/events/scroll-in-scaled-page-with-overflow-hidden.html
fast/dom/Element/scale-page-bounding-client-rect.html
fast/dom/Range/scale-page-bounding-client-rect.html
* DumpRenderTree/chromium/EventSender.cpp:
(EventSender::EventSender): Added bindings for scalePageBy().
(EventSender::scalePageBy): A wrapper method for scalePage() in WebView.
* DumpRenderTree/chromium/EventSender.h:
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::resetTestController): Resets the scale factor to 1.
LayoutTests:
* platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png: Added.
* platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png: Added.
* platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt: Added.
* platform/chromium-mac/fast/dom/Element/scale-page-bounding-client-rect-expected.txt: Removed.
* platform/chromium-mac/fast/dom/Range/scale-page-bounding-client-rect-expected.txt: Removed.
* platform/chromium-win/fast/dom/Element/scale-page-bounding-client-rect-expected.txt: Removed.
* platform/chromium-win/fast/dom/Element/scale-page-client-rects-expected.txt: Removed.
* platform/chromium-win/fast/dom/Range/scale-page-bounding-client-rect-expected.txt: Removed.
* platform/chromium-win/fast/dom/Range/scale-page-client-rects-expected.txt: Removed.
* platform/chromium/test_expectations.txt: Enabled one test. Enabled two tests for chromium-linux.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92341
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-08-03 Kentaro Hara <haraken@google.com>
+
+ Implement EventSender.scalePageBy()
+ https://bugs.webkit.org/show_bug.cgi?id=58013
+
+ Reviewed by Darin Fisher.
+
+ Implemented EventSender.scalePageBy(f, x, y), which scales a page by a factor of f
+ and then sets a scroll position to (x, y). Enabled the tests that had been waiting
+ for the implementation of EventSender.scalePageBy(f, x, y).
+
+ * platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png: Added.
+ * platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png: Added.
+ * platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt: Added.
+ * platform/chromium-mac/fast/dom/Element/scale-page-bounding-client-rect-expected.txt: Removed.
+ * platform/chromium-mac/fast/dom/Range/scale-page-bounding-client-rect-expected.txt: Removed.
+ * platform/chromium-win/fast/dom/Element/scale-page-bounding-client-rect-expected.txt: Removed.
+ * platform/chromium-win/fast/dom/Element/scale-page-client-rects-expected.txt: Removed.
+ * platform/chromium-win/fast/dom/Range/scale-page-bounding-client-rect-expected.txt: Removed.
+ * platform/chromium-win/fast/dom/Range/scale-page-client-rects-expected.txt: Removed.
+ * platform/chromium/test_expectations.txt: Enabled one test. Enabled two tests for chromium-linux.
+
2011-08-03 Ian Henderson <ianh@apple.com>
Draw rectangular box shadow for elements with border-radius if no corners are visible
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock (anonymous) at (0,0) size 784x20
+ RenderText {#text} at (0,0) size 686x19
+ text run at (0,0) width 686: "This test must be run in DumpRenderTree as a pixel test. There should not be visual aritfacts after scaling the page."
+ RenderBlock {DIV} at (0,20) size 500x500 [bgcolor=#008000]
+++ /dev/null
-CONSOLE MESSAGE: line 12: Uncaught TypeError: Object [object Object] has no method 'scalePageBy'
-This test must be run via DumpRenderTree.
+++ /dev/null
-CONSOLE MESSAGE: line 14: Uncaught TypeError: Object [object Object] has no method 'scalePageBy'
-This test must be run via DumpRenderTree.
+++ /dev/null
-CONSOLE MESSAGE: line 12: Uncaught TypeError: Object [object Object] has no method 'scalePageBy'
-This test must be run via DumpRenderTree.
+++ /dev/null
-CONSOLE MESSAGE: line 12: Uncaught TypeError: Object [object Object] has no method 'scalePageBy'
-This test must be run via DumpRenderTree.
+++ /dev/null
-CONSOLE MESSAGE: line 14: Uncaught TypeError: Object [object Object] has no method 'scalePageBy'
-This test must be run via DumpRenderTree.
+++ /dev/null
-CONSOLE MESSAGE: line 15: Uncaught TypeError: Object [object Object] has no method 'scalePageBy'
-This test must be run via DumpRenderTree.
BUGCR24197 SKIP : fast/css/disabled-author-styles.html = FAIL
// Needs eventSender.scalePageBy().
-BUGWK58013 : fast/repaint/scale-page-shrink.html = IMAGE+TEXT
-BUGWK58013 : fast/events/scroll-in-scaled-page-with-overflow-hidden.html = TEXT
-BUGWK58013 SKIP : compositing/scaling/tiled-layer-recursion.html = FAIL
+// These failures are going to be removed as a rebase line after the patch for bug 58013 is landed.
+BUGWK58013 WIN MAC : fast/repaint/scale-page-shrink.html = IMAGE+TEXT
+BUGWK58013 WIN MAC : compositing/scaling/tiled-layer-recursion.html = FAIL
// -----------------------------------------------------------------
// Inspector tests
+2011-08-03 Kentaro Hara <haraken@google.com>
+
+ Implement EventSender.scalePageBy()
+ https://bugs.webkit.org/show_bug.cgi?id=58013
+
+ Reviewed by Darin Fisher.
+
+ Implemented EventSender.scalePageBy(f, x, y), which scales a page by a factor of f
+ and then sets a scroll position to (x, y). Enabled the tests that had been waiting
+ for the implementation of EventSender.scalePageBy(f, x, y).
+
+ Tests: compositing/scaling/tiled-layer-recursion.html
+ fast/repaint/scale-page-shrink.html
+ fast/dom/Element/scale-page-client-rects.html
+ fast/dom/Range/scale-page-client-rects.html
+ fast/events/scroll-in-scaled-page-with-overflow-hidden.html
+ fast/dom/Element/scale-page-bounding-client-rect.html
+ fast/dom/Range/scale-page-bounding-client-rect.html
+
+ * public/WebView.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::scalePage): A wrapper method for scalePage() in WebCore.
+ * src/WebViewImpl.h:
+
2011-08-03 Darin Fisher <darin@chromium.org>
[Chromium] Rename WEBKIT_API to WEBKIT_EXPORT.
WEBKIT_EXPORT static double zoomLevelToZoomFactor(double zoomLevel);
WEBKIT_EXPORT static double zoomFactorToZoomLevel(double 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.
+ // On the other hand, zooming affects layout of the page.
+ virtual void scalePage(float scaleFactor, WebPoint origin) = 0;
+
// Media ---------------------------------------------------------------
return log(factor) / log(textSizeMultiplierRatio);
}
+void WebViewImpl::scalePage(float scaleFactor, WebPoint origin)
+{
+ if (!page())
+ return;
+
+ Frame* frame = page()->mainFrame();
+ if (!frame)
+ return;
+
+ frame->scalePage(scaleFactor, origin);
+}
+
void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
const WebPoint& location)
{
virtual double setZoomLevel(bool textOnly, double zoomLevel);
virtual void zoomLimitsChanged(double minimumZoomLevel,
double maximumZoomLevel);
+ virtual void scalePage(float scaleFactor, WebPoint origin);
virtual void performMediaPlayerAction(
const WebMediaPlayerAction& action,
const WebPoint& location);
+2011-08-03 Kentaro Hara <haraken@google.com>
+
+ Implement EventSender.scalePageBy()
+ https://bugs.webkit.org/show_bug.cgi?id=58013
+
+ Reviewed by Darin Fisher.
+
+ Implemented EventSender.scalePageBy(f, x, y), which scales a page by a factor of f
+ and then sets a scroll position to (x, y). Enabled the tests that had been waiting
+ for the implementation of EventSender.scalePageBy(f, x, y).
+
+ Tests: compositing/scaling/tiled-layer-recursion.html
+ fast/repaint/scale-page-shrink.html
+ fast/dom/Element/scale-page-client-rects.html
+ fast/dom/Range/scale-page-client-rects.html
+ fast/events/scroll-in-scaled-page-with-overflow-hidden.html
+ fast/dom/Element/scale-page-bounding-client-rect.html
+ fast/dom/Range/scale-page-bounding-client-rect.html
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender): Added bindings for scalePageBy().
+ (EventSender::scalePageBy): A wrapper method for scalePage() in WebView.
+ * DumpRenderTree/chromium/EventSender.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetTestController): Resets the scale factor to 1.
+
2011-08-03 David Levin <levin@chromium.org>
Rename WEBKIT_API to WEBKIT_EXPORT in check-webkit-style.
bindMethod("updateTouchPoint", &EventSender::updateTouchPoint);
bindMethod("zoomPageIn", &EventSender::zoomPageIn);
bindMethod("zoomPageOut", &EventSender::zoomPageOut);
+ bindMethod("scalePageBy", &EventSender::scalePageBy);
// When set to true (the default value), we batch mouse move and mouse up
// events so we can simulate drag & drop.
result->setNull();
}
+void EventSender::scalePageBy(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber())
+ return;
+
+ float scaleFactor = static_cast<float>(arguments[0].toDouble());
+ int x = arguments[1].toInt32();
+ int y = arguments[2].toInt32();
+ webview()->scalePage(scaleFactor, WebPoint(x, y));
+ result->setNull();
+}
+
void EventSender::mouseScrollBy(const CppArgumentList& arguments, CppVariant* result)
{
handleMouseWheel(arguments, result, false);
void textZoomOut(const CppArgumentList&, CppVariant*);
void zoomPageIn(const CppArgumentList&, CppVariant*);
void zoomPageOut(const CppArgumentList&, CppVariant*);
+ void scalePageBy(const CppArgumentList&, CppVariant*);
void mouseScrollBy(const CppArgumentList&, CppVariant*);
void continuousMouseScrollBy(const CppArgumentList&, CppVariant*);
void scheduleAsynchronousClick(const CppArgumentList&, CppVariant*);
#include "WebTestingSupport.h"
#include "WebKit.h"
#include "WebPermissions.h"
+#include "WebPoint.h"
#include "WebRuntimeFeatures.h"
#include "WebScriptController.h"
#include "WebSettings.h"
m_drtDevToolsAgent->reset();
if (m_drtDevToolsClient)
m_drtDevToolsClient->reset();
+ webView()->scalePage(1, WebPoint(0, 0));
webView()->mainFrame()->clearOpener();
}