Closed Bug 947170 Opened 12 years ago Closed 11 years ago

Regression: atk_text_get_text_at_offset broken for last object when closing tag is preceded by newline char

Categories

(Core :: Disability Access APIs, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: jdiggs, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(3 files)

Attached file test case
Steps to reproduce: 1. Load the attached test in Firefox 2. Enable caret navigation (F7) 3. Launch the attached accessible-event listener in a terminal 4. Place the caret in the document text and arrow amongst its characters Expected results: The line of text containing the caret, start offset, and end offset would appear in the terminal as you arrow around. Actual results: An empty string with start and end offsets of 0 appear. This regression was introduced in the 27 July nightly build: * 26 july: ('Hello world ', 0, 12) * 27 july: ('', 0, 0) If you modify the test case so that the closing </p> is on the same line as the text, this bug does not occur. Similarly, if you add text after that paragraph the bug does not occur.
Keywords: regression
so the problem here the trailing '\n' character is rendered as space but when we try to do nsIFrame::PeekOffset eSelectEndLine then it returns len - 1 because of the code http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsFrame.cpp#6353 (the comment says: "Do not position the caret after the terminating newline if we're trying to move to the end of line (see bug 596506)"). Maybe it should have some extra check like StyleText()->NewlineIsSignificant() from above or something else? Robert, do you have ideas?
Attachment #8343691 - Attachment mime type: text/x-python → text/plain
Yes, we should check NewlineIsSignificant. Everywhere we call HasTerminalNewline and don't check NewlineIsSignificant is a bug. Really we should just make a new method HasSignificantTerminalNewline which does both checks, and convert all HasTerminalNewline callers to it. I'd gladly accept a patch for that!
Robert, what about http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsTextFrame.cpp#7455 where WhiteSpaceIsSignificant() is used instead?
Flags: needinfo?(roc)
That looks like a bug.
Flags: needinfo?(roc)
Filed (In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #3) > Really we > should just make a new method HasSignificantTerminalNewline which does both > checks, and convert all HasTerminalNewline callers to it. I'd gladly accept > a patch for that! Filed bug 953438 with patch.
thank you! I'll add a11y test when patch is landed
Depends on: 953438
Blocks: 956711
Attached patch mochitest patchSplinter Review
Assignee: nobody → surkov.alexander
Attachment #8356114 - Flags: review?(trev.saunders)
Attachment #8356114 - Flags: review?(trev.saunders) → review+
(In reply to alexander :surkov from comment #9) > http://hg.mozilla.org/integration/mozilla-inbound/rev/9022f0cacaed a mochitest added, fixed by bug 953438
Flags: in-testsuite+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: