Changeset 126243 in webkit
- Timestamp:
- Aug 21, 2012 6:37:04 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126241 r126243 1 2012-08-21 Joanmarie Diggs <jdiggs@igalia.com> 2 3 [Gtk] No accessible caret-moved events found in certain content 4 https://bugs.webkit.org/show_bug.cgi?id=72811 5 6 Reviewed by Chris Fleizach. 7 8 Part of the bug is due to objects which should claim to implement AtkText 9 failed to do so as a result of containing a mixture of inline and block 10 spans. 11 12 An updated unit test was provided. 13 14 * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp: 15 (roleIsTextType): New method to check if a role is one expected to have 16 implemented the AtkText interface. Currently that is defined as: 17 - ParagraphRole 18 - HeadingRole 19 - DivRole 20 - CellRole 21 (getInterfaceMaskFromObject): If a role is one of the text type roles, 22 automatically add WAI_TEXT to the accessible object's interface mask. 23 1 24 2012-08-21 Tony Chang <tony@chromium.org> 2 25 -
trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp
r108463 r126243 816 816 } 817 817 818 static bool roleIsTextType(AccessibilityRole role) 819 { 820 return role == ParagraphRole || role == HeadingRole || role == DivRole || role == CellRole; 821 } 822 818 823 static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject) 819 824 { … … 857 862 if (role != TableRole) { 858 863 interfaceMask |= 1 << WAI_HYPERTEXT; 859 if ( renderer && renderer->childrenInline())864 if ((renderer && renderer->childrenInline()) || roleIsTextType(role)) 860 865 interfaceMask |= 1 << WAI_TEXT; 861 866 } -
trunk/Source/WebKit/gtk/ChangeLog
r126209 r126243 1 2012-08-21 Joanmarie Diggs <jdiggs@igalia.com> 2 [Gtk] No accessible caret-moved events found in certain content 3 https://bugs.webkit.org/show_bug.cgi?id=72811 4 5 Reviewed by Chris Fleizach. 6 7 Part of the bug is due to objects which should claim to implement AtkText 8 failed to do so as a result of containing a mixture of inline and block 9 spans. 10 11 An updated unit test was provided. 12 13 * tests/testatk.c: 14 (testWebkitAtkCaretOffsets): Added instances of objects containing a 15 mixture of inline and block spans and tested that they implement AtkText 16 and contain the right textual contents. 17 1 18 2012-08-21 Kihong Kwon <kihong.kwon@samsung.com> 2 19 -
trunk/Source/WebKit/gtk/tests/testatk.c
r125692 r126243 66 66 static const char* listsOfItems = "<html><body><ul><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ul><ol><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ol></body></html>"; 67 67 68 static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li>< /ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text'' name='foo'' value='foo bar baz' /><table><tr><td>a table cell</td></tr></table></body></html>";68 static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li><li><span style='display:block;'>Block span in a list item</span><span>Inline span in a list item</span></li><li><a href='foo'><span style='display:block;'>Block span in a link in a list item</span><span>Inline span in a link in a list item</span></a></li></ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text' name='foo' value='foo bar baz' /><table><tr><td>a table cell</td><td></td><td><a href='foo'><span style='display:block;'>Block span in a link in a table cell</span><span>Inline span in a link in a table cell</span></a></td><td><span style='display:block;'>Block span in a table cell</span><span>Inline span in a table cell</span></td></tr></table><h4><a href='foo'><span style='display:block;'>Block span in a link in a heading</span><span>Inline span in a link in a heading</span></h4><h4><span style='display:block;'>Block span in a heading</span><span>Inline span in a heading</span></h4></body></html>"; 69 69 70 70 static const char* textForSelections = "<html><body><p>A paragraph with plain text</p><p>A paragraph with <a href='http://webkit.org'>a link</a> in the middle</p><ol><li>A list item</li></ol><select></body></html>"; … … 337 337 g_assert(ATK_OBJECT(list)); 338 338 g_assert(atk_object_get_role(list) == ATK_ROLE_LIST); 339 g_assert_cmpint(atk_object_get_n_accessible_children(list), ==, 1);339 g_assert_cmpint(atk_object_get_n_accessible_children(list), ==, 3); 340 340 341 341 AtkObject* listItem = atk_object_ref_accessible_child(list, 0); … … 345 345 g_free (text); 346 346 347 listItem = atk_object_ref_accessible_child(list, 1); 348 g_assert(ATK_IS_TEXT(listItem)); 349 text = atk_text_get_text(ATK_TEXT(listItem), 0, -1); 350 g_assert_cmpstr(text, ==, "2. Block span in a list item\nInline span in a list item"); 351 g_free (text); 352 353 listItem = atk_object_ref_accessible_child(list, 2); 354 g_assert(ATK_IS_TEXT(listItem)); 355 text = atk_text_get_text(ATK_TEXT(listItem), 0, -1); 356 g_assert_cmpstr(text, ==, "3. Block span in a link in a list item\nInline span in a link in a list item"); 357 g_free (text); 358 347 359 /* It's not possible to place the caret inside an item's marker. */ 348 360 result = atk_text_set_caret_offset(ATK_TEXT(listItem), 1); … … 361 373 AtkObject* comboBox = atk_object_ref_accessible_child(panel, 0); 362 374 g_assert(ATK_IS_OBJECT(comboBox)); 375 g_assert(!ATK_IS_TEXT(comboBox)); 363 376 g_assert(atk_object_get_role(comboBox) == ATK_ROLE_COMBO_BOX); 364 377 365 378 AtkObject* menuPopup = atk_object_ref_accessible_child(comboBox, 0); 366 379 g_assert(ATK_IS_OBJECT(menuPopup)); 380 g_assert(!ATK_IS_TEXT(menuPopup)); 367 381 g_assert(atk_object_get_role(menuPopup) == ATK_ROLE_MENU); 368 382 … … 373 387 text = atk_text_get_text(ATK_TEXT(comboBoxOption), 0, -1); 374 388 g_assert_cmpstr(text, ==, "An option in a combo box"); 389 g_free(text); 375 390 376 391 /* It's not possible to place the caret inside an option for a combobox. */ … … 384 399 text = atk_text_get_text(ATK_TEXT(textEntry), 0, -1); 385 400 g_assert_cmpstr(text, ==, "foo bar baz"); 401 g_free(text); 386 402 387 403 result = atk_text_set_caret_offset(ATK_TEXT(textEntry), 5); … … 392 408 AtkObject* table = atk_object_ref_accessible_child(object, 4); 393 409 g_assert(ATK_IS_OBJECT(table)); 410 g_assert(!ATK_IS_TEXT(table)); 394 411 g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); 395 g_assert_cmpint(atk_object_get_n_accessible_children(table), ==, 1);412 g_assert_cmpint(atk_object_get_n_accessible_children(table), ==, 4); 396 413 397 414 AtkObject* tableCell = atk_object_ref_accessible_child(table, 0); … … 406 423 offset = atk_text_get_caret_offset(ATK_TEXT(tableCell)); 407 424 g_assert_cmpint(offset, ==, 2); 425 426 /* Even empty table cells should implement AtkText, but report an empty string */ 427 tableCell = atk_object_ref_accessible_child(table, 1); 428 g_assert(ATK_IS_TEXT(tableCell)); 429 g_assert(atk_object_get_role(tableCell) == ATK_ROLE_TABLE_CELL); 430 text = atk_text_get_text(ATK_TEXT(tableCell), 0, -1); 431 g_assert_cmpstr(text, ==, ""); 432 g_free(text); 433 434 tableCell = atk_object_ref_accessible_child(table, 2); 435 g_assert(ATK_IS_TEXT(tableCell)); 436 g_assert(atk_object_get_role(tableCell) == ATK_ROLE_TABLE_CELL); 437 text = atk_text_get_text(ATK_TEXT(tableCell), 0, -1); 438 g_assert_cmpstr(text, ==, "Block span in a link in a table cell\nInline span in a link in a table cell"); 439 g_free(text); 440 441 tableCell = atk_object_ref_accessible_child(table, 3); 442 g_assert(ATK_IS_TEXT(tableCell)); 443 g_assert(atk_object_get_role(tableCell) == ATK_ROLE_TABLE_CELL); 444 text = atk_text_get_text(ATK_TEXT(tableCell), 0, -1); 445 g_assert_cmpstr(text, ==, "Block span in a table cell\nInline span in a table cell"); 446 g_free(text); 447 448 header = atk_object_ref_accessible_child(object, 5); 449 g_assert(ATK_IS_TEXT(header)); 450 g_assert(atk_object_get_role(header) == ATK_ROLE_HEADING); 451 text = atk_text_get_text(ATK_TEXT(header), 0, -1); 452 g_assert_cmpstr(text, ==, "Block span in a link in a heading\nInline span in a link in a heading"); 453 g_free(text); 454 455 header = atk_object_ref_accessible_child(object, 6); 456 g_assert(ATK_IS_TEXT(header)); 457 g_assert(atk_object_get_role(header) == ATK_ROLE_HEADING); 458 text = atk_text_get_text(ATK_TEXT(header), 0, -1); 459 g_assert_cmpstr(text, ==, "Block span in a heading\nInline span in a heading"); 460 g_free(text); 408 461 409 462 g_free(textCaretMovedResult);
Note: See TracChangeset
for help on using the changeset viewer.