diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree')
52 files changed, 1894 insertions, 456 deletions
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/AccessibilityController.cpp index af1daf6..d3688f4 100644 --- a/WebKitTools/DumpRenderTree/AccessibilityController.cpp +++ b/WebKitTools/DumpRenderTree/AccessibilityController.cpp @@ -48,7 +48,11 @@ static JSValueRef getRootElementCallback(JSContextRef context, JSObjectRef thisO void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { JSRetainPtr<JSStringRef> accessibilityControllerStr(Adopt, JSStringCreateWithUTF8CString("accessibilityController")); - JSValueRef accessibilityControllerObject = JSObjectMake(context, getJSClass(), this); + + JSClassRef classRef = getJSClass(); + JSValueRef accessibilityControllerObject = JSObjectMake(context, classRef, this); + JSClassRelease(classRef); + JSObjectSetProperty(context, windowObject, accessibilityControllerStr.get(), accessibilityControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } @@ -85,8 +89,7 @@ JSClassRef AccessibilityController::getJSClass() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - static JSClassRef accessibilityControllerClass = JSClassCreate(&classDefinition); - return accessibilityControllerClass; + return JSClassCreate(&classDefinition); } void AccessibilityController::resetToConsistentState() diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp index 5958ccb..8c59252 100644 --- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp +++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp @@ -161,6 +161,53 @@ static JSValueRef childAtIndexCallback(JSContextRef context, JSObjectRef functio return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->getChildAtIndex(indexNumber)); } +static JSValueRef disclosedRowAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int indexNumber = 0; + if (argumentCount == 1) + indexNumber = JSValueToNumber(context, arguments[0], exception); + + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->disclosedRowAtIndex(indexNumber)); +} + +static JSValueRef ariaOwnsElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int indexNumber = 0; + if (argumentCount == 1) + indexNumber = JSValueToNumber(context, arguments[0], exception); + + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->ariaOwnsElementAtIndex(indexNumber)); +} + +static JSValueRef ariaFlowToElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int indexNumber = 0; + if (argumentCount == 1) + indexNumber = JSValueToNumber(context, arguments[0], exception); + + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->ariaFlowToElementAtIndex(indexNumber)); +} + +static JSValueRef selectedRowAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int indexNumber = 0; + if (argumentCount == 1) + indexNumber = JSValueToNumber(context, arguments[0], exception); + + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->selectedRowAtIndex(indexNumber)); +} + +static JSValueRef isEqualCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSObjectRef otherElement = 0; + if (argumentCount == 1) + otherElement = JSValueToObject(context, arguments[0], exception); + else + return JSValueMakeBoolean(context, false); + + return JSValueMakeBoolean(context, toAXElement(thisObject)->isEqual(toAXElement(otherElement))); +} + static JSValueRef elementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { int x = 0; @@ -173,13 +220,23 @@ static JSValueRef elementAtPointCallback(JSContextRef context, JSObjectRef funct return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->elementAtPoint(x, y)); } +static JSValueRef isAttributeSupportedCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSStringRef attribute = 0; + if (argumentCount == 1) + attribute = JSValueToStringCopy(context, arguments[0], exception); + JSValueRef result = JSValueMakeBoolean(context, toAXElement(thisObject)->isAttributeSupported(attribute)); + if (attribute) + JSStringRelease(attribute); + return result; +} static JSValueRef isAttributeSettableCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - JSStringRef attribute = NULL; + JSStringRef attribute = 0; if (argumentCount == 1) attribute = JSValueToStringCopy(context, arguments[0], exception); - JSValueRef result = JSValueMakeNumber(context, toAXElement(thisObject)->isAttributeSettable(attribute)); + JSValueRef result = JSValueMakeBoolean(context, toAXElement(thisObject)->isAttributeSettable(attribute)); if (attribute) JSStringRelease(attribute); return result; @@ -191,7 +248,7 @@ static JSValueRef isActionSupportedCallback(JSContextRef context, JSObjectRef fu JSStringRef action = 0; if (argumentCount == 1) action = JSValueToStringCopy(context, arguments[0], exception); - JSValueRef result = JSValueMakeNumber(context, toAXElement(thisObject)->isActionSupported(action)); + JSValueRef result = JSValueMakeBoolean(context, toAXElement(thisObject)->isActionSupported(action)); if (action) JSStringRelease(action); return result; @@ -199,7 +256,7 @@ static JSValueRef isActionSupportedCallback(JSContextRef context, JSObjectRef fu static JSValueRef attributeValueCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - JSStringRef attribute = NULL; + JSStringRef attribute = 0; if (argumentCount == 1) attribute = JSValueToStringCopy(context, arguments[0], exception); JSRetainPtr<JSStringRef> attributeValue(Adopt, toAXElement(thisObject)->attributeValue(attribute)); @@ -230,6 +287,11 @@ static JSValueRef parentElementCallback(JSContextRef context, JSObjectRef functi return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->parentElement()); } +static JSValueRef disclosedByRowCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->disclosedByRow()); +} + static JSValueRef setSelectedTextRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { unsigned location = UINT_MAX, length = 0; @@ -239,24 +301,51 @@ static JSValueRef setSelectedTextRangeCallback(JSContextRef context, JSObjectRef } toAXElement(thisObject)->setSelectedTextRange(location, length); - return 0; + return JSValueMakeUndefined(context); } static JSValueRef incrementCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { toAXElement(thisObject)->increment(); - return 0; + return JSValueMakeUndefined(context); } static JSValueRef decrementCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { toAXElement(thisObject)->decrement(); - return 0; + return JSValueMakeUndefined(context); } +static JSValueRef showMenuCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + toAXElement(thisObject)->showMenu(); + return JSValueMakeUndefined(context); +} // Static Value Getters +static JSValueRef getARIADropEffectsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> dropEffects(Adopt, toAXElement(thisObject)->ariaDropEffects()); + return JSValueMakeString(context, dropEffects.get()); +} + +static JSValueRef getARIAIsGrabbedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeBoolean(context, toAXElement(thisObject)->ariaIsGrabbed()); +} + +static JSValueRef getIsValidCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + AccessibilityUIElement* uiElement = toAXElement(thisObject); + if (!uiElement->platformUIElement()) + return JSValueMakeBoolean(context, false); + + // There might be other platform logic that one could check here... + + return JSValueMakeBoolean(context, true); +} + static JSValueRef getRoleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { JSRetainPtr<JSStringRef> role(Adopt, toAXElement(thisObject)->role()); @@ -269,6 +358,12 @@ static JSValueRef getSubroleCallback(JSContextRef context, JSObjectRef thisObjec return JSValueMakeString(context, role.get()); } +static JSValueRef getRoleDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> roleDesc(Adopt, toAXElement(thisObject)->roleDescription()); + return JSValueMakeString(context, roleDesc.get()); +} + static JSValueRef getTitleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { JSRetainPtr<JSStringRef> title(Adopt, toAXElement(thisObject)->title()); @@ -281,12 +376,24 @@ static JSValueRef getDescriptionCallback(JSContextRef context, JSObjectRef thisO return JSValueMakeString(context, description.get()); } +static JSValueRef getStringValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> stringValue(Adopt, toAXElement(thisObject)->stringValue()); + return JSValueMakeString(context, stringValue.get()); +} + static JSValueRef getLanguageCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { JSRetainPtr<JSStringRef> language(Adopt, toAXElement(thisObject)->language()); return JSValueMakeString(context, language.get()); } +static JSValueRef getOrientationCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> orientation(Adopt, toAXElement(thisObject)->orientation()); + return JSValueMakeString(context, orientation.get()); +} + static JSValueRef getChildrenCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { return JSValueMakeNumber(context, toAXElement(thisObject)->childrenCount()); @@ -358,12 +465,45 @@ static JSValueRef getIsRequiredCallback(JSContextRef context, JSObjectRef thisOb return JSValueMakeBoolean(context, toAXElement(thisObject)->isRequired()); } +static JSValueRef getIsSelectedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*) +{ + return JSValueMakeBoolean(context, toAXElement(thisObject)->isSelected()); +} + +static JSValueRef getIsExpandedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*) +{ + return JSValueMakeBoolean(context, toAXElement(thisObject)->isExpanded()); +} + +static JSValueRef hierarchicalLevelCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->hierarchicalLevel()); +} + static JSValueRef getValueDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { JSRetainPtr<JSStringRef> valueDescription(Adopt, toAXElement(thisObject)->valueDescription()); return JSValueMakeString(context, valueDescription.get()); } +static JSValueRef getAccessibilityValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> accessibilityValue(Adopt, toAXElement(thisObject)->accessibilityValue()); + return JSValueMakeString(context, accessibilityValue.get()); +} + +static JSValueRef getDocumentEncodingCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> documentEncoding(Adopt, toAXElement(thisObject)->documentEncoding()); + return JSValueMakeString(context, documentEncoding.get()); +} + +static JSValueRef getDocumentURICallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> documentURI(Adopt, toAXElement(thisObject)->documentURI()); + return JSValueMakeString(context, documentURI.get()); +} + // Destruction static void finalize(JSObjectRef thisObject) @@ -381,11 +521,14 @@ JSObjectRef AccessibilityUIElement::makeJSAccessibilityUIElement(JSContextRef co JSClassRef AccessibilityUIElement::getJSClass() { static JSStaticValue staticValues[] = { + { "accessibilityValue", getAccessibilityValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "role", getRoleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "subrole", getSubroleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "roleDescription", getRoleDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "title", getTitleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "description", getDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "language", getLanguageCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "stringValue", getStringValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "x", getXCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "y", getYCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "width", getWidthCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -400,7 +543,16 @@ JSClassRef AccessibilityUIElement::getJSClass() { "selectedTextRange", getSelectedTextRangeCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isEnabled", getIsEnabledCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isRequired", getIsRequiredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "isSelected", getIsSelectedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "isExpanded", getIsExpandedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "valueDescription", getValueDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "hierarchicalLevel", hierarchicalLevelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "documentEncoding", getDocumentEncodingCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "documentURI", getDocumentURICallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "isValid", getIsValidCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "orientation", getOrientationCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "ariaIsGrabbed", getARIAIsGrabbedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0, 0 } }; @@ -428,11 +580,19 @@ JSClassRef AccessibilityUIElement::getJSClass() { "titleUIElement", titleUIElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setSelectedTextRange", setSelectedTextRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "attributeValue", attributeValueCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "isAttributeSupported", isAttributeSupportedCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isAttributeSettable", isAttributeSettableCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isActionSupported", isActionSupportedCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "parentElement", parentElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "disclosedByRow", disclosedByRowCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "increment", incrementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "decrement", decrementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "showMenu", showMenuCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "disclosedRowAtIndex", disclosedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "ariaOwnsElementAtIndex", ariaOwnsElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "ariaFlowToElementAtIndex", ariaFlowToElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "selectedRowAtIndex", selectedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "isEqual", isEqualCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0 } }; diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h index fffdad8..9985523 100644 --- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h +++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h @@ -61,6 +61,8 @@ public: static JSObjectRef makeJSAccessibilityUIElement(JSContextRef, const AccessibilityUIElement&); + bool isEqual(AccessibilityUIElement* otherElement) { return platformUIElement() == otherElement->platformUIElement(); } + void getLinkedUIElements(Vector<AccessibilityUIElement>&); void getDocumentLinks(Vector<AccessibilityUIElement>&); void getChildren(Vector<AccessibilityUIElement>&); @@ -80,16 +82,22 @@ public: JSStringRef parameterizedAttributeNames(); void increment(); void decrement(); + void showMenu(); // Attributes - platform-independent implementations JSStringRef attributeValue(JSStringRef attribute); + bool isAttributeSupported(JSStringRef attribute); bool isAttributeSettable(JSStringRef attribute); bool isActionSupported(JSStringRef action); JSStringRef role(); JSStringRef subrole(); + JSStringRef roleDescription(); JSStringRef title(); JSStringRef description(); JSStringRef language(); + JSStringRef stringValue(); + JSStringRef accessibilityValue() const; + JSStringRef orientation() const; double x(); double y(); double width(); @@ -102,8 +110,13 @@ public: JSStringRef selectedTextRange(); bool isEnabled(); bool isRequired() const; + bool isSelected() const; + bool isExpanded() const; + int hierarchicalLevel() const; double clickPointX(); double clickPointY(); + JSStringRef documentEncoding(); + JSStringRef documentURI(); // Table-specific attributes JSStringRef attributesOfColumnHeaders(); @@ -116,6 +129,20 @@ public: JSStringRef rowIndexRange(); JSStringRef columnIndexRange(); + // Tree/Outline specific attributes + AccessibilityUIElement selectedRowAtIndex(unsigned); + AccessibilityUIElement disclosedByRow(); + AccessibilityUIElement disclosedRowAtIndex(unsigned); + + // ARIA specific + AccessibilityUIElement ariaOwnsElementAtIndex(unsigned); + AccessibilityUIElement ariaFlowToElementAtIndex(unsigned); + + // ARIA Drag and Drop + bool ariaIsGrabbed() const; + // A space concatentated string of all the drop effects. + JSStringRef ariaDropEffects() const; + // Parameterized attributes int lineForIndex(int); JSStringRef boundsForRange(unsigned location, unsigned length); diff --git a/WebKitTools/DumpRenderTree/GCController.cpp b/WebKitTools/DumpRenderTree/GCController.cpp index fe84a58..06a04fb 100644 --- a/WebKitTools/DumpRenderTree/GCController.cpp +++ b/WebKitTools/DumpRenderTree/GCController.cpp @@ -74,28 +74,15 @@ static JSValueRef getJSObjectCountCallback(JSContextRef context, JSObjectRef fun void GCController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { JSRetainPtr<JSStringRef> gcControllerStr(Adopt, JSStringCreateWithUTF8CString("GCController")); - JSValueRef gcControllerObject = JSObjectMake(context, getJSClass(), this); - JSObjectSetProperty(context, windowObject, gcControllerStr.get(), gcControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); -} - -JSClassRef GCController::getJSClass() -{ - static JSClassRef gcControllerClass = 0; - if (!gcControllerClass) { - JSStaticFunction* staticFunctions = GCController::staticFunctions(); - JSClassDefinition classDefinition = { - 0, kJSClassAttributeNone, "GCController", 0, 0, staticFunctions, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; + JSClassRef classRef = getJSClass(); + JSValueRef gcControllerObject = JSObjectMake(context, classRef, this); + JSClassRelease(classRef); - gcControllerClass = JSClassCreate(&classDefinition); - } - - return gcControllerClass; + JSObjectSetProperty(context, windowObject, gcControllerStr.get(), gcControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } -JSStaticFunction* GCController::staticFunctions() +JSClassRef GCController::getJSClass() { static JSStaticFunction staticFunctions[] = { { "collect", collectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -104,5 +91,10 @@ JSStaticFunction* GCController::staticFunctions() { 0, 0, 0 } }; - return staticFunctions; + static JSClassDefinition classDefinition = { + 0, kJSClassAttributeNone, "GCController", 0, 0, staticFunctions, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + return JSClassCreate(&classDefinition); } diff --git a/WebKitTools/DumpRenderTree/GCController.h b/WebKitTools/DumpRenderTree/GCController.h index 4284275..afc1de0 100644 --- a/WebKitTools/DumpRenderTree/GCController.h +++ b/WebKitTools/DumpRenderTree/GCController.h @@ -45,7 +45,6 @@ public: private: static JSClassRef getJSClass(); - static JSStaticFunction* staticFunctions(); }; #endif // GCController_h diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp index daf888f..572d610 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp @@ -838,6 +838,18 @@ static JSValueRef setXSSAuditorEnabledCallback(JSContextRef context, JSObjectRef return JSValueMakeUndefined(context); } +static JSValueRef setAllowUniversalAccessFromFileURLsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + // Has mac & windows implementation + if (argumentCount < 1) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setAllowUniversalAccessFromFileURLs(JSValueToBoolean(context, arguments[0])); + + return JSValueMakeUndefined(context); +} + static JSValueRef setTabKeyCyclesThroughElementsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation @@ -850,6 +862,16 @@ static JSValueRef setTabKeyCyclesThroughElementsCallback(JSContextRef context, J return JSValueMakeUndefined(context); } +static JSValueRef setTimelineProfilingEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + if (argumentCount < 1) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setTimelineProfilingEnabled(JSValueToBoolean(context, arguments[0])); + return JSValueMakeUndefined(context); +} + static JSValueRef setUseDashboardCompatibilityModeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation @@ -979,6 +1001,7 @@ static JSValueRef showWebInspectorCallback(JSContextRef context, JSObjectRef fun static JSValueRef closeWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setTimelineProfilingEnabled(false); controller->closeWebInspector(); return JSValueMakeUndefined(context); } @@ -1050,6 +1073,22 @@ static JSValueRef pauseTransitionAtTimeOnElementWithIdCallback(JSContextRef cont return JSValueMakeBoolean(context, controller->pauseTransitionAtTimeOnElementWithId(propertyName.get(), time, elementId.get())); } +static JSValueRef sampleSVGAnimationForElementAtTimeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + if (argumentCount != 3) + return JSValueMakeUndefined(context); + + JSRetainPtr<JSStringRef> animationId(Adopt, JSValueToStringCopy(context, arguments[0], exception)); + ASSERT(!*exception); + double time = JSValueToNumber(context, arguments[1], exception); + ASSERT(!*exception); + JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception)); + ASSERT(!*exception); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + return JSValueMakeBoolean(context, controller->sampleSVGAnimationForElementAtTime(animationId.get(), time, elementId.get())); +} + static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { if (argumentCount != 0) @@ -1150,26 +1189,24 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi { JSRetainPtr<JSStringRef> layoutTestContollerStr(Adopt, JSStringCreateWithUTF8CString("layoutTestController")); ref(); - JSValueRef layoutTestContollerObject = JSObjectMake(context, getJSClass(), this); + + JSClassRef classRef = getJSClass(); + JSValueRef layoutTestContollerObject = JSObjectMake(context, classRef, this); + JSClassRelease(classRef); + JSObjectSetProperty(context, windowObject, layoutTestContollerStr.get(), layoutTestContollerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } JSClassRef LayoutTestController::getJSClass() { - static JSClassRef layoutTestControllerClass; - - if (!layoutTestControllerClass) { - JSStaticValue* staticValues = LayoutTestController::staticValues(); - JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions(); - JSClassDefinition classDefinition = { - 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions, - 0, layoutTestControllerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - - layoutTestControllerClass = JSClassCreate(&classDefinition); - } + static JSStaticValue* staticValues = LayoutTestController::staticValues(); + static JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions(); + static JSClassDefinition classDefinition = { + 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions, + 0, layoutTestControllerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; - return layoutTestControllerClass; + return JSClassCreate(&classDefinition); } JSStaticValue* LayoutTestController::staticValues() @@ -1227,6 +1264,7 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "pathToLocalResource", pathToLocalResourceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pauseAnimationAtTimeOnElementWithId", pauseAnimationAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pauseTransitionAtTimeOnElementWithId", pauseTransitionAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "sampleSVGAnimationForElementAtTime", sampleSVGAnimationForElementAtTimeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "printToPDF", dumpAsPDFCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "queueBackNavigation", queueBackNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "queueForwardNavigation", queueForwardNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -1237,6 +1275,7 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "removeAllVisitedLinks", removeAllVisitedLinksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "repaintSweepHorizontally", repaintSweepHorizontallyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setAcceptsEditing", setAcceptsEditingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setAllowUniversalAccessFromFileURLs", setAllowUniversalAccessFromFileURLsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setAlwaysAcceptCookies", setAlwaysAcceptCookiesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setAppCacheMaximumSize", setAppCacheMaximumSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setAuthenticationPassword", setAuthenticationPasswordCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -1264,6 +1303,7 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "setSmartInsertDeleteEnabled", setSmartInsertDeleteEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setStopProvisionalFrameLoads", setStopProvisionalFrameLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setTabKeyCyclesThroughElements", setTabKeyCyclesThroughElementsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setTimelineProfilingEnabled", setTimelineProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setUseDashboardCompatibilityMode", setUseDashboardCompatibilityModeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setUserStyleSheetEnabled", setUserStyleSheetEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setUserStyleSheetLocation", setUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h index 79ffb99..7e18dce 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/LayoutTestController.h @@ -67,6 +67,7 @@ public: void removeAllVisitedLinks(); void setAcceptsEditing(bool acceptsEditing); void setAppCacheMaximumSize(unsigned long long quota); + void setAllowUniversalAccessFromFileURLs(bool); void setAuthorAndUserStylesEnabled(bool); void setCacheModel(int); void setCustomPolicyDelegate(bool setDelegate, bool permissive); @@ -201,6 +202,7 @@ public: bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId); bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId); + bool sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId); unsigned numberOfActiveAnimations() const; void whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains); @@ -214,6 +216,7 @@ public: void showWebInspector(); void closeWebInspector(); + void setTimelineProfilingEnabled(bool enabled); void evaluateInWebInspector(long callId, JSStringRef script); void evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp index 14280ba..fa8aed1 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp @@ -34,25 +34,12 @@ #include <string.h> #include <stdlib.h> -void pluginLog(NPP instance, const char* format, ...) +// Helper function which takes in the plugin window object for logging to the console object. +static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, const char* message) { - va_list args; - va_start(args, format); - char message[2048] = "PLUGIN: "; - vsprintf(message + strlen(message), format, args); - va_end(args); - - NPObject* windowObject = 0; - NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject); - if (error != NPERR_NO_ERROR) { - fprintf(stderr, "Failed to retrieve window object while logging: %s\n", message); - return; - } - NPVariant consoleVariant; if (!browser->getproperty(instance, windowObject, browser->getstringidentifier("console"), &consoleVariant)) { fprintf(stderr, "Failed to retrieve console object while logging: %s\n", message); - browser->releaseobject(windowObject); return; } @@ -65,12 +52,43 @@ void pluginLog(NPP instance, const char* format, ...) if (!browser->invoke(instance, consoleObject, browser->getstringidentifier("log"), &messageVariant, 1, &result)) { fprintf(stderr, "Failed to invoke console.log while logging: %s\n", message); browser->releaseobject(consoleObject); - browser->releaseobject(windowObject); return; } browser->releasevariantvalue(&result); browser->releaseobject(consoleObject); +} + +// Helper function which takes in the plugin window object for logging to the console object. This function supports variable +// arguments. +static void pluginLogWithWindowObjectVariableArgs(NPObject* windowObject, NPP instance, const char* format, ...) +{ + va_list args; + va_start(args, format); + char message[2048] = "PLUGIN: "; + vsprintf(message + strlen(message), format, args); + va_end(args); + + pluginLogWithWindowObject(windowObject, instance, message); +} + +// Helper function to log to the console object. +void pluginLog(NPP instance, const char* format, ...) +{ + va_list args; + va_start(args, format); + char message[2048] = "PLUGIN: "; + vsprintf(message + strlen(message), format, args); + va_end(args); + + NPObject* windowObject = 0; + NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject); + if (error != NPERR_NO_ERROR) { + fprintf(stderr, "Failed to retrieve window object while logging: %s\n", message); + return; + } + + pluginLogWithWindowObject(windowObject, instance, message); browser->releaseobject(windowObject); } @@ -152,6 +170,8 @@ enum { ID_TEST_THROW_EXCEPTION_METHOD, ID_TEST_FAIL_METHOD, ID_DESTROY_NULL_STREAM, + ID_TEST_RELOAD_PLUGINS_NO_PAGES, + ID_TEST_RELOAD_PLUGINS_AND_PAGES, NUM_METHOD_IDENTIFIERS }; @@ -177,7 +197,9 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { "testConstruct", "testThrowException", "testFail", - "destroyNullStream" + "destroyNullStream", + "reloadPluginsNoPages", + "reloadPluginsAndPages" }; static NPUTF8* createCStringFromNPVariant(const NPVariant* variant) @@ -643,6 +665,76 @@ static bool testConstruct(PluginObject* obj, const NPVariant* args, uint32_t arg return browser->construct(obj->npp, NPVARIANT_TO_OBJECT(args[0]), args + 1, argCount - 1, result); } +// Helper function to notify the layout test controller that the test completed. +void notifyTestCompletion(NPP npp, NPObject* object) +{ + NPVariant result; + NPString script; + script.UTF8Characters = "javascript:window.layoutTestController.notifyDone();"; + script.UTF8Length = strlen("javascript:window.layoutTestController.notifyDone();"); + browser->evaluate(npp, object, &script, &result); + browser->releasevariantvalue(&result); +} + +bool testDocumentOpen(NPP npp) +{ + NPIdentifier documentId = browser->getstringidentifier("document"); + NPIdentifier openId = browser->getstringidentifier("open"); + + NPObject *windowObject = NULL; + browser->getvalue(npp, NPNVWindowNPObject, &windowObject); + if (!windowObject) + return false; + + NPVariant docVariant; + browser->getproperty(npp, windowObject, documentId, &docVariant); + if (docVariant.type != NPVariantType_Object) + return false; + + NPObject *documentObject = NPVARIANT_TO_OBJECT(docVariant); + + NPVariant openArgs[2]; + STRINGZ_TO_NPVARIANT("text/html", openArgs[0]); + STRINGZ_TO_NPVARIANT("_blank", openArgs[1]); + + NPVariant result; + browser->invoke(npp, documentObject, openId, openArgs, 2, &result); + browser->releaseobject(documentObject); + + if (result.type == NPVariantType_Object) { + pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS"); + notifyTestCompletion(npp, result.value.objectValue); + browser->releaseobject(result.value.objectValue); + return true; + } + + return false; +} + +bool testWindowOpen(NPP npp) +{ + NPIdentifier openId = browser->getstringidentifier("open"); + + NPObject *windowObject = NULL; + browser->getvalue(npp, NPNVWindowNPObject, &windowObject); + if (!windowObject) + return false; + + NPVariant openArgs[2]; + STRINGZ_TO_NPVARIANT("about:blank", openArgs[0]); + STRINGZ_TO_NPVARIANT("_blank", openArgs[1]); + + NPVariant result; + browser->invoke(npp, windowObject, openId, openArgs, 2, &result); + if (result.type == NPVariantType_Object) { + pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS"); + notifyTestCompletion(npp, result.value.objectValue); + browser->releaseobject(result.value.objectValue); + return true; + } + return false; +} + static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) { PluginObject* plugin = reinterpret_cast<PluginObject*>(header); @@ -691,6 +783,13 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a browser->invoke(plugin->npp, windowScriptObject, name, args, argCount, result); } else if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM]) return destroyNullStream(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_NO_PAGES]) { + browser->reloadplugins(false); + return true; + } else if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_AND_PAGES]) { + browser->reloadplugins(true); + return true; + } return false; } @@ -721,6 +820,7 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->eventLogging = FALSE; newInstance->onStreamLoad = 0; newInstance->onStreamDestroy = 0; + newInstance->onDestroy = 0; newInstance->onURLNotify = 0; newInstance->logDestroy = FALSE; newInstance->logSetWindow = FALSE; @@ -732,6 +832,9 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->lastUrl = NULL; newInstance->lastHeaders = NULL; + newInstance->testDocumentOpenInDestroyStream = FALSE; + newInstance->testWindowOpen = FALSE; + return (NPObject*)newInstance; } diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h index 7437d04..157a1d2 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h @@ -38,8 +38,11 @@ typedef struct { NPBool cachedPrivateBrowsingMode; NPObject* testObject; NPStream* stream; + NPBool testDocumentOpenInDestroyStream; + NPBool testWindowOpen; char* onStreamLoad; char* onStreamDestroy; + char* onDestroy; char* onURLNotify; char* firstUrl; char* firstHeaders; @@ -55,3 +58,5 @@ extern void handleCallback(PluginObject* object, const char *url, NPReason reaso extern void notifyStream(PluginObject* object, const char *url, const char *headers); extern void testNPRuntime(NPP npp); extern void pluginLog(NPP instance, const char* format, ...); +extern bool testDocumentOpen(NPP npp); +extern bool testWindowOpen(NPP npp); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp index 125d2e8..5883ffb 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp @@ -105,6 +105,12 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch pluginLog(instance, "src: %s", argv[i]); } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0) executeScript(obj, "document.body.innerHTML = ''"); + else if (!strcasecmp(argn[i], "ondestroy")) + obj->onDestroy = strdup(argv[i]); + else if (strcasecmp(argn[i], "testdocumentopenindestroystream") == 0) + obj->testDocumentOpenInDestroyStream = TRUE; + else if (strcasecmp(argn[i], "testwindowopen") == 0) + obj->testWindowOpen = TRUE; } #ifndef NP_NO_CARBON @@ -140,6 +146,11 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); if (obj) { + if (obj->onDestroy) { + executeScript(obj, obj->onDestroy); + free(obj->onDestroy); + } + if (obj->onStreamLoad) free(obj->onStreamLoad); @@ -166,6 +177,11 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); obj->logSetWindow = false; } + + if (obj->testWindowOpen) { + testWindowOpen(instance); + obj->testWindowOpen = FALSE; + } } return NPERR_NO_ERROR; @@ -210,6 +226,11 @@ NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) if (obj->onStreamDestroy) executeScript(obj, obj->onStreamDestroy); + if (obj->testDocumentOpenInDestroyStream) { + testDocumentOpen(instance); + obj->testDocumentOpenInDestroyStream = FALSE; + } + return NPERR_NO_ERROR; } diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp index 593f2eb..df06cea 100644 --- a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp @@ -58,7 +58,11 @@ AccessibilityUIElement AccessibilityController::focusedElement() AccessibilityUIElement AccessibilityController::rootElement() { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); - AtkObject* axObject = gtk_widget_get_accessible(GTK_WIDGET(view)); + + // The presumed, desired rootElement is the parent of the web view. + GtkWidget* webViewParent = gtk_widget_get_parent(GTK_WIDGET(view)); + AtkObject* axObject = gtk_widget_get_accessible(webViewParent); + return AccessibilityUIElement(axObject); } diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp index 9aa31a8..13d313d 100644 --- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp @@ -161,6 +161,11 @@ JSStringRef AccessibilityUIElement::subrole() return 0; } +JSStringRef AccessibilityUIElement::roleDescription() +{ + return 0; +} + JSStringRef AccessibilityUIElement::title() { const gchar* name = atk_object_get_name(ATK_OBJECT(m_element)); @@ -181,6 +186,12 @@ JSStringRef AccessibilityUIElement::description() return JSStringCreateWithUTF8CString(description); } +JSStringRef AccessibilityUIElement::stringValue() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + JSStringRef AccessibilityUIElement::language() { // FIXME: implement @@ -233,6 +244,10 @@ double AccessibilityUIElement::clickPointY() return 0.f; } +JSStringRef AccessibilityUIElement::orientation() const +{ + return 0; +} double AccessibilityUIElement::intValue() { @@ -316,6 +331,34 @@ bool AccessibilityUIElement::isRequired() const return false; } +bool AccessibilityUIElement::isSelected() const +{ + // FIXME: implement + return false; +} + +int AccessibilityUIElement::hierarchicalLevel() const +{ + // FIXME: implement + return 0; +} + +bool AccessibilityUIElement::ariaIsGrabbed() const +{ + return false; +} + +JSStringRef AccessibilityUIElement::ariaDropEffects() const +{ + return 0; +} + +bool AccessibilityUIElement::isExpanded() const +{ + // FIXME: implement + return false; +} + JSStringRef AccessibilityUIElement::attributesOfColumnHeaders() { // FIXME: implement @@ -417,6 +460,11 @@ bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute) return false; } +bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute) +{ + return false; +} + void AccessibilityUIElement::increment() { // FIXME: implement @@ -426,3 +474,57 @@ void AccessibilityUIElement::decrement() { // FIXME: implement } + +void AccessibilityUIElement::showMenu() +{ + // FIXME: implement +} + +AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::disclosedByRow() +{ + return 0; +} + +JSStringRef AccessibilityUIElement::accessibilityValue() const +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::documentEncoding() +{ + AtkRole role = atk_object_get_role(ATK_OBJECT(m_element)); + if (role != ATK_ROLE_DOCUMENT_FRAME) + return JSStringCreateWithCharacters(0, 0); + + return JSStringCreateWithUTF8CString(atk_document_get_attribute_value(ATK_DOCUMENT(m_element), "Encoding")); +} + +JSStringRef AccessibilityUIElement::documentURI() +{ + AtkRole role = atk_object_get_role(ATK_OBJECT(m_element)); + if (role != ATK_ROLE_DOCUMENT_FRAME) + return JSStringCreateWithCharacters(0, 0); + + return JSStringCreateWithUTF8CString(atk_document_get_attribute_value(ATK_DOCUMENT(m_element), "URI")); +} diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp index 4ed6e36..fd1e3c6 100644 --- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -82,6 +82,7 @@ static GCController* gcController = 0; static WebKitWebView* webView; static GtkWidget* window; static GtkWidget* container; +static GtkWidget* webInspectorWindow; WebKitWebFrame* mainFrame = 0; WebKitWebFrame* topLoadingFrame = 0; guint waitToDumpWatchdog = 0; @@ -113,6 +114,11 @@ static bool shouldLogFrameLoadDelegates(const char* pathOrURL) return strstr(pathOrURL, "loading/"); } +static bool shouldOpenWebInspector(const char* pathOrURL) +{ + return strstr(pathOrURL, "inspector/"); +} + void dumpFrameScrollPosition(WebKitWebFrame* frame) { @@ -120,7 +126,7 @@ void dumpFrameScrollPosition(WebKitWebFrame* frame) void displayWebView() { - + gtk_widget_queue_draw(GTK_WIDGET(webView)); } static void appendString(gchar*& target, gchar* string) @@ -319,7 +325,6 @@ static void resetDefaultsToConsistentValues() "enable-offline-web-application-cache", TRUE, "enable-universal-access-from-file-uris", TRUE, "enable-scripts", TRUE, - "enable-web-sockets", TRUE, "enable-dom-paste", TRUE, "default-font-family", "Times", "monospace-font-family", "Courier", @@ -400,12 +405,8 @@ void dump() // FIXME: call displayWebView here when we support --paint - puts("#EOF"); // terminate the (possibly empty) pixels block - - fflush(stdout); - fflush(stderr); - done = true; + gtk_main_quit(); } static void setDefaultsToConsistentStateValuesForTesting() @@ -427,6 +428,14 @@ static void setDefaultsToConsistentStateValuesForTesting() g_free(databaseDirectory); } +static void sendPixelResultsEOF() +{ + puts("#EOF"); + + fflush(stdout); + fflush(stderr); +} + static void runTest(const string& testPathOrURL) { ASSERT(!testPathOrURL.empty()); @@ -455,6 +464,9 @@ static void runTest(const string& testPathOrURL) if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) gLayoutTestController->setDumpFrameLoadCallbacks(true); + if (shouldOpenWebInspector(pathOrURL.c_str())) + gLayoutTestController->showWebInspector(); + WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); @@ -484,9 +496,10 @@ static void runTest(const string& testPathOrURL) g_free(url); url = NULL; - while (!done) - g_main_context_iteration(NULL, TRUE); + gtk_main(); + if (shouldOpenWebInspector(pathOrURL.c_str())) + gLayoutTestController->closeWebInspector(); // Also check if we still have opened webViews and free them. if (gLayoutTestController->closeRemainingWindowsWhenComplete() || webViewList) { @@ -503,6 +516,9 @@ static void runTest(const string& testPathOrURL) gLayoutTestController->deref(); gLayoutTestController = 0; + + // terminate the (possibly empty) pixels block after all the state reset + sendPixelResultsEOF(); } void webViewLoadStarted(WebKitWebView* view, WebKitWebFrame* frame, void*) @@ -565,7 +581,7 @@ static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void if (WorkQueue::shared()->count()) g_timeout_add(0, processWork, 0); - else + else dump(); } @@ -708,9 +724,29 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We static WebKitWebView* webViewCreate(WebKitWebView*, WebKitWebFrame*); +static gboolean webInspectorShowWindow(WebKitWebInspector*, gpointer data) +{ + gtk_window_set_default_size(GTK_WINDOW(webInspectorWindow), 800, 600); + gtk_widget_show_all(webInspectorWindow); + return TRUE; +} + +static gboolean webInspectorCloseWindow(WebKitWebInspector*, gpointer data) +{ + gtk_widget_destroy(webInspectorWindow); + webInspectorWindow = 0; + return TRUE; +} + static WebKitWebView* webInspectorInspectWebView(WebKitWebInspector*, gpointer data) { - return WEBKIT_WEB_VIEW(webkit_web_view_new()); + webInspectorWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + GtkWidget* webView = webkit_web_view_new(); + gtk_container_add(GTK_CONTAINER(webInspectorWindow), + webView); + + return WEBKIT_WEB_VIEW(webView); } static WebKitWebView* createWebView() @@ -738,7 +774,11 @@ static WebKitWebView* createWebView() NULL); WebKitWebInspector* inspector = webkit_web_view_get_inspector(view); - g_signal_connect(inspector, "inspect-web-view", G_CALLBACK(webInspectorInspectWebView), 0); + g_object_connect(G_OBJECT(inspector), + "signal::inspect-web-view", webInspectorInspectWebView, 0, + "signal::show-window", webInspectorShowWindow, 0, + "signal::close-window", webInspectorCloseWindow, 0, + NULL); return view; } @@ -793,6 +833,7 @@ int main(int argc, char* argv[]) gtk_container_add(GTK_CONTAINER(container), GTK_WIDGET(webView)); gtk_widget_realize(GTK_WIDGET(webView)); gtk_widget_show_all(container); + gtk_widget_grab_focus(GTK_WIDGET(webView)); mainFrame = webkit_web_view_get_main_frame(webView); setDefaultsToConsistentStateValuesForTesting(); diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp index f42928c..6268b5b 100644 --- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp @@ -200,6 +200,23 @@ static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, return JSValueMakeUndefined(context); } +static guint getStateFlags() +{ + guint state = 0; + + if (down) { + if (currentEventButton == 1) + state = GDK_BUTTON1_MASK; + else if (currentEventButton == 2) + state = GDK_BUTTON2_MASK; + else if (currentEventButton == 3) + state = GDK_BUTTON3_MASK; + } else + state = 0; + + return state; +} + static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { @@ -207,8 +224,6 @@ static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JS if (!view) return JSValueMakeUndefined(context); - down = false; - GdkEvent event; memset(&event, 0, sizeof(event)); event.type = GDK_BUTTON_RELEASE; @@ -226,6 +241,9 @@ static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JS event.button.window = GTK_WIDGET(view)->window; event.button.time = GDK_CURRENT_TIME; event.button.device = gdk_device_get_core_pointer(); + event.button.state = getStateFlags(); + + down = false; int x_root, y_root; #if GTK_CHECK_VERSION(2,17,3) @@ -286,16 +304,8 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function event.motion.x_root = x_root; event.motion.y_root = y_root; - - if (down) { - if (currentEventButton == 1) - event.motion.state = GDK_BUTTON1_MASK; - else if (currentEventButton == 2) - event.motion.state = GDK_BUTTON2_MASK; - else if (currentEventButton == 3) - event.motion.state = GDK_BUTTON3_MASK; - } else - event.motion.state = 0; + + event.motion.state = getStateFlags(); if (dragMode && down && !replayingSavedEvents) { msgQueue[endOfQueue].event = event; diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index 631fc31..6e94c1c 100644 --- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -49,6 +49,7 @@ extern "C" { bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element); bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element); +bool webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element); unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame); void webkit_application_cache_set_maximum_size(unsigned long long size); unsigned int webkit_worker_thread_count(void); @@ -224,7 +225,18 @@ void LayoutTestController::setMainFrameIsFirstResponder(bool flag) void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) { - // FIXME: implement + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + WebKitWebSettings* settings = webkit_web_view_get_settings(webView); + g_object_set(G_OBJECT(settings), "tab-key-cycles-through-elements", cycles, NULL); +} + +void LayoutTestController::setTimelineProfilingEnabled(bool flag) +{ + WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); + ASSERT(view); + + WebKitWebInspector* inspector = webkit_web_view_get_inspector(view); + g_object_set(G_OBJECT(inspector), "timeline-profiling-enabled", flag, NULL); } void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) @@ -305,6 +317,15 @@ void LayoutTestController::setXSSAuditorEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-xss-auditor", flag, NULL); } +void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag) +{ + WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); + ASSERT(view); + + WebKitWebSettings* settings = webkit_web_view_get_settings(view); + g_object_set(G_OBJECT(settings), "enable-universal-access-from-file-uris", flag, NULL); +} + void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) { // FIXME: implement @@ -428,6 +449,16 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return returnValue; } +bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId) +{ + gchar* name = JSStringCopyUTF8CString(animationId); + gchar* element = JSStringCopyUTF8CString(elementId); + bool returnValue = webkit_web_frame_pause_svg_animation(mainFrame, name, time, element); + g_free(name); + g_free(element); + return returnValue; +} + unsigned LayoutTestController::numberOfActiveAnimations() const { return webkit_web_frame_number_of_active_animations(mainFrame); @@ -493,7 +524,7 @@ void LayoutTestController::showWebInspector() WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); g_object_set(webSettings, "enable-developer-extras", TRUE, NULL); - webkit_web_inspector_inspect_coordinates(inspector, 0, 0); + webkit_web_inspector_show(inspector); } void LayoutTestController::closeWebInspector() diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm index 375dbad..948f379 100644 --- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm +++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm @@ -40,6 +40,18 @@ #define NSAccessibilityValueDescriptionAttribute @"AXValueDescription" #endif +#ifndef NSAccessibilityOwnsAttribute +#define NSAccessibilityOwnsAttribute @"AXOwns" +#endif + +#ifndef NSAccessibilityGrabbedAttribute +#define NSAccessibilityGrabbedAttribute @"AXGrabbed" +#endif + +#ifndef NSAccessibilityDropEffectsAttribute +#define NSAccessibilityDropEffectsAttribute @"AXDropEffects" +#endif + @interface NSObject (WebKitAccessibilityArrayCategory) - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount; @end @@ -232,7 +244,43 @@ AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index) if (children.size() == 1) return children[0]; - return nil; + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index) +{ + NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityOwnsAttribute]; + if (index < [objects count]) + return [objects objectAtIndex:index]; + + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index) +{ + NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute]; + if (index < [objects count]) + return [objects objectAtIndex:index]; + + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index) +{ + NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedRowsAttribute]; + if (index < [rows count]) + return [rows objectAtIndex:index]; + + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index) +{ + NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilitySelectedRowsAttribute]; + if (index < [rows count]) + return [rows objectAtIndex:index]; + + return 0; } AccessibilityUIElement AccessibilityUIElement::titleUIElement() @@ -241,7 +289,7 @@ AccessibilityUIElement AccessibilityUIElement::titleUIElement() if (accessibilityObject) return AccessibilityUIElement(accessibilityObject); - return nil; + return 0; } AccessibilityUIElement AccessibilityUIElement::parentElement() @@ -250,7 +298,16 @@ AccessibilityUIElement AccessibilityUIElement::parentElement() if (accessibilityObject) return AccessibilityUIElement(accessibilityObject); - return nil; + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::disclosedByRow() +{ + id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedByRowAttribute]; + if (accessibilityObject) + return AccessibilityUIElement(accessibilityObject); + + return 0; } JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements() @@ -293,6 +350,11 @@ bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute) return [m_element accessibilityIsAttributeSettable:[NSString stringWithJSStringRef:attribute]]; } +bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute) +{ + return [[m_element accessibilityAttributeNames] containsObject:[NSString stringWithJSStringRef:attribute]]; +} + JSStringRef AccessibilityUIElement::parameterizedAttributeNames() { NSArray* supportedParameterizedAttributes = [m_element accessibilityParameterizedAttributeNames]; @@ -317,6 +379,12 @@ JSStringRef AccessibilityUIElement::subrole() return concatenateAttributeAndValue(@"AXSubrole", role); } +JSStringRef AccessibilityUIElement::roleDescription() +{ + NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleDescriptionAttribute], m_element); + return concatenateAttributeAndValue(@"AXRoleDescription", role); +} + JSStringRef AccessibilityUIElement::title() { NSString* title = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityTitleAttribute], m_element); @@ -329,6 +397,18 @@ JSStringRef AccessibilityUIElement::description() return concatenateAttributeAndValue(@"AXDescription", description); } +JSStringRef AccessibilityUIElement::orientation() const +{ + id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityOrientationAttribute], m_element); + return concatenateAttributeAndValue(@"AXOrientation", description); +} + +JSStringRef AccessibilityUIElement::stringValue() +{ + id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityValueAttribute], m_element); + return concatenateAttributeAndValue(@"AXValue", description); +} + JSStringRef AccessibilityUIElement::language() { id description = descriptionOfValue([m_element accessibilityAttributeValue:@"AXLanguage"], m_element); @@ -433,6 +513,55 @@ bool AccessibilityUIElement::isRequired() const return false; } +bool AccessibilityUIElement::isSelected() const +{ + id value = [m_element accessibilityAttributeValue:NSAccessibilitySelectedAttribute]; + if ([value isKindOfClass:[NSNumber class]]) + return [value boolValue]; + return false; +} + +bool AccessibilityUIElement::isExpanded() const +{ + id value = [m_element accessibilityAttributeValue:NSAccessibilityExpandedAttribute]; + if ([value isKindOfClass:[NSNumber class]]) + return [value boolValue]; + return false; +} + +int AccessibilityUIElement::hierarchicalLevel() const +{ + id value = [m_element accessibilityAttributeValue:NSAccessibilityDisclosureLevelAttribute]; + if ([value isKindOfClass:[NSNumber class]]) + return [value intValue]; + return 0; +} + +bool AccessibilityUIElement::ariaIsGrabbed() const +{ + id value = [m_element accessibilityAttributeValue:NSAccessibilityGrabbedAttribute]; + if ([value isKindOfClass:[NSNumber class]]) + return [value boolValue]; + return false; +} + +JSStringRef AccessibilityUIElement::ariaDropEffects() const +{ + id value = [m_element accessibilityAttributeValue:NSAccessibilityDropEffectsAttribute]; + if (![value isKindOfClass:[NSArray class]]) + return 0; + + NSMutableString* dropEffects = [NSMutableString string]; + NSInteger length = [value count]; + for (NSInteger k = 0; k < length; ++k) { + [dropEffects appendString:[value objectAtIndex:k]]; + if (k < length - 1) + [dropEffects appendString:@","]; + } + + return [dropEffects createJSStringRef]; +} + // parameterized attributes int AccessibilityUIElement::lineForIndex(int index) { @@ -571,3 +700,24 @@ void AccessibilityUIElement::decrement() { [m_element accessibilityPerformAction:NSAccessibilityDecrementAction]; } + +void AccessibilityUIElement::showMenu() +{ + [m_element accessibilityPerformAction:NSAccessibilityShowMenuAction]; +} + +JSStringRef AccessibilityUIElement::accessibilityValue() const +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::documentEncoding() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::documentURI() +{ + return JSStringCreateWithCharacters(0, 0); +} diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm index 98f4f9c..4ffeac3 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm @@ -87,6 +87,10 @@ using namespace std; @interface DumpRenderTreeEvent : NSEvent @end +@interface NSURLRequest (PrivateThingsWeShouldntReallyUse) ++(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host; +@end + static void runTest(const string& testPathOrURL); // Deciding when it's OK to dump out the state is a bit tricky. All these must be true: @@ -302,7 +306,7 @@ WebView *createWebViewAndOffscreenWindow() [window orderBack:nil]; [window setAutodisplay:NO]; - [window startObservingWebView]; + [window startListeningForAcceleratedCompositingChanges]; // For reasons that are not entirely clear, the following pair of calls makes WebView handle its // dynamic scrollbars properly. Without it, every frame will always have scrollbars. @@ -596,9 +600,17 @@ void dumpRenderTree(int argc, const char *argv[]) mainFrame = [webView mainFrame]; [[NSURLCache sharedURLCache] removeAllCachedResponses]; - [WebCache empty]; - + + // <http://webkit.org/b/31200> In order to prevent extra frame load delegate logging being generated if the first test to use SSL + // is set to log frame load delegate calls we ignore SSL certificate errors on localhost and 127.0.0.1. +#if BUILDING_ON_TIGER + // Initialize internal NSURLRequest data for setAllowsAnyHTTPSCertificate:forHost: to work properly. + [[[[NSURLRequest alloc] init] autorelease] HTTPMethod]; +#endif + [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:@"localhost"]; + [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:@"127.0.0.1"]; + // <rdar://problem/5222911> testStringByEvaluatingJavaScriptFromString(); @@ -1090,6 +1102,11 @@ static bool shouldLogHistoryDelegates(const char* pathOrURL) return strstr(pathOrURL, "globalhistory/"); } +static bool shouldOpenWebInspector(const char* pathOrURL) +{ + return strstr(pathOrURL, "inspector/"); +} + static void resetWebViewToConsistentStateBeforeTesting() { WebView *webView = [mainFrame webView]; @@ -1105,6 +1122,7 @@ static void resetWebViewToConsistentStateBeforeTesting() [webView _clearMainFrameName]; [[webView undoManager] removeAllActions]; [WebView _removeAllUserContentFromGroup:[webView groupName]]; + [[webView window] setAutodisplay:NO]; resetDefaultsToConsistentValues(); @@ -1166,7 +1184,10 @@ static void runTest(const string& testPathOrURL) [[mainFrame webView] setHistoryDelegate:historyDelegate]; else [[mainFrame webView] setHistoryDelegate:nil]; - + + if (shouldOpenWebInspector(pathOrURL.c_str())) + gLayoutTestController->showWebInspector(); + if ([WebHistory optionalSharedHistory]) [WebHistory setOptionalSharedHistory:nil]; lastMousePosition = NSZeroPoint; @@ -1190,6 +1211,7 @@ static void runTest(const string& testPathOrURL) [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]]; [pool release]; } + pool = [[NSAutoreleasePool alloc] init]; [EventSendingController clearSavedEvents]; [[mainFrame webView] setSelectedDOMRange:nil affinity:NSSelectionAffinityDownstream]; @@ -1214,11 +1236,14 @@ static void runTest(const string& testPathOrURL) } } + if (shouldOpenWebInspector(pathOrURL.c_str())) + gLayoutTestController->closeWebInspector(); + resetWebViewToConsistentStateBeforeTesting(); [mainFrame loadHTMLString:@"<html></html>" baseURL:[NSURL URLWithString:@"about:blank"]]; [mainFrame stopLoading]; - + [pool release]; // We should only have our main window left open when we're done diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h index 72d5db1..fe1ac00 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h @@ -42,6 +42,7 @@ @class NavigationController; @class PolicyDelegate; @class WebFrame; +@class WebScriptWorld; @class WebView; typedef const struct __CFString* CFStringRef; @@ -62,4 +63,6 @@ extern CFRunLoopTimerRef waitToDumpWatchdog; WebView* createWebViewAndOffscreenWindow(); void setPersistentUserStyleSheetLocation(CFStringRef); +unsigned worldIDForWorld(WebScriptWorld *); + #endif // DumpRenderTreeMac_h diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.h b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.h index b6bdcb8..a229d20 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.h +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.h @@ -34,7 +34,6 @@ @interface DumpRenderTreeWindow : NSWindow { - BOOL observingWebView; } // I'm not sure why we can't just use [NSApp windows] @@ -42,7 +41,6 @@ - (WebView *)webView; -- (void)startObservingWebView; -- (void)stopObservingWebView; +- (void)startListeningForAcceleratedCompositingChanges; @end diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm index aa5b117..8845ef0 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm @@ -67,7 +67,7 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { - (void)close { - [self stopObservingWebView]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; CFRange arrayRange = CFRangeMake(0, CFArrayGetCount(openWindowsRef)); CFIndex i = CFArrayGetFirstIndexOfValue(openWindowsRef, arrayRange, self); @@ -99,32 +99,20 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { return nil; } -- (void)startObservingWebView +- (void)startListeningForAcceleratedCompositingChanges { - [self stopObservingWebView]; - [[self webView] addObserver:self forKeyPath:@"_isUsingAcceleratedCompositing" options:0 context:0]; - observingWebView = YES; + [[self webView] _setPostsAcceleratedCompositingNotifications:YES]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(webViewStartedAcceleratedCompositing:) + name:_WebViewDidStartAcceleratedCompositingNotification object:nil]; } -- (void)stopObservingWebView +- (void)webViewStartedAcceleratedCompositing:(NSNotification *)notification { - if (!observingWebView) - return; - [[self webView] removeObserver:self forKeyPath:@"_isUsingAcceleratedCompositing"]; - observingWebView = NO; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - if ([keyPath isEqualToString:@"_isUsingAcceleratedCompositing"]) { - // When using accelerated compositing, the window needs to be autodisplay for AppKit/CA to - // start accelerated animations correctly. - BOOL isAccelerated = [[self webView] _isUsingAcceleratedCompositing]; - [self setAutodisplay:isAccelerated]; - return; - } - - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + // If the WebView has gone into compositing mode, turn on window autodisplay. This is necessary for CA + // to update layers and start animations. + // We only ever turn autodisplay on here, because we turn it off before every test. + if ([[self webView] _isUsingAcceleratedCompositing]) + [self setAutodisplay:YES]; } @end diff --git a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm index 2838d2e..963eae7 100644 --- a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm @@ -48,13 +48,10 @@ #import <WebKit/WebHTMLViewPrivate.h> #import <WebKit/WebKit.h> #import <WebKit/WebNSURLExtras.h> +#import <WebKit/WebScriptWorld.h> #import <WebKit/WebSecurityOriginPrivate.h> #import <wtf/Assertions.h> -@interface NSURLRequest (PrivateThingsWeShouldntReallyUse) -+(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host; -@end - @interface NSURL (DRTExtras) - (NSString *)_drt_descriptionSuitableForTestResult; @end @@ -182,13 +179,15 @@ { if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailProvisionalLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; - printf ("%s\n", [string UTF8String]); + printf("%s\n", [string UTF8String]); } if ([error domain] == NSURLErrorDomain && ([error code] == NSURLErrorServerCertificateHasUnknownRoot || [error code] == NSURLErrorServerCertificateUntrusted)) { - NSURL *failedURL = [[error userInfo] objectForKey:@"NSErrorFailingURLKey"]; - [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[failedURL _web_hostString]]; - [frame loadRequest:[[[[frame provisionalDataSource] request] mutableCopy] autorelease]]; + // <http://webkit.org/b/31200> In order to prevent extra frame load delegate logging being generated if the first test to use SSL + // is set to log frame load delegate calls we ignore SSL certificate errors on localhost and 127.0.0.1 from within dumpRenderTree. + // Those are the only hosts that we use SSL with at present. If we hit this code path then we've found another host that we need + // to apply the workaround to. + ASSERT_NOT_REACHED(); return; } @@ -238,11 +237,8 @@ ASSERT_NOT_REACHED(); } -- (void)webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)obj forFrame:(WebFrame *)frame +- (void)didClearWindowObjectInStandardWorldForFrame:(WebFrame *)frame { - ASSERT(obj == [frame windowObject]); - ASSERT([obj JSObject] == JSContextGetGlobalObject([frame globalContext])); - // Make New-Style LayoutTestController JSContextRef context = [frame globalContext]; JSObjectRef globalObject = JSContextGetGlobalObject(context); @@ -260,7 +256,9 @@ // Make Old-Style controllers - AppleScriptController *asc = [[AppleScriptController alloc] initWithWebView:sender]; + WebView *webView = [frame webView]; + WebScriptObject *obj = [frame windowObject]; + AppleScriptController *asc = [[AppleScriptController alloc] initWithWebView:webView]; [obj setValue:asc forKey:@"appleScriptController"]; [asc release]; @@ -284,11 +282,32 @@ [obj setValue:[PlainTextController sharedPlainTextController] forKey:@"plainText"]; - TextInputController *tic = [[TextInputController alloc] initWithWebView:sender]; + TextInputController *tic = [[TextInputController alloc] initWithWebView:webView]; [obj setValue:tic forKey:@"textInputController"]; [tic release]; } +- (void)didClearWindowObjectForFrame:(WebFrame *)frame inIsolatedWorld:(WebScriptWorld *)world +{ + JSGlobalContextRef ctx = [frame _globalContextForScriptWorld:world]; + if (!ctx) + return; + + JSObjectRef globalObject = JSContextGetGlobalObject(ctx); + if (!globalObject) + return; + + JSObjectSetProperty(ctx, globalObject, JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("__worldID")).get(), JSValueMakeNumber(ctx, worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0); +} + +- (void)webView:(WebView *)sender didClearWindowObjectForFrame:(WebFrame *)frame inScriptWorld:(WebScriptWorld *)world +{ + if (world == [WebScriptWorld standardWorld]) + [self didClearWindowObjectInStandardWorldForFrame:frame]; + else + [self didClearWindowObjectForFrame:frame inIsolatedWorld:world]; +} + - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame { if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index 4d6a609..69fe19f 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -43,25 +43,27 @@ #import <WebKit/WebApplicationCache.h> #import <WebKit/WebBackForwardList.h> #import <WebKit/WebCoreStatistics.h> -#import <WebKit/WebDatabaseManagerPrivate.h> #import <WebKit/WebDataSource.h> +#import <WebKit/WebDatabaseManagerPrivate.h> #import <WebKit/WebFrame.h> #import <WebKit/WebFrameViewPrivate.h> -#import <WebKit/WebIconDatabasePrivate.h> +#import <WebKit/WebGeolocationMockPrivate.h> #import <WebKit/WebHTMLRepresentation.h> #import <WebKit/WebHTMLViewPrivate.h> #import <WebKit/WebHistory.h> #import <WebKit/WebHistoryPrivate.h> +#import <WebKit/WebIconDatabasePrivate.h> #import <WebKit/WebInspectorPrivate.h> -#import <WebKit/WebGeolocationMockPrivate.h> #import <WebKit/WebNSURLExtras.h> #import <WebKit/WebPreferences.h> #import <WebKit/WebPreferencesPrivate.h> +#import <WebKit/WebScriptWorld.h> #import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebTypesInternal.h> #import <WebKit/WebView.h> #import <WebKit/WebViewPrivate.h> #import <WebKit/WebWorkersPrivate.h> +#import <wtf/HashMap.h> #import <wtf/RetainPtr.h> @interface CommandValidationTarget : NSObject <NSValidatedUserInterfaceItem> @@ -299,6 +301,11 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled) [[[mainFrame webView] preferences] setXSSAuditorEnabled:enabled]; } +void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +{ + [[[mainFrame webView] preferences] setAllowUniversalAccessFromFileURLs:enabled]; +} + void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) { [[[mainFrame webView] preferences] setJavaScriptCanOpenWindowsAutomatically:!popupBlockingEnabled]; @@ -309,6 +316,11 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) [[mainFrame webView] setTabKeyCyclesThroughElements:cycles]; } +void LayoutTestController::setTimelineProfilingEnabled(bool enabled) +{ + [[[mainFrame webView] inspector] setTimelineProfilingEnabled:enabled]; +} + void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) { [[mainFrame webView] _setDashboardBehavior:WebDashboardBehaviorUseBackwardCompatibilityMode to:flag]; @@ -474,6 +486,16 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return [mainFrame _pauseTransitionOfProperty:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time]; } +bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId) +{ + RetainPtr<CFStringRef> animationIDCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, animationId)); + NSString *animationIDNS = (NSString *)animationIDCF.get(); + RetainPtr<CFStringRef> elementIDCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId)); + NSString *elementIDNS = (NSString *)elementIDCF.get(); + + return [mainFrame _pauseSVGAnimation:elementIDNS onSMILNode:[[mainFrame DOMDocument] getElementById:animationIDNS] atTime:time]; +} + unsigned LayoutTestController::numberOfActiveAnimations() const { return [mainFrame _numberOfActiveAnimations]; @@ -501,14 +523,14 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart) { RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source)); NSString *sourceNS = (NSString *)sourceCF.get(); - [WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" worldID:1 source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd)]; + [WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd)]; } void LayoutTestController::addUserStyleSheet(JSStringRef source) { RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source)); NSString *sourceNS = (NSString *)sourceCF.get(); - [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" worldID:1 source:sourceNS url:nil whitelist:nil blacklist:nil]; + [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil]; } void LayoutTestController::showWebInspector() @@ -530,9 +552,40 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip [[[mainFrame webView] inspector] evaluateInFrontend:nil callId:callId script:scriptNS]; } +typedef HashMap<unsigned, RetainPtr<WebScriptWorld> > WorldMap; +static WorldMap& worldMap() +{ + static WorldMap& map = *new WorldMap; + return map; +} + +unsigned worldIDForWorld(WebScriptWorld *world) +{ + WorldMap::const_iterator end = worldMap().end(); + for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { + if (it->second == world) + return it->first; + } + + return 0; +} + void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script)); NSString *scriptNS = (NSString *)scriptCF.get(); - [mainFrame _stringByEvaluatingJavaScriptInIsolatedWorld:worldID WithGlobalObject:globalObject FromString:scriptNS]; + + // A worldID of 0 always corresponds to a new world. Any other worldID corresponds to a world + // that is created once and cached forever. + WebScriptWorld *world; + if (!worldID) + world = [WebScriptWorld world]; + else { + RetainPtr<WebScriptWorld>& worldSlot = worldMap().add(worldID, 0).first->second; + if (!worldSlot) + worldSlot.adoptNS([[WebScriptWorld alloc] init]); + world = worldSlot.get(); + } + + [mainFrame _stringByEvaluatingJavaScriptFromString:scriptNS withGlobalObject:globalObject inScriptWorld:world]; } diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm index 393899e..81c03d2 100644 --- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm @@ -34,9 +34,9 @@ #import "EventSendingController.h" #import "LayoutTestController.h" #import <WebKit/WebFramePrivate.h> -#import <WebKit/WebGeolocationPrivate.h> #import <WebKit/WebHTMLViewPrivate.h> #import <WebKit/WebSecurityOriginPrivate.h> +#import <WebKit/WebUIDelegatePrivate.h> #import <WebKit/WebView.h> #import <wtf/Assertions.h> @@ -151,10 +151,14 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]); } -- (void)webView:(WebView *)sender frame:(WebFrame *)frame requestGeolocationPermission:(WebGeolocation *)geolocation securityOrigin:(WebSecurityOrigin *)origin +- (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebGeolocationPolicyListener>)listener { - if (gLayoutTestController->isGeolocationPermissionSet()) - [geolocation setIsAllowed:gLayoutTestController->geolocationPermission()]; + if (gLayoutTestController->isGeolocationPermissionSet()) { + if (gLayoutTestController->geolocationPermission()) + [listener allow]; + else + [listener deny]; + } } - (BOOL)webView:(WebView *)sender shouldHaltPlugin:(DOMNode *)pluginNode diff --git a/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp b/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp index 3ac257d..5a48b27 100644 --- a/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp +++ b/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp @@ -28,6 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "JavaScriptThreading.h" #include <CoreFoundation/CoreFoundation.h> diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp index 9faa37f..6d466bf 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp @@ -29,6 +29,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" + #include "DumpRenderTree.h" #include "EventSenderQt.h" #include "LayoutTestControllerQt.h" @@ -41,25 +43,29 @@ #include <QCryptographicHash> #include <QDir> #include <QFile> -#include <QTimer> -#include <QBoxLayout> -#include <QScrollArea> #include <QApplication> #include <QUrl> +#include <QFileInfo> #include <QFocusEvent> #include <QFontDatabase> +#include <QNetworkAccessManager> +#include <QNetworkReply> #include <QNetworkRequest> +#include <QUndoStack> -#include <qwebpage.h> -#include <qwebframe.h> -#include <qwebview.h> #include <qwebsettings.h> #include <qwebsecurityorigin.h> +#ifndef QT_NO_UITOOLS +#include <QtUiTools/QUiLoader> +#endif + #ifdef Q_WS_X11 #include <fontconfig/fontconfig.h> #endif +#include <limits.h> + #include <unistd.h> #include <qdebug.h> @@ -69,6 +75,7 @@ extern void qt_dump_frame_loader(bool b); extern void qt_drt_clearFrameName(QWebFrame* qFrame); extern void qt_drt_overwritePluginDirectories(); extern void qt_drt_resetOriginAccessWhiteLists(); +extern bool qt_drt_hasDocumentElement(QWebFrame* qFrame); namespace WebCore { @@ -76,39 +83,39 @@ namespace WebCore { const unsigned int maxViewWidth = 800; const unsigned int maxViewHeight = 600; -class WebPage : public QWebPage { - Q_OBJECT -public: - WebPage(QWidget *parent, DumpRenderTree *drt); - - QWebPage *createWindow(QWebPage::WebWindowType); - - void javaScriptAlert(QWebFrame *frame, const QString& message); - void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID); - bool javaScriptConfirm(QWebFrame *frame, const QString& msg); - bool javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result); - - void resetSettings(); - -public slots: - bool shouldInterruptJavaScript() { return false; } +NetworkAccessManager::NetworkAccessManager(QObject* parent) + : QNetworkAccessManager(parent) +{ +#ifndef QT_NO_SSL + connect(this, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), + this, SLOT(sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&))); +#endif +} -protected: - bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type); +#ifndef QT_NO_SSL +void NetworkAccessManager::sslErrorsEncountered(QNetworkReply* reply, const QList<QSslError>& errors) +{ + if (reply->url().host() == "127.0.0.1" || reply->url().host() == "localhost") { + bool ignore = true; + + // Accept any HTTPS certificate. + foreach (const QSslError& error, errors) { + if (error.error() < QSslError::UnableToGetIssuerCertificate || error.error() > QSslError::HostNameMismatch) { + ignore = false; + break; + } + } -private slots: - void setViewGeometry(const QRect &r) - { - QWidget *v = view(); - if (v) - v->setGeometry(r); + if (ignore) + reply->ignoreSslErrors(); } -private: - DumpRenderTree *m_drt; -}; +} +#endif -WebPage::WebPage(QWidget *parent, DumpRenderTree *drt) - : QWebPage(parent), m_drt(drt) +WebPage::WebPage(QObject* parent, DumpRenderTree* drt) + : QWebPage(parent) + , m_webInspector(0) + , m_drt(drt) { QWebSettings* globalSettings = QWebSettings::globalSettings(); @@ -129,21 +136,37 @@ WebPage::WebPage(QWidget *parent, DumpRenderTree *drt) connect(this, SIGNAL(geometryChangeRequested(const QRect &)), this, SLOT(setViewGeometry(const QRect & ))); + setNetworkAccessManager(new NetworkAccessManager(this)); setPluginFactory(new TestPlugin(this)); } +WebPage::~WebPage() +{ + delete m_webInspector; +} + +QWebInspector* WebPage::webInspector() +{ + if (!m_webInspector) { + m_webInspector = new QWebInspector; + m_webInspector->setPage(this); + } + return m_webInspector; +} + void WebPage::resetSettings() { // After each layout test, reset the settings that may have been changed by // layoutTestController.overridePreference() or similar. settings()->resetFontSize(QWebSettings::DefaultFontSize); - settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows); settings()->resetAttribute(QWebSettings::JavascriptEnabled); settings()->resetAttribute(QWebSettings::PrivateBrowsingEnabled); settings()->resetAttribute(QWebSettings::LinksIncludedInFocusChain); settings()->resetAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); + settings()->resetAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); + QWebSettings::setMaximumPagesInCache(0); // reset to default } QWebPage *WebPage::createWindow(QWebPage::WebWindowType) @@ -153,22 +176,52 @@ QWebPage *WebPage::createWindow(QWebPage::WebWindowType) void WebPage::javaScriptAlert(QWebFrame*, const QString& message) { + if (!isTextOutputEnabled()) + return; + fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData()); } +static QString urlSuitableForTestResult(const QString& url) +{ + if (url.isEmpty() || !url.startsWith(QLatin1String("file://"))) + return url; + + return QFileInfo(url).fileName(); +} + void WebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString&) { - fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData()); + if (!isTextOutputEnabled()) + return; + + QString newMessage; + if (!message.isEmpty()) { + newMessage = message; + + size_t fileProtocol = newMessage.indexOf(QLatin1String("file://")); + if (fileProtocol != -1) { + newMessage = newMessage.left(fileProtocol) + urlSuitableForTestResult(newMessage.mid(fileProtocol)); + } + } + + fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, newMessage.toUtf8().constData()); } bool WebPage::javaScriptConfirm(QWebFrame*, const QString& msg) { + if (!isTextOutputEnabled()) + return true; + fprintf(stdout, "CONFIRM: %s\n", msg.toUtf8().constData()); return true; } bool WebPage::javaScriptPrompt(QWebFrame*, const QString& msg, const QString& defaultValue, QString* result) { + if (!isTextOutputEnabled()) + return true; + fprintf(stdout, "PROMPT: %s, default text: %s\n", msg.toUtf8().constData(), defaultValue.toUtf8().constData()); *result = defaultValue; return true; @@ -203,35 +256,83 @@ bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& r typeDescription = "illegal value"; } - fprintf(stdout, "Policy delegate: attempt to load %s with navigation type '%s'\n", - url.toUtf8().constData(), typeDescription.toUtf8().constData()); + if (isTextOutputEnabled()) + fprintf(stdout, "Policy delegate: attempt to load %s with navigation type '%s'\n", + url.toUtf8().constData(), typeDescription.toUtf8().constData()); + m_drt->layoutTestController()->notifyDone(); } return QWebPage::acceptNavigationRequest(frame, request, type); } +bool WebPage::supportsExtension(QWebPage::Extension extension) const +{ + if (extension == QWebPage::ErrorPageExtension) + return m_drt->layoutTestController()->shouldHandleErrorPages(); + + return false; +} + +bool WebPage::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output) +{ + const QWebPage::ErrorPageExtensionOption* info = static_cast<const QWebPage::ErrorPageExtensionOption*>(option); + + // Lets handle error pages for the main frame for now. + if (info->frame != mainFrame()) + return false; + + QWebPage::ErrorPageExtensionReturn* errorPage = static_cast<QWebPage::ErrorPageExtensionReturn*>(output); + + errorPage->content = QString("data:text/html,<body/>").toUtf8(); + + return true; +} + +QObject* WebPage::createPlugin(const QString& classId, const QUrl& url, const QStringList& paramNames, const QStringList& paramValues) +{ + Q_UNUSED(url); + Q_UNUSED(paramNames); + Q_UNUSED(paramValues); +#ifndef QT_NO_UITOOLS + QUiLoader loader; + return loader.createWidget(classId, view()); +#else + Q_UNUSED(classId); + return 0; +#endif +} + DumpRenderTree::DumpRenderTree() : m_dumpPixels(false) , m_stdin(0) , m_notifier(0) + , m_enableTextOutput(false) { qt_drt_overwritePluginDirectories(); QWebSettings::enablePersistentStorage(); + // create our primary testing page/view. + m_mainView = new QWebView(0); + m_mainView->resize(QSize(maxViewWidth, maxViewHeight)); + m_page = new WebPage(m_mainView, this); + m_mainView->setPage(m_page); + + // create out controllers. This has to be done before connectFrame, + // as it exports there to the JavaScript DOM window. m_controller = new LayoutTestController(this); connect(m_controller, SIGNAL(done()), this, SLOT(dump())); + m_eventSender = new EventSender(m_page); + m_textInputController = new TextInputController(m_page); + m_gcController = new GCController(m_page); - QWebView *view = new QWebView(0); - view->resize(QSize(maxViewWidth, maxViewHeight)); - m_page = new WebPage(view, this); - view->setPage(m_page); - connect(m_page, SIGNAL(frameCreated(QWebFrame *)), this, SLOT(connectFrame(QWebFrame *))); + // now connect our different signals + connect(m_page, SIGNAL(frameCreated(QWebFrame *)), + this, SLOT(connectFrame(QWebFrame *))); connectFrame(m_page->mainFrame()); - connect(m_page->mainFrame(), SIGNAL(loadFinished(bool)), m_controller, SLOT(maybeDump(bool))); + connect(m_page, SIGNAL(loadFinished(bool)), + m_controller, SLOT(maybeDump(bool))); - m_page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); - m_page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); connect(m_page->mainFrame(), SIGNAL(titleChanged(const QString&)), SLOT(titleChanged(const QString&))); connect(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)), @@ -239,20 +340,15 @@ DumpRenderTree::DumpRenderTree() connect(m_page, SIGNAL(statusBarMessage(const QString&)), this, SLOT(statusBarMessage(const QString&))); - m_eventSender = new EventSender(m_page); - m_textInputController = new TextInputController(m_page); - m_gcController = new GCController(m_page); - QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection); qt_drt_run(true); QFocusEvent event(QEvent::FocusIn, Qt::ActiveWindowFocusReason); - QApplication::sendEvent(view, &event); + QApplication::sendEvent(m_mainView, &event); } DumpRenderTree::~DumpRenderTree() { - delete m_page; - + delete m_mainView; delete m_stdin; delete m_notifier; } @@ -270,29 +366,48 @@ void DumpRenderTree::open() } } -void DumpRenderTree::resetToConsistentStateBeforeTesting() +static void clearHistory(QWebPage* page) { - closeRemainingWindows(); + // QWebHistory::clear() leaves current page, so remove it as well by setting + // max item count to 0, and then setting it back to it's original value. + + QWebHistory* history = page->history(); + int itemCount = history->maximumItemCount(); + + history->clear(); + history->setMaximumItemCount(0); + history->setMaximumItemCount(itemCount); +} - // Reset so that any current loads are stopped +void DumpRenderTree::resetToConsistentStateBeforeTesting() +{ + // reset so that any current loads are stopped + // NOTE: that this has to be done before the layoutTestController is + // reset or we get timeouts for some tests. m_page->blockSignals(true); m_page->triggerAction(QWebPage::Stop); m_page->blockSignals(false); - m_page->mainFrame()->setZoomFactor(1.0); + // reset the layoutTestController at this point, so that we under no + // circumstance dump (stop the waitUntilDone timer) during the reset + // of the DRT. + m_controller->reset(); + + closeRemainingWindows(); - static_cast<WebPage*>(m_page)->resetSettings(); + m_page->resetSettings(); + m_page->undoStack()->clear(); + m_page->mainFrame()->setZoomFactor(1.0); + clearHistory(m_page); qt_drt_clearFrameName(m_page->mainFrame()); WorkQueue::shared()->clear(); - // Causes timeout, why? - //WorkQueue::shared()->setFrozen(false); + WorkQueue::shared()->setFrozen(false); - m_controller->reset(); qt_drt_resetOriginAccessWhiteLists(); - QLocale qlocale; - QLocale::setDefault(qlocale); + QLocale::setDefault(QLocale::c()); + setlocale(LC_ALL, ""); } void DumpRenderTree::open(const QUrl& aurl) @@ -316,7 +431,7 @@ void DumpRenderTree::open(const QUrl& aurl) bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1"); int width = isW3CTest ? 480 : maxViewWidth; int height = isW3CTest ? 360 : maxViewHeight; - m_page->view()->resize(QSize(width, height)); + m_mainView->resize(QSize(width, height)); m_page->setPreferredContentsSize(QSize()); m_page->setViewportSize(QSize(width, height)); @@ -329,6 +444,7 @@ void DumpRenderTree::open(const QUrl& aurl) #endif qt_dump_frame_loader(url.toString().contains("loading/")); + setTextOutputEnabled(true); m_page->mainFrame()->load(url); } @@ -359,7 +475,7 @@ void DumpRenderTree::setDumpPixels(bool dump) void DumpRenderTree::closeRemainingWindows() { - foreach(QWidget *widget, windows) + foreach (QObject* widget, windows) delete widget; windows.clear(); } @@ -377,7 +493,7 @@ void DumpRenderTree::initJSObjects() QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame) { - if (!frame) + if (!frame || !qt_drt_hasDocumentElement(frame)) return QString(); QString result; @@ -388,7 +504,8 @@ QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame) result.append(QLatin1String("'\n--------\n")); } - result.append(frame->toPlainText()); + QString innerText = frame->toPlainText(); + result.append(innerText); result.append(QLatin1String("\n")); if (m_controller->shouldDumpChildrenAsText()) { @@ -400,11 +517,69 @@ QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame) return result; } +static QString dumpHistoryItem(const QWebHistoryItem& item, int indent, bool current) +{ + QString result; + + int start = 0; + if (current) { + result.append(QLatin1String("curr->")); + start = 6; + } + for (int i = start; i < indent; i++) + result.append(' '); + + QString url = item.url().toString(); + if (url.contains("file://")) { + static QString layoutTestsString("/LayoutTests/"); + static QString fileTestString("(file test):"); + + QString res = url.mid(url.indexOf(layoutTestsString) + layoutTestsString.length()); + if (res.isEmpty()) + return result; + + result.append(fileTestString); + result.append(res); + } else { + result.append(url); + } + + // FIXME: Wrong, need (private?) API for determining this. + result.append(QLatin1String(" **nav target**")); + result.append(QLatin1String("\n")); + + return result; +} + QString DumpRenderTree::dumpBackForwardList() { + QWebHistory* history = webPage()->history(); + QString result; result.append(QLatin1String("\n============== Back Forward List ==============\n")); - result.append(QLatin1String("FIXME: Unimplemented!\n")); + + // FORMAT: + // " (file test):fast/loader/resources/click-fragment-link.html **nav target**" + // "curr-> (file test):fast/loader/resources/click-fragment-link.html#testfragment **nav target**" + + int maxItems = history->maximumItemCount(); + + foreach (const QWebHistoryItem item, history->backItems(maxItems)) { + if (!item.isValid()) + continue; + result.append(dumpHistoryItem(item, 8, false)); + } + + QWebHistoryItem item = history->currentItem(); + if (item.isValid()) + result.append(dumpHistoryItem(item, 8, true)); + + foreach (const QWebHistoryItem item, history->forwardItems(maxItems)) { + if (!item.isValid()) + continue; + result.append(dumpHistoryItem(item, 8, false)); + } + result.append(QLatin1String("===============================================\n")); return result; } @@ -551,25 +726,28 @@ QWebPage *DumpRenderTree::createWindow() { if (!m_controller->canOpenWindows()) return 0; - QWidget *container = new QWidget(0); - container->resize(0, 0); - container->move(-1, -1); - container->hide(); - QWebPage *page = new WebPage(container, this); - connectFrame(page->mainFrame()); - connect(m_page, SIGNAL(frameCreated(QWebFrame *)), this, SLOT(connectFrame(QWebFrame *))); + + // Create a dummy container object to track the page in DRT. + // QObject is used instead of QWidget to prevent DRT from + // showing the main view when deleting the container. + + QObject* container = new QObject(m_mainView); + // create a QWebPage we want to return + QWebPage* page = static_cast<QWebPage*>(new WebPage(container, this)); + // gets cleaned up in closeRemainingWindows() windows.append(container); + + // connect the needed signals to the page + connect(page, SIGNAL(frameCreated(QWebFrame*)), this, SLOT(connectFrame(QWebFrame*))); + connectFrame(page->mainFrame()); + connect(page, SIGNAL(loadFinished(bool)), m_controller, SLOT(maybeDump(bool))); return page; } int DumpRenderTree::windowCount() const { - int count = 0; - foreach(QWidget *w, windows) { - if (w->children().count()) - ++count; - } - return count + 1; +// include the main view in the count + return windows.count() + 1; } #if defined(Q_WS_X11) @@ -613,5 +791,3 @@ void DumpRenderTree::initializeFonts() #endif } - -#include "DumpRenderTree.moc" diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h index c5b4801..ab229fe 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h @@ -31,15 +31,25 @@ #define DUMPRENDERTREE_H #include <QList> +#include <QNetworkAccessManager> #include <QObject> #include <QTextStream> #include <QSocketNotifier> +#ifndef QT_NO_SSL +#include <QSslError> +#endif + +#include <qwebframe.h> +#include <qwebinspector.h> +#include <qwebpage.h> +#include <qwebview.h> + QT_BEGIN_NAMESPACE class QUrl; class QFile; QT_END_NAMESPACE -class QWebPage; + class QWebFrame; class LayoutTestController; @@ -49,6 +59,8 @@ class GCController; namespace WebCore { +class WebPage; + class DumpRenderTree : public QObject { Q_OBJECT @@ -62,6 +74,9 @@ public: // Initialize in single-file mode. void open(const QUrl& url); + void setTextOutputEnabled(bool enable) { m_enableTextOutput = enable; } + bool isTextOutputEnabled() { return m_enableTextOutput; } + void setDumpPixels(bool); void closeRemainingWindows(); @@ -74,7 +89,7 @@ public: QWebPage *createWindow(); int windowCount() const; - QWebPage *webPage() const { return m_page; } + WebPage *webPage() const { return m_page; } #if defined(Q_WS_X11) @@ -101,7 +116,8 @@ private: bool m_dumpPixels; QString m_expectedHash; - QWebPage *m_page; + WebPage *m_page; + QWebView* m_mainView; EventSender *m_eventSender; TextInputController *m_textInputController; @@ -110,7 +126,59 @@ private: QFile *m_stdin; QSocketNotifier* m_notifier; - QList<QWidget *> windows; + QList<QObject*> windows; + bool m_enableTextOutput; +}; + +class NetworkAccessManager : public QNetworkAccessManager { + Q_OBJECT +public: + NetworkAccessManager(QObject* parent); + +private slots: +#ifndef QT_NO_SSL + void sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&); +#endif +}; + +class WebPage : public QWebPage { + Q_OBJECT +public: + WebPage(QObject* parent, DumpRenderTree*); + virtual ~WebPage(); + QWebInspector* webInspector(); + + QWebPage *createWindow(QWebPage::WebWindowType); + + void javaScriptAlert(QWebFrame *frame, const QString& message); + void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID); + bool javaScriptConfirm(QWebFrame *frame, const QString& msg); + bool javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result); + + void resetSettings(); + + virtual bool supportsExtension(QWebPage::Extension extension) const; + virtual bool extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output); + + QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&); + +public slots: + bool shouldInterruptJavaScript() { return false; } + +protected: + bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type); + bool isTextOutputEnabled() { return m_drt->isTextOutputEnabled(); } + +private slots: + void setViewGeometry(const QRect &r) + { + QWidget *v = view(); + if (v) + v->setGeometry(r); + } +private: + QWebInspector* m_webInspector; + DumpRenderTree *m_drt; }; } diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro index 571313c..81e929b 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro @@ -1,9 +1,20 @@ TARGET = DumpRenderTree CONFIG -= app_bundle +CONFIG += uitools + +mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) { + CONFIG -= debug + CONFIG += release +} + +BASEDIR = $$PWD/../ include(../../../WebKit.pri) INCLUDEPATH += /usr/include/freetype2 +INCLUDEPATH += ../../.. INCLUDEPATH += ../../../JavaScriptCore +INCLUDEPATH += ../../../JavaScriptCore/ForwardingHeaders +INCLUDEPATH += $$BASEDIR DESTDIR = ../../../bin CONFIG += link_pkgconfig @@ -12,7 +23,7 @@ PKGCONFIG += fontconfig QT = core gui network macx: QT += xml -HEADERS = WorkQueue.h \ +HEADERS = $$BASEDIR/WorkQueue.h \ WorkQueueItem.h \ DumpRenderTree.h \ EventSenderQt.h \ @@ -20,7 +31,7 @@ HEADERS = WorkQueue.h \ LayoutTestControllerQt.h \ jsobjects.h \ testplugin.h -SOURCES = WorkQueue.cpp \ +SOURCES = $$BASEDIR/WorkQueue.cpp \ DumpRenderTree.cpp \ EventSenderQt.cpp \ TextInputControllerQt.cpp \ @@ -34,8 +45,4 @@ unix:!mac { QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR } -lessThan(QT_MINOR_VERSION, 4) { - DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE="" -} - DEFINES+=USE_SYSTEM_MALLOC diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp index bbefed9..a0da273 100644 --- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp @@ -30,6 +30,15 @@ #include "EventSenderQt.h" //#include <QtDebug> + +#define KEYCODE_DEL 127 +#define KEYCODE_BACKSPACE 8 +#define KEYCODE_LEFTARROW 0xf702 +#define KEYCODE_RIGHTARROW 0xf703 +#define KEYCODE_UPARROW 0xf700 +#define KEYCODE_DOWNARROW 0xf701 + + EventSender::EventSender(QWebPage* parent) : QObject(parent) { @@ -129,7 +138,7 @@ void EventSender::keyDown(const QString& string, const QStringList& modifiers) if (modifs == Qt::ShiftModifier) code = Qt::Key_Backtab; s = QString(); - } else if (code == 127) { + } else if (code == KEYCODE_DEL || code == KEYCODE_BACKSPACE) { code = Qt::Key_Backspace; if (modifs == Qt::AltModifier) modifs = Qt::ControlModifier; @@ -148,28 +157,28 @@ void EventSender::keyDown(const QString& string, const QStringList& modifiers) s = QString(); code = Qt::Key_Home; modifs = 0; - } else if (code == 0xf702) { + } else if (code == KEYCODE_LEFTARROW) { s = QString(); code = Qt::Key_Left; if (modifs & Qt::MetaModifier) { code = Qt::Key_Home; modifs &= ~Qt::MetaModifier; } - } else if (code == 0xf703) { + } else if (code == KEYCODE_RIGHTARROW) { s = QString(); code = Qt::Key_Right; if (modifs & Qt::MetaModifier) { code = Qt::Key_End; modifs &= ~Qt::MetaModifier; } - } else if (code == 0xf700) { + } else if (code == KEYCODE_UPARROW) { s = QString(); code = Qt::Key_Up; if (modifs & Qt::MetaModifier) { code = Qt::Key_PageUp; modifs &= ~Qt::MetaModifier; } - } else if (code == 0xf701) { + } else if (code == KEYCODE_DOWNARROW) { s = QString(); code = Qt::Key_Down; if (modifs & Qt::MetaModifier) { diff --git a/WebKitTools/DumpRenderTree/qt/ImageDiff.pro b/WebKitTools/DumpRenderTree/qt/ImageDiff.pro index 11ee1fa..636835a 100644 --- a/WebKitTools/DumpRenderTree/qt/ImageDiff.pro +++ b/WebKitTools/DumpRenderTree/qt/ImageDiff.pro @@ -13,6 +13,3 @@ unix:!mac { QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR } -lessThan(QT_MINOR_VERSION, 4) { - DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE="" -} diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index b8de6a5..0ea5632 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -32,13 +32,16 @@ #include "DumpRenderTree.h" #include "WorkQueue.h" #include "WorkQueueItem.h" +#include <QDir> extern void qt_dump_editing_callbacks(bool b); extern void qt_dump_resource_load_callbacks(bool b); extern void qt_drt_setJavaScriptProfilingEnabled(QWebFrame*, bool enabled); extern bool qt_drt_pauseAnimation(QWebFrame*, const QString& name, double time, const QString& elementId); extern bool qt_drt_pauseTransitionOfProperty(QWebFrame*, const QString& name, double time, const QString& elementId); +extern bool qt_drt_pauseSVGAnimation(QWebFrame*, const QString& animationId, double time, const QString& elementId); extern int qt_drt_numberOfActiveAnimations(QWebFrame*); + extern void qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); extern QString qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id); @@ -63,6 +66,7 @@ void LayoutTestController::reset() m_timeoutTimer.stop(); m_topLoadingFrame = 0; m_waitForPolicy = false; + m_handleErrorPages = false; qt_dump_editing_callbacks(false); qt_dump_resource_load_callbacks(false); } @@ -72,7 +76,7 @@ void LayoutTestController::processWork() // qDebug() << ">>>processWork"; // if we didn't start a new load, then we finished all the commands, so we're ready to dump state - if (!WorkQueue::shared()->processWork() && !shouldWaitUntilDone()) { + if (WorkQueue::shared()->processWork() && !shouldWaitUntilDone()) { emit done(); m_isLoading = false; } @@ -81,7 +85,7 @@ void LayoutTestController::processWork() // Called on loadFinished on mainFrame. void LayoutTestController::maybeDump(bool success) { - Q_ASSERT(sender() == m_topLoadingFrame); + Q_ASSERT(sender() == m_topLoadingFrame->page()); // as the function is called on loadFinished, the test might // already have dumped and thus no longer be active, thus @@ -107,7 +111,7 @@ void LayoutTestController::waitUntilDone() { //qDebug() << ">>>>waitForDone"; m_waitForDone = true; - m_timeoutTimer.start(11000, this); + m_timeoutTimer.start(15000, this); } QString LayoutTestController::counterValueForElementById(const QString& id) @@ -123,10 +127,14 @@ void LayoutTestController::keepWebHistory() void LayoutTestController::notifyDone() { qDebug() << ">>>>notifyDone"; + if (!m_timeoutTimer.isActive()) return; + m_timeoutTimer.stop(); emit done(); + + // FIXME: investigate why always resetting these result in timeouts m_isLoading = false; m_waitForDone = false; m_waitForPolicy = false; @@ -142,6 +150,12 @@ void LayoutTestController::clearBackForwardList() m_drt->webPage()->history()->clear(); } +QString LayoutTestController::pathToLocalResource(const QString& url) +{ + // Function introduced in r28690. + return QLatin1String("file://") + QUrl(url).toLocalFile(); +} + void LayoutTestController::dumpEditingCallbacks() { qDebug() << ">>>dumpEditingCallbacks"; @@ -179,10 +193,16 @@ void LayoutTestController::queueReload() WorkQueue::shared()->queue(new ReloadItem(m_drt->webPage())); } -void LayoutTestController::queueScript(const QString &url) +void LayoutTestController::queueLoadingScript(const QString& script) +{ + //qDebug() << ">>>queueLoadingScript" << script; + WorkQueue::shared()->queue(new LoadingScriptItem(script, m_drt->webPage())); +} + +void LayoutTestController::queueNonLoadingScript(const QString& script) { - //qDebug() << ">>>queueScript" << url; - WorkQueue::shared()->queue(new ScriptItem(url, m_drt->webPage())); + //qDebug() << ">>>queueNonLoadingScript" << script; + WorkQueue::shared()->queue(new NonLoadingScriptItem(script, m_drt->webPage())); } void LayoutTestController::provisionalLoad() @@ -195,7 +215,9 @@ void LayoutTestController::provisionalLoad() void LayoutTestController::timerEvent(QTimerEvent *ev) { if (ev->timerId() == m_timeoutTimer.timerId()) { - //qDebug() << ">>>>>>>>>>>>> timeout"; + const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; + fprintf(stderr, "%s", message); + fprintf(stdout, "%s", message); notifyDone(); } else QObject::timerEvent(ev); @@ -215,6 +237,22 @@ QString LayoutTestController::decodeHostName(const QString& host) return decoded; } +void LayoutTestController::showWebInspector() +{ + m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + m_drt->webPage()->webInspector()->show(); +} + +void LayoutTestController::hideWebInspector() +{ + m_drt->webPage()->webInspector()->hide(); +} + +void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +{ + m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, enabled); +} + void LayoutTestController::setJavaScriptProfilingEnabled(bool enable) { m_topLoadingFrame->page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); @@ -260,6 +298,15 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& p return qt_drt_pauseTransitionOfProperty(frame, propertyName, time, elementId); } +bool LayoutTestController::sampleSVGAnimationForElementAtTime(const QString& animationId, + double time, + const QString& elementId) +{ + QWebFrame* frame = m_drt->webPage()->mainFrame(); + Q_ASSERT(frame); + return qt_drt_pauseSVGAnimation(frame, animationId, time, elementId); +} + unsigned LayoutTestController::numberOfActiveAnimations() const { QWebFrame* frame = m_drt->webPage()->mainFrame(); @@ -313,4 +360,6 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian settings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, value.toBool()); else if (name == "WebKitDefaultFontSize") settings->setFontSize(QWebSettings::DefaultFontSize, value.toInt()); + else if (name == "WebKitUsesPageCachePreferenceKey") + QWebSettings::setMaximumPagesInCache(value.toInt()); } diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h index cab014c..ac8681f 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -63,6 +63,7 @@ public: bool shouldDumpDatabaseCallbacks() const { return m_dumpDatabaseCallbacks; } bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; } bool shouldWaitUntilDone() const { return m_waitForDone; } + bool shouldHandleErrorPages() const { return m_handleErrorPages; } bool canOpenWindows() const { return m_canOpenWindows; } bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; } bool waitForPolicy() const { return m_waitForPolicy; } @@ -87,22 +88,28 @@ public slots: void keepWebHistory(); void notifyDone(); void dumpBackForwardList() { m_dumpBackForwardList = true; } + void handleErrorPages() { m_handleErrorPages = true; } void dumpEditingCallbacks(); void dumpResourceLoadCallbacks(); void queueBackNavigation(int howFarBackward); void queueForwardNavigation(int howFarForward); void queueLoad(const QString& url, const QString& target = QString()); void queueReload(); - void queueScript(const QString& url); + void queueLoadingScript(const QString& script); + void queueNonLoadingScript(const QString& script); void provisionalLoad(); void setCloseRemainingWindowsWhenComplete(bool = false) {} int windowCount(); void display() {} void clearBackForwardList(); + QString pathToLocalResource(const QString& url); void dumpTitleChanges() { m_dumpTitleChanges = true; } QString encodeHostName(const QString& host); QString decodeHostName(const QString& host); void dumpSelectionRect() const {} + void showWebInspector(); + void hideWebInspector(); + void setAllowUniversalAccessFromFileURLs(bool enable); void setJavaScriptProfilingEnabled(bool enable); void setFixedContentsSize(int width, int height); void setPrivateBrowsingEnabled(bool enable); @@ -111,6 +118,8 @@ public slots: bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId); bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId); + bool sampleSVGAnimationForElementAtTime(const QString& animationId, double time, const QString& elementId); + unsigned numberOfActiveAnimations() const; void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); @@ -138,6 +147,7 @@ private: bool m_dumpDatabaseCallbacks; bool m_dumpStatusCallbacks; bool m_waitForPolicy; + bool m_handleErrorPages; QBasicTimer m_timeoutTimer; QWebFrame* m_topLoadingFrame; diff --git a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro index 7f502f8..7b8162b 100644 --- a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro +++ b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro @@ -1,7 +1,7 @@ TEMPLATE = lib TARGET = TestNetscapePlugIn -VPATH = ../../gtk/TestNetscapePlugin ../../TestNetscapePlugIn.subproj +VPATH = ../../unix/TestNetscapePlugin ../../TestNetscapePlugIn.subproj include(../../../../WebKit.pri) DESTDIR = $$OUTPUT_DIR/lib/plugins @@ -18,8 +18,8 @@ mac { } INCLUDEPATH += ../../../../JavaScriptCore \ - ../../gtk/TestNetscapePlugin/ForwardingHeaders \ - ../../gtk/TestNetscapePlugin/ForwardingHeaders/WebKit \ + ../../unix/TestNetscapePlugin/ForwardingHeaders \ + ../../unix/TestNetscapePlugin/ForwardingHeaders/WebKit \ ../../../../WebCore \ ../../../../WebCore/bridge \ ../../TestNetscapePlugIn.subproj @@ -31,5 +31,5 @@ mac { SOURCES += ../../TestNetscapePlugIn.subproj/main.cpp LIBS += -framework Carbon } else { - SOURCES += ../../gtk/TestNetscapePlugin/TestNetscapePlugin.cpp + SOURCES += ../../unix/TestNetscapePlugin/TestNetscapePlugin.cpp } diff --git a/WebKitTools/DumpRenderTree/qt/WorkQueue.cpp b/WebKitTools/DumpRenderTree/qt/WorkQueue.cpp deleted file mode 100644 index f8448e4..0000000 --- a/WebKitTools/DumpRenderTree/qt/WorkQueue.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h" -#include "WorkQueue.h" - -static const unsigned queueLength = 1024; - -static WorkQueueItem* theQueue[queueLength]; -static unsigned startOfQueue; -static unsigned endOfQueue; - -WorkQueue* WorkQueue::shared() -{ - static WorkQueue* sharedInstance = new WorkQueue; - return sharedInstance; -} - -WorkQueue::WorkQueue() - : m_frozen(false) -{ -} - -void WorkQueue::queue(WorkQueueItem* item) -{ - Q_ASSERT(endOfQueue < queueLength); - Q_ASSERT(endOfQueue >= startOfQueue); - - if (m_frozen) { - delete item; - return; - } - - theQueue[endOfQueue++] = item; -} - -WorkQueueItem* WorkQueue::dequeue() -{ - Q_ASSERT(endOfQueue >= startOfQueue); - - if (startOfQueue == endOfQueue) - return 0; - - return theQueue[startOfQueue++]; -} - -unsigned WorkQueue::count() -{ - return endOfQueue - startOfQueue; -} - -void WorkQueue::clear() -{ - for (unsigned i = startOfQueue; i < endOfQueue; ++i) { - delete theQueue[i]; - theQueue[i] = 0; - } - - startOfQueue = 0; - endOfQueue = 0; -} - -bool WorkQueue::processWork() -{ - bool startedLoad = false; - - while (!startedLoad && count()) { - WorkQueueItem* item = dequeue(); - Q_ASSERT(item); - startedLoad = item->invoke(); - delete item; - } - - // If we're done and we didn't start a load, then we're really done, so return true. - return !startedLoad; -} diff --git a/WebKitTools/DumpRenderTree/qt/WorkQueue.h b/WebKitTools/DumpRenderTree/qt/WorkQueue.h deleted file mode 100644 index 902ba0d..0000000 --- a/WebKitTools/DumpRenderTree/qt/WorkQueue.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef WorkQueue_h -#define WorkQueue_h - -#include "WorkQueueItem.h" - -class WorkQueue { -public: - static WorkQueue* shared(); - - void queue(WorkQueueItem*); - WorkQueueItem* dequeue(); - void clear(); - unsigned count(); - - void setFrozen(bool b) { m_frozen = b; } - - bool processWork(); // Returns true if all work is done, false if we started a load. - -private: - WorkQueue(); - - bool m_frozen; -}; - -#endif // !defined(WorkQueue_h) diff --git a/WebKitTools/DumpRenderTree/qt/WorkQueueItem.h b/WebKitTools/DumpRenderTree/qt/WorkQueueItem.h index 9819ec0..d534493 100644 --- a/WebKitTools/DumpRenderTree/qt/WorkQueueItem.h +++ b/WebKitTools/DumpRenderTree/qt/WorkQueueItem.h @@ -89,6 +89,27 @@ private: QString m_script; }; +class LoadingScriptItem : public ScriptItem { +public: + LoadingScriptItem(const QString& script, QWebPage* page) + : ScriptItem(script, page) + { + } + + virtual bool invoke() const { return ScriptItem::invoke(); } +}; + +class NonLoadingScriptItem : public ScriptItem { +public: + NonLoadingScriptItem(const QString& script, QWebPage* page) + : ScriptItem(script, page) + { + } + + virtual bool invoke() const { ScriptItem::invoke(); return false; } +}; + + class BackForwardItem : public WorkQueueItem { public: virtual bool invoke() const; diff --git a/WebKitTools/DumpRenderTree/qt/jsobjects.cpp b/WebKitTools/DumpRenderTree/qt/jsobjects.cpp index e747aeb..af331f0 100644 --- a/WebKitTools/DumpRenderTree/qt/jsobjects.cpp +++ b/WebKitTools/DumpRenderTree/qt/jsobjects.cpp @@ -26,7 +26,10 @@ * (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 <jsobjects.h> + +#include "config.h" +#include "jsobjects.h" + #include <qwebpage.h> GCController::GCController(QWebPage* parent) diff --git a/WebKitTools/DumpRenderTree/qt/main.cpp b/WebKitTools/DumpRenderTree/qt/main.cpp index ae67a59..719315f 100644 --- a/WebKitTools/DumpRenderTree/qt/main.cpp +++ b/WebKitTools/DumpRenderTree/qt/main.cpp @@ -29,6 +29,8 @@ #include "DumpRenderTree.h" +#include <wtf/AlwaysInline.h> + #include <qstringlist.h> #include <qapplication.h> #include <qurl.h> @@ -38,6 +40,7 @@ #include <qwebsettings.h> #include <qwebdatabase.h> #include <qdesktopservices.h> +#include <qwindowsstyle.h> #ifdef Q_WS_X11 #include <qx11info_x11.h> @@ -86,7 +89,7 @@ QString get_backtrace() { return s; } -static void crashHandler(int sig) +static NO_RETURN void crashHandler(int sig) { fprintf(stderr, "%s\n", strsignal(sig)); fprintf(stderr, "%s\n", get_backtrace().toLatin1().constData()); @@ -98,23 +101,25 @@ int main(int argc, char* argv[]) #ifdef Q_WS_X11 FcInit(); WebCore::DumpRenderTree::initializeFonts(); +#endif + #if QT_VERSION >= 0x040500 QApplication::setGraphicsSystem("raster"); #endif -#endif - QApplication app(argc, argv); -#ifdef Q_WS_X11 - QX11Info::setAppDpiY(0, 96); - QX11Info::setAppDpiX(0, 96); -#endif + + QApplication::setStyle(new QWindowsStyle); QFont f("Sans Serif"); f.setPointSize(9); f.setWeight(QFont::Normal); f.setStyle(QFont::StyleNormal); - app.setFont(f); - app.setStyle(QLatin1String("Plastique")); + QApplication::setFont(f); + QApplication app(argc, argv); +#ifdef Q_WS_X11 + QX11Info::setAppDpiY(0, 96); + QX11Info::setAppDpiX(0, 96); +#endif signal(SIGILL, crashHandler); /* 4: illegal instruction (not reset when caught) */ signal(SIGTRAP, crashHandler); /* 5: trace trap (not reset when caught) */ diff --git a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/ForwardingHeaders/WebKit/npapi.h b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npapi.h index 08706f7..08706f7 100644 --- a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/ForwardingHeaders/WebKit/npapi.h +++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npapi.h diff --git a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h index 54a603d..54a603d 100644 --- a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h +++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h diff --git a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h index 00bbc18..00bbc18 100644 --- a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h +++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h diff --git a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp index 6c62a7c..cb01267 100644 --- a/WebKitTools/DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp +++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp @@ -45,6 +45,8 @@ extern "C" { char* NP_GetMIMEDescription(void); } +static void executeScript(const PluginObject* obj, const char* script); + static NPError webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/, NPP instance, @@ -75,9 +77,15 @@ webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/, for (int i = 0; i < argc; i++) if (strcasecmp(argn[i], "src") == 0) pluginLog(instance, "src: %s", argv[i]); - } + } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0) + executeScript(obj, "document.body.innerHTML = ''"); + else if (!strcasecmp(argn[i], "ondestroy")) + obj->onDestroy = strdup(argv[i]); + else if (strcasecmp(argn[i], "testdocumentopenindestroystream") == 0) + obj->testDocumentOpenInDestroyStream = TRUE; + else if (strcasecmp(argn[i], "testwindowopen") == 0) + obj->testWindowOpen = TRUE; } - instance->pdata = obj; } @@ -89,6 +97,11 @@ webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** /*save*/) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); if (obj) { + if (obj->onDestroy) { + executeScript(obj, obj->onDestroy); + free(obj->onDestroy); + } + if (obj->onStreamLoad) free(obj->onStreamLoad); @@ -117,6 +130,12 @@ webkit_test_plugin_set_window(NPP instance, NPWindow *window) pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); obj->logSetWindow = false; } + + if (obj->testWindowOpen) { + testWindowOpen(instance); + obj->testWindowOpen = FALSE; + } + } return NPERR_NO_ERROR; @@ -167,6 +186,11 @@ webkit_test_plugin_destroy_stream(NPP instance, NPStream* /*stream*/, NPError /* if (obj->onStreamDestroy) executeScript(obj, obj->onStreamDestroy); + if (obj->testDocumentOpenInDestroyStream) { + testDocumentOpen(instance); + obj->testDocumentOpenInDestroyStream = FALSE; + } + return NPERR_NO_ERROR; } diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp index de3d9ff..163abb1 100644 --- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp +++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp @@ -151,10 +151,24 @@ JSStringRef AccessibilityUIElement::role() VARIANT vRole; if (FAILED(m_element->get_accRole(self(), &vRole))) return JSStringCreateWithCharacters(0, 0); - ASSERT(V_VT(&vRole) == VT_I4); - TCHAR roleText[64] = {0}; - ::GetRoleText(V_I4(&vRole), roleText, ARRAYSIZE(roleText)); - return JSStringCreateWithCharacters(roleText, _tcslen(roleText)); + + ASSERT(V_VT(&vRole) == VT_I4 || V_VT(&vRole) == VT_BSTR); + + wstring result; + if (V_VT(&vRole) == VT_I4) { + unsigned roleTextLength = ::GetRoleText(V_I4(&vRole), 0, 0) + 1; + + Vector<TCHAR> roleText(roleTextLength); + + ::GetRoleText(V_I4(&vRole), roleText.data(), roleTextLength); + + result = roleText.data(); + } else if (V_VT(&vRole) == VT_BSTR) + result = wstring(V_BSTR(&vRole), ::SysStringLen(V_BSTR(&vRole))); + + ::VariantClear(&vRole); + + return JSStringCreateWithCharacters(result.data(), result.length()); } JSStringRef AccessibilityUIElement::subrole() @@ -162,6 +176,11 @@ JSStringRef AccessibilityUIElement::subrole() return 0; } +JSStringRef AccessibilityUIElement::roleDescription() +{ + return 0; +} + JSStringRef AccessibilityUIElement::title() { BSTR titleBSTR; @@ -175,13 +194,18 @@ JSStringRef AccessibilityUIElement::title() JSStringRef AccessibilityUIElement::description() { BSTR descriptionBSTR; - if (FAILED(m_element->get_accName(self(), &descriptionBSTR)) || !descriptionBSTR) + if (FAILED(m_element->get_accDescription(self(), &descriptionBSTR)) || !descriptionBSTR) return JSStringCreateWithCharacters(0, 0); wstring description(descriptionBSTR, SysStringLen(descriptionBSTR)); ::SysFreeString(descriptionBSTR); return JSStringCreateWithCharacters(description.data(), description.length()); } +JSStringRef AccessibilityUIElement::stringValue() +{ + return JSStringCreateWithCharacters(0, 0); +} + JSStringRef AccessibilityUIElement::language() { return JSStringCreateWithCharacters(0, 0); @@ -233,6 +257,35 @@ JSStringRef AccessibilityUIElement::valueDescription() { return 0; } +bool AccessibilityUIElement::isSelected() const +{ + return false; +} + +int AccessibilityUIElement::hierarchicalLevel() const +{ + return 0; +} + +bool AccessibilityUIElement::ariaIsGrabbed() const +{ + return false; +} + +JSStringRef AccessibilityUIElement::ariaDropEffects() const +{ + return 0; +} + +bool AccessibilityUIElement::isExpanded() const +{ + return false; +} + +JSStringRef AccessibilityUIElement::orientation() const +{ + return 0; +} double AccessibilityUIElement::intValue() { @@ -270,6 +323,7 @@ bool AccessibilityUIElement::isRequired() const return false; } + int AccessibilityUIElement::insertionPointLineNumber() { return 0; @@ -359,6 +413,11 @@ bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute) return false; } +bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute) +{ + return false; +} + void AccessibilityUIElement::increment() { } @@ -366,3 +425,55 @@ void AccessibilityUIElement::increment() void AccessibilityUIElement::decrement() { } + +void AccessibilityUIElement::showMenu() +{ +} + +AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index) +{ + return 0; +} + +AccessibilityUIElement AccessibilityUIElement::disclosedByRow() +{ + return 0; +} + +JSStringRef AccessibilityUIElement::accessibilityValue() const +{ + BSTR valueBSTR; + if (FAILED(m_element->get_accValue(self(), &valueBSTR)) || !valueBSTR) + return JSStringCreateWithCharacters(0, 0); + + wstring value(valueBSTR, SysStringLen(valueBSTR)); + ::SysFreeString(valueBSTR); + + return JSStringCreateWithCharacters(value.data(), value.length()); +} + + +JSStringRef AccessibilityUIElement::documentEncoding() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::documentURI() +{ + return JSStringCreateWithCharacters(0, 0); +} diff --git a/WebKitTools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp b/WebKitTools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp index b18b724..1bc4678 100644 --- a/WebKitTools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp +++ b/WebKitTools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp @@ -28,6 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "DRTDesktopNotificationPresenter.h" #include "DumpRenderTree.h" diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp index d486d06..1315f9e 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp @@ -66,7 +66,7 @@ using namespace std; -#ifndef NDEBUG +#if !defined(NDEBUG) && (!defined(DEBUG_INTERNAL) || defined(DEBUG_ALL)) const LPWSTR TestPluginDir = L"TestNetscapePlugin_Debug"; #else const LPWSTR TestPluginDir = L"TestNetscapePlugin"; @@ -201,6 +201,43 @@ static const wstring& fontsPath() return path; } +static void addQTDirToPATH() +{ + static LPCWSTR pathEnvironmentVariable = L"PATH"; + static LPCWSTR quickTimeKeyName = L"Software\\Apple Computer, Inc.\\QuickTime"; + static LPCWSTR quickTimeSysDir = L"QTSysDir"; + static bool initialized; + + if (initialized) + return; + initialized = true; + + // Get the QuickTime dll directory from the registry. The key can be in either HKLM or HKCU. + WCHAR qtPath[MAX_PATH]; + DWORD qtPathBufferLen = sizeof(qtPath); + DWORD keyType; + HRESULT result = SHGetValue(HKEY_LOCAL_MACHINE, quickTimeKeyName, quickTimeSysDir, &keyType, (LPVOID)qtPath, &qtPathBufferLen); + if (result != ERROR_SUCCESS || !qtPathBufferLen || keyType != REG_SZ) { + qtPathBufferLen = sizeof(qtPath); + result = SHGetValue(HKEY_CURRENT_USER, quickTimeKeyName, quickTimeSysDir, &keyType, (LPVOID)qtPath, &qtPathBufferLen); + if (result != ERROR_SUCCESS || !qtPathBufferLen || keyType != REG_SZ) + return; + } + + // Read the current PATH. + DWORD pathSize = GetEnvironmentVariableW(pathEnvironmentVariable, 0, 0); + Vector<WCHAR> oldPath(pathSize); + if (!GetEnvironmentVariableW(pathEnvironmentVariable, oldPath.data(), oldPath.size())) + return; + + // And add the QuickTime dll. + wstring newPath; + newPath.append(qtPath); + newPath.append(L";"); + newPath.append(oldPath.data(), oldPath.size()); + SetEnvironmentVariableW(pathEnvironmentVariable, newPath.data()); +} + #ifdef DEBUG_ALL #define WEBKITDLL TEXT("WebKit_debug.dll") #else @@ -263,6 +300,10 @@ static void initialize() for (int i = 0; i < ARRAYSIZE(fontsToInstall); ++i) textRenderer->registerPrivateFont(wstring(resourcesPath + fontsToInstall[i]).c_str()); + // Add the QuickTime dll directory to PATH or QT 7.6 will fail to initialize on systems + // linked with older versions of qtmlclientlib.dll. + addQTDirToPATH(); + // Register a host window WNDCLASSEX wcex; @@ -286,7 +327,7 @@ static void initialize() void displayWebView() { ::InvalidateRect(webViewWindow, 0, TRUE); - ::UpdateWindow(webViewWindow); + ::SendMessage(webViewWindow, WM_PAINT, 0, 0); } void dumpFrameScrollPosition(IWebFrame* frame) @@ -688,6 +729,11 @@ static bool shouldLogHistoryDelegates(const char* pathOrURL) return strstr(pathOrURL, "/globalhistory/") || strstr(pathOrURL, "\\globalhistory\\"); } +static bool shouldOpenWebInspector(const char* pathOrURL) +{ + return strstr(pathOrURL, "/inspector/") || strstr(pathOrURL, "\\inspector\\"); +} + static void resetDefaultsToConsistentValues(IWebPreferences* preferences) { #ifdef USE_MAC_FONTS @@ -793,6 +839,12 @@ static void resetWebViewToConsistentStateBeforeTesting() webViewPrivate->clearMainFrameName(); webViewPrivate->resetOriginAccessWhiteLists(); + BSTR groupName; + if (SUCCEEDED(webView->groupName(&groupName))) { + webViewPrivate->removeAllUserContentFromGroup(groupName); + SysFreeString(groupName); + } + sharedUIDelegate->resetUndoManager(); sharedFrameLoadDelegate->resetToConsistentState(); @@ -859,6 +911,9 @@ static void runTest(const string& testPathOrURL) resetWebViewToConsistentStateBeforeTesting(); + if (shouldOpenWebInspector(pathOrURL.c_str())) + gLayoutTestController->showWebInspector(); + prevTestBFItem = 0; if (webView) { COMPtr<IWebBackForwardList> bfList; @@ -893,6 +948,9 @@ static void runTest(const string& testPathOrURL) DispatchMessage(&msg); } + if (shouldOpenWebInspector(pathOrURL.c_str())) + gLayoutTestController->closeWebInspector(); + resetWebViewToConsistentStateBeforeTesting(); frame->stopLoading(); diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj index ba3640c..299c53c 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj @@ -84,7 +84,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -157,7 +157,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -228,7 +228,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -300,7 +300,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -373,7 +373,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -444,7 +444,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42.dll" xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42.dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
if exist "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb"xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
</Configurations>
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h index 6eb468d..54ec87b 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h @@ -30,6 +30,7 @@ #define DumpRenderTreeWin_h struct IWebFrame; +struct IWebScriptWorld; struct IWebView; struct PolicyDelegate; typedef const struct __CFString* CFStringRef; @@ -55,6 +56,8 @@ WindowToWebViewMap& windowToWebViewMap(); void setPersistentUserStyleSheetLocation(CFStringRef); bool setAlwaysAcceptCookies(bool alwaysAcceptCookies); +unsigned worldIDForWorld(IWebScriptWorld*); + extern UINT_PTR waitToDumpWatchdog; #endif // DumpRenderTreeWin_h diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp index 939090a..37d5e1c 100644 --- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp @@ -289,12 +289,53 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::willCloseFrame( return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didClearWindowObject( - /* [in] */ IWebView*webView, - /* [in] */ JSContextRef context, - /* [in] */ JSObjectRef windowObject, - /* [in] */ IWebFrame* frame) +HRESULT FrameLoadDelegate::didClearWindowObject(IWebView*, JSContextRef, JSObjectRef, IWebFrame*) +{ + return E_NOTIMPL; +} + +HRESULT FrameLoadDelegate::didClearWindowObjectForFrameInScriptWorld(IWebView* webView, IWebFrame* frame, IWebScriptWorld* world) +{ + ASSERT_ARG(webView, webView); + ASSERT_ARG(frame, frame); + ASSERT_ARG(world, world); + if (!webView || !frame || !world) + return E_POINTER; + + COMPtr<IWebScriptWorld> standardWorld; + if (FAILED(world->standardWorld(&standardWorld))) + return S_OK; + + if (world == standardWorld) + didClearWindowObjectForFrameInStandardWorld(frame); + else + didClearWindowObjectForFrameInIsolatedWorld(frame, world); + return S_OK; +} + +void FrameLoadDelegate::didClearWindowObjectForFrameInIsolatedWorld(IWebFrame* frame, IWebScriptWorld* world) +{ + COMPtr<IWebFramePrivate> framePrivate(Query, frame); + if (!framePrivate) + return; + + JSGlobalContextRef ctx = framePrivate->globalContextForScriptWorld(world); + if (!ctx) + return; + + JSObjectRef globalObject = JSContextGetGlobalObject(ctx); + if (!globalObject) + return; + + JSObjectSetProperty(ctx, globalObject, JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("__worldID")).get(), JSValueMakeNumber(ctx, worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0); + return; +} + +void FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld(IWebFrame* frame) { + JSGlobalContextRef context = frame->globalContext(); + JSObjectRef windowObject = JSContextGetGlobalObject(context); + JSValueRef exception = 0; ::gLayoutTestController->makeWindowObject(context, windowObject, &exception); @@ -310,8 +351,6 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didClearWindowObject( JSValueRef eventSender = makeEventSender(context); JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0); JSStringRelease(eventSenderStr); - - return S_OK; } HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishDocumentLoadForFrame( diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h index 56325e2..cc6653b 100644 --- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h +++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h @@ -141,7 +141,24 @@ public: /* [in] */ IWebView *sender, /* [in] */ IWebSecurityOrigin *origin); -protected: + virtual HRESULT STDMETHODCALLTYPE didClearWindowObjectForFrameInScriptWorld(IWebView*, IWebFrame*, IWebScriptWorld*); + + virtual HRESULT STDMETHODCALLTYPE didPushStateWithinPageForFrame( + /* [in] */ IWebView *sender, + /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } + + virtual HRESULT STDMETHODCALLTYPE didReplaceStateWithinPageForFrame( + /* [in] */ IWebView *sender, + /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } + + virtual HRESULT STDMETHODCALLTYPE didPopStateWithinPageForFrame( + /* [in] */ IWebView *sender, + /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } + +private: + void didClearWindowObjectForFrameInIsolatedWorld(IWebFrame*, IWebScriptWorld*); + void didClearWindowObjectForFrameInStandardWorld(IWebFrame*); + void locationChangeDone(IWebError*, IWebFrame*); ULONG m_refCount; diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp index d3cac7a..5debf16 100644 --- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp @@ -372,6 +372,23 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled) prefsPrivate->setXSSAuditorEnabled(enabled); } +void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return; + + COMPtr<IWebPreferences> preferences; + if (FAILED(webView->preferences(&preferences))) + return; + + COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences); + if (!prefsPrivate) + return; + + prefsPrivate->setAllowUniversalAccessFromFileURLs(enabled); +} + void LayoutTestController::setPopupBlockingEnabled(bool enabled) { COMPtr<IWebView> webView; @@ -398,6 +415,23 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle) viewPrivate->setTabKeyCyclesThroughElements(shouldCycle ? TRUE : FALSE); } +void LayoutTestController::setTimelineProfilingEnabled(bool flag) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return; + + COMPtr<IWebViewPrivate> viewPrivate; + if (FAILED(webView->QueryInterface(&viewPrivate))) + return; + + COMPtr<IWebInspector> inspector; + if (FAILED(viewPrivate->inspector(&inspector))) + return; + + inspector->setTimelineProfilingEnabled(flag); +} + void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) { // FIXME: Implement! @@ -827,6 +861,31 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return SUCCEEDED(hr) && wasRunning; } +bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId) +{ + COMPtr<IDOMDocument> document; + if (FAILED(frame->DOMDocument(&document))) + return false; + + BSTR idBSTR = JSStringCopyBSTR(animationId); + COMPtr<IDOMElement> element; + HRESULT hr = document->getElementById(idBSTR, &element); + SysFreeString(idBSTR); + if (FAILED(hr)) + return false; + + COMPtr<IWebFramePrivate> framePrivate(Query, frame); + if (!framePrivate) + return false; + + BSTR elementIdBSTR = JSStringCopyBSTR(elementId); + BOOL wasRunning = FALSE; + hr = framePrivate->pauseSVGAnimation(elementIdBSTR, element.get(), time, &wasRunning); + SysFreeString(elementIdBSTR); + + return SUCCEEDED(hr) && wasRunning; +} + unsigned LayoutTestController::numberOfActiveAnimations() const { COMPtr<IWebFramePrivate> framePrivate(Query, frame); @@ -861,7 +920,11 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart) if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) return; - webView->addUserScriptToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), 1, bstrT(source).GetBSTR(), 0, 0, 0, 0, 0, runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd); + COMPtr<IWebScriptWorld> world; + if (FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(world), reinterpret_cast<void**>(&world)))) + return; + + webView->addUserScriptToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0, runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd); } @@ -871,7 +934,11 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source) if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) return; - webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), 1, bstrT(source).GetBSTR(), 0, 0, 0, 0, 0); + COMPtr<IWebScriptWorld> world; + if (FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(world), reinterpret_cast<void**>(&world)))) + return; + + webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0); } void LayoutTestController::showWebInspector() @@ -947,14 +1014,45 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip inspectorPrivate->evaluateInFrontend(callId, bstrT(script).GetBSTR()); } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script) +typedef HashMap<unsigned, COMPtr<IWebScriptWorld> > WorldMap; +static WorldMap& worldMap() +{ + static WorldMap& map = *new WorldMap; + return map; +} + +unsigned worldIDForWorld(IWebScriptWorld* world) +{ + WorldMap::const_iterator end = worldMap().end(); + for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { + if (it->second == world) + return it->first; + } + + return 0; +} + +void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) return; + // A worldID of 0 always corresponds to a new world. Any other worldID corresponds to a world + // that is created once and cached forever. + COMPtr<IWebScriptWorld> world; + if (!worldID) { + if (FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(world), reinterpret_cast<void**>(&world)))) + return; + } else { + COMPtr<IWebScriptWorld>& worldSlot = worldMap().add(worldID, 0).first->second; + if (!worldSlot && FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(worldSlot), reinterpret_cast<void**>(&worldSlot)))) + return; + world = worldSlot; + } + BSTR result; - if (FAILED(framePrivate->stringByEvaluatingJavaScriptInIsolatedWorld(worldId, reinterpret_cast<OLE_HANDLE>(globalObject), bstrT(script).GetBSTR(), &result))) + if (FAILED(framePrivate->stringByEvaluatingJavaScriptInScriptWorld(world.get(), globalObject, bstrT(script).GetBSTR(), &result))) return; SysFreeString(result); } diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp index 7175d33..82b1d4d 100644 --- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp +++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp @@ -88,12 +88,15 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch for (int i = 0; i < argc; i++) if (_stricmp(argn[i], "src") == 0) pluginLog(instance, "src: %s", argv[i]); - } + } else if (_stricmp(argn[i], "testdocumentopenindestroystream") == 0) + obj->testDocumentOpenInDestroyStream = TRUE; + else if (_stricmp(argn[i], "testwindowopen") == 0) + obj->testWindowOpen = TRUE; } instance->pdata = obj; } - + return NPERR_NO_ERROR; } @@ -120,6 +123,15 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) NPError NPP_SetWindow(NPP instance, NPWindow *window) { + PluginObject* obj = static_cast<PluginObject*>(instance->pdata); + + if (obj) { + if (obj->testWindowOpen) { + testWindowOpen(instance); + obj->testWindowOpen = FALSE; + } + } + return NPERR_NO_ERROR; } @@ -149,7 +161,7 @@ NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool se if (obj->onStreamLoad) executeScript(obj, obj->onStreamLoad); - + return NPERR_NO_ERROR; } @@ -160,6 +172,10 @@ NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) if (obj->onStreamDestroy) executeScript(obj, obj->onStreamDestroy); + if (obj->testDocumentOpenInDestroyStream) { + testDocumentOpen(instance); + } + return NPERR_NO_ERROR; } diff --git a/WebKitTools/DumpRenderTree/wscript b/WebKitTools/DumpRenderTree/wscript new file mode 100644 index 0000000..29eca9a --- /dev/null +++ b/WebKitTools/DumpRenderTree/wscript @@ -0,0 +1,64 @@ +#! /usr/bin/env python + +# Copyright (C) 2009 Kevin Ollivier 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 COMPUTER, INC. ``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 COMPUTER, INC. OR +# 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. +# +# wxBrowser sample app build script for the waf build system + +import sys + +from settings import * + +include_paths = [ + os.path.join(output_dir), + os.path.join(wk_root, 'JavaScriptCore'), + os.path.join(wk_root, 'WebCore'), + os.path.join(wk_root, 'WebKit', 'wx'), + '.', + 'wx' + ] +sources = [ + 'LayoutTestController.cpp', + 'WorkQueue.cpp', + 'wx/DumpRenderTreeWx.cpp', + 'wx/LayoutTestControllerWx.cpp', + 'wx/WorkQueueItemWx.cpp' + ] + +def set_options(opt): + common_set_options(opt) + +def configure(conf): + common_configure(conf) + +def build(bld): + obj = bld.new_task_gen( + features = 'cxx cprogram', + includes = ' '.join(include_paths), + source = sources, + target = 'DumpRenderTree', + uselib = 'WXWEBKIT WX ' + get_config(), + libpath = [output_dir], + uselib_local = '', + install_path = output_dir) + diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp index 72f85ae..2c46950 100644 --- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp @@ -170,6 +170,11 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled) // FIXME: implement } +void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +{ + // FIXME: implement +} + void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) { // FIXME: implement @@ -262,6 +267,12 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return false; } +bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId) +{ + // FIXME: implement + return false; +} + void LayoutTestController::setCacheModel(int) { // FIXME: implement @@ -318,3 +329,28 @@ void LayoutTestController::removeAllVisitedLinks() { // FIXME: Implement this. } + +void LayoutTestController::setTimelineProfilingEnabled(bool enabled) +{ + +} + +void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script) +{ + +} + +void LayoutTestController::disableImageLoading() +{ + +} + +void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +{ + +} + +JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id) +{ + +} |