Index: src/orca/scripts/toolkits/Gecko/script.py
===================================================================
--- src/orca/scripts/toolkits/Gecko/script.py	(revision 4146)
+++ src/orca/scripts/toolkits/Gecko/script.py	(working copy)
@@ -179,6 +179,12 @@
         self.currentLineContents = None
         self._nextLineContents = None
 
+        # For really large objects, a call to getAttributes can take up to
+        # two seconds! This is a Firefox bug. We'll try to improve things
+        # by storing attributes.
+        #
+        self._currentAttrs = {}
+
         # Last focused frame. We are only interested in frame focused events
         # when it is a different frame, so here we store the last frame
         # that recieved state-changed:focused.
@@ -1921,6 +1927,7 @@
         self._previousLineContents = None
         self.currentLineContents = None
         self._nextLineContents = None
+        self._currentAttrs = {}
 
     def presentLine(self, obj, offset):
         """Presents the current line in speech and in braille.
@@ -4641,6 +4648,35 @@
 
         return string, caretOffset, startOffset
 
+    def getTextAttributes(self, acc, offset, get_defaults=False):
+        """Get the text attributes run for a given offset in a given accessible
+
+        Arguments:
+        - acc: An accessible.
+        - offset: Offset in the accessible's text for which to retrieve the
+        attributes.
+        - get_defaults: Get the default attributes as well as the unique ones.
+        Default is True
+
+        Returns a dictionary of attributes, a start offset where the attributes
+        begin, and an end offset. Returns ({}, 0, 0) if the accessible does not
+        supprt the text attribute.
+        """
+
+        # For really large objects, a call to getAttributes can take up to
+        # two seconds! This is a Firefox bug. We'll try to improve things
+        # by storing attributes.
+        #
+        attrsForObj = self._currentAttrs.get(hash(acc)) or {}
+        if attrsForObj.has_key(offset):
+            return attrsForObj.get(offset)
+
+        attrs = \
+            default.Script.getTextAttributes(self, acc, offset, get_defaults)
+        self._currentAttrs[hash(acc)] = {offset:attrs}
+
+        return attrs
+
     def getCaretContext(self, includeNonText=True):
         """Returns the current [obj, caretOffset] if defined.  If not,
         it returns the first [obj, caretOffset] found by an in order
Index: src/orca/braille.py
===================================================================
--- src/orca/braille.py	(revision 4146)
+++ src/orca/braille.py	(working copy)
@@ -577,7 +577,9 @@
             n = 0
             while n < nLinks:
                 link = hyperText.getLink(n)
-                if self.lineOffset <= link.startIndex:
+                if link.startIndex > lineEndOffset:
+                    break
+                elif self.lineOffset <= link.startIndex:
                     for i in xrange(link.startIndex, link.endIndex):
                         try:
                             regionMask[i] |= linkIndicator
