WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
a11y-aria-describedby.patch (text/plain), 12.08 KB, created by
Krzysztof Czech
on 2014-01-20 02:48:50 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Krzysztof Czech
Created:
2014-01-20 02:48:50 PST
Size:
12.08 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e8ca868..e610078 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2014-01-20 Krzysztof Czech <k.czech@samsung.com> >+ >+ [ATK] Expose aria-describedby with ATK_RELATION_DESCRIBED_BY >+ https://bugs.webkit.org/show_bug.cgi?id=121684 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Slightly modified test so that it could test aria-describedby with multiple id references. >+ >+ * accessibility/aria-describedby-on-input-expected.txt: >+ * accessibility/aria-describedby-on-input.html: >+ * platform/efl/TestExpectations: >+ * platform/gtk/TestExpectations: >+ > 2014-01-20 Morten Stenshorne <mstensho@opera.com> > > Region based multicol: tall line causes taller multicol container than necessary >diff --git a/LayoutTests/accessibility/aria-describedby-on-input-expected.txt b/LayoutTests/accessibility/aria-describedby-on-input-expected.txt >index 136d469..c72e146 100644 >--- a/LayoutTests/accessibility/aria-describedby-on-input-expected.txt >+++ b/LayoutTests/accessibility/aria-describedby-on-input-expected.txt >@@ -1,4 +1,5 @@ > This computer will self-destruct in minutes. >-Allows you to specify the number of minutes after which the computer will self-destruct. >+Allows you to specify the number of minutes after >+which the computer will self-destruct. > > The accessibility description is "AXHelp: Allows you to specify the number of minutes after which the computer will self-destruct." >diff --git a/LayoutTests/accessibility/aria-describedby-on-input.html b/LayoutTests/accessibility/aria-describedby-on-input.html >index f6d3279..97fd94a 100644 >--- a/LayoutTests/accessibility/aria-describedby-on-input.html >+++ b/LayoutTests/accessibility/aria-describedby-on-input.html >@@ -5,9 +5,10 @@ > </script> > <body> > <span id="message">This computer will self-destruct in</span> >- <input id="time" type="text" value="10" aria-describedby="description"/> >+ <input id="time" type="text" value="10" aria-describedby="description1 description2"/> > <span id="unit"> minutes.</span> >- <div id="description">Allows you to specify the number of minutes after which the computer will self-destruct.</div> >+ <div id="description1">Allows you to specify the number of minutes after</div> >+ <div id="description2">which the computer will self-destruct.</div> > <div id="result"></div> > > <script> >diff --git a/LayoutTests/platform/efl/TestExpectations b/LayoutTests/platform/efl/TestExpectations >index 8c58639..3769817 100644 >--- a/LayoutTests/platform/efl/TestExpectations >+++ b/LayoutTests/platform/efl/TestExpectations >@@ -1445,7 +1445,6 @@ webkit.org/b/106316 accessibility/render-counter-text.html [ Failure ] > # New accessibility test added in r149155 is failing. Has been moved to the mac port in r155603. > webkit.org/b/115659 accessibility/meter-element.html [ Missing ] > >-webkit.org/b/121684 accessibility/aria-describedby-on-input.html [ Failure ] > webkit.org/b/121593 accessibility/radio-button-title-label.html [ Failure ] > > # Newly added test at r139111 is failing. >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index 5910361..e0c2887 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -939,7 +939,6 @@ webkit.org/b/73766 css3/unicode-bidi-isolate-aharon-failing.html [ ImageOnlyFail > > webkit.org/b/79757 fast/selectors/selection-window-inactive.html [ ImageOnlyFailure ] > >-webkit.org/b/121684 accessibility/aria-describedby-on-input.html [ Failure ] > webkit.org/b/98357 accessibility/aria-readonly.html [ Failure ] > webkit.org/b/98359 accessibility/aria-text-role.html [ Failure ] > webkit.org/b/98363 accessibility/canvas-fallback-content-2.html [ Failure ] >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5fde81e..22d8502 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2014-01-20 Krzysztof Czech <k.czech@samsung.com> >+ >+ [ATK] Expose aria-describedby with ATK_RELATION_DESCRIBED_BY >+ https://bugs.webkit.org/show_bug.cgi?id=121684 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests. Covered by existing one. >+ >+ Exposed aria-describedby by ATK_RELATION_DESCRIBED_BY. >+ Change elementsFromAttribute method to virtual one so that it could be visible from AccessibilityRenderObject. >+ >+ * accessibility/AccessibilityNodeObject.h: >+ * accessibility/AccessibilityObject.h: >+ (WebCore::AccessibilityObject::elementsFromAttribute): >+ * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: >+ (setAtkRelationSetFromCoreObject): >+ > 2014-01-20 Morten Stenshorne <mstensho@opera.com> > > Region based multicol: tall line causes taller multicol container than necessary >diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.h b/Source/WebCore/accessibility/AccessibilityNodeObject.h >index adab3be..bf05d17 100644 >--- a/Source/WebCore/accessibility/AccessibilityNodeObject.h >+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.h >@@ -182,7 +182,7 @@ protected: > String ariaAccessibilityDescription() const; > void ariaLabeledByElements(Vector<Element*>& elements) const; > String accessibilityDescriptionForElements(Vector<Element*> &elements) const; >- void elementsFromAttribute(Vector<Element*>& elements, const QualifiedName&) const; >+ virtual void elementsFromAttribute(Vector<Element*>& elements, const QualifiedName&) const override; > virtual LayoutRect boundingBoxRect() const override; > virtual String ariaDescribedByAttribute() const override; > >diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h >index 761df3d..a383f3e 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.h >+++ b/Source/WebCore/accessibility/AccessibilityObject.h >@@ -627,6 +627,8 @@ public: > virtual String ariaDescribedByAttribute() const { return String(); } > const AtomicString& placeholderValue() const; > >+ virtual void elementsFromAttribute(Vector<Element*>&, const QualifiedName&) const { } >+ > // Only if isColorWell() > virtual void colorValue(int& r, int& g, int& b) const { r = 0; g = 0; b = 0; } > >diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp >index 305e233..bda3ab2 100644 >--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp >+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp >@@ -231,6 +231,17 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk > removeAtkRelationByType(relationSet, ATK_RELATION_LABELLED_BY); > atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper()); > } >+ // Checking also the aria-describedby which provides an additional information for the user . >+ removeAtkRelationByType(relationSet, ATK_RELATION_DESCRIBED_BY); >+ Vector<Element*> describedByAttributes; >+ coreObject->elementsFromAttribute(describedByAttributes, HTMLNames::aria_describedbyAttr); >+ for (Element* element : describedByAttributes) { >+ AccessibilityObject* axObject = coreObject->document()->axObjectCache()->getOrCreate(element); >+ if (!axObject) >+ continue; >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIBED_BY, axObject->wrapper()); >+ } >+ > } else { > AccessibilityObject* control = coreObject->correspondingControlForLabelElement(); > if (control) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 65fcd3e..79edff8 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2014-01-20 Krzysztof Czech <k.czech@samsung.com> >+ >+ [ATK] Expose aria-describedby with ATK_RELATION_DESCRIBED_BY >+ https://bugs.webkit.org/show_bug.cgi?id=121684 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implementing helpText by using relation ATK_RELATION_DESCRIBED_BY. >+ >+ * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp: >+ (AccessibilityUIElement::helpText): >+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: >+ (WTR::AccessibilityUIElement::helpText): >+ > 2014-01-19 Ryuan Choi <ryuan.choi@samsung.com> > > [EFL][WK1] Remove and refactor the APIs which use single and base keyword >diff --git a/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp b/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp >index fb51025..b84357c 100644 >--- a/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp >+++ b/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp >@@ -803,10 +803,34 @@ JSStringRef AccessibilityUIElement::language() > > JSStringRef AccessibilityUIElement::helpText() const > { >- // FIXME: We need to provide a proper implementation for this that does >- // not depend on Mac specific concepts such as ATK_RELATION_DESCRIBED_BY, >- // once it's implemented (see http://webkit.org/b/121684). >- return JSStringCreateWithCharacters(0, 0); >+ if (!ATK_IS_OBJECT(m_element)) >+ return JSStringCreateWithCharacters(0, 0); >+ >+ AtkRelationSet* set = atk_object_ref_relation_set(ATK_OBJECT(m_element)); >+ if (!set) >+ return nullptr; >+ >+ StringBuilder builder; >+ builder.append("AXHelp: "); >+ >+ int count = atk_relation_set_get_n_relations(set); >+ for (int i = 0; i < count; i++) { >+ AtkRelation* relation = atk_relation_set_get_relation(set, i); >+ if (atk_relation_get_relation_type(relation) == ATK_RELATION_DESCRIBED_BY) { >+ GPtrArray* targetList = atk_relation_get_target(relation); >+ for (int targetCount = 0; targetCount < targetList->len; targetCount++) { >+ AtkObject* target = static_cast<AtkObject*>(g_ptr_array_index(targetList, targetCount)); >+ GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(target), 0, -1)); >+ if (targetCount) >+ builder.append(" "); >+ builder.append(text.get()); >+ } >+ } >+ } >+ >+ g_object_unref(set); >+ >+ return JSStringCreateWithUTF8CString(builder.toString().utf8().data()); > } > > double AccessibilityUIElement::x() >diff --git a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp >index 85e2726..6d6f502 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp >@@ -943,10 +943,34 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::language() > > JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const > { >- // FIXME: We need to provide a proper implementation for this that does >- // not depend on Mac specific concepts such as ATK_RELATION_DESCRIBED_BY, >- // once it's implemented (see http://webkit.org/b/121684). >- return JSStringCreateWithCharacters(0, 0); >+ if (!ATK_IS_OBJECT(m_element.get())) >+ return JSStringCreateWithCharacters(0, 0); >+ >+ AtkRelationSet* set = atk_object_ref_relation_set(ATK_OBJECT(m_element.get())); >+ if (!set) >+ return nullptr; >+ >+ StringBuilder builder; >+ builder.append("AXHelp: "); >+ >+ int count = atk_relation_set_get_n_relations(set); >+ for (int i = 0; i < count; i++) { >+ AtkRelation* relation = atk_relation_set_get_relation(set, i); >+ if (atk_relation_get_relation_type(relation) == ATK_RELATION_DESCRIBED_BY) { >+ GPtrArray* targetList = atk_relation_get_target(relation); >+ for (int targetCount = 0; targetCount < targetList->len; targetCount++) { >+ AtkObject* target = static_cast<AtkObject*>(g_ptr_array_index(targetList, targetCount)); >+ GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(target), 0, -1)); >+ if (targetCount) >+ builder.append(" "); >+ builder.append(text.get()); >+ } >+ } >+ } >+ >+ g_object_unref(set); >+ >+ return JSStringCreateWithUTF8CString(builder.toString().utf8().data()); > } > > double AccessibilityUIElement::x()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 121684
:
221468
|
221640
|
221642
|
221655
|
221979
|
221982
|
221984
|
222564
|
222565