[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
eric at webkit.org
eric at webkit.org
Wed Jan 20 22:14:50 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 24e81791152358f8b41118b14c07cf02363d921b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 7 02:05:01 2010 +0000
2010-01-06 Joanmarie Diggs <joanmarie.diggs at gmail.com>
Reviewed by Xan Lopez.
https://bugs.webkit.org/show_bug.cgi?id=30883
[Gtk] Implement AtkText for HTML elements which contain text
* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(getInterfaceMaskFromObject):
(getPangoLayoutForAtk):
(webkit_accessible_text_get_text):
* accessibility/gtk/AccessibilityObjectAtk.cpp:
(AccessibilityObject::accessibilityPlatformIncludesObject):
2010-01-06 Joanmarie Diggs <joanmarie.diggs at gmail.com>
Reviewed by Xan Lopez.
https://bugs.webkit.org/show_bug.cgi?id=30883
[Gtk] Implement AtkText for HTML elements which contain text
* tests/testatk.c
(test_webkit_atk_get_text_at_offset):
(test_webkit_atk_get_text_at_offset_forms):
(test_webkit_atk_get_text_at_offset_newlines):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a709d3a..b2df360 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-06 Joanmarie Diggs <joanmarie.diggs at gmail.com>
+
+ Reviewed by Xan Lopez.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30883
+ [Gtk] Implement AtkText for HTML elements which contain text
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (getInterfaceMaskFromObject):
+ (getPangoLayoutForAtk):
+ (webkit_accessible_text_get_text):
+ * accessibility/gtk/AccessibilityObjectAtk.cpp:
+ (AccessibilityObject::accessibilityPlatformIncludesObject):
+
2010-01-06 Dan Bernstein <mitz at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
index 7fd59ac..bc31fce 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
@@ -47,6 +47,10 @@ AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformI
if (parent->isPasswordField() || parent->isTextControl())
return IgnoreObject;
+ // The object containing the text should implement AtkText itself.
+ if (roleValue() == StaticTextRole)
+ return IgnoreObject;
+
return DefaultBehavior;
}
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 16ea948..dc96f4a 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -820,8 +820,11 @@ static gchar* webkit_accessible_text_get_text(AtkText* text, gint startOffset, g
AccessibilityObject* coreObject = core(text);
String ret;
unsigned start = startOffset;
- if (endOffset == -1)
+ if (endOffset == -1) {
endOffset = coreObject->stringValue().length();
+ if (!endOffset)
+ endOffset = coreObject->textUnderElement().length();
+ }
int length = endOffset - startOffset;
if (coreObject->isTextControl())
@@ -903,11 +906,9 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject);
if (!accObject)
return 0;
- RenderText* renderText = toRenderText(accObject->renderer());
- if (!renderText)
- return 0;
// Create a string with the layout as it appears on the screen
+ // For text controls, we can get the text line by line.
if (accObject->isTextControl()) {
unsigned textLength = accObject->textLength();
int lineNumber = 0;
@@ -922,15 +923,32 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
range = accObject->doAXRangeForLine(++lineNumber);
}
} else {
- InlineTextBox* box = renderText->firstTextBox();
- while (box) {
- gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
- g_string_append(str, text);
- // Newline chars in the source result in separate text boxes, so check
- // before adding a newline in the layout. See bug 25415 comment #78.
- if (!box->nextOnLineExists())
+ // For RenderBlocks, piece together the text from the RenderText objects they contain.
+ for (RenderObject* obj = accObject->renderer()->firstChild(); obj; obj = obj->nextSibling()) {
+ if (obj->isBR()) {
g_string_append(str, "\n");
- box = box->nextTextBox();
+ continue;
+ }
+
+ RenderText* renderText = toRenderText(obj);
+ // Be sure we have a RenderText object we can work with.
+ if (!renderText || !obj->isText()) {
+ // Handle RenderInlines (and any other similiar RenderObjects).
+ renderText = toRenderText(obj->firstChild());
+ if (!renderText)
+ continue;
+ }
+
+ InlineTextBox* box = renderText->firstTextBox();
+ while (box) {
+ gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
+ g_string_append(str, text);
+ // Newline chars in the source result in separate text boxes, so check
+ // before adding a newline in the layout. See bug 25415 comment #78.
+ if (!box->nextOnLineExists())
+ g_string_append(str, "\n");
+ box = box->nextTextBox();
+ }
}
}
@@ -1610,11 +1628,13 @@ static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)
if (role == StaticTextRole)
interfaceMask |= 1 << WAI_TEXT;
- else if (coreObject->isAccessibilityRenderObject() && coreObject->isTextControl()) {
- interfaceMask |= 1 << WAI_TEXT;
- if (!coreObject->isReadOnly())
- interfaceMask |= 1 << WAI_EDITABLE_TEXT;
- }
+ else if (coreObject->isAccessibilityRenderObject())
+ if (coreObject->isTextControl()) {
+ interfaceMask |= 1 << WAI_TEXT;
+ if (!coreObject->isReadOnly())
+ interfaceMask |= 1 << WAI_EDITABLE_TEXT;
+ } else if (static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline())
+ interfaceMask |= 1 << WAI_TEXT;
// Image
if (coreObject->isImage())
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 5ed99e5..cc6d12e 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-06 Joanmarie Diggs <joanmarie.diggs at gmail.com>
+
+ Reviewed by Xan Lopez.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30883
+ [Gtk] Implement AtkText for HTML elements which contain text
+
+ * tests/testatk.c
+ (test_webkit_atk_get_text_at_offset):
+ (test_webkit_atk_get_text_at_offset_forms):
+ (test_webkit_atk_get_text_at_offset_newlines):
+
2010-01-05 Gustavo Noronha Silva <gns at gnome.org>
Updated docs for 1.1.18 release.
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index c5f4db3..7f87bdc 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -221,8 +221,6 @@ static void test_webkit_atk_get_text_at_offset_forms(void)
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);
- obj = atk_object_ref_accessible_child(obj, 0);
- g_assert(obj);
text_obj = ATK_TEXT(obj);
g_assert(ATK_IS_TEXT(text_obj));
@@ -254,8 +252,6 @@ static void test_webkit_atk_get_text_at_offset(void)
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);
- obj = atk_object_ref_accessible_child(obj, 0);
- g_assert(obj);
text_obj = ATK_TEXT(obj);
g_assert(ATK_IS_TEXT(text_obj));
@@ -287,8 +283,6 @@ static void test_webkit_atk_get_text_at_offset_newlines(void)
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);
- obj = atk_object_ref_accessible_child(obj, 0);
- g_assert(obj);
text_obj = ATK_TEXT(obj);
g_assert(ATK_IS_TEXT(text_obj));
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list