Title: [202088] trunk
Revision
202088
Author
pvol...@apple.com
Date
2016-06-15 02:55:18 -0700 (Wed, 15 Jun 2016)

Log Message

[Win] The test accessibility/selected-text-range-aria-elements.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=158732

Reviewed by Brent Fulgham.

Source/WebCore:

Implement support for getting selected text range.

* accessibility/win/AccessibilityObjectWrapperWin.cpp:
(WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):

Tools:

Implement selectedTextRange() method.

* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::selectedTextRange):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202087 => 202088)


--- trunk/Source/WebCore/ChangeLog	2016-06-15 09:36:22 UTC (rev 202087)
+++ trunk/Source/WebCore/ChangeLog	2016-06-15 09:55:18 UTC (rev 202088)
@@ -1,3 +1,15 @@
+2016-06-15  Per Arne Vollan  <pvol...@apple.com>
+
+        [Win] The test accessibility/selected-text-range-aria-elements.html is failing.
+        https://bugs.webkit.org/show_bug.cgi?id=158732
+
+        Reviewed by Brent Fulgham.
+
+        Implement support for getting selected text range.
+
+        * accessibility/win/AccessibilityObjectWrapperWin.cpp:
+        (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
+
 2016-06-14  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Addressing post-review comments after r201971

Modified: trunk/Source/WebCore/accessibility/win/AccessibilityObjectWrapperWin.cpp (202087 => 202088)


--- trunk/Source/WebCore/accessibility/win/AccessibilityObjectWrapperWin.cpp	2016-06-15 09:36:22 UTC (rev 202087)
+++ trunk/Source/WebCore/accessibility/win/AccessibilityObjectWrapperWin.cpp	2016-06-15 09:55:18 UTC (rev 202088)
@@ -65,6 +65,15 @@
         V_BSTR(result) = WebCore::BString(m_object->getAttribute(WebCore::HTMLNames::idAttr)).release();
         return;
     }
+
+    if (attributeName == "AXSelectedTextRangeAttribute") {
+        ASSERT(V_VT(result) == VT_EMPTY);
+        V_VT(result) = VT_BSTR;
+        PlainTextRange textRange = m_object->selectedTextRange();
+        String range = String::format("{%u, %u}", textRange.start, textRange.length);
+        V_BSTR(result) = WebCore::BString(range).release();
+        return;
+    }
 }
 
 

Modified: trunk/Tools/ChangeLog (202087 => 202088)


--- trunk/Tools/ChangeLog	2016-06-15 09:36:22 UTC (rev 202087)
+++ trunk/Tools/ChangeLog	2016-06-15 09:55:18 UTC (rev 202088)
@@ -1,5 +1,17 @@
 2016-06-15  Per Arne Vollan  <pvol...@apple.com>
 
+        [Win] The test accessibility/selected-text-range-aria-elements.html is failing.
+        https://bugs.webkit.org/show_bug.cgi?id=158732
+
+        Reviewed by Brent Fulgham.
+
+        Implement selectedTextRange() method.
+
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::selectedTextRange):
+
+2016-06-15  Per Arne Vollan  <pvol...@apple.com>
+
         [Win] MiniBrowser is not DPI aware.
         https://bugs.webkit.org/show_bug.cgi?id=158733
 

Modified: trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (202087 => 202088)


--- trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp	2016-06-15 09:36:22 UTC (rev 202087)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp	2016-06-15 09:55:18 UTC (rev 202088)
@@ -686,7 +686,16 @@
 
 JSStringRef AccessibilityUIElement::selectedTextRange()
 {
-    return JSStringCreateWithCharacters(0, 0);    
+    COMPtr<IAccessibleComparable> comparable = comparableObject(platformUIElement().get());
+    if (!comparable)
+        return JSStringCreateWithCharacters(0, 0);
+
+    _variant_t value;
+    if (FAILED(comparable->get_attribute(_bstr_t(L"AXSelectedTextRangeAttribute"), &value.GetVARIANT())))
+        return JSStringCreateWithCharacters(0, 0);    
+
+    ASSERT(V_VT(&value) == VT_BSTR);
+    return JSStringCreateWithBSTR(value.bstrVal);
 }
 
 void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to