Closed Bug 359790 Opened 15 years ago Closed 15 years ago

set text doesn't work correctly for XUL entry

Categories

(Firefox :: Disability Access, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ginnchen+exoracle, Assigned: nian.liu)

References

Details

(Keywords: access)

Attachments

(3 files, 1 obsolete file)

Invoke firefox, open the proxy setting dialog in top menu
Edit->Preferences->Advanced->Network->Settings.
Check the 'Manual proxy configuration' radio button and put the proxy and
port number in the entries, press Enter to save them.
Click the 'Settings' button to open the proxy settings window again.

try to use at-poke to edit that entry.
the entry in Firefox is populated with very bizarre results.

BTW: Location field and search field is fine, they're ROLE_AUTOCOMPLETE
No longer depends on: 357032
Depends on: 359924
No longer depends on: 359924
Depends on: 359924
Attached patch trial patchSplinter Review
if editor exists, use editor's selection and selection controller

is there a scenario that an editor doesn't exist for a nsHyperTextAccessible?
Attachment #248706 - Flags: review?(aaronleventhal)
Comment on attachment 248706 [details] [diff] [review]
trial patch

Great work!

Yes, it happens all the time, because not every nsHyperTextAccessible represents something editable. Some are for things as simple as an <h1> or <div>. Those are not editable and have no editor.
Attachment #248706 - Flags: review?(aaronleventhal) → review+
Assignee: nobody → nian.liu
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Attached patch patch based on previous one (obsolete) — Splinter Review
aSelCon para may be nsnull(currentlly always) and for a nsIEditor, GetSelectionController may return nsnull.

when aSelCon is null, GetSelectionController returns null is acceptable

i haven't done test after i add NS_ENSURE_ check. sorry for that.
Attachment #248970 - Flags: review?(ginn.chen)
more accurate one
Attachment #248970 - Attachment is obsolete: true
Attachment #248971 - Flags: review?(ginn.chen)
Attachment #248970 - Flags: review?(ginn.chen)
Attachment #248971 - Flags: review?(ginn.chen) → review+
patch 2 committed
Is it possible that this caused new crashes (first ones in 2006-12-18-04 builds):
nsHyperTextAccessible::GetCaretOffset  [mozilla\accessible\src\html\nshypertextaccessible.cpp, line 1340]
nsCaretAccessible::NotifySelectionChanged  [mozilla\accessible\src\base\nscaretaccessible.cpp, line 214]
nsTypedSelection::NotifySelectionListeners  [mozilla\layout\generic\nsselection.cpp, line 7370]
nsFrameSelection::NotifySelectionListeners  [mozilla\layout\generic\nsselection.cpp, line 2828]
nsFrame::HandleEvent  [mozilla\layout\generic\nsframe.cpp, line 1583]
nsPresShellEventCB::HandleEvent  [mozilla\layout\base\nspresshell.cpp, line 1232]
nsEventDispatcher::Dispatch  [mozilla\content\events\src\nseventdispatcher.cpp, line 643]
PresShell::HandleEventInternal  [mozilla\layout\base\nspresshell.cpp, line 5812]
PresShell::HandlePositionedEvent  [mozilla\layout\base\nspresshell.cpp, line 5703]
PresShell::HandleEvent  [mozilla\layout\base\nspresshell.cpp, line 5531]
nsViewManager::HandleEvent  [mozilla\view\src\nsviewmanager.cpp, line 1665]
nsViewManager::DispatchEvent  [mozilla\view\src\nsviewmanager.cpp, line 1618]
HandleEvent  [mozilla\view\src\nsview.cpp, line 174]
nsWindow::DispatchEvent  [mozilla\widget\src\windows\nswindow.cpp, line 1115]
nsWindow::DispatchMouseEvent  [mozilla\widget\src\windows\nswindow.cpp, line 6289]
ChildWindow::DispatchMouseEvent  [mozilla\widget\src\windows\nswindow.cpp, line 6470]
nsWindow::ProcessMessage  [mozilla\widget\src\windows\nswindow.cpp, line 4715] 

Looks like nsHyperTextAccessible::GetSelections return NS_OK and 
nsnull as *aDomSel.
Comment on attachment 248971 [details] [diff] [review]
patch based on previous onev2


>+    if (aSelCon) {
>+      editor->GetSelectionController(aSelCon);
>+      NS_ENSURE_TRUE(aSelCon, NS_ERROR_FAILURE);

I think this should be NS_ENSURE_TRUE(*aSelCon, NS_ERROR_FAILURE);



>+    if (aDomSel) {
>+      editor->GetSelection(aDomSel);
>+      NS_ENSURE_TRUE(aDomSel, NS_ERROR_FAILURE);

And this one NS_ENSURE_TRUE(*aDomSel, NS_ERROR_FAILURE);
Attachment #249126 - Flags: review?(ginn.chen) → review+
Comment on attachment 249126 [details] [diff] [review]
might fix the crashes

Checked in
You need to log in before you can comment on or make changes to this bug.