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)
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: jdiggs, Assigned: surkov)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(3 files)
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.
Reporter | ||
Comment 1•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Blocks: getText*a11y, 2013q4a11y
Assignee | ||
Updated•12 years ago
|
Keywords: regression
Assignee | ||
Comment 2•12 years ago
|
||
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!
Assignee | ||
Comment 4•12 years ago
|
||
Robert, what about http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsTextFrame.cpp#7455 where WhiteSpaceIsSignificant() is used instead?
Assignee | ||
Updated•12 years ago
|
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.
Assignee | ||
Comment 7•12 years ago
|
||
thank you! I'll add a11y test when patch is landed
Assignee | ||
Comment 8•11 years ago
|
||
Assignee: nobody → surkov.alexander
Attachment #8356114 -
Flags: review?(trev.saunders)
Updated•11 years ago
|
Attachment #8356114 -
Flags: review?(trev.saunders) → review+
Assignee | ||
Comment 9•11 years ago
|
||
Assignee | ||
Comment 10•11 years ago
|
||
(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+
Comment 11•11 years ago
|
||
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.
Description
•