[orca] Sanity check to prevent hang in WebKitGtk content.
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Sanity check to prevent hang in WebKitGtk content.
- Date: Wed, 11 Dec 2013 16:21:34 +0000 (UTC)
commit f1996e8f0ef0bd921e9adec27b6df769039169bc
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Dec 11 17:10:55 2013 +0100
Sanity check to prevent hang in WebKitGtk content.
src/orca/scripts/toolkits/WebKitGtk/script.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index e3aac70..801c242 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -549,10 +549,16 @@ class Script(default.Script):
string = self.utilities.adjustForRepeats(string)
voice = self.speechGenerator.getVoiceForString(obj, string)
string = self.utilities.adjustForLinks(obj, string, start)
+ # Incrementing the offset should cause us to eventually reach
+ # the end of the text as indicated by a 0-length string and
+ # start and end offsets of 0. Sometimes WebKitGtk returns the
+ # final text segment instead.
+ if segments and [string, start, end, voice] == segments[-1]:
+ break
+
segments.append([string, start, end, voice])
offset = end + 1
string, start, end = text.getTextAtOffset(offset, boundary)
-
return segments
def textLines(self, obj):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]