Changeset 52890 in webkit
- Timestamp:
- Jan 6, 2010 6:05:01 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52889 r52890 1 2010-01-06 Joanmarie Diggs <joanmarie.diggs@gmail.com> 2 3 Reviewed by Xan Lopez. 4 5 https://bugs.webkit.org/show_bug.cgi?id=30883 6 [Gtk] Implement AtkText for HTML elements which contain text 7 8 * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: 9 (getInterfaceMaskFromObject): 10 (getPangoLayoutForAtk): 11 (webkit_accessible_text_get_text): 12 * accessibility/gtk/AccessibilityObjectAtk.cpp: 13 (AccessibilityObject::accessibilityPlatformIncludesObject): 14 1 15 2010-01-06 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
r50238 r52890 48 48 return IgnoreObject; 49 49 50 // The object containing the text should implement AtkText itself. 51 if (roleValue() == StaticTextRole) 52 return IgnoreObject; 53 50 54 return DefaultBehavior; 51 55 } -
trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
r51768 r52890 821 821 String ret; 822 822 unsigned start = startOffset; 823 if (endOffset == -1) 823 if (endOffset == -1) { 824 824 endOffset = coreObject->stringValue().length(); 825 if (!endOffset) 826 endOffset = coreObject->textUnderElement().length(); 827 } 825 828 int length = endOffset - startOffset; 826 829 … … 904 907 if (!accObject) 905 908 return 0; 906 RenderText* renderText = toRenderText(accObject->renderer());907 if (!renderText)908 return 0;909 909 910 910 // Create a string with the layout as it appears on the screen 911 // For text controls, we can get the text line by line. 911 912 if (accObject->isTextControl()) { 912 913 unsigned textLength = accObject->textLength(); … … 923 924 } 924 925 } else { 925 InlineTextBox* box = renderText->firstTextBox(); 926 while (box) { 927 gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end()); 928 g_string_append(str, text); 929 // Newline chars in the source result in separate text boxes, so check 930 // before adding a newline in the layout. See bug 25415 comment #78. 931 if (!box->nextOnLineExists()) 926 // For RenderBlocks, piece together the text from the RenderText objects they contain. 927 for (RenderObject* obj = accObject->renderer()->firstChild(); obj; obj = obj->nextSibling()) { 928 if (obj->isBR()) { 932 929 g_string_append(str, "\n"); 933 box = box->nextTextBox(); 930 continue; 931 } 932 933 RenderText* renderText = toRenderText(obj); 934 // Be sure we have a RenderText object we can work with. 935 if (!renderText || !obj->isText()) { 936 // Handle RenderInlines (and any other similiar RenderObjects). 937 renderText = toRenderText(obj->firstChild()); 938 if (!renderText) 939 continue; 940 } 941 942 InlineTextBox* box = renderText->firstTextBox(); 943 while (box) { 944 gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end()); 945 g_string_append(str, text); 946 // Newline chars in the source result in separate text boxes, so check 947 // before adding a newline in the layout. See bug 25415 comment #78. 948 if (!box->nextOnLineExists()) 949 g_string_append(str, "\n"); 950 box = box->nextTextBox(); 951 } 934 952 } 935 953 } … … 1611 1629 if (role == StaticTextRole) 1612 1630 interfaceMask |= 1 << WAI_TEXT; 1613 else if (coreObject->isAccessibilityRenderObject() && coreObject->isTextControl()) { 1614 interfaceMask |= 1 << WAI_TEXT; 1615 if (!coreObject->isReadOnly()) 1616 interfaceMask |= 1 << WAI_EDITABLE_TEXT; 1617 } 1631 else if (coreObject->isAccessibilityRenderObject()) 1632 if (coreObject->isTextControl()) { 1633 interfaceMask |= 1 << WAI_TEXT; 1634 if (!coreObject->isReadOnly()) 1635 interfaceMask |= 1 << WAI_EDITABLE_TEXT; 1636 } else if (static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline()) 1637 interfaceMask |= 1 << WAI_TEXT; 1618 1638 1619 1639 // Image -
trunk/WebKit/gtk/ChangeLog
r52798 r52890 1 2010-01-06 Joanmarie Diggs <joanmarie.diggs@gmail.com> 2 3 Reviewed by Xan Lopez. 4 5 https://bugs.webkit.org/show_bug.cgi?id=30883 6 [Gtk] Implement AtkText for HTML elements which contain text 7 8 * tests/testatk.c 9 (test_webkit_atk_get_text_at_offset): 10 (test_webkit_atk_get_text_at_offset_forms): 11 (test_webkit_atk_get_text_at_offset_newlines): 12 1 13 2010-01-05 Gustavo Noronha Silva <gns@gnome.org> 2 14 -
trunk/WebKit/gtk/tests/testatk.c
r51768 r52890 222 222 obj = atk_object_ref_accessible_child(obj, 0); 223 223 g_assert(obj); 224 obj = atk_object_ref_accessible_child(obj, 0);225 g_assert(obj);226 224 227 225 text_obj = ATK_TEXT(obj); … … 255 253 obj = atk_object_ref_accessible_child(obj, 0); 256 254 g_assert(obj); 257 obj = atk_object_ref_accessible_child(obj, 0);258 g_assert(obj);259 255 260 256 text_obj = ATK_TEXT(obj); … … 285 281 /* Get to the inner AtkText object */ 286 282 obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); 287 g_assert(obj);288 obj = atk_object_ref_accessible_child(obj, 0);289 283 g_assert(obj); 290 284 obj = atk_object_ref_accessible_child(obj, 0);
Note: See TracChangeset
for help on using the changeset viewer.