mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1111433 - Dispatch the SelectionStateChanged event for blur. r=ehsan
This commit is contained in:
parent
7d1003f392
commit
dc0b00c38c
@ -594,6 +594,11 @@ BrowserElementChild.prototype = {
|
||||
|
||||
_selectionStateChangedHandler: function(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
if (!this._isContentWindowCreated) {
|
||||
return;
|
||||
}
|
||||
|
||||
let boundingClientRect = e.boundingClientRect;
|
||||
|
||||
let isCollapsed = (e.selectedText.length == 0);
|
||||
@ -613,11 +618,13 @@ BrowserElementChild.prototype = {
|
||||
}
|
||||
|
||||
// The collapsed SelectionStateChanged event is unnecessary to dispatch,
|
||||
// bypass this event by default. But there is one exception to support
|
||||
// the shortcut mode which can paste previous copied content easily
|
||||
// bypass this event by default, but here comes some exceptional cases
|
||||
if (isCollapsed) {
|
||||
if (isMouseUp && canPaste) {
|
||||
//Dispatch this selection change event to support shortcut mode
|
||||
// Always dispatch to support shortcut mode which can paste previous
|
||||
// copied content easily
|
||||
} else if (e.states.indexOf('blur') == 0) {
|
||||
// Always dispatch to notify the blur for the focus content
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@ -1111,6 +1111,7 @@ SelectionCarets::DispatchSelectionStateChangedEvent(Selection* aSelection,
|
||||
void
|
||||
SelectionCarets::NotifyBlur(bool aIsLeavingDocument)
|
||||
{
|
||||
SELECTIONCARETS_LOG("Send out the blur event");
|
||||
SetVisibility(false);
|
||||
if (aIsLeavingDocument) {
|
||||
CancelLongTapDetector();
|
||||
|
Loading…
Reference in New Issue
Block a user