mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Issue #12 Part 5: WidgetEvent shouldn't mark event as consumed if it's not cancelable.
Currently, EventListenerManager calls WidgetEvent::PreventDefault() when the status is nsEventStatus_eConsumeNoDefault. That causes an unexpected state of events. To solve this, WidgetEvent should do nothing when it's not cancelable but PreventDefault() is called.
This commit is contained in:
parent
3e44d7b990
commit
ea3ff24118
1 changed files with 6 additions and 0 deletions
|
|
@ -161,6 +161,9 @@ public:
|
||||||
}
|
}
|
||||||
inline void PreventDefault(bool aCalledByDefaultHandler = true)
|
inline void PreventDefault(bool aCalledByDefaultHandler = true)
|
||||||
{
|
{
|
||||||
|
if (!mCancelable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mDefaultPrevented = true;
|
mDefaultPrevented = true;
|
||||||
// Note that even if preventDefault() has already been called by chrome,
|
// Note that even if preventDefault() has already been called by chrome,
|
||||||
// a call of preventDefault() by content needs to overwrite
|
// a call of preventDefault() by content needs to overwrite
|
||||||
|
|
@ -175,6 +178,9 @@ public:
|
||||||
// This should be used only before dispatching events into the DOM tree.
|
// This should be used only before dispatching events into the DOM tree.
|
||||||
inline void PreventDefaultBeforeDispatch()
|
inline void PreventDefaultBeforeDispatch()
|
||||||
{
|
{
|
||||||
|
if (!mCancelable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mDefaultPrevented = true;
|
mDefaultPrevented = true;
|
||||||
}
|
}
|
||||||
inline bool DefaultPrevented() const
|
inline bool DefaultPrevented() const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue