mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1181418 - Send selectionEditable info to app_text_selection_dialog. r=tlin, r=kanru, sr=smaug
This commit is contained in:
parent
5e2ac88ac9
commit
9d9d551cf0
@ -71,7 +71,8 @@ let CopyPasteAssistent = {
|
||||
reason: e.reason,
|
||||
collapsed: e.collapsed,
|
||||
caretVisible: e.caretVisible,
|
||||
selectionVisible: e.selectionVisible
|
||||
selectionVisible: e.selectionVisible,
|
||||
selectionEditable: e.selectionEditable
|
||||
};
|
||||
|
||||
// Get correct geometry information if we have nested iframe.
|
||||
|
@ -452,6 +452,7 @@ BrowserElementParent.prototype = {
|
||||
// - collapsed: Indicate current selection is collapsed or not.
|
||||
// - caretVisible: Indicate the caret visiibility.
|
||||
// - selectionVisible: Indicate current selection is visible or not.
|
||||
// - selectionEditable: Indicate current selection is editable or not.
|
||||
_handleCaretStateChanged: function(data) {
|
||||
let evt = this._createEvent('caretstatechanged', data.json,
|
||||
/* cancelable = */ false);
|
||||
|
@ -19,6 +19,7 @@ dictionary CaretStateChangedEventInit : EventInit {
|
||||
CaretChangedReason reason = "visibilitychange";
|
||||
boolean caretVisible = false;
|
||||
boolean selectionVisible = false;
|
||||
boolean selectionEditable = false;
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional CaretStateChangedEventInit eventInit),
|
||||
@ -29,4 +30,5 @@ interface CaretStateChangedEvent : Event {
|
||||
readonly attribute CaretChangedReason reason;
|
||||
readonly attribute boolean caretVisible;
|
||||
readonly attribute boolean selectionVisible;
|
||||
readonly attribute boolean selectionEditable;
|
||||
};
|
||||
|
@ -941,6 +941,11 @@ AccessibleCaretManager::DispatchCaretStateChangedEvent(CaretChangedReason aReaso
|
||||
init.mSelectionVisible = true;
|
||||
}
|
||||
|
||||
// Send isEditable info w/ event detail. This info can help determine
|
||||
// whether to show cut command on selection dialog or not.
|
||||
init.mSelectionEditable = commonAncestorFrame &&
|
||||
commonAncestorFrame->GetContent()->GetEditingHost();
|
||||
|
||||
init.mBoundingClientRect = domRect;
|
||||
init.mReason = aReason;
|
||||
init.mCollapsed = sel->IsCollapsed();
|
||||
|
Loading…
Reference in New Issue
Block a user