Closed Bug 460417 Opened 17 years ago Closed 17 years ago

invalid handling of selection changes inside input element

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: access, regression, verified1.9.0.6)

Attachments

(2 files, 1 obsolete file)

when addressbar is clicked then I got an assertion "no IAccessibleText for caret move event". The problem is we get focusContainer - html:div (child of html:input), focusOffset is 1, html:div has one child. Therefore we don't get focusNode correctly. We should use html:div as focus node in this case.
Attached patch patch (obsolete) — Splinter Review
Attachment #343569 - Flags: review?(aaronleventhal)
Attachment #343569 - Flags: review?(marco.zehe)
Attachment #343569 - Flags: superreview?(neil)
Attachment #343569 - Flags: review?(aaronleventhal)
Attachment #343569 - Flags: review+
Comment on attachment 343569 [details] [diff] [review] patch >+ nsCOMPtr<nsIDOMNode> focusNode; >+ aSelection->GetFocusNode(getter_AddRefs(focusNode)); >+ if (!focusNode) >+ return nsnull; >+ >+ // Get DOM node that focus DOM point points to. >+ nsCOMPtr<nsIDOMNode> resultNode = focusNode; >+ >+ nsCOMPtr<nsIContent> focusContent(do_QueryInterface(focusNode)); Nit: focusNode is never used after this point... maybe call it resultNode? >+ NS_ASSERTION(focusOffset >= 0 && focusOffset <= static_cast<PRInt32>(childCount), >+ "Wrong focus offset in selection!"); >+ >+ // The offset can be after last child of container node that means DOM point >+ // is placed immediately after the last child. In this case use focusNode >+ // as result node. >+ if (focusOffset != childCount) { Don't you need to cast here too to avoid the signed/unsigned mismatch? (I didn't think to capture the compiler output to check.) >+ Nit: whitespace. (Don't feel too bad, you managed to remove some too.) >+ if (!content || !content->IsNodeOfType(nsINode::eTEXT)) { Don't you mean content && ! >+ NS_ASSERTION(PR_FALSE, "No nsIAccessibleText for selection change event!"); Please use NS_ERROR or NS_NOTREACHED or similar? >+ rv= textAcc->GetCaretOffset(&caretOffset); Nit: space before =
Attachment #343569 - Flags: superreview?(neil) → superreview+
(In reply to comment #2) > >+ if (!content || !content->IsNodeOfType(nsINode::eTEXT)) { > Don't you mean content && ! I don't think so. It's copy&paste from existing code but !content is true when result node is document (which has text accessible)
Attached patch patch2Splinter Review
neil's comments + mochitest
Attachment #343569 - Attachment is obsolete: true
Attachment #344600 - Flags: review?(marco.zehe)
Attachment #343569 - Flags: review?(marco.zehe)
Flags: in-testsuite+
Attachment #344600 - Flags: review?(marco.zehe) → review+
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment on attachment 344600 [details] [diff] [review] patch2 This bug, which is a duplicate of bug 459152, is a regression from bug 454377. Since we have approval 1.9.0.5 for bug 454377, which is needed by JAWS 10, requesting approval for this bug as well so we don't regress on Linux once 454377 lands.
Attachment #344600 - Flags: approval1.9.0.5?
Comment on attachment 344600 [details] [diff] [review] patch2 Good catch. Approved for 1.9.0.5. a=ss
Attachment #344600 - Flags: approval1.9.0.5? → approval1.9.0.5+
Attachment #344600 - Flags: approval1.9.0.5+ → approval1.9.0.5-
Comment on attachment 344600 [details] [diff] [review] patch2 Too late for 1.9.0.5
Attached patch patch 1.9.0Splinter Review
Attachment #348933 - Flags: review?(aaronleventhal)
Attachment #348933 - Flags: review?(marco.zehe)
Comment on attachment 348933 [details] [diff] [review] patch 1.9.0 It's basically the same but merged, right? rs=aaronlev
Attachment #348933 - Flags: review?(aaronleventhal) → review+
(In reply to comment #12) > (From update of attachment 348933 [details] [diff] [review]) > It's basically the same but merged, right? > > rs=aaronlev right but it's not automatic merging so I reask reviews.
Attachment #348933 - Flags: review?(marco.zehe) → review+
Attachment #348933 - Flags: approval1.9.0.6?
Comment on attachment 348933 [details] [diff] [review] patch 1.9.0 I guess it's too late for 1.9.0.5 so nominate for 1.9.0.6
Blocks: 454377
Keywords: regression
Attachment #348933 - Flags: approval1.9.0.6? → approval1.9.0.6+
Comment on attachment 348933 [details] [diff] [review] patch 1.9.0 Approved for 1.9.0.6, a=dveditz for release-drivers.
Checking in accessible/src/base/nsAccessibilityUtils.cpp; /cvsroot/mozilla/accessible/src/base/nsAccessibilityUtils.cpp,v <-- nsAccessibilityUtils.cpp new revision: 1.35; previous revision: 1.34 done Checking in accessible/src/base/nsAccessibilityUtils.h; /cvsroot/mozilla/accessible/src/base/nsAccessibilityUtils.h,v <-- nsAccessibilityUtils.h new revision: 1.28; previous revision: 1.27 done Checking in accessible/src/base/nsCaretAccessible.cpp; /cvsroot/mozilla/accessible/src/base/nsCaretAccessible.cpp,v <-- nsCaretAccessible.cpp new revision: 1.66; previous revision: 1.65 done Checking in accessible/tests/mochitest/Makefile.in; /cvsroot/mozilla/accessible/tests/mochitest/Makefile.in,v <-- Makefile.in new revision: 1.26; previous revision: 1.25 done RCS file: /cvsroot/mozilla/accessible/tests/mochitest/test_events_caretmove.html,v done Checking in accessible/tests/mochitest/test_events_caretmove.html; /cvsroot/mozilla/accessible/tests/mochitest/test_events_caretmove.html,v <-- test_events_caretmove.html initial revision: 1.1 done
Keywords: fixed1.9.0.6
Marco, can you verify this for 1.9.0.6?
Verified fixed in Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: