mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1083629 Use nsHTMLEditor::IsAcceptableInputEvent() instead of nsEditor::IsDescendantOfEditorRoot() for checking if a mouse down event target is in focused HTML editor r=ehsan
This commit is contained in:
parent
b9df016d99
commit
da1ac44cbc
@ -72,6 +72,11 @@ nsresult
|
||||
nsHTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
|
||||
{
|
||||
nsHTMLEditor* htmlEditor = GetHTMLEditor();
|
||||
// Contenteditable should disregard mousedowns outside it.
|
||||
// IsAcceptableInputEvent() checks it for a mouse event.
|
||||
if (!htmlEditor->IsAcceptableInputEvent(aMouseEvent)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Detect only "context menu" click
|
||||
// XXX This should be easier to do!
|
||||
@ -93,11 +98,6 @@ nsHTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
|
||||
NS_ENSURE_TRUE(target, NS_ERROR_NULL_POINTER);
|
||||
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(target);
|
||||
|
||||
// Contenteditable should disregard mousedowns outside it
|
||||
if (element && !htmlEditor->IsDescendantOfEditorRoot(element)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (isContextClick || (buttonNumber == 0 && clickCount == 2)) {
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
mEditor->GetSelection(getter_AddRefs(selection));
|
||||
|
Loading…
Reference in New Issue
Block a user