[orca] Fix for bug #664386 - Orca does not always present image links in WebKitGtk content
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for bug #664386 - Orca does not always present image links in WebKitGtk content
- Date: Sat, 19 Nov 2011 19:12:42 +0000 (UTC)
commit c0ffe0fee35eabbc93efcbe8cb837d2dcd10f352
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Sat Nov 19 14:10:41 2011 -0500
Fix for bug #664386 - Orca does not always present image links in WebKitGtk content
src/orca/scripts/toolkits/WebKitGtk/script.py | 24 ++++++++++++++++++++
.../scripts/toolkits/WebKitGtk/script_utilities.py | 21 +++++++++++++++++
2 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index 572bbc9..3b964b7 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -515,3 +515,27 @@ class Script(default.Script):
return
text.setCaretOffset(offset)
+
+ def getTextLineAtCaret(self, obj, offset=None):
+ """Gets the line of text where the caret is.
+
+ Argument:
+ - obj: an Accessible object that implements the AccessibleText
+ interface
+ - offset: an optional caret offset to use. (Not used here at the
+ moment, but needed in the Gecko script)
+
+ Returns the [string, caretOffset, startOffset] for the line of text
+ where the caret is.
+ """
+
+ # TODO - JD: Piece together the full line for braille
+
+ textLine = default.Script.getTextLineAtCaret(self, obj, offset)
+ string = textLine[0].decode('UTF-8')
+ if string.find(self.EMBEDDED_OBJECT_CHARACTER) == -1:
+ return textLine
+
+ textLine[0] = self.utilities.displayedText(obj)
+
+ return textLine
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py b/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py
index 879291b..a7eb387 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py
@@ -135,3 +135,24 @@ class Utilities(script_utilities.Utilities):
self, child, line, startOffset - adjustment)
return adjustedLine
+
+ def displayedText(self, obj):
+ """Returns the text being displayed for an object.
+
+ Arguments:
+ - obj: the object
+
+ Returns the text being displayed for an object or None if there isn't
+ any text being shown.
+ """
+
+ text = script_utilities.Utilities.displayedText(self, obj)
+ if text and text != self.EMBEDDED_OBJECT_CHARACTER:
+ return text
+
+ if obj.getRole() == pyatspi.ROLE_LINK:
+ text = ' '.join(map(self.displayedText, (x for x in obj)))
+ if not text:
+ text = self.linkBasename(obj)
+
+ return text
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]