Changeset 127367 in webkit
- Timestamp:
- Sep 1, 2012 1:43:04 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127365 r127367 1 2012-09-01 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [Gtk] Incorrect/unexpected characters in the text of certain accessibles 4 https://bugs.webkit.org/show_bug.cgi?id=95180 5 6 Reviewed by Chris Fleizach. 7 8 Two new layout tests, plus one updated one. 9 10 * platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt: Indicated replaced objects. 11 * platform/gtk/accessibility/entry-and-password-expected.txt: Added. 12 * platform/gtk/accessibility/entry-and-password.html: Added. 13 * platform/gtk/accessibility/replaced-objects-in-anonymous-blocks-expected.txt: Added. 14 * platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: Added. 15 1 16 2012-09-01 Tommy Widenflycht <tommyw@google.com> 2 17 -
trunk/LayoutTests/platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt
r126941 r127367 15 15 AXRole: document frame 16 16 AXRole: paragraph AXValue: Before 17 AXRole: panel 17 AXRole: panel AXValue: <obj> 18 18 AXRole: scroll pane 19 19 AXRole: document frame 20 AXRole: panel 20 AXRole: panel AXValue: <obj>Click me 21 21 AXRole: push button 22 22 AXRole: paragraph AXValue: After … … 27 27 AXRole: document frame 28 28 AXRole: paragraph AXValue: Before 29 AXRole: panel 29 AXRole: panel AXValue: 30 30 AXRole: paragraph AXValue: After 31 31 AXRole: paragraph AXValue: End of test -
trunk/Source/WebCore/ChangeLog
r127366 r127367 1 2012-09-01 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [Gtk] Incorrect/unexpected characters in the text of certain accessibles 4 https://bugs.webkit.org/show_bug.cgi?id=95180 5 6 Reviewed by Chris Fleizach. 7 8 The bug was caused by failing to properly handle anonymous block text 9 which had object replacement characters (multibyte) in it. Calculating 10 the string length based on the UTF-8 string meant that we were returning 11 more characters than were there and in danger of splitting a multibyte 12 character. 13 14 Tests: platform/gtk/accessibility/entry-and-password.html 15 platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html 16 17 * accessibility/gtk/WebKitAccessibleInterfaceText.cpp: 18 (webkitAccessibleTextGetText): Convert the text returned by textForObject() 19 to Unicode before calculating its length. 20 1 21 2012-09-01 Adam Barth <abarth@webkit.org> 2 22 -
trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp
r126359 r127367 538 538 if (!ret.length()) { 539 539 // This can happen at least with anonymous RenderBlocks (e.g. body text amongst paragraphs) 540 ret = String(textForObject(coreObject)); 540 // In such instances, there may also be embedded objects. The object replacement character 541 // is something ATs want included and we have to account for the fact that it is multibyte. 542 ret = String::fromUTF8(textForObject(coreObject)); 541 543 if (!end) 542 544 end = ret.length(); -
trunk/Source/WebKit/gtk/ChangeLog
r127328 r127367 1 2012-09-01 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [Gtk] Incorrect/unexpected characters in the text of certain accessibles 4 https://bugs.webkit.org/show_bug.cgi?id=95180 5 6 Reviewed by Chris Fleizach. 7 8 Corrected a unit test in which the expected accessible text was wrong as 9 a result of this bug. In particular, the AtkText inserted into an empty 10 text field is expected to be the same text atk_text_get_text() returns. 11 That was not happening -- and presumably not noticed as a result of the 12 hard to read textual representation of the multibyte password field 13 bullets. 14 15 * tests/testatk.c: 16 (testWebkitAtkTextChangedNotifications): Corrected the test and added a 17 comment so that one knows what the multibyte character is. 18 1 19 2012-08-31 José Dapena Paz <jdapena@igalia.com> 2 20 -
trunk/Source/WebKit/gtk/tests/testatk.c
r126243 r127367 1868 1868 1869 1869 pos = 0; 1870 /* A single bullet character is '\342\200\242' */ 1870 1871 atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "foobar", 6, &pos); 1871 1872 g_assert_cmpstr(textChangedResult, ==, "|1|0|6|'\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242'|"); 1872 1873 text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1); 1873 g_assert_cmpstr(text, ==, "\3 03\242\302\200\302\242\303\242\302\200\302\242");1874 g_assert_cmpstr(text, ==, "\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242"); 1874 1875 g_free(text); 1875 1876 … … 1878 1879 1879 1880 text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1); 1880 g_assert_cmpstr(text, ==, "\3 03\242\302\200\302\242\303\242");1881 g_assert_cmpstr(text, ==, "\342\200\242\342\200\242\342\200\242\342\200\242"); 1881 1882 g_free(text); 1882 1883 … … 1886 1887 1887 1888 text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1); 1888 g_assert_cmpstr(text, ==, "\3 03\242\302\200\302\242\303\242\302\200\302\242\303\242");1889 g_assert_cmpstr(text, ==, "\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242"); 1889 1890 g_free(text); 1890 1891 -
trunk/Tools/ChangeLog
r127365 r127367 1 2012-09-01 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [Gtk] Incorrect/unexpected characters in the text of certain accessibles 4 https://bugs.webkit.org/show_bug.cgi?id=95180 5 6 Reviewed by Chris Fleizach. 7 8 The bug that was fixed stood in the way of fully implementing stringValue(). 9 Testing that the bug is fixed requires stringValue() to be fully implemented 10 and object replacement characters to be printable. 11 12 * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: 13 (replaceCharactersForResults): New method which turns object replacement 14 characters into "<obj>" so that the characters can be properly shown in 15 Layout Test results. Also turns "\n" into "<\\n>" so that printing the 16 accessible text of a single object in the accessible tree doesn't mess up 17 the readibility of the results. 18 (AccessibilityUIElement::stringValue): Remove the code that immediately 19 returned upon encountering an object of ATK_ROLE_PANEL and call the new 20 replaceCharactersForResults() prior to returning the accessible string 21 value. 22 1 23 2012-09-01 Tommy Widenflycht <tommyw@google.com> 2 24 -
trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
r126941 r127367 35 35 #include <wtf/gobject/GOwnPtr.h> 36 36 #include <wtf/gobject/GRefPtr.h> 37 #include <wtf/text/WTFString.h> 38 #include <wtf/unicode/CharacterNames.h> 39 40 static inline gchar* replaceCharactersForResults(gchar* str) 41 { 42 String uString = String::fromUTF8(str); 43 44 // The object replacement character is passed along to ATs so we need to be 45 // able to test for their presence and do so without causing test failures. 46 uString.replace(objectReplacementCharacter, "<obj>"); 47 48 // The presence of newline characters in accessible text of a single object 49 // is appropriate, but it makes test results (especially the accessible tree) 50 // harder to read. 51 uString.replace("\n", "<\\n>"); 52 53 return g_strdup(uString.utf8().data()); 54 } 37 55 38 56 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element) … … 275 293 return JSStringCreateWithCharacters(0, 0); 276 294 277 // FIXME: implement properly for ATK_ROLE_PANEL. Prior to doing so, we need 278 // to fix bug 95180 as well as determine which panels we wish to keep in the 279 // accessible hierarchy. See, for instance, bug 72811. 280 AtkRole role = atk_object_get_role(ATK_OBJECT(m_element)); 281 if (role == ATK_ROLE_PANEL) 282 return JSStringCreateWithCharacters(0, 0); 283 284 gchar* text =text = atk_text_get_text(ATK_TEXT(m_element), 0, -1); 285 GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", text)); 295 gchar* text = atk_text_get_text(ATK_TEXT(m_element), 0, -1); 296 GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", replaceCharactersForResults(text))); 286 297 g_free(text); 287 298
Note: See TracChangeset
for help on using the changeset viewer.