summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/accessibility
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-06-29 13:58:03 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2009-06-29 13:58:03 +0200
commit107b7d767d99104aac9d236b3dc872663a236cd4 (patch)
treed7a0d11234e71ab013e40c83bed84b994f69936c /src/3rdparty/webkit/WebCore/accessibility
parent1df2292eaa543f7f25e37b7f14d63f6e70394c56 (diff)
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit-4.6-snapshot-29062009 ( 22aadba1b4356ad7d8e9446b95baccb6b2c037b0 )
Changes in WebKit/qt since the last update: 2009-06-29 Simon Hausmann <simon.hausmann@nokia.com> Fix the Qt build, add missing isSpeaking() implementation to ContextMenuClient. * WebCoreSupport/ContextMenuClientQt.cpp: (WebCore::ContextMenuClientQt::isSpeaking): * WebCoreSupport/ContextMenuClientQt.h: 2009-06-28 Sriram Yadavalli <sriram.yadavalli@nokia.com> Reviewed by Eric Seidel. [Qt] Fix build break for Qt https://bugs.webkit.org/show_bug.cgi?id=26779 * Api/qwebpage.cpp: (QWebPage::swallowContextMenuEvent): 2009-06-27 Simon Hausmann <simon.hausmann@nokia.com> Build fix for Qt under Windows. * Api/qwebhistory.h: Use consistent export linkage for the datastream operators. 2009-06-26 Brian Weinstein <bweinstein@apple.com> Reviewed by Simon Fraser. Changed call of scrollbarUnderMouse to scrollbarUnderPoint to match new API. * Api/qwebpage.cpp: (QWebPage::swallowContextMenuEvent): 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Simon Hausmann. Add support for saving and loading of QWebHistory to and from a QByteArray. This includes streaming operators for QWebHistory. for convenience. New autotests that test QWebHistory and QWebHistoryItem serialization. * Api/qwebhistory.cpp: (QWebHistory::restoreState): (QWebHistory::saveState): (operator<<): (operator>>): * Api/qwebhistory.h: * Api/qwebhistory_p.h: * tests/qwebhistory/tst_qwebhistory.cpp: (tst_QWebHistory::): (tst_QWebHistory::init): (tst_QWebHistory::title): (tst_QWebHistory::count): (tst_QWebHistory::back): (tst_QWebHistory::forward): (tst_QWebHistory::itemAt): (tst_QWebHistory::goToItem): (tst_QWebHistory::items): (tst_QWebHistory::serialize_1): (tst_QWebHistory::serialize_2): (tst_QWebHistory::serialize_3): (tst_QWebHistory::saveAndRestore_1): (tst_QWebHistory::saveAndRestore_2): (tst_QWebHistory::saveAndRestore_3): 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Simon Hausmann. Fix the behaviour of QWebHistory::itemAt to interpret the specified index as absolute index. Returns an invalid QWebHistoryItem if the index is out of range. * Api/qwebhistory.cpp: (QWebHistory::itemAt): * tests/qwebhistory/tst_qwebhistory.cpp: (tst_QWebHistory::itemAt): 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Simon Hausmann. Added a few autotest to QWebHistory. * tests/qwebhistory/data/page1.html: Added. * tests/qwebhistory/data/page2.html: Added. * tests/qwebhistory/data/page3.html: Added. * tests/qwebhistory/data/page4.html: Added. * tests/qwebhistory/data/page5.html: Added. * tests/qwebhistory/data/page6.html: Added. * tests/qwebhistory/qwebhistory.pro: Added. * tests/qwebhistory/tst_qwebhistory.cpp: Added. (tst_QWebHistory::): (tst_QWebHistory::tst_QWebHistory): (tst_QWebHistory::~tst_QWebHistory): (tst_QWebHistory::init): (tst_QWebHistory::cleanup): (tst_QWebHistory::title): (tst_QWebHistory::count): (tst_QWebHistory::back): (tst_QWebHistory::forward): (tst_QWebHistory::goToItem): (tst_QWebHistory::items): * tests/qwebhistory/tst_qwebhistory.qrc: Added. * tests/tests.pro: 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Simon Hausmann. Fix support for documenting functions prefixed with QWEBKIT_EXPORT Add QWEBKIT_EXPORT to the list of macros to ignore by qdoc. * docs/qtwebkit.qdocconf: 2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com> Reviewed by Eric Seidel. Bug 20303: [Qt] Key events are not working in frames. Send scrolling events to current focused frame, bubble the event up to parent frame if it is not handled. Use EventHandler's new shared scrolling code. * Api/qwebpage.cpp: (QWebPagePrivate::keyPressEvent): (QWebPagePrivate::handleScrolling): * Api/qwebpage_p.h: 2009-06-25 Jakub Wieczorek <faw217@gmail.com> Reviewed by Adam Treat. Add highlight functionality to the QWebPage::findText() method. Introduced is new HighlightAllOccurrences flag which passed to the function will make it mark all existing occurrences of specified string in the page. * Api/qwebpage.cpp: (QWebPage::findText): * Api/qwebpage.h: * Api/qwebview.cpp:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/accessibility')
-rw-r--r--src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.cpp17
-rw-r--r--src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.h3
-rw-r--r--src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.cpp54
-rw-r--r--src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.h2
4 files changed, 70 insertions, 6 deletions
diff --git a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.cpp b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.cpp
index dccff8220b..a6cd62d95f 100644
--- a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.cpp
+++ b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.cpp
@@ -298,7 +298,22 @@ bool AccessibilityObject::press() const
actionElem->accessKeyAction(true);
return true;
}
-
+
+String AccessibilityObject::language() const
+{
+ AccessibilityObject* parent = parentObject();
+
+ // as a last resort, fall back to the content language specified in the meta tag
+ if (!parent) {
+ Document* doc = document();
+ if (doc)
+ return doc->contentLanguage();
+ return String();
+ }
+
+ return parent->language();
+}
+
AXObjectCache* AccessibilityObject::axObjectCache() const
{
return 0;
diff --git a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.h b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.h
index f71be99ba6..8939092762 100644
--- a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.h
+++ b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityObject.h
@@ -311,7 +311,8 @@ public:
virtual Document* document() const { return 0; }
virtual FrameView* topDocumentFrameView() const { return 0; }
virtual FrameView* documentFrameView() const;
-
+ virtual String language() const;
+
void setAXObjectID(unsigned);
virtual void setFocused(bool);
virtual void setSelectedText(const String&);
diff --git a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.cpp b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.cpp
index be16195fc4..7d4cb39536 100644
--- a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -656,6 +656,25 @@ String AccessibilityRenderObject::helpText() const
return String();
}
+
+String AccessibilityRenderObject::language() const
+{
+ if (!m_renderer)
+ return String();
+
+ // Defer to parent if this element doesn't have a language set
+ Node* node = m_renderer->node();
+ if (!node)
+ return AccessibilityObject::language();
+
+ if (!node->isElementNode())
+ return AccessibilityObject::language();
+
+ String language = static_cast<Element*>(node)->getAttribute(langAttr);
+ if (language.isEmpty())
+ return AccessibilityObject::language();
+ return language;
+}
String AccessibilityRenderObject::textUnderElement() const
{
@@ -1167,12 +1186,31 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
return 0;
}
+bool AccessibilityRenderObject::ariaIsHidden() const
+{
+ if (equalIgnoringCase(getAttribute(aria_hiddenAttr).string(), "true"))
+ return true;
+
+ // aria-hidden hides this object and any children
+ AccessibilityObject* object = parentObject();
+ while (object) {
+ if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_cast<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr).string(), "true"))
+ return true;
+ object = object->parentObject();
+ }
+
+ return false;
+}
+
bool AccessibilityRenderObject::accessibilityIsIgnored() const
{
// ignore invisible element
if (!m_renderer || m_renderer->style()->visibility() != VISIBLE)
return true;
+ if (ariaIsHidden())
+ return true;
+
if (isPresentationalChildOfAriaRole())
return true;
@@ -1512,6 +1550,10 @@ void AccessibilityRenderObject::setValue(const String& string)
bool AccessibilityRenderObject::isEnabled() const
{
ASSERT(m_renderer);
+
+ if (equalIgnoringCase(getAttribute(aria_disabledAttr).string(), "true"))
+ return false;
+
Node* node = m_renderer->node();
if (!node || !node->isElementNode())
return true;
@@ -2112,12 +2154,13 @@ AccessibilityObject* AccessibilityRenderObject::observableObject() const
typedef HashMap<String, AccessibilityRole, CaseFoldingHash> ARIARoleMap;
-struct RoleEntry {
- String ariaRole;
- AccessibilityRole webcoreRole;
-};
static const ARIARoleMap& createARIARoleMap()
{
+ struct RoleEntry {
+ String ariaRole;
+ AccessibilityRole webcoreRole;
+ };
+
const RoleEntry roles[] = {
{ "button", ButtonRole },
{ "checkbox", CheckBoxRole },
@@ -2322,6 +2365,9 @@ bool AccessibilityRenderObject::canSetFocusAttribute() const
bool AccessibilityRenderObject::canSetValueAttribute() const
{
+ if (equalIgnoringCase(getAttribute(aria_readonlyAttr).string(), "true"))
+ return false;
+
if (isWebArea())
return !isReadOnly();
diff --git a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.h b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.h
index 3fa88a2c7b..4fa325f137 100644
--- a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityRenderObject.h
@@ -177,6 +177,7 @@ public:
virtual Widget* widgetForAttachmentView() const;
virtual void getDocumentLinks(AccessibilityChildrenVector&);
virtual FrameView* documentFrameView() const;
+ virtual String language() const;
virtual const AccessibilityChildrenVector& children();
@@ -226,6 +227,7 @@ protected:
private:
void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
void ariaListboxVisibleChildren(AccessibilityChildrenVector&);
+ bool ariaIsHidden() const;
Element* menuElementForMenuButton() const;
Element* menuItemElementForMenu() const;