icecat: add release icecat-140.8.0-2gnu1 for ecne
This commit is contained in:
parent
450538011a
commit
8eb1f1732f
616 changed files with 39955 additions and 33937 deletions
|
|
@ -2878,13 +2878,26 @@ void EditorBase::DispatchInputEvent() {
|
|||
return;
|
||||
}
|
||||
RefPtr<DataTransfer> dataTransfer = GetInputEventDataTransfer();
|
||||
const EditAction editAction = GetEditAction();
|
||||
if (editAction == EditAction::eCancelComposition ||
|
||||
editAction == EditAction::eCommitComposition) {
|
||||
MOZ_ASSERT(!mComposition);
|
||||
if (MOZ_UNLIKELY(!CanDispatchInputEventAfterCompositionEnd())) {
|
||||
MOZ_LOG(gEventLog, LogLevel::Info,
|
||||
("%p %s: Blocked to dispatch \"input\" event immediately after "
|
||||
"eCompositionEnd",
|
||||
this, mIsHTMLEditorClass ? "HTMLEditor" : "TextEditor"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
const EditorInputType inputType = ToInputType(editAction);
|
||||
mEditActionData->WillDispatchInputEvent();
|
||||
MOZ_LOG(gEventLog, LogLevel::Info,
|
||||
("%p %s: Dispatching \"input\" event: { inputType=\"%s\" }...", this,
|
||||
mIsHTMLEditorClass ? "HTMLEditor" : "TextEditor",
|
||||
ToString(ToInputType(GetEditAction())).c_str()));
|
||||
ToString(inputType).c_str()));
|
||||
DebugOnly<nsresult> rvIgnored = nsContentUtils::DispatchInputEvent(
|
||||
targetElement, eEditorInput, ToInputType(GetEditAction()), this,
|
||||
targetElement, eEditorInput, inputType, this,
|
||||
dataTransfer ? InputEventOptions(dataTransfer,
|
||||
InputEventOptions::NeverCancelable::No)
|
||||
: InputEventOptions(GetInputEventData(),
|
||||
|
|
@ -2892,7 +2905,7 @@ void EditorBase::DispatchInputEvent() {
|
|||
MOZ_LOG(gEventLog, LogLevel::Debug,
|
||||
("%p %s: Dispatched \"input\" event: { inputType=\"%s\" }", this,
|
||||
mIsHTMLEditorClass ? "HTMLEditor" : "TextEditor",
|
||||
ToString(ToInputType(GetEditAction())).c_str()));
|
||||
ToString(inputType).c_str()));
|
||||
mEditActionData->DidDispatchInputEvent();
|
||||
NS_WARNING_ASSERTION(
|
||||
NS_SUCCEEDED(rvIgnored),
|
||||
|
|
@ -4215,8 +4228,10 @@ nsresult EditorBase::OnCompositionChange(
|
|||
// NOTE: When the pref is enabled, the last `input` event which will be fired
|
||||
// after `compositionend` won't be paired with corresponding `beforeinput`
|
||||
// event.
|
||||
else if (StaticPrefs::dom_input_events_dispatch_before_compositionend() &&
|
||||
mDispatchInputEvent && !IsEditActionAborted()) {
|
||||
else if (MOZ_LIKELY(
|
||||
StaticPrefs::dom_input_events_dispatch_before_compositionend() &&
|
||||
mDispatchInputEvent && !IsEditActionAborted() &&
|
||||
CanDispatchInputEventBeforeCompositionEnd())) {
|
||||
DispatchInputEvent();
|
||||
}
|
||||
|
||||
|
|
@ -4297,6 +4312,56 @@ void EditorBase::OnCompositionEnd(
|
|||
NotifyEditorObservers(eNotifyEditorObserversOfEnd);
|
||||
}
|
||||
|
||||
bool EditorBase::CanDispatchInputEventBeforeCompositionEnd() const {
|
||||
Document* const doc = GetDocument();
|
||||
if (NS_WARN_IF(!doc)) {
|
||||
return false;
|
||||
}
|
||||
nsIPrincipal* const principal = doc->GetPrincipalForPrefBasedHacks();
|
||||
if (!principal) {
|
||||
return true;
|
||||
}
|
||||
constexpr static auto* kTextEditorPref =
|
||||
"editor.texteditor.inputevent.hack.no_dispatch_before_compositionend";
|
||||
constexpr static auto* kTextEditorAddlPref =
|
||||
"editor.texteditor.inputevent.hack.no_dispatch_before_compositionend."
|
||||
"addl";
|
||||
constexpr static auto* kHTMLEditorPref =
|
||||
"editor.htmleditor.inputevent.hack.no_dispatch_before_compositionend";
|
||||
constexpr static auto* kHTMLEditorAddlPref =
|
||||
"editor.htmleditor.inputevent.hack.no_dispatch_before_compositionend."
|
||||
"addl";
|
||||
return !principal->IsURIInPrefList(IsTextEditor() ? kTextEditorPref
|
||||
: kHTMLEditorPref) &&
|
||||
!principal->IsURIInPrefList(IsTextEditor() ? kTextEditorAddlPref
|
||||
: kHTMLEditorAddlPref);
|
||||
}
|
||||
|
||||
bool EditorBase::CanDispatchInputEventAfterCompositionEnd() const {
|
||||
Document* const doc = GetDocument();
|
||||
if (NS_WARN_IF(!doc)) {
|
||||
return false;
|
||||
}
|
||||
nsIPrincipal* const principal = doc->GetPrincipalForPrefBasedHacks();
|
||||
if (!principal) {
|
||||
return true;
|
||||
}
|
||||
constexpr static auto* kTextEditorPref =
|
||||
"editor.texteditor.inputevent.hack.no_dispatch_after_compositionend";
|
||||
constexpr static auto* kTextEditorAddlPref =
|
||||
"editor.texteditor.inputevent.hack.no_dispatch_after_compositionend."
|
||||
"addl";
|
||||
constexpr static auto* kHTMLEditorPref =
|
||||
"editor.htmleditor.inputevent.hack.no_dispatch_after_compositionend";
|
||||
constexpr static auto* kHTMLEditorAddlPref =
|
||||
"editor.htmleditor.inputevent.hack.no_dispatch_after_compositionend."
|
||||
"addl";
|
||||
return !principal->IsURIInPrefList(IsTextEditor() ? kTextEditorPref
|
||||
: kHTMLEditorPref) &&
|
||||
!principal->IsURIInPrefList(IsTextEditor() ? kTextEditorAddlPref
|
||||
: kHTMLEditorAddlPref);
|
||||
}
|
||||
|
||||
bool EditorBase::WillHandleMouseButtonEvent(WidgetMouseEvent& aMouseEvent) {
|
||||
MOZ_ASSERT(aMouseEvent.mMessage == eMouseDown ||
|
||||
aMouseEvent.mMessage == eMouseUp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue