diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-18 13:59:13 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-18 13:59:28 +0200 |
commit | 4d6084feccab99c0a7b3ecef26bb49c41dd50201 (patch) | |
tree | fd1195897f551eee6d5a15d07ff5733b15aa2a5c /Tools/WebKitTestRunner | |
parent | ae901828d4689ab9e89113f6b6ea8042b37a9fda (diff) | |
download | qtwebkit-4d6084feccab99c0a7b3ecef26bb49c41dd50201.tar.gz |
Imported WebKit commit ff52235a78888e5cb8e286a828a8698042200e67 (http://svn.webkit.org/repository/webkit/trunk@122948)
New snapshot that should fix the rendering issues recently introduced
Diffstat (limited to 'Tools/WebKitTestRunner')
10 files changed, 992 insertions, 4 deletions
diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am index 546961331..a255f67e3 100644 --- a/Tools/WebKitTestRunner/GNUmakefile.am +++ b/Tools/WebKitTestRunner/GNUmakefile.am @@ -94,6 +94,7 @@ Libraries_libTestRunnerInjectedBundle_la_SOURCES = \ Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h \ Tools/WebKitTestRunner/InjectedBundle/GCController.cpp \ Tools/WebKitTestRunner/InjectedBundle/GCController.h \ + Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp \ diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp index 7c06237ee..42e25711c 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp @@ -54,7 +54,7 @@ bool AccessibilityUIElement::isValid() const } // Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified. -#if !PLATFORM(MAC) +#if !PLATFORM(MAC) && !PLATFORM(GTK) AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement) { } AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement&) { } AccessibilityUIElement::~AccessibilityUIElement() { } diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h index 697918f33..551f59174 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h +++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h @@ -243,6 +243,9 @@ private: void getLinkedUIElements(Vector<RefPtr<AccessibilityUIElement> >&); void getDocumentLinks(Vector<RefPtr<AccessibilityUIElement> >&); +#endif + +#if PLATFORM(MAC) || PLATFORM(GTK) void getChildren(Vector<RefPtr<AccessibilityUIElement> >&); void getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >&, unsigned location, unsigned length); #endif diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl index a1e8a062c..312a1e328 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl +++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl @@ -28,6 +28,10 @@ module WTR { interface AccessibilityUIElement { boolean isEqual(in AccessibilityUIElement otherElement); + // Document information + readonly attribute DOMString documentEncoding; + readonly attribute DOMString documentURI; + // Element access. AccessibilityUIElement elementAtPoint(in int x, in int y); AccessibilityUIElement childAtIndex(in unsigned long index); diff --git a/Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp new file mode 100644 index 000000000..e83b784b2 --- /dev/null +++ b/Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp @@ -0,0 +1,971 @@ +/* + * Copyright (C) 2011 Apple Inc. All Rights Reserved. + * Copyright (C) 2012 Igalia S.L. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * 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 "AccessibilityUIElement.h" + +#include "InjectedBundle.h" +#include "InjectedBundlePage.h" +#include <JavaScriptCore/JSStringRef.h> +#include <atk/atk.h> +#include <gtk/gtk.h> +#include <wtf/Assertions.h> +#include <wtf/gobject/GOwnPtr.h> +#include <wtf/gobject/GRefPtr.h> + +namespace WTR { + +static gchar* attributeSetToString(AtkAttributeSet* attributeSet) +{ + GString* str = g_string_new(0); + for (GSList* attributes = attributeSet; attributes; attributes = attributes->next) { + AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data); + GOwnPtr<gchar> attributeData(g_strconcat(attribute->name, ":", attribute->value, NULL)); + g_string_append(str, attributeData.get()); + if (attributes->next) + g_string_append(str, ", "); + } + + return g_string_free(str, FALSE); +} + +static bool checkElementState(PlatformUIElement element, AtkStateType stateType) +{ + if (!ATK_IS_OBJECT(element)) + return false; + + GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element))); + return atk_state_set_contains_state(stateSet.get(), stateType); +} + +static JSStringRef indexRangeInTable(PlatformUIElement element, bool isRowRange) +{ + GOwnPtr<gchar> rangeString(g_strdup("{0, 0}")); + + if (!element || !ATK_IS_OBJECT(element)) + return JSStringCreateWithUTF8CString(rangeString.get()); + + AtkObject* axTable = atk_object_get_parent(ATK_OBJECT(element)); + if (!axTable || !ATK_IS_TABLE(axTable)) + return JSStringCreateWithUTF8CString(rangeString.get()); + + // Look for the cell in the table. + gint indexInParent = atk_object_get_index_in_parent(ATK_OBJECT(element)); + if (indexInParent == -1) + return JSStringCreateWithUTF8CString(rangeString.get()); + + int row = -1; + int column = -1; + row = atk_table_get_row_at_index(ATK_TABLE(axTable), indexInParent); + column = atk_table_get_column_at_index(ATK_TABLE(axTable), indexInParent); + + // Get the actual values, if row and columns are valid values. + if (row != -1 && column != -1) { + int base = 0; + int length = 0; + if (isRowRange) { + base = row; + length = atk_table_get_row_extent_at(ATK_TABLE(axTable), row, column); + } else { + base = column; + length = atk_table_get_column_extent_at(ATK_TABLE(axTable), row, column); + } + rangeString.set(g_strdup_printf("{%d, %d}", base, length)); + } + + return JSStringCreateWithUTF8CString(rangeString.get()); +} + +static void alterCurrentValue(PlatformUIElement element, int factor) +{ + if (!element || !ATK_IS_VALUE(element)) + return; + + GValue currentValue = G_VALUE_INIT; + atk_value_get_current_value(ATK_VALUE(element), ¤tValue); + + GValue increment = G_VALUE_INIT; + atk_value_get_minimum_increment(ATK_VALUE(element), &increment); + + GValue newValue = G_VALUE_INIT; + g_value_init(&newValue, G_TYPE_DOUBLE); + + g_value_set_float(&newValue, g_value_get_float(¤tValue) + factor * g_value_get_float(&increment)); + atk_value_set_current_value(ATK_VALUE(element), &newValue); + + g_value_unset(&newValue); + g_value_unset(&increment); + g_value_unset(¤tValue); +} + +AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element) + : m_element(element) +{ +} + +AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other) + : JSWrappable() + , m_element(other.m_element) +{ +} + +AccessibilityUIElement::~AccessibilityUIElement() +{ +} + +bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement) +{ + return m_element == otherElement->platformUIElement(); +} + +void AccessibilityUIElement::getChildren(Vector<RefPtr<AccessibilityUIElement> >& children) +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return; + + int count = childrenCount(); + for (int i = 0; i < count; i++) { + AtkObject* child = atk_object_ref_accessible_child(ATK_OBJECT(m_element), i); + children.append(AccessibilityUIElement::create(child)); + } +} + +void AccessibilityUIElement::getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >& children, unsigned location, unsigned length) +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return; + unsigned end = location + length; + for (unsigned i = location; i < end; i++) { + AtkObject* child = atk_object_ref_accessible_child(ATK_OBJECT(m_element), i); + children.append(AccessibilityUIElement::create(child)); + } +} + +int AccessibilityUIElement::childrenCount() +{ + Vector<RefPtr<AccessibilityUIElement> > children; + getChildren(children); + return children.size(); +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::elementAtPoint(int x, int y) +{ + // FIXME: implement + return 0; +} + +unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element) +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0; + + Vector<RefPtr<AccessibilityUIElement> > children; + getChildren(children); + + unsigned count = children.size(); + for (unsigned i = 0; i < count; i++) + if (children[i]->isEqual(element)) + return i; + + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::childAtIndex(unsigned index) +{ + Vector<RefPtr<AccessibilityUIElement> > children; + getChildrenWithRange(children, index, 1); + + if (children.size() == 1) + return children[0]; + + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(unsigned index) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::rowAtIndex(unsigned index) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned index) const +{ + // FIXME: implement + return 0; +} + +unsigned AccessibilityUIElement::selectedChildrenCount() const +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedRowAtIndex(unsigned index) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::titleUIElement() +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0; + + AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element)); + return parent ? AccessibilityUIElement::create(parent) : 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedByRow() +{ + // FIXME: implement + return 0; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return JSStringCreateWithCharacters(0, 0); + + GOwnPtr<gchar> attributeData(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element)))); + return JSStringCreateWithUTF8CString(attributeData.get()); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute) +{ + // FIXME: implement + return 0.0f; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementAttributeValue(JSStringRef attribute) const +{ + // FIXME: implement + return 0; +} + +bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute) +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute) +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute) +{ + // FIXME: implement + return false; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::role() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return JSStringCreateWithCharacters(0, 0); + + AtkRole role = atk_object_get_role(ATK_OBJECT(m_element)); + if (!role) + return JSStringCreateWithCharacters(0, 0); + + const gchar* roleName = atk_role_get_name(role); + GOwnPtr<gchar> axRole(g_strdup_printf("AXRole: %s", roleName)); + + return JSStringCreateWithUTF8CString(axRole.get()); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::title() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return JSStringCreateWithCharacters(0, 0); + + const gchar* name = atk_object_get_name(ATK_OBJECT(m_element)); + if (!name) + return JSStringCreateWithCharacters(0, 0); + + GOwnPtr<gchar> axTitle(g_strdup_printf("AXTitle: %s", name)); + + return JSStringCreateWithUTF8CString(axTitle.get()); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::description() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return JSStringCreateWithCharacters(0, 0); + + const gchar* description = atk_object_get_description(ATK_OBJECT(m_element)); + if (!description) + return JSStringCreateWithCharacters(0, 0); + + GOwnPtr<gchar> axDesc(g_strdup_printf("AXDescription: %s", description)); + + return JSStringCreateWithUTF8CString(axDesc.get()); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::language() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const +{ + // FIXME: implement + // We need a way to call WebCore::AccessibilityObject::helpText() + // from here, probably a new helper class in WebProcess/WebCoreSupport. + return JSStringCreateWithCharacters(0, 0); +} + +double AccessibilityUIElement::x() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + int x, y; + atk_component_get_position(ATK_COMPONENT(m_element), &x, &y, ATK_XY_SCREEN); + return x; +} + +double AccessibilityUIElement::y() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + int x, y; + atk_component_get_position(ATK_COMPONENT(m_element), &x, &y, ATK_XY_SCREEN); + return y; +} + +double AccessibilityUIElement::width() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + int width, height; + atk_component_get_size(ATK_COMPONENT(m_element), &width, &height); + return width; +} + +double AccessibilityUIElement::height() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + int width, height; + atk_component_get_size(ATK_COMPONENT(m_element), &width, &height); + return height; +} + +double AccessibilityUIElement::clickPointX() +{ + // FIXME: implement + return 0.0f; +} + +double AccessibilityUIElement::clickPointY() +{ + // FIXME: implement + return 0.0f; +} + +double AccessibilityUIElement::intValue() const +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + GValue value = G_VALUE_INIT; + atk_value_get_current_value(ATK_VALUE(m_element), &value); + if (!G_VALUE_HOLDS_FLOAT(&value)) + return 0.0f; + + return g_value_get_float(&value); +} + +double AccessibilityUIElement::minValue() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + GValue value = G_VALUE_INIT; + atk_value_get_minimum_value(ATK_VALUE(m_element), &value); + if (!G_VALUE_HOLDS_FLOAT(&value)) + return 0.0f; + + return g_value_get_float(&value); +} + +double AccessibilityUIElement::maxValue() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return 0.0f; + + GValue value = G_VALUE_INIT; + atk_value_get_maximum_value(ATK_VALUE(m_element), &value); + if (!G_VALUE_HOLDS_FLOAT(&value)) + return 0.0f; + + return g_value_get_float(&value); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +int AccessibilityUIElement::insertionPointLineNumber() +{ + // FIXME: implement + return -1; +} + +bool AccessibilityUIElement::isActionSupported(JSStringRef action) +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::isEnabled() +{ + return checkElementState(m_element, ATK_STATE_ENABLED); +} + +bool AccessibilityUIElement::isRequired() const +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::isFocused() const +{ + return checkElementState(m_element, ATK_STATE_FOCUSED); +} + +bool AccessibilityUIElement::isSelected() const +{ + return checkElementState(m_element, ATK_STATE_SELECTED); +} + +bool AccessibilityUIElement::isExpanded() const +{ + return checkElementState(m_element, ATK_STATE_EXPANDED); +} + +bool AccessibilityUIElement::isChecked() const +{ + return checkElementState(m_element, ATK_STATE_CHECKED); +} + +int AccessibilityUIElement::hierarchicalLevel() const +{ + // FIXME: implement + return 0; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::speak() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +bool AccessibilityUIElement::ariaIsGrabbed() const +{ + // FIXME: implement + return false; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +// parameterized attributes +int AccessibilityUIElement::lineForIndex(int index) +{ + // FIXME: implement + return 0; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int x, int y) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length) +{ + // FIXME: implement + return false; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText) +{ + // FIXME: implement + return 0; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +int AccessibilityUIElement::rowCount() +{ + if (!m_element || !ATK_IS_TABLE(m_element)) + return 0; + + return atk_table_get_n_rows(ATK_TABLE(m_element)); +} + +int AccessibilityUIElement::columnCount() +{ + if (!m_element || !ATK_IS_TABLE(m_element)) + return 0; + + return atk_table_get_n_columns(ATK_TABLE(m_element)); +} + +int AccessibilityUIElement::indexInTable() +{ + // FIXME: implement + return -1; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange() +{ + // Range in table for rows. + return indexRangeInTable(m_element, true); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange() +{ + // Range in table for columns. + return indexRangeInTable(m_element, false); +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row) +{ + if (!m_element || !ATK_IS_TABLE(m_element)) + return 0; + + AtkObject* foundCell = atk_table_ref_at(ATK_TABLE(m_element), row, col); + return foundCell ? AccessibilityUIElement::create(foundCell) : 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::horizontalScrollbar() const +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const +{ + // FIXME: implement + return 0; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length) +{ + // FIXME: implement +} + +void AccessibilityUIElement::increment() +{ + alterCurrentValue(m_element, 1); +} + +void AccessibilityUIElement::decrement() +{ + alterCurrentValue(m_element, -1); +} + +void AccessibilityUIElement::showMenu() +{ + // FIXME: implement +} + +void AccessibilityUIElement::press() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return; + + if (!ATK_IS_ACTION(m_element)) + return; + + // Only one action per object is supported so far. + atk_action_do_action(ATK_ACTION(m_element), 0); +} + +void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const +{ + // FIXME: implement +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return JSStringCreateWithCharacters(0, 0); + + 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")); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI() +{ + if (!m_element || !ATK_IS_OBJECT(m_element)) + return JSStringCreateWithCharacters(0, 0); + + 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")); +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::url() +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +bool AccessibilityUIElement::addNotificationListener(JSValueRef functionCallback) +{ + // FIXME: implement + return true; +} + +bool AccessibilityUIElement::removeNotificationListener() +{ + // FIXME: implement + return true; +} + +bool AccessibilityUIElement::isFocusable() const +{ + return checkElementState(m_element, ATK_STATE_FOCUSABLE); +} + +bool AccessibilityUIElement::isSelectable() const +{ + return checkElementState(m_element, ATK_STATE_SELECTABLE); +} + +bool AccessibilityUIElement::isMultiSelectable() const +{ + return checkElementState(m_element, ATK_STATE_MULTISELECTABLE); +} + +bool AccessibilityUIElement::isVisible() const +{ + return checkElementState(m_element, ATK_STATE_VISIBLE); +} + +bool AccessibilityUIElement::isOffScreen() const +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::isCollapsed() const +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::isIgnored() const +{ + // FIXME: implement + return false; +} + +bool AccessibilityUIElement::hasPopup() const +{ + // FIXME: implement + return false; +} + +void AccessibilityUIElement::takeFocus() +{ + // FIXME: implement +} + +void AccessibilityUIElement::takeSelection() +{ + // FIXME: implement +} + +void AccessibilityUIElement::addSelection() +{ + // FIXME: implement +} + +void AccessibilityUIElement::removeSelection() +{ + // FIXME: implement +} + +// Text markers +PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element) +{ + // FIXME: implement + return 0; +} + +int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker) +{ + // FIXME: implement + return 0; +} + +JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange) +{ + // FIXME: implement + return JSStringCreateWithCharacters(0, 0); +} + +PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x, int y) +{ + // FIXME: implement + return 0; +} + +PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker) +{ + // FIXME: implement + return 0; +} + +bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef attribute, AccessibilityTextMarkerRange* range) +{ + // FIXME: implement + return false; +} + +int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker* marker) +{ + // FIXME: implement + return -1; +} + +bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker* textMarker) +{ + // FIXME: implement + return false; +} + +PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForIndex(int textIndex) +{ + // FIXME: implement + return 0; +} + + +} // namespace WTR diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake index e43febd1a..942c003f2 100644 --- a/Tools/WebKitTestRunner/PlatformEfl.cmake +++ b/Tools/WebKitTestRunner/PlatformEfl.cmake @@ -26,6 +26,7 @@ LIST(APPEND WebKitTestRunner_SOURCES LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES ${TOOLS_DIR}/DumpRenderTree/efl/ + ${WEBKIT2_DIR}/UIProcess/API/efl "${WTF_DIR}/wtf/gobject" ${CAIRO_INCLUDE_DIRS} @@ -56,4 +57,4 @@ LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES # structure. See <https://bugs.webkit.org/show_bug.cgi?id=81475>. ADD_DEFINITIONS(-DFONTS_CONF_DIR="${TOOLS_DIR}/DumpRenderTree/gtk/fonts" -DDOWNLOADED_FONTS_DIR="${CMAKE_SOURCE_DIR}/WebKitBuild/Dependencies/Source/webkitgtk-test-fonts-0.0.3" - -DDATA_DIR="${THEME_BINARY_DIR}") + -DTHEME_DIR="${THEME_BINARY_DIR}") diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp index 3c10ac170..c47c47536 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp @@ -324,7 +324,8 @@ void TestController::initialize(int argc, const char* argv[]) }; WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient); - WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory()); + if (testPluginDirectory()) + WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory()); m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get())); diff --git a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp index f17820d91..c3c0863c8 100644 --- a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp +++ b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp @@ -20,6 +20,7 @@ #include "config.h" #include "PlatformWebView.h" +#include "EWebKit2.h" #include "WebKit2/WKAPICast.h" #include <Ecore_Evas.h> @@ -46,6 +47,8 @@ PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup) m_window = initEcoreEvas(); Evas* evas = ecore_evas_get(m_window); m_view = toImpl(WKViewCreate(evas, context, pageGroup)); + + ewk_view_theme_set(m_view, THEME_DIR"/default.edj"); m_windowIsKey = false; } diff --git a/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp b/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp index fbb36508a..87537f682 100644 --- a/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp +++ b/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp @@ -23,6 +23,7 @@ #include <Ecore.h> #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <wtf/Platform.h> #include <wtf/text/WTFString.h> diff --git a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp index 158e8089a..4a4cbec14 100644 --- a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp +++ b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp @@ -104,7 +104,10 @@ void TestController::initializeInjectedBundlePath() void TestController::initializeTestPluginDirectory() { - m_testPluginDirectory = WKStringCreateWithUTF8CString(qgetenv("QTWEBKIT_PLUGIN_PATH").constData()); + // FIXME: the test plugin cause some trouble for us, so we don't load it for the time being. + // See: https://bugs.webkit.org/show_bug.cgi?id=86620 + + // m_testPluginDirectory = WKStringCreateWithUTF8CString(qgetenv("QTWEBKIT_PLUGIN_PATH").constData()); } void TestController::platformInitializeContext() |