[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
jhoneycutt at apple.com
jhoneycutt at apple.com
Thu Dec 3 13:23:50 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 4729875730f3ae023f97603e4da9bbdadcca0fa6
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 30 21:37:44 2009 +0000
MSAA: Accessibility of links is wrong
https://bugs.webkit.org/show_bug.cgi?id=30928
Reviewed by Darin Adler.
WebCore:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::stringValueForMSAA):
Return the URL.
(WebCore::AccessibilityImageMapLink::nameForMSAA):
Return the alt text.
* accessibility/AccessibilityImageMapLink.h:
(WebCore::AccessibilityImageMapLink::isLinked):
Return true.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isLinked):
(WebCore::AccessibilityObject::stringValueForMSAA):
(WebCore::AccessibilityObject::nameForMSAA):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::isLinkable):
Return true if the element is considered "linkable" with respect to
accessibility.
(WebCore::AccessibilityRenderObject::stringValueForMSAA):
If the element is linkable, check whether it has a parent anchor
element. If so, return the anchor element's href.
(WebCore::AccessibilityRenderObject::isLinked):
Return true if the element is linkable and if it's parent anchor tag's
href is non-empty.
(WebCore::AccessibilityRenderObject::nameForMSAA):
For text nodes, return the text.
* accessibility/AccessibilityRenderObject.h:
WebKit/win:
* AccessibleBase.cpp:
(AccessibleBase::get_accState):
Check whether the element is linked, instead of whether the node is an
anchor, so the child "linkable" elements of anchor elements will also
be "linked".
(AccessibleBase::name):
Return the name for MSAA.
(AccessibleBase::value):
Return the string value for MSAA.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dc0a47f..5de4cde 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,41 @@
+2009-10-29 Jon Honeycutt <jhoneycutt at apple.com>
+
+ MSAA: Accessibility of links is wrong
+
+ https://bugs.webkit.org/show_bug.cgi?id=30928
+
+ Reviewed by Darin Adler.
+
+ * accessibility/AccessibilityImageMapLink.cpp:
+ (WebCore::AccessibilityImageMapLink::stringValueForMSAA):
+ Return the URL.
+ (WebCore::AccessibilityImageMapLink::nameForMSAA):
+ Return the alt text.
+
+ * accessibility/AccessibilityImageMapLink.h:
+ (WebCore::AccessibilityImageMapLink::isLinked):
+ Return true.
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isLinked):
+ (WebCore::AccessibilityObject::stringValueForMSAA):
+ (WebCore::AccessibilityObject::nameForMSAA):
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::isLinkable):
+ Return true if the element is considered "linkable" with respect to
+ accessibility.
+ (WebCore::AccessibilityRenderObject::stringValueForMSAA):
+ If the element is linkable, check whether it has a parent anchor
+ element. If so, return the anchor element's href.
+ (WebCore::AccessibilityRenderObject::isLinked):
+ Return true if the element is linkable and if it's parent anchor tag's
+ href is non-empty.
+ (WebCore::AccessibilityRenderObject::nameForMSAA):
+ For text nodes, return the text.
+
+ * accessibility/AccessibilityRenderObject.h:
+
2009-10-30 Evan Stade <estade at chromium.org>
Reviewed by David Levin.
diff --git a/WebCore/accessibility/AccessibilityImageMapLink.cpp b/WebCore/accessibility/AccessibilityImageMapLink.cpp
index 943122e..31ab0c0 100644
--- a/WebCore/accessibility/AccessibilityImageMapLink.cpp
+++ b/WebCore/accessibility/AccessibilityImageMapLink.cpp
@@ -134,5 +134,15 @@ IntSize AccessibilityImageMapLink::size() const
{
return elementRect().size();
}
-
+
+String AccessibilityImageMapLink::stringValueForMSAA() const
+{
+ return url();
+}
+
+String AccessibilityImageMapLink::nameForMSAA() const
+{
+ return accessibilityDescription();
+}
+
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityImageMapLink.h b/WebCore/accessibility/AccessibilityImageMapLink.h
index 2c27e46..27ceba2 100644
--- a/WebCore/accessibility/AccessibilityImageMapLink.h
+++ b/WebCore/accessibility/AccessibilityImageMapLink.h
@@ -56,9 +56,13 @@ public:
virtual Element* actionElement() const;
virtual KURL url() const;
virtual bool isLink() const { return true; }
+ virtual bool isLinked() const { return true; }
virtual String title() const;
virtual String accessibilityDescription() const;
-
+
+ virtual String stringValueForMSAA() const;
+ virtual String nameForMSAA() const;
+
virtual IntSize size() const;
virtual IntRect elementRect() const;
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 8fc40e8..68c6cb8 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -284,6 +284,7 @@ public:
virtual bool isReadOnly() const { return false; };
virtual bool isVisited() const { return false; };
virtual bool isRequired() const { return false; };
+ virtual bool isLinked() const { return false; }
virtual bool canSetFocusAttribute() const { return false; };
virtual bool canSetTextRangeAttributes() const { return false; };
@@ -446,6 +447,9 @@ public:
unsigned doAXLineForIndex(unsigned);
+ virtual String stringValueForMSAA() const { return String(); }
+ virtual String nameForMSAA() const { return String(); }
+
#if HAVE(ACCESSIBILITY)
#if PLATFORM(GTK)
AccessibilityObjectWrapper* wrapper() const;
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 4c50b9a..013757f 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -2711,4 +2711,45 @@ void AccessibilityRenderObject::updateBackingStore()
m_renderer->document()->updateLayoutIgnorePendingStylesheets();
}
+static bool isLinkable(const AccessibilityRenderObject& object)
+{
+ if (!object.renderer())
+ return false;
+
+ // See https://wiki.mozilla.org/Accessibility/AT-Windows-API for the elements
+ // Mozilla considers linkable.
+ return object.isLink() || object.isImage() || object.renderer()->isText();
+}
+
+String AccessibilityRenderObject::stringValueForMSAA() const
+{
+ if (isLinkable(*this)) {
+ Element* anchor = anchorElement();
+ if (anchor && anchor->hasTagName(aTag))
+ return static_cast<HTMLAnchorElement*>(anchor)->href();
+ }
+
+ return stringValue();
+}
+
+bool AccessibilityRenderObject::isLinked() const
+{
+ if (!isLinkable(*this))
+ return false;
+
+ Element* anchor = anchorElement();
+ if (!anchor || !anchor->hasTagName(aTag))
+ return false;
+
+ return !static_cast<HTMLAnchorElement*>(anchor)->href().isEmpty();
+}
+
+String AccessibilityRenderObject::nameForMSAA() const
+{
+ if (m_renderer && m_renderer->isText())
+ return textUnderElement();
+
+ return title();
+}
+
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index c6fd748..693a23a 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -102,6 +102,7 @@ public:
virtual bool isReadOnly() const;
virtual bool isVisited() const;
virtual bool isRequired() const;
+ virtual bool isLinked() const;
const AtomicString& getAttribute(const QualifiedName&) const;
virtual bool canSetFocusAttribute() const;
@@ -224,7 +225,10 @@ public:
virtual IntRect doAXBoundsForRange(const PlainTextRange&) const;
virtual void updateBackingStore();
-
+
+ virtual String stringValueForMSAA() const;
+ virtual String nameForMSAA() const;
+
protected:
RenderObject* m_renderer;
AccessibilityRole m_ariaRole;
diff --git a/WebKit/win/AccessibleBase.cpp b/WebKit/win/AccessibleBase.cpp
index 55cbab3..4e4e6da 100644
--- a/WebKit/win/AccessibleBase.cpp
+++ b/WebKit/win/AccessibleBase.cpp
@@ -232,7 +232,7 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::get_accState(VARIANT vChild, VARIANT*
pvState->vt = VT_I4;
pvState->lVal = 0;
- if (childObj->isAnchor())
+ if (childObj->isLinked())
pvState->lVal |= STATE_SYSTEM_LINKED;
if (childObj->isHovered())
@@ -514,12 +514,12 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::accDoDefaultAction(VARIANT vChild)
// AccessibleBase
String AccessibleBase::name() const
{
- return m_object->title();
+ return m_object->nameForMSAA();
}
String AccessibleBase::value() const
{
- return m_object->stringValue();
+ return m_object->stringValueForMSAA();
}
String AccessibleBase::description() const
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index fc1d868..2412de0 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-29 Jon Honeycutt <jhoneycutt at apple.com>
+
+ MSAA: Accessibility of links is wrong
+
+ https://bugs.webkit.org/show_bug.cgi?id=30928
+
+ Reviewed by Darin Adler.
+
+ * AccessibleBase.cpp:
+ (AccessibleBase::get_accState):
+ Check whether the element is linked, instead of whether the node is an
+ anchor, so the child "linkable" elements of anchor elements will also
+ be "linked".
+ (AccessibleBase::name):
+ Return the name for MSAA.
+ (AccessibleBase::value):
+ Return the string value for MSAA.
+
2009-10-30 Evan Stade <estade at chromium.org>
Reviewed by David Levin.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list