GNOME Bugzilla – Bug 504742
Gecko.py should not call getLineContentsAtOffset() twice unnecessarily
Last modified: 2008-07-22 19:33:01 UTC
Currently, Gecko.py has a number of places where it makes two back-to-back calls: updateBraille() speakContents() speakContents() is being passed what is returned by getLineContentsAtOffset() updateBraille() turns around and calls getLineContentsAtOffset() again. We should store the contents so we don't have to call the method twice.
Created attachment 101354 [details] [review] proposed patch Mike please test. Especially without the other performance patch you've been testing.
Created attachment 101356 [details] [review] revised version Mike please test.
Even without the patch to bug 500016 this patch does improve arrowing by line.
I think this looks good as is, especially since it's been tested by you and Mike. If I were to be a little anal, it would be to make currentLineContents be _currentLineContents, and I'd move the "contents = self.currentLineContents" line in updateBraille closer to the first use of contents in the method (e.g., just before the "if not contents or needToRefresh" line). Anyhow, great to see this done! Thanks!
Created attachment 101372 [details] [review] made the changes Will indicated Patch committed. Moving to pending.
Created attachment 101654 [details] [review] minor tweak In redoing the Firefox regression tests to use assertions, I caught the fact that I was a little too enthusiastic with my patch for this bug: go{Next,Previous}Chunk() should present the object contents; not the line contents. My bad. Patch pylinted, regression tested, committed.
This one seems to be working well.
Thanks! Closing as FIXED.