Closed
Bug 120402
Opened 23 years ago
Closed 23 years ago
pref for 'browsewithcaret' doesn't work in XHTML/XML documents
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
DUPLICATE
of bug 114440
People
(Reporter: rbs, Assigned: joki)
Details
If you set the pref:
user_pref("accessibility.browsewithcaret", true);
This only works in vanilla HTML. So documents in XHTML/XML don't show the caret.
The problem is that the code that set the caret based on that pref is excluding
non-HTML documents:
nsEventStateManager::PreHandleEvent()
[...]
// Set mBrowseWithCaret to value of preference if we're in HTML (don't use
caret in XUL)
if (mDocument) {
mBrowseWithCaret = PR_FALSE;
nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(mDocument));
if (htmlDoc)
mPrefService->GetBoolPref("accessibility.browsewithcaret",
&mBrowseWithCaret);
}
[...]
}
Also browsing with the pref on ends up causing a crash on a null pointer here:
nsEventStateManager::GetCaretLocation()
[...]
nsIFrame *primaryFrame = nsnull;
if (selectionContent)
rv = shell->GetPrimaryFrameFor(selectionContent, &primaryFrame);
*aCaretFrame = primaryFrame;
*aCaretContent = selectionContent;
NS_ADDREF(*aCaretContent); <===========================CRASH
return rv;
}
The test |if (selectionContent)| implies that it can be null. And this suggests
that the whole chunk of code is meant to be in |if (selectionContent) { ... }|.
Assignee | ||
Comment 2•23 years ago
|
||
*** This bug has been marked as a duplicate of 114440 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Updated•23 years ago
|
QA Contact: madhur → rakeshmishra
Updated•22 years ago
|
QA Contact: rakeshmishra → trix
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•