diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree')
35 files changed, 760 insertions, 412 deletions
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp index 1643ba6..ee44325 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp @@ -513,6 +513,24 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context return controller->computedStyleIncludingVisitedInfo(context, arguments[0]); } +static JSValueRef nodesFromRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + if (argumentCount != 8) + return JSValueMakeUndefined(context); + + int x = JSValueToNumber(context, arguments[1], NULL); + int y = JSValueToNumber(context, arguments[2], NULL); + int top = static_cast<unsigned>(JSValueToNumber(context, arguments[3], NULL)); + int right = static_cast<unsigned>(JSValueToNumber(context, arguments[4], NULL)); + int bottom = static_cast<unsigned>(JSValueToNumber(context, arguments[5], NULL)); + int left = static_cast<unsigned>(JSValueToNumber(context, arguments[6], NULL)); + bool ignoreClipping = JSValueToBoolean(context, arguments[7]); + + // Has mac implementation. + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + return controller->nodesFromRect(context, arguments[0], x, y, top, right, bottom, left, ignoreClipping); +} + static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation @@ -1843,6 +1861,7 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "nodesFromRect", nodesFromRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h index 2bf7a75..755a2b2 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/LayoutTestController.h @@ -60,6 +60,7 @@ public: bool isCommandEnabled(JSStringRef name); void keepWebHistory(); JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef); + JSValueRef nodesFromRect(JSContextRef, JSValueRef, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping); void notifyDone(); int numberOfPages(float pageWidthInPixels, float pageHeightInPixels); void overridePreference(JSStringRef key, JSStringRef value); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp index 5002400..1df1c76 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp @@ -971,15 +971,18 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->returnNegativeOneFromWrite = FALSE; newInstance->stream = 0; - newInstance->firstUrl = NULL; - newInstance->firstHeaders = NULL; - newInstance->lastUrl = NULL; - newInstance->lastHeaders = NULL; + newInstance->firstUrl = 0; + newInstance->firstHeaders = 0; + newInstance->lastUrl = 0; + newInstance->lastHeaders = 0; newInstance->testGetURLOnDestroy = FALSE; newInstance->testWindowOpen = FALSE; newInstance->testKeyboardFocusForPlugins = FALSE; + newInstance->mouseDownForEvaluateScript = FALSE; + newInstance->evaluateScriptOnMouseDownOrKeyDown = 0; + return (NPObject*)newInstance; } diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h index 2c1d325..6c30578 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h @@ -57,6 +57,7 @@ typedef struct { NPBool testGetURLOnDestroy; NPBool testWindowOpen; NPBool testKeyboardFocusForPlugins; + NPBool mouseDownForEvaluateScript; char* onStreamLoad; char* onStreamDestroy; char* onDestroy; @@ -66,6 +67,7 @@ typedef struct { char* firstHeaders; char* lastUrl; char* lastHeaders; + char* evaluateScriptOnMouseDownOrKeyDown; #ifdef XP_MACOSX NPEventModel eventModel; #endif diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp index 0ff7029..83eda3a 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp @@ -60,6 +60,11 @@ NPError PluginTest::NPP_GetValue(NPPVariable variable, void *value) return NPERR_GENERIC_ERROR; } +NPError PluginTest::NPP_SetWindow(NPP, NPWindow*) +{ + return NPERR_NO_ERROR; +} + NPIdentifier PluginTest::NPN_GetStringIdentifier(const NPUTF8 *name) { return browser->getstringidentifier(name); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h index ecc0185..2e896a6 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h @@ -57,6 +57,7 @@ public: // NPP functions. virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason); virtual NPError NPP_GetValue(NPPVariable, void* value); + virtual NPError NPP_SetWindow(NPP, NPWindow*); // NPN functions. NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp new file mode 100644 index 0000000..40bceb9 --- /dev/null +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "PluginTest.h" + +#include "PluginObject.h" + +using namespace std; + +// Plugin's HWND should be sized/positioned before NPP_SetWindow is called. + +class WindowGeometryInitializedBeforeSetWindow : public PluginTest { +public: + WindowGeometryInitializedBeforeSetWindow(NPP npp, const string& identifier) + : PluginTest(npp, identifier) + { + } + +private: + virtual NPError NPP_SetWindow(NPP instance, NPWindow* window) + { + if (window->type != NPWindowTypeWindow) { + pluginLog(instance, "window->type should be NPWindowTypeWindow but was %d", window->type); + return NPERR_GENERIC_ERROR; + } + + HWND hwnd = reinterpret_cast<HWND>(window->window); + RECT rect; + if (!::GetClientRect(hwnd, &rect)) { + pluginLog(instance, "::GetClientRect failed"); + return NPERR_GENERIC_ERROR; + } + + if (::IsRectEmpty(&rect)) { + pluginLog(instance, "Plugin's HWND has not been sized when NPP_SetWindow is called"); + return NPERR_GENERIC_ERROR; + } + + HWND parent = ::GetParent(hwnd); + if (!parent) { + pluginLog(instance, "::GetParent failed"); + return NPERR_GENERIC_ERROR; + } + + // MSDN says that calling ::MapWindowPoints this way will tell it we're passing a RECT rather than two POINTs. + if (!::MapWindowPoints(hwnd, parent, reinterpret_cast<POINT*>(&rect), 2)) { + pluginLog(instance, "::MapWindowPoints failed"); + return NPERR_GENERIC_ERROR; + } + + if (rect.left != window->x || rect.top != window->y || (rect.right - rect.left) != window->width || (rect.bottom - rect.top) != window->height) { + pluginLog(instance, "HWND's rect and NPWindow's rect are not equal"); + return NPERR_GENERIC_ERROR; + } + + pluginLog(instance, "Plugin's HWND has been sized and positioned before NPP_SetWindow was called"); + return NPERR_NO_ERROR; + } +}; + +static PluginTest::Register<WindowGeometryInitializedBeforeSetWindow> windowGeometryInitializedBeforeSetWindow("window-geometry-initialized-before-set-window"); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp index c02e918..dd894f4 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp @@ -218,8 +218,20 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc // FIXME: When https://bugs.webkit.org/show_bug.cgi?id=41831 is fixed, this #ifdef can be removed. obj->testGetURLOnDestroy = TRUE; #endif - } else if (strcasecmp(argn[i], "src") == 0 && strstr(argv[i], "plugin-document-has-focus.pl")) + } else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl")) obj->testKeyboardFocusForPlugins = TRUE; + else if (!strcasecmp(argn[i], "evaluatescript")) { + char* script = argv[i]; + if (script == strstr(script, "mouse::")) { + obj->mouseDownForEvaluateScript = true; + obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("mouse::") - 1); + } else if (script == strstr(script, "key::")) { + obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("key::") - 1); + } + // When testing evaluate script on mouse-down or key-down, allow event logging to handle events. + if (obj->evaluateScriptOnMouseDownOrKeyDown) + obj->eventLogging = true; + } } #if XP_MACOSX @@ -300,7 +312,7 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) } } - return NPERR_NO_ERROR; + return obj->pluginTest->NPP_SetWindow(instance, window); } static void executeScript(const PluginObject* obj, const char* script) @@ -401,6 +413,8 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e case mouseDown: GlobalToLocal(&pt); pluginLog(instance, "mouseDown at (%d, %d)", pt.h, pt.v); + if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript) + executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); break; case mouseUp: GlobalToLocal(&pt); @@ -408,6 +422,8 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e break; case keyDown: pluginLog(instance, "keyDown '%c'", (char)(event->message & 0xFF)); + if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript) + executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); break; case keyUp: pluginLog(instance, "keyUp '%c'", (char)(event->message & 0xFF)); @@ -481,6 +497,8 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e case NPCocoaEventKeyDown: if (event->data.key.characters) pluginLog(instance, "keyDown '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0)); + if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript) + executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); return 1; case NPCocoaEventKeyUp: @@ -501,6 +519,8 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e pluginLog(instance, "mouseDown at (%d, %d)", (int)event->data.mouse.pluginX, (int)event->data.mouse.pluginY); + if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript) + executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown); return 1; case NPCocoaEventMouseUp: pluginLog(instance, "mouseUp at (%d, %d)", diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj index c36666f..5ffb832 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj @@ -367,6 +367,34 @@ <References>
</References>
<Files>
+ <Filter
+ Name="Tests"
+ >
+ <File
+ RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
+ >
+ </File>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
<File
RelativePath="..\main.cpp"
>
@@ -456,26 +484,6 @@ RelativePath="..\TestObject.h"
>
</File>
- <Filter
- Name="Tests"
- >
- <File
- RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
- >
- </File>
- </Filter>
</Files>
<Globals>
</Globals>
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp index 6e180d0..b2e50f7 100644 --- a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -48,6 +48,7 @@ static const char optionTestShell[] = "--test-shell"; static const char optionAllowExternalPages[] = "--allow-external-pages"; static const char optionStartupDialog[] = "--testshell-startup-dialog"; static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-deps"; +static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas"; static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode) { @@ -92,6 +93,7 @@ int main(int argc, char* argv[]) bool testShellMode = false; bool allowExternalPages = false; bool startupDialog = false; + bool accelerated2DCanvasEnabled = false; for (int i = 1; i < argc; ++i) { string argument(argv[i]); if (argument == "-") @@ -112,6 +114,8 @@ int main(int argc, char* argv[]) startupDialog = true; else if (argument == optionCheckLayoutTestSystemDeps) exit(checkLayoutTestSystemDependencies() ? EXIT_SUCCESS : EXIT_FAILURE); + else if (argument == optionEnableAccelerated2DCanvas) + accelerated2DCanvasEnabled = true; else if (argument.size() && argument[0] == '-') fprintf(stderr, "Unknown option: %s\n", argv[i]); else @@ -128,6 +132,7 @@ int main(int argc, char* argv[]) { // Explicit scope for the TestShell instance. TestShell shell(testShellMode); shell.setAllowExternalPages(allowExternalPages); + shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled); if (serverMode && !tests.size()) { params.printSeparators = true; char testString[2048]; // 2048 is the same as the sizes of other platforms. diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp index 2c6c600..3d3c204 100644 --- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp @@ -126,6 +126,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry); bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally); bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations); + bindMethod("sampleSVGAnimationForElementAtTime", &LayoutTestController::sampleSVGAnimationForElementAtTime); bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing); bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs); bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs); @@ -959,6 +960,19 @@ void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result->setNull(); } +void LayoutTestController::sampleSVGAnimationForElementAtTime(const CppArgumentList& arguments, CppVariant* result) +{ + if (arguments.size() != 3) { + result->setNull(); + return; + } + WebString animationId = cppVariantToWebString(arguments[0]); + double time = arguments[1].toDouble(); + WebString elementId = cppVariantToWebString(arguments[2]); + bool success = m_shell->webView()->mainFrame()->pauseSVGAnimation(animationId, time, elementId); + result->set(success); +} + void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result) { m_shell->preferences()->loadsImagesAutomatically = false; @@ -1251,6 +1265,10 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments, prefs->tabsToLinks = cppVariantToBool(value); else if (key == "WebKitWebGLEnabled") prefs->experimentalWebGLEnabled = cppVariantToBool(value); + else if (key == "WebKitHyperlinkAuditingEnabled") + prefs->hyperlinkAuditingEnabled = cppVariantToBool(value); + else if (key == "WebKitEnableCaretBrowsing") + prefs->caretBrowsingEnabled = cppVariantToBool(value); else { string message("Invalid name for preference: "); message.append(key); @@ -1443,7 +1461,10 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C return; WebView::addUserStyleSheet( cppVariantToWebString(arguments[0]), WebVector<WebString>(), - arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly); + arguments[1].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly, + // Chromium defaults to InjectInSubsequentDocuments, but for compatibility + // with the other ports' DRTs, we use UserStyleInjectInExistingDocuments. + WebView::UserStyleInjectInExistingDocuments); } void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, CppVariant* results) diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h index ec2503f..8467097 100644 --- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h @@ -223,6 +223,7 @@ public: void numberOfActiveAnimations(const CppArgumentList&, CppVariant*); void suspendAnimations(const CppArgumentList&, CppVariant*); void resumeAnimations(const CppArgumentList&, CppVariant*); + void sampleSVGAnimationForElementAtTime(const CppArgumentList&, CppVariant*); void disableImageLoading(const CppArgumentList&, CppVariant*); void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*); void dumpSelectionRect(const CppArgumentList&, CppVariant*); diff --git a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp index d9e79a0..2130534 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp @@ -99,7 +99,8 @@ void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, c printf("\nExpectedHash: %s\n", expectedHash); if (imageData && imageSize) { printf("Content-Type: image/png\n"); - printf("Content-Length: %lu\n", imageSize); + // Printf formatting for size_t on 32-bit, 64-bit, and on Windows is hard so just cast to an int. + printf("Content-Length: %d\n", static_cast<int>(imageSize)); if (fwrite(imageData, 1, imageSize, stdout) != imageSize) { fprintf(stderr, "Short write to stdout.\n"); exit(1); diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp index 15d6dee..1a99b7d 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp @@ -83,6 +83,7 @@ TestShell::TestShell(bool testShellMode) , m_focusedWidget(0) , m_testShellMode(testShellMode) , m_allowExternalPages(false) + , m_accelerated2dCanvasEnabled(false) , m_devTools(0) { WebRuntimeFeatures::enableGeolocation(true); @@ -155,6 +156,7 @@ void TestShell::closeDevTools() void TestShell::resetWebSettings(WebView& webView) { m_prefs.reset(); + m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled; m_prefs.applyTo(&webView); } diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h index 6d93d4a..4d022dc 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestShell.h +++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h @@ -123,6 +123,8 @@ public: bool allowExternalPages() const { return m_allowExternalPages; } void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } + void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; } + #if defined(OS_WIN) // Access to the finished event. Used by the static WatchDog thread. HANDLE finishedEvent() { return m_finishedEvent; } @@ -176,6 +178,7 @@ private: TestParams m_params; int m_timeout; // timeout value in millisecond bool m_allowExternalPages; + bool m_accelerated2dCanvasEnabled; WebPreferences m_prefs; // List of all windows in this process. diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp index 60408b9..1cf7c56 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp @@ -134,22 +134,23 @@ static void setupFontconfig() // few layout tests. static const char* const optionalFonts[] = { "/usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf", - - // This font changed paths across Ubuntu releases. "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf", - "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf", }; for (size_t i = 0; i < arraysize(optionalFonts); ++i) { const char* font = optionalFonts[i]; + + // This font changed paths across Ubuntu releases, so try checking in both locations. + if (!strcmp(font, "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf") + && access(font, R_OK) < 0) + font = "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf"; + if (access(font, R_OK) < 0) { fprintf(stderr, "You are missing %s. Without this, some layout tests may fail. " "See http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites " "for more.\n", font); - } else { - if (!FcConfigAppFontAddFile(fontcfg, (FcChar8 *) font)) { - fprintf(stderr, "Failed to load font %s\n", font); - exit(1); - } + } else if (!FcConfigAppFontAddFile(fontcfg, (FcChar8 *) font)) { + fprintf(stderr, "Failed to load font %s\n", font); + exit(1); } } diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp index 16f1575..4f06874 100644 --- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp @@ -32,6 +32,7 @@ #include "TextInputController.h" #include "TestShell.h" +#include "public/WebBindings.h" #include "public/WebFrame.h" #include "public/WebRange.h" #include "public/WebString.h" @@ -186,10 +187,27 @@ void TextInputController::selectedRange(const CppArgumentList&, CppVariant* resu result->set(string(buffer)); } -void TextInputController::firstRectForCharacterRange(const CppArgumentList&, CppVariant* result) +void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result) { - // FIXME: Implement this. result->setNull(); + + WebFrame* mainFrame = getMainFrame(); + if (!mainFrame) + return; + + if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) + return; + + WebRect rect; + if (!mainFrame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect)) + return; + + Vector<int> intArray(4); + intArray[0] = rect.x; + intArray[1] = rect.y; + intArray[2] = rect.width; + intArray[3] = rect.height; + result->set(WebBindings::makeIntArray(intArray)); } void TextInputController::characterIndexForPoint(const CppArgumentList&, CppVariant* result) diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp index 004865a..35247ef 100644 --- a/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp @@ -88,6 +88,7 @@ void WebPreferences::reset() userStyleSheetLocation = WebURL(); usesPageCache = false; webSecurityEnabled = true; + caretBrowsingEnabled = false; // Allow those layout tests running as local files, i.e. under // LayoutTests/http/tests/local, to access http server. @@ -100,6 +101,8 @@ void WebPreferences::reset() #endif tabsToLinks = false; + hyperlinkAuditingEnabled = false; + accelerated2dCanvasEnabled = false; } void WebPreferences::applyTo(WebView* webView) @@ -139,9 +142,11 @@ void WebPreferences::applyTo(WebView* webView) settings->setWebSecurityEnabled(webSecurityEnabled); settings->setAllowUniversalAccessFromFileURLs(allowUniversalAccessFromFileURLs); settings->setEditingBehavior(editingBehavior); + settings->setHyperlinkAuditingEnabled(hyperlinkAuditingEnabled); // LayoutTests were written with Safari Mac in mind which does not allow // tabbing to links by default. webView->setTabsToLinks(tabsToLinks); + settings->setCaretBrowsingEnabled(caretBrowsingEnabled); // Fixed values. settings->setShouldPaintCustomScrollbars(true); @@ -157,5 +162,7 @@ void WebPreferences::applyTo(WebView* webView) // FIXME: crbug.com/51879 settings->setAcceleratedCompositingEnabled(false); + + settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled); } diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.h b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h index f197c16..c0ea70f 100644 --- a/WebKitTools/DumpRenderTree/chromium/WebPreferences.h +++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h @@ -75,6 +75,9 @@ struct WebPreferences { bool allowUniversalAccessFromFileURLs; WebKit::WebSettings::EditingBehavior editingBehavior; bool tabsToLinks; + bool hyperlinkAuditingEnabled; + bool caretBrowsingEnabled; + bool accelerated2dCanvasEnabled; WebPreferences() { reset(); } void reset(); diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp index af2e403..521a0e1 100644 --- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -35,6 +35,7 @@ #include "AccessibilityController.h" #include "EventSender.h" #include "GCController.h" +#include "GOwnPtr.h" #include "LayoutTestController.h" #include "PixelDumpSupport.h" #include "WorkQueue.h" @@ -133,37 +134,81 @@ static void appendString(gchar*& target, gchar* string) static void initializeFonts() { #if PLATFORM(X11) - static int numFonts = -1; - FcInit(); - // Some tests may add or remove fonts via the @font-face rule. - // If that happens, font config should be re-created to suppress any unwanted change. + // If a test resulted a font being added or removed via the @font-face rule, then + // we want to reset the FontConfig configuration to prevent it from affecting other tests. + static int numFonts = 0; FcFontSet* appFontSet = FcConfigGetFonts(0, FcSetApplication); - if (appFontSet && numFonts >= 0 && appFontSet->nfont == numFonts) + if (appFontSet && numFonts && appFontSet->nfont == numFonts) return; - const char* fontDirEnv = g_getenv("WEBKIT_TESTFONTS"); - if (!fontDirEnv) - g_error("WEBKIT_TESTFONTS environment variable is not set, but it should point to the directory " - "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n"); + // Load our configuration file, which sets up proper aliases for family + // names like sans, serif and monospace. + FcConfig* config = FcConfigCreate(); + GOwnPtr<gchar> fontConfigFilename(g_build_filename(FONTS_CONF_DIR, "fonts.conf", NULL)); + if (!FcConfigParseAndLoad(config, reinterpret_cast<FcChar8*>(fontConfigFilename.get()), true)) + g_error("Couldn't load font configuration file from: %s", fontConfigFilename.get()); + + static const char *const fontPaths[][2] = { + { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-BoldItalic.ttf", + "/usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Bold.ttf", + "/usr/share/fonts/liberation/LiberationMono-Bold.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Italic.ttf", + "/usr/share/fonts/liberation/LiberationMono-Italic.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Regular.ttf", + "/usr/share/fonts/liberation/LiberationMono-Regular.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-BoldItalic.ttf", + "/usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Bold.ttf", + "/usr/share/fonts/liberation/LiberationSans-Bold.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Italic.ttf", + "/usr/share/fonts/liberation/LiberationSans-Italic.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf", + "/usr/share/fonts/liberation/LiberationSans-Regular.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-BoldItalic.ttf", + "/usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Bold.ttf", + "/usr/share/fonts/liberation/LiberationSerif-Bold.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Italic.ttf", + "/usr/share/fonts/liberation/LiberationSerif-Italic.ttf", }, + { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Regular.ttf", + "/usr/share/fonts/liberation/LiberationSerif-Regular.ttf", }, + { "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf", + "/usr/share/fonts/dejavu/DejaVuSans.ttf", }, + }; - GFile* fontDir = g_file_new_for_path(fontDirEnv); - if (!fontDir || !g_file_query_exists(fontDir, NULL)) - g_error("WEBKIT_TESTFONTS environment variable is not set correctly - it should point to the directory " - "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n"); + // TODO: Some tests use Lucida. We should load these as well, once it becomes + // clear how to install these fonts easily on Fedora. + for (size_t font = 0; font < G_N_ELEMENTS(fontPaths); font++) { + bool found = false; + for (size_t path = 0; path < 2; path++) { + + if (g_file_test(fontPaths[font][path], G_FILE_TEST_EXISTS)) { + found = true; + if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(fontPaths[font][path]))) + g_error("Could not load font at %s!", fontPaths[font][path]); + else + break; + } + } + + if (!found) + g_error("Could not find font at %s. Either install this font or file a bug " + "at http://bugs.webkit.org if it is installed in another location.", + fontPaths[font][0]); + } - FcConfig *config = FcConfigCreate(); - if (!FcConfigParseAndLoad (config, (FcChar8*) FONTS_CONF_FILE, true)) - g_error("Couldn't load font configuration file"); - if (!FcConfigAppFontAddDir (config, (FcChar8*) g_file_get_path(fontDir))) - g_error("Couldn't add font dir!"); - FcConfigSetCurrent(config); + // Ahem is used by many layout tests. + GOwnPtr<gchar> ahemFontFilename(g_build_filename(FONTS_CONF_DIR, "AHEM____.TTF", NULL)); + if (!FcConfigAppFontAddFile(config, reinterpret_cast<FcChar8*>(ahemFontFilename.get()))) + g_error("Could not load font at %s!", ahemFontFilename.get()); - g_object_unref(fontDir); + if (!FcConfigSetCurrent(config)) + g_error("Could not set the current font configuration!"); - appFontSet = FcConfigGetFonts(config, FcSetApplication); - numFonts = appFontSet->nfont; + numFonts = FcConfigGetFonts(config, FcSetApplication)->nfont; #endif } @@ -336,6 +381,7 @@ static void resetDefaultsToConsistentValues() "auto-resize-window", TRUE, "enable-java-applet", FALSE, "enable-plugins", TRUE, + "enable-hyperlink-auditing", FALSE, "editing-behavior", WEBKIT_EDITING_BEHAVIOR_MAC, NULL); diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp index d1529db..6e5fa5f 100644 --- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp @@ -147,6 +147,58 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber, guint return true; } +static JSValueRef getMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) +{ + GtkWidget* widget = GTK_WIDGET(JSObjectGetPrivate(object)); + CString label; + if (GTK_IS_SEPARATOR_MENU_ITEM(widget)) + label = "<separator>"; + else + label = gtk_menu_item_get_label(GTK_MENU_ITEM(widget)); + + return JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data())); +} + +static bool setMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + return true; +} + +static JSValueRef menuItemClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + GtkMenuItem* item = GTK_MENU_ITEM(JSObjectGetPrivate(thisObject)); + gtk_menu_item_activate(item); + return JSValueMakeUndefined(context); +} + +static JSStaticFunction staticMenuItemFunctions[] = { + { "click", menuItemClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { 0, 0, 0 } +}; + +static JSStaticValue staticMenuItemValues[] = { + { "title", getMenuItemTitleCallback, setMenuItemTitleCallback, kJSPropertyAttributeNone }, + { 0, 0, 0, 0 } +}; + +static JSClassRef getMenuItemClass() +{ + static JSClassRef menuItemClass = 0; + + if (!menuItemClass) { + JSClassDefinition classDefinition = { + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + classDefinition.staticFunctions = staticMenuItemFunctions; + classDefinition.staticValues = staticMenuItemValues; + + menuItemClass = JSClassCreate(&classDefinition); + } + + return menuItemClass; +} + + static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { GdkEvent* pressEvent = gdk_event_new(GDK_BUTTON_PRESS); @@ -165,13 +217,7 @@ static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef functio JSValueRef arrayValues[g_list_length(items)]; int index = 0; for (GList* item = g_list_first(items); item; item = g_list_next(item)) { - CString label; - if (GTK_IS_SEPARATOR_MENU_ITEM(item->data)) - label = "<separator>"; - else - label = gtk_menu_item_get_label(GTK_MENU_ITEM(item->data)); - - arrayValues[index] = JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data())); + arrayValues[index] = JSObjectMake(context, getMenuItemClass(), item->data); index++; } if (index) diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index 32be43d..d831076 100644 --- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -38,7 +38,6 @@ #include "WorkQueueItem.h" #include <JavaScriptCore/JSRetainPtr.h> #include <JavaScriptCore/JSStringRef.h> - #include <cstring> #include <iostream> #include <sstream> @@ -46,6 +45,7 @@ #include <glib.h> #include <libsoup/soup.h> #include <webkit/webkit.h> +#include <wtf/gobject/GOwnPtr.h> extern "C" { bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element); @@ -66,24 +66,6 @@ void webkit_web_view_execute_core_command_by_name(WebKitWebView* webView, const gboolean webkit_web_view_is_command_enabled(WebKitWebView* webView, const gchar* name); } -static gchar* copyWebSettingKey(gchar* preferenceKey) -{ - static GHashTable* keyTable; - - if (!keyTable) { - // If you add a pref here, make sure you reset the value in - // DumpRenderTree::resetDefaultsToConsistentValues. - keyTable = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(keyTable, g_strdup("WebKitJavaScriptEnabled"), g_strdup("enable-scripts")); - g_hash_table_insert(keyTable, g_strdup("WebKitDefaultFontSize"), g_strdup("default-font-size")); - g_hash_table_insert(keyTable, g_strdup("WebKitEnableCaretBrowsing"), g_strdup("enable-caret-browsing")); - g_hash_table_insert(keyTable, g_strdup("WebKitUsesPageCachePreferenceKey"), g_strdup("enable-page-cache")); - g_hash_table_insert(keyTable, g_strdup("WebKitPluginsEnabled"), g_strdup("enable-plugins")); - } - - return g_strdup(static_cast<gchar*>(g_hash_table_lookup(keyTable, preferenceKey))); -} - LayoutTestController::~LayoutTestController() { // FIXME: implement @@ -155,6 +137,12 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef return JSValueMakeUndefined(context); } +JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + // FIXME: Implement this. + return JSValueMakeUndefined(context); +} + JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const { // FIXME: implement @@ -664,48 +652,53 @@ void LayoutTestController::resumeAnimations() const void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) { - gchar* name = JSStringCopyUTF8CString(key); - gchar* strValue = JSStringCopyUTF8CString(value); + GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key)); + GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value)); WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); - WebKitWebSettings* settings = webkit_web_view_get_settings(view); - gchar* webSettingKey = copyWebSettingKey(name); - - if (webSettingKey) { - GValue stringValue = { 0, { { 0 } } }; - g_value_init(&stringValue, G_TYPE_STRING); - g_value_set_string(&stringValue, const_cast<gchar*>(strValue)); - - WebKitWebSettingsClass* klass = WEBKIT_WEB_SETTINGS_GET_CLASS(settings); - GParamSpec* pspec = g_object_class_find_property(G_OBJECT_CLASS(klass), webSettingKey); - GValue propValue = { 0, { { 0 } } }; - g_value_init(&propValue, pspec->value_type); - - if (g_value_type_transformable(G_TYPE_STRING, pspec->value_type)) { - g_value_transform(const_cast<GValue*>(&stringValue), &propValue); - g_object_set_property(G_OBJECT(settings), webSettingKey, const_cast<GValue*>(&propValue)); - } else if (G_VALUE_HOLDS_BOOLEAN(&propValue)) { - char* lowered = g_utf8_strdown(strValue, -1); - g_object_set(G_OBJECT(settings), webSettingKey, - g_str_equal(lowered, "true") - || g_str_equal(strValue, "1"), - NULL); - g_free(lowered); - } else if (G_VALUE_HOLDS_INT(&propValue)) { - std::string str(strValue); - std::stringstream ss(str); - int val = 0; - if (!(ss >> val).fail()) - g_object_set(G_OBJECT(settings), webSettingKey, val, NULL); - } else - printf("LayoutTestController::overridePreference failed to override preference '%s'.\n", name); + // This transformation could be handled by a hash table (and it once was), but + // having it prominent, makes it easier for people from other ports to keep the + // list up to date. + const gchar* propertyName = 0; + if (g_str_equal(originalName.get(), "WebKitJavaScriptEnabled")) + propertyName = "enable-scripts"; + else if (g_str_equal(originalName.get(), "WebKitDefaultFontSize")) + propertyName = "default-font-size"; + else if (g_str_equal(originalName.get(), "WebKitEnableCaretBrowsing")) + propertyName = "enable-caret-browsing"; + else if (g_str_equal(originalName.get(), "WebKitUsesPageCachePreferenceKey")) + propertyName = "enable-page-cache"; + else if (g_str_equal(originalName.get(), "WebKitPluginsEnabled")) + propertyName = "enable-plugins"; + else if (g_str_equal(originalName.get(), "WebKitHyperlinkAuditingEnabled")) + propertyName = "enable-hyperlink-auditing"; + else { + fprintf(stderr, "LayoutTestController::overridePreference tried to override " + "unknown preference '%s'.\n", originalName.get()); + return; } - g_free(webSettingKey); - g_free(name); - g_free(strValue); + WebKitWebSettings* settings = webkit_web_view_get_settings(view); + GParamSpec* pspec = g_object_class_find_property(G_OBJECT_CLASS( + WEBKIT_WEB_SETTINGS_GET_CLASS(settings)), propertyName); + GValue currentPropertyValue = { 0, { { 0 } } }; + g_value_init(¤tPropertyValue, pspec->value_type); + + if (G_VALUE_HOLDS_STRING(¤tPropertyValue)) + g_object_set(settings, propertyName, valueAsString.get(), NULL); + else if (G_VALUE_HOLDS_BOOLEAN(¤tPropertyValue)) + g_object_set(G_OBJECT(settings), propertyName, !g_ascii_strcasecmp(valueAsString.get(), "true") + || !g_ascii_strcasecmp(valueAsString.get(), "1"), NULL); + else if (G_VALUE_HOLDS_INT(¤tPropertyValue)) + g_object_set(G_OBJECT(settings), propertyName, atoi(valueAsString.get()), NULL); + else if (G_VALUE_HOLDS_FLOAT(¤tPropertyValue)) { + gfloat newValue = g_ascii_strtod(valueAsString.get(), 0); + g_object_set(G_OBJECT(settings), propertyName, newValue, NULL); + } else + fprintf(stderr, "LayoutTestController::overridePreference failed to override " + "preference '%s'.\n", originalName.get()); } void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) diff --git a/WebKitTools/DumpRenderTree/gtk/fonts.conf b/WebKitTools/DumpRenderTree/gtk/fonts.conf deleted file mode 100644 index 3540c47..0000000 --- a/WebKitTools/DumpRenderTree/gtk/fonts.conf +++ /dev/null @@ -1,258 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> -<fontconfig> - -<!-- - Accept deprecated 'mono' alias, replacing it with 'monospace' ---> - <match target="pattern"> - <test qual="any" name="family"> - <string>mono</string> - </test> - <edit name="family" mode="assign"> - <string>monospace</string> - </edit> - </match> - -<!-- - Accept alternate 'sans serif' spelling, replacing it with 'sans-serif' ---> - <match target="pattern"> - <test qual="any" name="family"> - <string>sans serif</string> - </test> - <edit name="family" mode="assign"> - <string>sans-serif</string> - </edit> - </match> - -<!-- - Accept deprecated 'sans' alias, replacing it with 'sans-serif' ---> - <match target="pattern"> - <test qual="any" name="family"> - <string>sans</string> - </test> - <edit name="family" mode="assign"> - <string>sans-serif</string> - </edit> - </match> - - - <config> -<!-- - These are the default Unicode chars that are expected to be blank - in fonts. All other blank chars are assumed to be broken and - won't appear in the resulting charsets - --> - <blank> - <int>0x0020</int> <!-- SPACE --> - <int>0x00A0</int> <!-- NO-BREAK SPACE --> - <int>0x00AD</int> <!-- SOFT HYPHEN --> - <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER --> - <int>0x0600</int> <!-- ARABIC NUMBER SIGN --> - <int>0x0601</int> <!-- ARABIC SIGN SANAH --> - <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER --> - <int>0x0603</int> <!-- ARABIC SIGN SAFHA --> - <int>0x06DD</int> <!-- ARABIC END OF AYAH --> - <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK --> - <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER --> - <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER --> - <int>0x1680</int> <!-- OGHAM SPACE MARK --> - <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ --> - <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA --> - <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR --> - <int>0x2000</int> <!-- EN QUAD --> - <int>0x2001</int> <!-- EM QUAD --> - <int>0x2002</int> <!-- EN SPACE --> - <int>0x2003</int> <!-- EM SPACE --> - <int>0x2004</int> <!-- THREE-PER-EM SPACE --> - <int>0x2005</int> <!-- FOUR-PER-EM SPACE --> - <int>0x2006</int> <!-- SIX-PER-EM SPACE --> - <int>0x2007</int> <!-- FIGURE SPACE --> - <int>0x2008</int> <!-- PUNCTUATION SPACE --> - <int>0x2009</int> <!-- THIN SPACE --> - <int>0x200A</int> <!-- HAIR SPACE --> - <int>0x200B</int> <!-- ZERO WIDTH SPACE --> - <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER --> - <int>0x200D</int> <!-- ZERO WIDTH JOINER --> - <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK --> - <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK --> - <int>0x2028</int> <!-- LINE SEPARATOR --> - <int>0x2029</int> <!-- PARAGRAPH SEPARATOR --> - <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING --> - <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING --> - <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING --> - <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE --> - <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE --> - <int>0x202F</int> <!-- NARROW NO-BREAK SPACE --> - <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE --> - <int>0x2060</int> <!-- WORD JOINER --> - <int>0x2061</int> <!-- FUNCTION APPLICATION --> - <int>0x2062</int> <!-- INVISIBLE TIMES --> - <int>0x2063</int> <!-- INVISIBLE SEPARATOR --> - <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING --> - <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING --> - <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING --> - <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING --> - <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES --> - <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES --> - <int>0x3000</int> <!-- IDEOGRAPHIC SPACE --> - <int>0x3164</int> <!-- HANGUL FILLER --> - <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE --> - <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER --> - <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR --> - <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR --> - <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR --> - </blank> -<!-- - Rescan configuration every 30 seconds when FcFontSetList is called - --> - <rescan> - <int>30</int> - </rescan> - </config> - -<!-- - URW provides metric and shape compatible fonts for these 10 Adobe families. - - However, these fonts are quite ugly and do not render well on-screen, - so we avoid matching them if the application said `anymetrics'; in that - case, a more generic font with different metrics but better appearance - will be used. - --> - <match target="pattern"> - <test name="family"> - <string>Avant Garde</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>URW Gothic L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Bookman</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>URW Bookman L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Courier</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>Nimbus Mono L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Helvetica</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>Nimbus Sans L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>New Century Schoolbook</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>Century Schoolbook L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Palatino</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>URW Palladio L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Times</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>Nimbus Roman No9 L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Zapf Chancery</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>URW Chancery L</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Zapf Dingbats</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append"> - <string>Dingbats</string> - </edit> - </match> - <match target="pattern"> - <test name="family"> - <string>Symbol</string> - </test> - <test name="anymetrics" qual="all" compare="not_eq"> - <bool>true</bool> - </test> - <edit name="family" mode="append" binding="same"> - <string>Standard Symbols L</string> - </edit> - </match> - -<!-- - Serif faces - --> - <alias> - <family>Nimbus Roman No9 L</family> - <default><family>serif</family></default> - </alias> -<!-- - Sans-serif faces - --> - <alias> - <family>Nimbus Sans L</family> - <default><family>sans-serif</family></default> - </alias> -<!-- - Monospace faces - --> - <alias> - <family>Nimbus Mono L</family> - <default><family>monospace</family></default> - </alias> - - -</fontconfig> diff --git a/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF b/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF Binary files differnew file mode 100644 index 0000000..ac81cb0 --- /dev/null +++ b/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF diff --git a/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf b/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf new file mode 100644 index 0000000..520f96e --- /dev/null +++ b/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf @@ -0,0 +1,282 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<fontconfig> + + <!-- The sans-serif font should be Liberation Serif --> + <match target="pattern"> + <test qual="any" name="family"> + <string>serif</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + </match> + <match target="pattern"> + <test qual="any" name="family"> + <string>Times</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + </match> + <match target="pattern"> + <test qual="any" name="family"> + <string>Times New Roman</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + </match> + + <!-- The sans-serif font should be Liberation Sans --> + <match target="pattern"> + <test qual="any" name="family"> + <string>sans serif</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + </match> + <match target="pattern"> + <test qual="any" name="family"> + <string>sans</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + </match> + <!-- We need to ensure that layout tests that use "Helvetica" don't + fall back to the default serif font --> + <match target="pattern"> + <test qual="any" name="family"> + <string>Helvetica</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + </match> + + <!-- The Monospace font should be Liberation Mono --> + <match target="pattern"> + <test qual="any" name="family"> + <string>monospace</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Mono</string> + </edit> + </match> + <match target="pattern"> + <test qual="any" name="family"> + <string>mono</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Mono</string> + </edit> + </match> + <!-- We need to ensure that layout tests that use "Courier", "Courier New", + and "Monaco" (all monospace fonts) don't fall back to the default + serif font --> + <match target="pattern"> + <test qual="any" name="family"> + <string>Courier</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Mono</string> + </edit> + </match> + <match target="pattern"> + <test qual="any" name="family"> + <string>Courier New</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Mono</string> + </edit> + </match> + <match target="pattern"> + <test qual="any" name="family"> + <string>Monaco</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Mono</string> + </edit> + </match> + + <!-- The following hinting specializations are adapted from those in the + Chromium test_shell. We try to duplicate their incredibly thorough + testing here --> + <match target="pattern"> + <test name="family" compare="eq"> + <string>NonAntiAliasedSans</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + <edit name="antialias" mode="assign"> + <bool>false</bool> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>SlightHintedSerif</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + <edit name="hintstyle" mode="assign"> + <const>hintslight</const> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>NonHintedSans</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + <!-- These deliberately contradict each other. The 'hinting' preference + should take priority --> + <edit name="hintstyle" mode="assign"> + <const>hintfull</const> + </edit> + <edit name="hinting" mode="assign"> + <bool>false</bool> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>AutohintedSerif</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + <edit name="autohint" mode="assign"> + <bool>true</bool> + </edit> + <edit name="hintstyle" mode="assign"> + <const>hintmedium</const> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>HintedSerif</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + <edit name="autohint" mode="assign"> + <bool>false</bool> + </edit> + <edit name="hintstyle" mode="assign"> + <const>hintmedium</const> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>FullAndAutoHintedSerif</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Serif</string> + </edit> + <edit name="autohint" mode="assign"> + <bool>true</bool> + </edit> + <edit name="hintstyle" mode="assign"> + <const>hintfull</const> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>SubpixelEnabledSans</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + <edit name="rgba" mode="assign"> + <const>rgb</const> + </edit> + </match> + + <match target="pattern"> + <test name="family" compare="eq"> + <string>SubpixelDisabledSans</string> + </test> + <edit name="family" mode="assign"> + <string>Liberation Sans</string> + </edit> + <edit name="rgba" mode="assign"> + <const>none</const> + </edit> + </match> + + <config> + <!-- These are the default Unicode chars that are expected to be blank + in fonts. All other blank chars are assumed to be broken and won't + appear in the resulting charsets --> + <blank> + <int>0x0020</int> <!-- SPACE --> + <int>0x00A0</int> <!-- NO-BREAK SPACE --> + <int>0x00AD</int> <!-- SOFT HYPHEN --> + <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER --> + <int>0x0600</int> <!-- ARABIC NUMBER SIGN --> + <int>0x0601</int> <!-- ARABIC SIGN SANAH --> + <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER --> + <int>0x0603</int> <!-- ARABIC SIGN SAFHA --> + <int>0x06DD</int> <!-- ARABIC END OF AYAH --> + <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK --> + <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER --> + <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER --> + <int>0x1680</int> <!-- OGHAM SPACE MARK --> + <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ --> + <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA --> + <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR --> + <int>0x2000</int> <!-- EN QUAD --> + <int>0x2001</int> <!-- EM QUAD --> + <int>0x2002</int> <!-- EN SPACE --> + <int>0x2003</int> <!-- EM SPACE --> + <int>0x2004</int> <!-- THREE-PER-EM SPACE --> + <int>0x2005</int> <!-- FOUR-PER-EM SPACE --> + <int>0x2006</int> <!-- SIX-PER-EM SPACE --> + <int>0x2007</int> <!-- FIGURE SPACE --> + <int>0x2008</int> <!-- PUNCTUATION SPACE --> + <int>0x2009</int> <!-- THIN SPACE --> + <int>0x200A</int> <!-- HAIR SPACE --> + <int>0x200B</int> <!-- ZERO WIDTH SPACE --> + <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER --> + <int>0x200D</int> <!-- ZERO WIDTH JOINER --> + <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK --> + <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK --> + <int>0x2028</int> <!-- LINE SEPARATOR --> + <int>0x2029</int> <!-- PARAGRAPH SEPARATOR --> + <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING --> + <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING --> + <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING --> + <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE --> + <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE --> + <int>0x202F</int> <!-- NARROW NO-BREAK SPACE --> + <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE --> + <int>0x2060</int> <!-- WORD JOINER --> + <int>0x2061</int> <!-- FUNCTION APPLICATION --> + <int>0x2062</int> <!-- INVISIBLE TIMES --> + <int>0x2063</int> <!-- INVISIBLE SEPARATOR --> + <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING --> + <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING --> + <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING --> + <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING --> + <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES --> + <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES --> + <int>0x3000</int> <!-- IDEOGRAPHIC SPACE --> + <int>0x3164</int> <!-- HANGUL FILLER --> + <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE --> + <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER --> + <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR --> + <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR --> + <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR --> + </blank> + </config> +</fontconfig> diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index f55093e..d2a6f79 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -198,6 +198,11 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value]; } +JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + return [[mainFrame webView] _nodesFromRect:context forDocument:value x:x y:y top:top right:right bottom:bottom left:left ignoreClipping:ignoreClipping]; +} + JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const { JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText])); diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro index 5b81901..801251d 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro @@ -43,4 +43,9 @@ unix:!mac { QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR } +wince*: { + INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat $$WCECOMPAT/include + LIBS += $$WCECOMPAT/lib/wcecompat.lib +} + DEFINES+=USE_SYSTEM_MALLOC diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 4e6f049..80fa441 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -564,7 +564,10 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting() DumpRenderTreeSupportQt::setEditingBehavior(m_page, "win"); QLocale::setDefault(QLocale::c()); + +#ifndef Q_OS_WINCE setlocale(LC_ALL, ""); +#endif } static bool isGlobalHistoryTest(const QUrl& url) diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp index 63dbd2a..fd7c925 100644 --- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp @@ -381,7 +381,6 @@ void EventSender::scheduleAsynchronousClick() void EventSender::addTouchPoint(int x, int y) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) // Use index to refer to the position in the vector that this touch // is stored. We then create a unique id for the touch that will be // passed into WebCore. @@ -391,24 +390,20 @@ void EventSender::addTouchPoint(int x, int y) m_touchPoints.append(point); updateTouchPoint(index, x, y); m_touchPoints[index].setState(Qt::TouchPointPressed); -#endif } void EventSender::updateTouchPoint(int index, int x, int y) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (index < 0 || index >= m_touchPoints.count()) return; QTouchEvent::TouchPoint &p = m_touchPoints[index]; p.setPos(QPointF(x, y)); p.setState(Qt::TouchPointMoved); -#endif } void EventSender::setTouchModifier(const QString &modifier, bool enable) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) Qt::KeyboardModifier mod = Qt::NoModifier; if (!modifier.compare(QLatin1String("shift"), Qt::CaseInsensitive)) mod = Qt::ShiftModifier; @@ -423,30 +418,24 @@ void EventSender::setTouchModifier(const QString &modifier, bool enable) m_touchModifiers |= mod; else m_touchModifiers &= ~mod; -#endif } void EventSender::touchStart() { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (!m_touchActive) { sendTouchEvent(QEvent::TouchBegin); m_touchActive = true; } else sendTouchEvent(QEvent::TouchUpdate); -#endif } void EventSender::touchMove() { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) sendTouchEvent(QEvent::TouchUpdate); -#endif } void EventSender::touchEnd() { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) for (int i = 0; i < m_touchPoints.count(); ++i) if (m_touchPoints[i].state() != Qt::TouchPointReleased) { sendTouchEvent(QEvent::TouchUpdate); @@ -454,31 +443,25 @@ void EventSender::touchEnd() } sendTouchEvent(QEvent::TouchEnd); m_touchActive = false; -#endif } void EventSender::clearTouchPoints() { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) m_touchPoints.clear(); m_touchModifiers = Qt::KeyboardModifiers(); m_touchActive = false; -#endif } void EventSender::releaseTouchPoint(int index) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (index < 0 || index >= m_touchPoints.count()) return; m_touchPoints[index].setState(Qt::TouchPointReleased); -#endif } void EventSender::sendTouchEvent(QEvent::Type type) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers); event.setTouchPoints(m_touchPoints); sendEvent(m_page, &event); @@ -491,7 +474,6 @@ void EventSender::sendTouchEvent(QEvent::Type type) ++it; } } -#endif } void EventSender::zoomPageIn() diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h index a17e938..4ba8382 100644 --- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h +++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h @@ -41,13 +41,11 @@ #include <QPoint> #include <QString> #include <QStringList> +#include <QTouchEvent> #include <qwebpage.h> #include <qwebframe.h> -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) -#include <QTouchEvent> -#endif class EventSender : public QObject { Q_OBJECT @@ -107,10 +105,8 @@ private: QEventLoop* m_eventLoop; QWebFrame* frameUnderMouse() const; QBasicTimer m_clickTimer; -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QList<QTouchEvent::TouchPoint> m_touchPoints; Qt::KeyboardModifiers m_touchModifiers; bool m_touchActive; -#endif }; #endif // EventSenderQt_h diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index b2ef716..90a04c4 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -591,6 +591,8 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian settings->setAttribute(QWebSettings::PluginsEnabled, value.toBool()); else if (name == "WebKitWebGLEnabled") settings->setAttribute(QWebSettings::WebGLEnabled, value.toBool()); + else if (name == "WebKitHyperlinkAuditingEnabled") + settings->setAttribute(QWebSettings::HyperlinkAuditingEnabled, value.toBool()); else printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n", name.toLatin1().data()); diff --git a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp index e0c9b61..08d8850 100644 --- a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp @@ -133,10 +133,8 @@ void TextInputController::doCommand(const QString& command) void TextInputController::setMarkedText(const QString& string, int start, int end) { QList<QInputMethodEvent::Attribute> attributes; -#if QT_VERSION >= 0x040600 QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, start, end, QVariant()); attributes << selection; -#endif QInputMethodEvent event(string, attributes); QApplication::sendEvent(parent(), &event); } diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj index 1e765c6..1cba86a 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj @@ -242,7 +242,7 @@ >
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash
if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%
cmd /c
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash
if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%
cmd /c
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
xcopy /y /d "$(TargetDir)\..\include\WebCore\ForwardingHeaders\wtf\MD5.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -316,7 +316,7 @@ >
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash
if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%
cmd /c
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash
if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%
cmd /c
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
xcopy /y /d "$(TargetDir)\..\include\WebCore\ForwardingHeaders\wtf\MD5.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -566,23 +566,23 @@ </File>
</Filter>
<File
- RelativePath="..\AccessibilityUIElement.cpp"
+ RelativePath="..\AccessibilityTextMarker.cpp"
>
</File>
<File
- RelativePath="..\AccessibilityUIElement.h"
+ RelativePath="..\AccessibilityTextMarker.h"
>
</File>
<File
- RelativePath=".\AccessibilityUIElementWin.cpp"
+ RelativePath="..\AccessibilityUIElement.cpp"
>
</File>
<File
- RelativePath="..\AccessibilityTextMarker.cpp"
+ RelativePath="..\AccessibilityUIElement.h"
>
</File>
<File
- RelativePath="..\AccessibilityTextMarker.h"
+ RelativePath=".\AccessibilityUIElementWin.cpp"
>
</File>
<File
@@ -608,10 +608,42 @@ <File
RelativePath=".\MD5.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\MD5.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\PixelDumpSupport.cpp"
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp index 68f4a6a..6dd609c 100644 --- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp @@ -179,6 +179,12 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef return JSValueMakeUndefined(context); } +JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + // FIXME: Implement this. + return JSValueMakeUndefined(context); +} + JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const { COMPtr<IWebFramePrivate> framePrivate(Query, frame); diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp index f36c290..5fba1cf 100644 --- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp @@ -486,6 +486,12 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, return 0; } +JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + // FIXME: Implement this. + return 0; +} + void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { } |