Граф коммитов

219 Коммитов

Автор SHA1 Сообщение Дата
Olli Pettay 32d9cd7454 Bug 1815273 - WidgetEvent::Duplicate triggers extra TimeStamp::Now() call, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D185608
2023-08-09 10:29:39 +00:00
Masayuki Nakano e4d8451468 Bug 1845904 - Make `PresShell::EventHandler::HandleEventWithCurrentEventInfo` stop flushing pending notifications if a query content event does not require that r=emilio
We've already known that `WidgetQueryContentEvent` is dispatched at initializing
a popup menu on macOS (bug 1530188).  Therefore, I made the dispatcher under
`widget/cocoa` set `WidgetQueryContentEvent::mNeedLayoutFlush` to `false` to
avoid to flush pending things in `ContentEventHandler`, but
`PresShell::EventHandler` does it.

Differential Revision: https://phabricator.services.mozilla.com/D185264
2023-08-07 05:24:20 +00:00
Masayuki Nakano 0f39d7eda7 Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-07 01:03:58 +00:00
Cristian Tuns f5572b469f Backed out 2 changesets (bug 1266437, bug 1232918) for causing mochitest failures in test_autoplay_policy_key_blacklist.html CLOSED TREE
Backed out changeset 33e3c6593d4b (bug 1232918)
Backed out changeset 1b56e99dd221 (bug 1266437)
2023-08-03 23:29:52 -04:00
Masayuki Nakano 0664d98bce Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-04 00:10:11 +00:00
Vincent Hilla f6c40d202b Bug 1731504 - Explicitly call capturing listeners before bubbling listeners on target. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D178776
2023-06-06 09:08:14 +00:00
Olli Pettay f588c0a3e3 Bug 1832515, remove unsused *PrivilegedClickListeners and mIsChrome, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D177737
2023-05-12 04:37:11 +00:00
Olli Pettay 5d21de32ac Bug 1807812 - Remove WidgetEventTime::mTime, r=masayuki,geckoview-reviewers,m_kato
HTMLSelectEventListener changes are needed, since currently that code works somewhat by accident given that
mTime often contains totally bogus values, like PR_IntervalNow(). Those changes then reveal issues also in
browser_editAddressDialog.js.

Differential Revision: https://phabricator.services.mozilla.com/D165618
2023-01-02 12:31:40 +00:00
Masayuki Nakano 22ef139a2d Bug 1763634 - part 2: Make `BrowserParent` verify whether replied keyboard events are what it sent r=smaug
For making this, `BrowserParent` (temporarily) store sent keyboard events which
wants reply from the remote process.  Then, when it gets a reply event received,
it compares whether the event data is broken or not.

Differential Revision: https://phabricator.services.mozilla.com/D145944
2022-06-02 23:50:44 +00:00
Masayuki Nakano 75077811f9 Bug 1766350 - Get rid of unused internal event messages r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D144683
2022-04-27 01:15:29 +00:00
Masayuki Nakano 37e94b914c Bug 1754367 - Get rid of `WidgetGUIEvent::mPluginEvent` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D138257
2022-02-10 00:39:42 +00:00
Cristian Tuns 7863a1ef75 Backed out changeset 6a408466ecb6 (bug 1731504) for causing bug 1739045 CLOSED TREE 2021-11-03 12:10:03 -04:00
Olli Pettay 7938f41dae WIP: Bug 1731504, explicitly call capturing listeners before bubbling listeners at target r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D128956
2021-10-27 12:37:50 +00:00
Emilio Cobos Álvarez f467ea41bc Bug 1689317 - Clipboard events should be composed. r=smaug
Automate some of the copy event tests which tested for this, since there
seems we/WPT don't have a lot of coverage for them.

Differential Revision: https://phabricator.services.mozilla.com/D103428
2021-01-29 13:30:40 +00:00
Masayuki Nakano 525ffa0f23 Bug 1683226 - part 16: Get rid of `WidgetPluginEvent` r=smaug
Depends on D100389

Differential Revision: https://phabricator.services.mozilla.com/D100390
2020-12-29 21:19:45 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Kagami Sascha Rosylight 0c28c71544 Bug 1677254 - Make select event from select() uncancelable r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D97068
2020-11-15 02:32:22 +00:00
Emilio Cobos Álvarez 4ad501e86f Bug 1666497 - Don't flush layout from popuppositioned events. r=mconley,Gijs,smaug
We don't need to flush before dispatching the event because we know that
if the values we cared about changed, then we'd get another event.

Differential Revision: https://phabricator.services.mozilla.com/D92444
2020-10-06 16:28:41 +00:00
Botond Ballo 6bda5b208d Bug 1556556 - Document WidgetEvent::mRefPoint as being in visual coordinates. r=kats
This is already the case for real input events since that's how they
arrive from APZ, and we are no longer changing the coordinates at
the process boundary.

For synthesized events, a future patch will add layout-to-visual
converions to code that sets mRefPoint as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D68917
2020-05-05 19:24:41 +00:00
Simon Giesecke 49eb05a114 Bug 1626570 - Improve handling of copying arrays in widget/. r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D72321
2020-04-30 09:38:38 +00:00
Csoregi Natalia b073baab86 Backed out 30 changesets (bug 1556556, bug 1631568) for multiple mochitest failures. CLOSED TREE
Backed out changeset edd529f7a9c5 (bug 1631568)
Backed out changeset 1cc0881e244b (bug 1631568)
Backed out changeset ed3c1e85d5e3 (bug 1556556)
Backed out changeset 38ffc6215bbf (bug 1556556)
Backed out changeset 03c2c25d8023 (bug 1556556)
Backed out changeset 9c717eb067b8 (bug 1556556)
Backed out changeset 98e26bc98b85 (bug 1556556)
Backed out changeset 05a6a581e755 (bug 1556556)
Backed out changeset 867946cf05bb (bug 1556556)
Backed out changeset 20d72a334530 (bug 1556556)
Backed out changeset 2c62e61d9054 (bug 1556556)
Backed out changeset 62a223d057d2 (bug 1556556)
Backed out changeset 2c5d55a1f0b1 (bug 1556556)
Backed out changeset 700447945b4e (bug 1556556)
Backed out changeset 93190ae4f5ff (bug 1556556)
Backed out changeset a7bd34d961bb (bug 1556556)
Backed out changeset fccd1d3c7189 (bug 1556556)
Backed out changeset 24056e47183d (bug 1556556)
Backed out changeset 204881474cc1 (bug 1556556)
Backed out changeset 387320881876 (bug 1556556)
Backed out changeset be8f5eb58460 (bug 1556556)
Backed out changeset 629c58a9166b (bug 1556556)
Backed out changeset 4312b2b5dda8 (bug 1556556)
Backed out changeset d11dbf6403a5 (bug 1556556)
Backed out changeset 95c54c023779 (bug 1556556)
Backed out changeset 80fcb7e71188 (bug 1556556)
Backed out changeset d75a4ecb0d47 (bug 1556556)
Backed out changeset 903c4de34e7a (bug 1556556)
Backed out changeset f15334a3e803 (bug 1556556)
Backed out changeset 9553e99137ea (bug 1556556)
2020-04-28 12:43:11 +03:00
Botond Ballo 219449f114 Bug 1556556 - Document WidgetEvent::mRefPoint as being in visual coordinates. r=kats
This is already the case for real input events since that's how they
arrive from APZ, and we are no longer changing the coordinates at
the process boundary.

For synthesized events, a future patch will add layout-to-visual
converions to code that sets mRefPoint as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D68917
2020-04-28 01:38:15 +00:00
André Bargull b0c9db06e3 Bug 1625138 - Part 12: Replace mozilla::IsPointer with std::is_pointer. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68366

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:14 +00:00
Simon Giesecke cb0734d274 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:57 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 2d961c08ab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 09:14:12 +00:00
Masayuki Nakano c90d6c80b3 Bug 1569512 - Make `PresShell` ignore synthesized `mousemove` events coming from another process if the child process stores mouse location of synthesized mouse events for tests r=smaug
The reason of intermittent failure of `test_bug656379-2.html` is, synthesized
`mousemove` event coming from the parent process causes `mouseout` and
`mouseleave` events of the last synthesized `mousemove` in the test.  The
reason is, synthesized `mousemove` for tests makes `PresShell` in the content
process record the cursor location, but won't make it `PresShell` in the
parent process do it.  Therefore, parent process may synthesize `mousemove`
event for the system cursor position which does not match with the synthesized
mouse location in the content process.  Therefore, `:hover` state may be
updated unexpectedly.

This patch makes `WidgetEvent::mFlags` have a flag to indicate whether it
came from another process.  Then, makes `PresShell::HandleEvent()` ignore
synthesized `mousemove` events coming from another process only when the
recorded mouse location was set by a mouse event synthesized for tests.

Differential Revision: https://phabricator.services.mozilla.com/D65282

--HG--
extra : moz-landing-system : lando
2020-03-05 21:34:28 +00:00
Simon Giesecke 9350e6b741 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

Differential Revision: https://phabricator.services.mozilla.com/D62604

--HG--
extra : moz-landing-system : lando
2020-02-20 11:40:14 +00:00
Dorel Luca d5f9df8ee1 Backed out 2 changesets (bug 1613985) for Build bustage on Windows2012. CLOSED TREE
Backed out changeset fd177b40b561 (bug 1613985)
Backed out changeset fb6d62b7f28d (bug 1613985)
2020-02-19 22:22:41 +02:00
Simon Giesecke 59b23375c0 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

Differential Revision: https://phabricator.services.mozilla.com/D62604

--HG--
extra : moz-landing-system : lando
2020-02-19 18:05:38 +00:00
Masayuki Nakano 4d302443ce Bug 970802 - part 3: Implement `beforeinput` event dispatcher and add `onbeforeinput` event handler attribute r=smaug
This patch makes `nsContentUtils::DispatchInputEvent()` dispatch `beforeinput`
event too.  And also adds `onbeforeinput` event handler which is really
important for feature detection (although Chrome has not implemented this
attribute yet: https://bugs.chromium.org/p/chromium/issues/detail?id=947408).

However, we don't implement `InputEvent.getTargetRanges()` in this bug and
implementing `beforeinput` event may hit bugs of some web apps.  Therefore,
this patch disables `beforeinput` event by default even in Nightly channel.

Differential Revision: https://phabricator.services.mozilla.com/D58125

--HG--
extra : moz-landing-system : lando
2020-01-14 07:15:45 +00:00
Razvan Maries 0df75c8122 Backed out 5 changesets (bug 970802) for xpcshell perma fails. CLOSED TREE
Backed out changeset 5511edd700f7 (bug 970802)
Backed out changeset 1fb9cf2264b6 (bug 970802)
Backed out changeset 6b185296c742 (bug 970802)
Backed out changeset ce6853e64ed6 (bug 970802)
Backed out changeset aa9bd45c09b1 (bug 970802)
2020-01-14 04:41:15 +02:00
Masayuki Nakano 81d47ee6d5 Bug 970802 - part 3: Implement `beforeinput` event dispatcher and add `onbeforeinput` event handler attribute r=smaug
This patch makes `nsContentUtils::DispatchInputEvent()` dispatch `beforeinput`
event too.  And also adds `onbeforeinput` event handler which is really
important for feature detection (although Chrome has not implemented this
attribute yet: https://bugs.chromium.org/p/chromium/issues/detail?id=947408).

However, we don't implement `InputEvent.getTargetRanges()` in this bug and
implementing `beforeinput` event may hit bugs of some web apps.  Therefore,
this patch disables `beforeinput` event by default even in Nightly channel.

Differential Revision: https://phabricator.services.mozilla.com/D58125

--HG--
extra : moz-landing-system : lando
2020-01-08 09:23:40 +00:00
Emilio Cobos Álvarez 9ee2b1259b Bug 1601184 - Make legacy mouse scroll events composed. r=smaug
Makes sense to be consistent with wheel.

Differential Revision: https://phabricator.services.mozilla.com/D55896

--HG--
extra : moz-landing-system : lando
2019-12-08 21:43:11 +00:00
Masayuki Nakano ab0ac8c7e6 Bug 1581192 - `WidgetEvent::mFlags::mDispatchedAtLeastOnce` needs to be reset before dispatching in content process again r=smaug
The crash occurs when dispatching a user input event which is a default action
of a raw user input event like `click` event caused by `mouseup` event if
the raw event's `isTrusted` is set to `false` accidentally during dispatch.

User input events are fired in the main process first.  Then,
`EventStateManager` sends it to remote process from `PostHandleEvent()` if
necessary.  However, at this time, `WidgetEvent::mFlags::mDispatchedAtLeastOnce`
is never rest, but its only referrer, `EventDispatcher::DispatchDOMEvent()`
assumes that when it's `true`, `WidgetEvent::mFlags:mIsBeingDispatched` is
`false`.  Therefore, only in content process, `mouseup` event's `isTrusted` is
set to `false` by `EventTarget.dispatchEvent()` even while it's being dispatch.
And also the trusted state will be used for creating next event which is part
of the default action.
https://searchfox.org/mozilla-central/rev/6566d92dd46417a2f57e75c515135ebe84c9cef5/dom/events/EventDispatcher.cpp#1121,1126,1130-1131,1135,1138,1143

Therefore, this patch makes `WidgetEvent::mFlags` reset `mDispatchedAtLeastOnce`
when it's copied across process boundary and make
`EventDispatcher::DispatchDOMEvent()` won't modify being dispatched events for
avoiding any odd issues.

Unfortunately, this patch adds "expected: FAIL" to the new WPT test only on
Windows.  The failure reason is still unclear.  I cannot reproduce the failure
on my Windows environment, but on Try Server, it fails permanently since
the driver succeeds to send the mouse click, but the button never receives
`mouseup` nor `click` event.

Differential Revision: https://phabricator.services.mozilla.com/D52988

--HG--
extra : moz-landing-system : lando
2019-11-26 09:08:38 +00:00
Sean Feng a2de02dc9b Bug 1589742 - Collect telemetry on the types of user clicks r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D51508

--HG--
extra : moz-landing-system : lando
2019-11-13 18:12:02 +00:00
Edgar Chen 6c45f02a32 Bug 1553852 - Mark eCompositionChange as composed event; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D33387

--HG--
extra : moz-landing-system : lando
2019-06-03 09:18:47 +00:00
Emilio Cobos Álvarez f43eec6676 Bug 1551412 - Make XUL popup events composed. r=smaug
The front-end relies on getting the event for nodes in a ShadowRoot.

Differential Revision: https://phabricator.services.mozilla.com/D31365

--HG--
extra : moz-landing-system : lando
2019-05-16 20:56:45 +00:00
Ryan Hunt 0eeced87be Bug 1534395 - Rename TabParent to BrowserParent. r=nika
This commit renames TabParent to BrowserParent.

Differential Revision: https://phabricator.services.mozilla.com/D28133

--HG--
rename : dom/ipc/TabParent.cpp => dom/ipc/BrowserParent.cpp
rename : dom/ipc/TabParent.h => dom/ipc/BrowserParent.h
extra : rebase_source : d2706b9f42177d8de16068b7b1d088a44b8720a4
extra : histedit_source : a617ddac45c58050ef799116a67d2d983f2a8f6d%2C1d1dabd8761a32d548a6fbf1027be960698f6a5e
2019-04-09 16:38:15 -05:00
Henri Sivonen 862a7144a9 Bug 1524226 - Add LayersId field to WidgetEvent and InputData. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D20169

--HG--
extra : moz-landing-system : lando
2019-02-26 07:15:43 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Jan Henning 7fb92b8c44 Bug 1478776 - Part 10: Add internal VisualViewport resize/scroll events. r=botond,nika
The VisualViewport events are all nice and shiny, but unfortunately not quite
what is needed for the session store.

Firstly, the spec wants the "scroll" event to be fired only when the *relative*
offset between visual and layout viewport changes. The session store however
records the absolute offset and as such is interested in when *that* changes.

Secondly, again as per the spec the events don't bubble, and with the default
DOMEventTargetHelper implementation they don't escape the VisualViewport during
capturing, either. This means that any event listener must be added directly on
the VisualViewport itself in order to capture any events.

This might have been intended because the events use the same names as the
normal "scroll"/"resize" events, and as such you cannot specify separate event
listeners for VisualViewport and non-VisualViewport "scroll" events if both
events end up being dispatched to the same element (you can only try to filter
after the fact by looking at the originalTarget of the event).

At the same time, the VisualViewport is attached to the inner Window, and so
each time you navigate, you also get a different VisualViewport object.
All of this might be totally fine from the perspective of a page script, because
in that case you won't care anyway about what happens when the current page goes
away.

From the session store perspective on the other hand (especially Fennec's non-
e10s session store design), this is rather unfortunate because we don't want to
have to keep registering event listeners
a) manually for each subframe
b) each time the page navigates

The event target chain problem could be solved by letting the scroll events
escape the VisualViewport during the capturing phase (which the spec doesn't say
anything about), but this would mean that any scroll listener attached to a
window/browser/... that uses capturing will now catch both layout and visual
viewport scroll events.

In some cases this might even be beneficial, but in others (e.g. bug 1498812
comment 21) I'd like to specifically decide which kind of scroll event to
capture. Having to look at event.originalTarget to distinguish the two kinds
might be defensible in test code, but in case this distinction would be needed
in production code as well, given the existence of a C++-based filtering helper
in nsSessionStoreUtils for another use case where (scroll) events need to be
filtered, JS-based scroll event filtering might be a bad idea.

Additionally, in any case this wouldn't solve the fundamental conflict between
the spec and the session store about *when* the "scroll" event should be fired
in the first place.

Hence I'd like to introduce a separate set of events with distinct event names,
which will be dispatched according to the requirements of our internal users
(i.e. currently the session store). To avoid potential web compatibility issues
down the road, for now these events will be dispatched only to event listeners
registered in the system group (allowing *all* Chrome event listeners cannot be
done because checking the Chrome status of each event target might be too
expensive for frequently dispatched events).

Differential Revision: https://phabricator.services.mozilla.com/D14046

--HG--
extra : moz-landing-system : lando
2018-12-20 22:14:42 +00:00
Jan Henning c3352661fc Bug 1478776 - Part 8: Add an event flag for dispatching to system group only. r=smaug
The semantics of the VisualViewport resize/scroll events aren't quite what is
needed for internal browser usage, so we need a separate set of events that can
be used e.g. by the session store. To avoid future web compatibility issues,
that event should be kept internal, however none of the existing
options to achieve that are suitable:
- mNoContentDispatch can actually end up being dispatched to content after all
  and as per its comment preferably shouldn't be used any more for new features
- mOnlySystemGroupDispatchInContent would work perfectly, except that it
  shouldn't be used for frequent events, which the resize/scroll events
  arguably are
- mOnlyChromeDispatch doesn't work for the Desktop session store's content
  script, plus it might have the same performance problems as
  mOnlySystemGroupDispatchInContent

Therefore, I propose to introduce a new mOnlySystemGroupDispatch event flag,
which skips the comparatively expensive IsCurrentTargetChrome() check and relies
only on the event listener having been registered in the system group.

Differential Revision: https://phabricator.services.mozilla.com/D14045

--HG--
extra : moz-landing-system : lando
2018-12-20 21:35:39 +00:00
Olli Pettay b977d23eb2 Bug 1089326, make <button> hit testing similar to other elements which may have some content, and for click target find the common (interactive) ancestor, r=masayuki
--HG--
extra : rebase_source : 80caab4e074d552c38b62842fe3102fb6735dfd9
2018-12-11 23:35:40 +02:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano abe138f771 Bug 1504911 - part 1: Make all "input" event dispatcher in C++ use new utility method r=smaug
Currently, a lot of code dispatch "input" event and some of them dispatch
"input" event with wrong interface and/or values.  Therefore this patch
creates nsContentUtils::DispatchInputEvent() to make all of them dispatch
correct event.

Unfortunately, due to bug 1506439, we cannot set pointer to refcountable
classes of MOZ_CAN_RUN_SCRIPT method to nullptr.  Therefore, this patch
creates temporary RefPtr<TextEditor> a lot even though it makes damage to
the performance if it's in a hot path.

This patch makes eEditorInput event dispatched with
InternalEditorInputEvent when "input" event should be dispatched with
dom::InputEvent.  However, this patch uses WidgetEvent whose message is
eUnidentifiedEvent and setting WidgetEvent::mSpecifiedEventType to
nsGkAtoms::oninput when "input" event should be dispatched with
dom::Event because we need to keep that eEditorInput and
InternalEditorInputEvent are mapped each other.

Differential Revision: https://phabricator.services.mozilla.com/D12244

--HG--
extra : moz-landing-system : lando
2018-11-21 03:59:02 +00:00
Kartikaya Gupta f366022cd6 Bug 1504793 - Remove out-of-date sentence from comment. r=botond
DONTBUILD because comment-only change.

Differential Revision: https://phabricator.services.mozilla.com/D10948

--HG--
extra : moz-landing-system : lando
2018-11-05 23:36:14 +00:00
Olli Pettay ddda29dcf1 Bug 1484371 - make *enter/*leave events uncomposed, r=masayuki
--HG--
extra : rebase_source : 508dc487915b352682887e1a4650fc396564d532
2018-08-22 16:08:17 +03:00
Olli Pettay 7146d67afe Bug 1472887, focusin/out should be composed, and mark chrome event target chain items as chrome, r=masayuki 2018-07-09 17:40:01 +03:00
Masayuki Nakano 36f73c43d8 Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Currently, if an event is consumed in the main process, EventStateManager
does not send it to remote process.  However, this is unexpected behavior
for some WidgetKeyboardEvent dispatchers.  OS sometimes has consumed native
key events before sending applications.  For example, Alt key on Windows
should activate menu bar of focused window but Alt key may be consumed before
focused window receives the event.  In such case, we mark Alt keyboard event
as "consumed before dispatch", and chrome treat it like as its preventDefault()
is called in web content.  (Note that for compatibility with other browsers,
the consumed state is not exposed to web content.  So, Event.defaultPrevented
returns false in web content.)

Therefore, we need to treat "consumed" state and "cross process forwarding"
state separately.  This patch makes calling WidgetEvent::PreventDefault()
always stops cross process forwarding for backward compatibility.  Additionally,
for the special case mentioned above, this patch makes
WidgetEvent::PreventDefaultBeforeDispatch() take additional argument,
|aIfStopCrossProcessForwarding|.  If this is CrossProcessForwarding::eStop,
the event won't be sent to remote process as same as calling PreventDefault().
Otherwise, CrossProcessForwarding::eHold, PreventDefaultBeforeDispatch() call
does not change "cross process forwarding" state.  I.e., if the event's
StopCrossProcessForwarding() and PreventDefault() are not called until
EventStateManager::PostHandleEvent(), the event will be sent to remote process
as usual.

MozReview-Commit-ID: IQGWJvXetxV

--HG--
extra : rebase_source : 4ccdd500e80b8fe29e469ac3b85578e1c07c8358
2018-06-25 18:17:18 +09:00