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
wtr-atspi-xml-roles.diff (text/plain), 3.54 KB, created by
Carlos Garcia Campos
on 2021-12-23 06:13:41 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2021-12-23 06:13:41 PST
Size:
3.54 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 72ce5c18e71b..490e150370a8 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2021-12-23 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK][a11y] WTR: handle xml-roles attributes to return the right role for landmark with ATSPI >+ https://bugs.webkit.org/show_bug.cgi?id=234638 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp: >+ (WTR::xmlRoleValueString): >+ (WTR::AccessibilityUIElement::role): >+ > 2021-12-23 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][a11y] Expose live region attributes with ATSPI >diff --git a/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp b/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp >index 02e0ccddd5bc..e04c2e8f2e36 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp >@@ -35,6 +35,8 @@ > #include <WebCore/AccessibilityAtspiEnums.h> > #include <WebCore/AccessibilityObjectAtspi.h> > #include <WebKit/WKBundleFrame.h> >+#include <wtf/NeverDestroyed.h> >+#include <wtf/HashSet.h> > #include <wtf/URL.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> >@@ -564,6 +566,52 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames() > return JSStringCreateWithCharacters(nullptr, 0); > } > >+static String xmlRoleValueString(const String& xmlRoles) >+{ >+ static NeverDestroyed<HashSet<String, ASCIICaseInsensitiveHash>> regionRoles = HashSet<String, ASCIICaseInsensitiveHash>({ >+ "doc-acknowledgments", >+ "doc-afterword", >+ "doc-appendix", >+ "doc-bibliography", >+ "doc-chapter", >+ "doc-conclusion", >+ "doc-credits", >+ "doc-endnotes", >+ "doc-epilogue", >+ "doc-errata", >+ "doc-foreword", >+ "doc-glossary", >+ "doc-glossref", >+ "doc-index", >+ "doc-introduction", >+ "doc-pagelist", >+ "doc-part", >+ "doc-preface", >+ "doc-prologue", >+ "doc-toc", >+ "region" >+ }); >+ >+ if (regionRoles->contains(xmlRoles)) >+ return "AXLandmarkRegion"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "banner")) >+ return "AXLandmarkBanner"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "complementary")) >+ return "AXLandmarkComplementary"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "contentinfo")) >+ return "AXLandmarkContentInfo"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "form")) >+ return "AXLandmarkForm"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "main")) >+ return "AXLandmarkMain"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "navigation")) >+ return "AXLandmarkNavigation"_s; >+ if (equalLettersIgnoringASCIICase(xmlRoles, "search")) >+ return "AXLandmarkSearch"_s; >+ >+ return { }; >+} >+ > static String roleValueToString(unsigned roleValue) > { > switch (roleValue) { >@@ -742,7 +790,8 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::role() > m_element->updateBackingStore(); > roleValue = m_element->role(); > }); >- auto roleValueString = roleValueToString(roleValue); >+ >+ auto roleValueString = roleValue == WebCore::Atspi::Role::Landmark ? xmlRoleValueString(m_element->attributes().get("xml-roles")) : roleValueToString(roleValue); > if (roleValueString.isEmpty()) > return JSStringCreateWithCharacters(nullptr, 0); >
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
Flags:
aperez
:
review+
aperez
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 234638
: 447877