Commit Graph

699 Commits

Author SHA1 Message Date
Alexandru Marc
46de26821c Revert "Bug 1550462 - part 3: Enable pointerrawupdate event r=smaug" for causing mochitest failures @ test_pointerrawupdate_event_count.html
This reverts commit eb27445e03.

Revert "Bug 1550462 - part 2: Make `PresShell::HandleEvent` dispatch preceding `pointerrawupdate` event r=smaug,dom-core,edgar"

This reverts commit 502f22686c.

Revert "Bug 1550462 - part 1: Define `pointerawupdate` event r=smaug"

This reverts commit 2b13850454.
2025-05-16 06:32:12 +00:00
Masayuki Nakano
502f22686c Bug 1550462 - part 2: Make PresShell::HandleEvent dispatch preceding pointerrawupdate event r=smaug,dom-core,edgar
This patch tries to dispatch `ePointerRawUpdate` with
`PresShell::EventHandler::DispatchPrecedingPointerEvent` as same as usual
pointer events.

For using the path, this patch adds 2 internal events, `eMouseRawUpdate`
and `eTouchRawUpdate` which are never dispatched into the DOM because
`PresShell::EventHandler::DispatchPrecedingPointerEvent` will return `false`
for that and then the caller will stop handling the internal events.

There are 3 dispatchers of the internal raw update events.

One is `PresShell::EnsurePrecedingPointerRawUpdate()`.  This dispatches the
internal event if and only if the coming event of `PresShell::HandleEvent` will
cause `ePointerMove`.  The reason why `PresShell::HandleEvent` handles the
preceding raw-update event is, we should support `ePointerRawUpdate` events
for synthesized events for tests (in-process ones) and in the main process.
Additionally, if a `pointerrawupdate` event may destroy the target `<iframe>`.
In such ase, the following `pointermove` may need to be dispatched on its parent
window or another `<iframe>` window.  Therefore, we need to dispatch the
internal raw update event before considering the target window (`PresShell`) and
handling the capturing element.

The others are `BrowserChild::RecvRealMouseMoveEvent` and
`BrowserChild::RecvRealTouchMoveEvent`.  They dispatch the internal events
when they won't dispatch the received event immediately to coalesce with further
similar input.

For avoiding to dispatch the internal event for same source event, this adds
`WidgetPointerHelper::convertToPointerRawUpdate` member to check it in
`PresShell::HandlePrecedingPointerRawUpdate`.

Differential Revision: https://phabricator.services.mozilla.com/D243404
2025-05-15 03:22:44 +00:00
Masayuki Nakano
2b13850454 Bug 1550462 - part 1: Define pointerawupdate event r=smaug
This patch just defines the event message, an atom for event listener attribute
and managing whether the window may have a listener.

Differential Revision: https://phabricator.services.mozilla.com/D243403
2025-05-15 03:22:40 +00:00
Masayuki Nakano
69f1102665 Bug 1885232 - part 1: Make PresShell::GetOverrideClickTarget and EventStateManager::SetClickCount use pointer capturing element at dispatching the source event r=smaug
Pointer Events defines the `click`, `auxclick` and `contextmenu` target as [1]:
> 1. Let event be the click, auxclick or contextmenu event being dispatched,
> and userEvent be the user interaction event that caused the firing of event.
> 2. If userEvent is not a PointerEvent, dispatch event following the [UIEVENTS]
> spec without overriding event target and skip the remaining steps below.
> 3. If event is a contextmenu event, or userEvent was dispatched while the
> corresponding pointer was captured, then let target be the target of userEvent.

`contextmenu` case is a little bit more complicated than `click` and `auxclick`
because it's always targeted to the `pointerup` target and we don't store the
`pointerup` target and `contextmenu` is usually triggered by the native
"contextmenu" event.  Therefore, this patch fixes only the case if an element
captures the pointer at dispatching `pointerup`.

However, this standardized behavior is unfortunately different from the fixed
behavior of bug 1447993.  In the bug, we made the target as the element under
the pointer which may be a descendant of the capturing element.  Fortunately,
even after applying this patch, the reported web app works even though the
reported page has gone and the issue of the web app is still open.  For making
things safer, this patch enables the new behavior only on early beta builds and
in the nightly channel for now to get the feedback from the testers.

`test_bug1447993.html` (and `window_bug1447993.html`) keeps testing the fix of
bug 1447993 with disabling the new behavior.  Instead of the test, this patch
adds new WPT to check the standardized behavior in the same steps.  Chrome
files to target to the capturing element at touch, but the developers agree
with it's unexpected behavior [2].

1. https://w3c.github.io/pointerevents/#event-dispatch
2. https://github.com/w3c/pointerevents/issues/508#issuecomment-2180813312

Differential Revision: https://phabricator.services.mozilla.com/D218275
2025-05-10 11:12:07 +00:00
Cathy Lu
9b532e96df Bug 1940052 - Apply fixed position css to Android pip media query r=emilio,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D246364
2025-04-29 14:33:50 +00:00
Emilio Cobos Álvarez
79aa0d7606 Bug 1958322 - Plumb pip mode to Gecko. r=padenot,hiro,geckoview-reviewers,webidl,saschanaz,smaug,calu
Differential Revision: https://phabricator.services.mozilla.com/D244794
2025-04-09 18:04:42 +00:00
kernp25
4d18975ff5 Bug 1945924 - Replace SchemeIsFoo functions with the inlined SchemeIs() call. r=valentin,emilio,necko-reviewers,geckoview-reviewers,anti-tracking-reviewers,core-sessionstore-reviewers,ohall,farre
No behavior change intended.

Differential Revision: https://phabricator.services.mozilla.com/D236756
2025-03-31 14:25:54 +00:00
Andrew McCreight
c02511ddd5 Bug 1936641, part 1 - Traverse and unlink BrowserChild::mWebBrowser. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D231849
2024-12-12 14:57:35 +00:00
Adam Vandolder
2ba689d99e Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-12-05 01:20:07 +00:00
Goloman Adrian
05b7d33317 Backed out changeset 4d19e4620e63 (bug 1924861) for causing bc failures @browser_stop_pending.js. CLOSED TREE 2024-12-04 09:11:45 +02:00
Adam Vandolder
87c9038ba7 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-12-04 04:17:36 +00:00
Cosmin Sabou
82fbc8fbe4 Backed out changeset a8d030efc4ea (bug 1924861) for causing bc failures on browser_stop_pending. 2024-12-02 01:21:14 +02:00
Adam Vandolder
f6e7455adc Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-12-01 04:13:01 +00:00
Sandor Molnar
7e190c9386 Backed out changeset b94afd94ed9c (bug 1924861) for causing multiple bc failures. CLOSED TREE 2024-11-30 20:40:15 +02:00
Adam Vandolder
5f7b028386 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-11-29 23:38:09 +00:00
Jonathan Watt
650e5227e6 Bug 1931496. Some missed contentViewer to documentViewer renames. r=baku DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D229104
2024-11-15 11:01:18 +00:00
Emilio Cobos Álvarez
30929e04af Bug 1930476 - Improve units in nsFrameLoader and related code. r=geckoview-reviewers,jwatt,ohall
Use LayoutDevice units for most these things, since it's what they are:

  ScreenIntSize(presContext->AppUnitsToDevPixels(size.width), ...

Is clearly a lie :)

Differential Revision: https://phabricator.services.mozilla.com/D228586
2024-11-12 15:16:50 +00:00
Edgar Chen
db01e53404 Bug 1928340 - Add some log for pointer lock; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D228090
2024-11-06 20:59:35 +00:00
Emilio Cobos Álvarez
0642354b62 Bug 1927255 - More subtly deal with preserveLayers in inactive tabs. r=mconley
PreserveLayers is propagated to child frames, and it'd be nice if it
could be used just the same way it's used for the top level tab, to
avoid discarding the resources.

For the top level, if you call preserveLayers() you also need to have
renderLayers = true.

It'd be better long-term, perhaps, to have renderLayers and
preserveLayers in the parent BC. Happy to work on that refactoring if
you agree.

Testing wise, I don't think this is easily testable...

Differential Revision: https://phabricator.services.mozilla.com/D227000
2024-10-30 00:42:23 +00:00
Masayuki Nakano
fa2615a67d Bug 1922549 - Send and handle OnEventNeedingAckHandled of content command events r=smaug
When I make `ContentCacheInParent` manage the pending content command events, I forgot
to make `BrowserChild::RecvInsertText()` and `BrowserChild::RecvReplaceText()` call
`SendOnEventNeedingAckHandled()` because they have existed and I added
`BrowserChild::RecvSimpleContentCommandEvent()`.  Therefore, this patch makes them call
`SendOnEventNeedingAckHandled()`.

Additionally, `ContentCacheInParent::OnEventNeedingAckHandled()` returns without
managing the count if it's called for the content command events.  Therefore, this patch
fixes the early return bug too.

Differential Revision: https://phabricator.services.mozilla.com/D225749
2024-10-16 08:21:48 +00:00
Emilio Cobos Álvarez
7e3778ba99 Bug 1922956 - Further clean-up widget creation code-paths. r=win-reviewers,mac-reviewers,geckoview-reviewers,mstange,rkraesig,m_kato
This is all super-hacky (see a lot of the XXXcjones comments).

Simplify it... We never create widgets with a bare native parent but no
nsIWidget parent. Pass nsIWidgets and deal with things correctly.

There were also things that were dealing with stuff that can't happen,
like top level popups, children of PuppetWidgets, or such.

Instead of overriding Create(), let's just teach nsBaseWidget about
non-native (headless/puppet) widgets.

Remove lots of old APIs for the native window stuff that are unused
and/or unimplemented.

Differential Revision: https://phabricator.services.mozilla.com/D224613
2024-10-07 16:43:53 +00:00
Julian Descottes
161f9b2b25 Bug 1921119 - Add canceledReason to RemoteWebProgressRequest r=nika
The canceledReason is added to the RequestData used to build the
RemoteWebProgressRequest. This canceledReason is useful for consumers such
as WebDriverBiDi which need to emit different error messages depending on
the reason why a specific navigation request was canceled.

Differential Revision: https://phabricator.services.mozilla.com/D223174
2024-09-25 21:25:40 +00:00
Masayuki Nakano
bfa50cbcb0 Bug 1863611 Make EventStateManager send content command events to focused remote process r=smaug
Currently, `EventStateManager` handles some content commands only in the parent
process.  Therefore, if `eSetSelection` event or something is being handled in
the focused remote process, the command may be disabled yet.

Avoiding the race conditions, we should handle the content command events in the
focused process.

Differential Revision: https://phabricator.services.mozilla.com/D222789
2024-09-20 08:12:33 +00:00
Cristian Tuns
8b350cfc18 Backed out changeset 1590ecab1ea1 (bug 1863611) for causing bc failures in browser_test_contentCommand_immediately_after_setSelection.js CLOSED TREE 2024-09-19 22:00:15 -04:00
Masayuki Nakano
61ad8758cb Bug 1863611 Make EventStateManager send content command events to focused remote process r=smaug
Currently, `EventStateManager` handles some content commands only in the parent
process.  Therefore, if `eSetSelection` event or something is being handled in
the focused remote process, the command may be disabled yet.

Avoiding the race conditions, we should handle the content command events in the
focused process.

Differential Revision: https://phabricator.services.mozilla.com/D222789
2024-09-19 22:41:20 +00:00
David Parks
cdf1ecf510 Bug 1918907: Don't clear drag session target BrowserChild on eDragLeave/eDragExit r=m_kato
The BrowserChild should only be cleared on EndDragSession, which is sent when
the user finishes or cancels dragging. This is reciprocal to it being set in
StartDragSession.

The change to nsDragSessionProxy::EndDragSessionImpl is non-functional -- it
highlights the BrowserChild symmetry above.

Differential Revision: https://phabricator.services.mozilla.com/D222389
2024-09-19 16:17:21 +00:00
Greg Stoll
cb31f6b3bb Bug 1918579 - don't crash when dropping with content analysis and focus changes r=masayuki,dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D222290
2024-09-17 14:05:24 +00:00
David Parks
2f776696c6 Bug 1910452: Part 1 - Intercept drop events for content analysis r=smaug,dlp-reviewers,gstoll,reusable-components-reviewers,mstriemer
Sends OOP drop events to content analysis for approval before sending them to
the DOM.  It intercepts drop events at the browser level and sends them to CA
before calling stopPropagation and preventDefault on them.  (CA also presents a
modal dialog over the tab.) The drag session then ends as usual in the parent
process but remains open on the related browser in the process where it would be
sent to the DOM while the drop is being analyzed.  While CA runs, the browser
dispatches an eQueryDropTargetHittest event to locate the drop target while the
event screen coordinates are still valid.  When CA is complete, a drop or
dragexit event is sent to the drop target (drop if it was approved by CA). Calls
to EndDragSession are delayed during this.

Differential Revision: https://phabricator.services.mozilla.com/D219201
2024-09-11 23:02:22 +00:00
David Parks
7c7f364d0d Bug 1912340: Use correct principal for remotely dragged data-transfer contents r=m_kato
This comment assumes dom.events.datatransfer.protected.enabled=false.  when
dom.events.datatransfer.protected.enabled=true (which matches the spec and is
not the default), the behavior is fine as-is.

Since bug 1871222 (by one perspective) moved drag sessions from PContents to
PBrowsers, we need to update permission handling for in-process "remote"
sessions (ones that started on one PBrowser and currently target another). When
the target and source are in the same process, they don't properly handle
privileged DataTransfer access.  We are currently denying privileged access to
some in-process principals because we incorrectly use the system principal. The
system principal always happens to give the right result for out-of-process
remote sessions, which were the only kind that existed before bug 1871222.

This solution creates the "remote" DataTransfer with the "correct" (not system)
principal of its source content.  However, this misses the case where two
different browsers are at the same location (same principal) -- each would
incorrectly get privileged access to the other's DataTransfer in a drag.  We
avoid that case by limiting the change to extension processes.  This means that
remote DataTransfers created in the extension process will check for protected
access using a principal check against the drag-source-element's principal but,
otherwise, DataTransfers will continue to use the system principal for the
check.

Differential Revision: https://phabricator.services.mozilla.com/D219074
2024-08-22 18:51:52 +00:00
Florian Quèze
7c36c2563c Bug 1913624 - Remove expired telemetry histogram TABCHILD_PAINT_TIME, r=TravisLong.
Depends on D219480

Differential Revision: https://phabricator.services.mozilla.com/D219481
2024-08-21 09:14:31 +00:00
Hiroyuki Ikezoe
29265bc3fa Bug 1831649 - Propagate the software keyboard height change into nsPresContext. r=botond,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D204166
2024-08-06 07:46:21 +00:00
Tom Schuster
c051081043 Bug 1809713 - Make DataTransfer use Maybe<ClipboardType>. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D214585
2024-07-29 11:52:34 +00:00
Makoto Kato
11120016db Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki
When using autocorrect, we should use `insertReplacementText` according
to https://github.com/w3c/input-events/issues/152. So I would like to
add eContentCommandReplaceText command for this.

Also, this command has an option that is source string text. When
processing text subsitution, parent process doesn't know whether
target replaced text is modified. So I add this option for check.

Differential Revision: https://phabricator.services.mozilla.com/D213511
2024-07-26 06:38:52 +00:00
Stanca Serban
b74d1bcd26 Backed out 12 changesets (bug 1831649) for causing multiple failures.
Backed out changeset 501dc3134ae1 (bug 1831649)
Backed out changeset 21235ab42839 (bug 1831649)
Backed out changeset 279fdf36aac1 (bug 1831649)
Backed out changeset 17fb50534fae (bug 1831649)
Backed out changeset b2718b2f730d (bug 1831649)
Backed out changeset a05aa1c75ece (bug 1831649)
Backed out changeset becfb23cd6b4 (bug 1831649)
Backed out changeset 2d0e7e662530 (bug 1831649)
Backed out changeset 22538f7bdc88 (bug 1831649)
Backed out changeset 4ddecb37950f (bug 1831649)
Backed out changeset 1e6ed8b78e8f (bug 1831649)
Backed out changeset 6e96a1a01c24 (bug 1831649)
2024-07-18 06:13:43 +03:00
Hiroyuki Ikezoe
56a2fb332d Bug 1831649 - Propagate the software keyboard height change into nsPresContext. r=botond,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D204166
2024-07-18 00:31:12 +00:00
Otto Länd
ee85122101 Bug 1893119: apply code formatting via Lando
# ignore-this-changeset
2024-07-04 07:52:52 +00:00
David P
e844cdeed5 Bug 1893119: Part 21 - Separate nsIDragService and nsIDragSession implementations r=gstoll,geckoview-reviewers,rkraesig,win-reviewers,m_kato
Split the class inheritance trees for nsIDragService and nsIDragSession.
Remember that, before the start of this patch series, the inheritance
diagram was:

nsDragService -> nsBaseDragService -> nsIDragService + nsIDragSession

and the only instance was a singleton.  We switched it to:

nsDragService -> nsDragSession -> nsBaseDragService -> nsIDragService + nsBaseDragSession -> nsIDragSession

and maintained the singleton.  This allowed us to allow us to move things to
the new classes without breaking behavior.  We are done with that,
so we can now change the inheritance to its final form:

nsDragService -> nsBaseDragService -> nsIDragService

nsDragSession -> nsBaseDragSession -> nsIDragSession

Of course, we also need to properly construct and release the
nsIDragSessions (formerly part of the singleton), so that is done here as
well.  That happens in nsBaseDrag[Service|Session] for parent process drags
and in nsDrag[Service|Session]Proxy for content.  This is all fairly
straightforward, except in the case of gtk, where we need to change
some callback behavior.

Differential Revision: https://phabricator.services.mozilla.com/D211084
2024-07-04 07:48:11 +00:00
David P
5c77b63f65 Bug 1893119: Part 20 - Move EndDragSession from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
This is a straightforward move.  It does take the liberty of breaking out an
EndDragSessionImpl method, which will be needed later.

Differential Revision: https://phabricator.services.mozilla.com/D211083
2024-07-04 07:48:11 +00:00
David P
19861d5e8d Bug 1893119: Part 17 - Pass the widget to StartDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211080
2024-07-04 07:48:10 +00:00
David P
c32e8a504a Bug 1893119: Part 16 - Make nsBaseDragService weakly remember PBrowsers instead of PContents r=nika,win-reviewers,rkraesig
nsBaseDragService keeps track of the processes that might need to cancel a drag with EndDragSession and this is technically correct since the drag session is a singleton in the child process, but this series of patches changes those sessions to be per-PuppetWidget/BrowserChild.  This allows content processes to distinguish which of its browsers is engaged in a drag.

Differential Revision: https://phabricator.services.mozilla.com/D211062
2024-07-04 07:48:09 +00:00
David Parks
88e30b7141 Bug 1893119: Part 13 - Move FireDragEventAtSource from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211077
2024-07-04 07:48:08 +00:00
David P
805b8742ba Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig
Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
2024-07-04 07:48:04 +00:00
Masayuki Nakano
b3c5045ec1 Bug 1675847 - part 5: Make contextmenu event dispatchers use WidgetPointerEvent or PointerEvent r=smaug,pip-reviewers,devtools-reviewers,nchevobbe,mconley
`eContextMenu` event may be fired from `widget`.  Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch.  This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`

Differential Revision: https://phabricator.services.mozilla.com/D213003
2024-06-14 00:18:48 +00:00
Edgar Chen
d67110bf57 Bug 1743329 - Release pointer lock when xul popup is open; r=smaug,pbz
Differential Revision: https://phabricator.services.mozilla.com/D211620
2024-05-31 11:13:46 +00:00
Andrew McCreight
c1d7b2257a Bug 1899888 - Remove the frequent "Fallback to FallbackRenderer" warning. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D212186
2024-05-30 21:48:17 +00:00
Butkovits Atila
3a56b9800d Backed out 4 changesets (bug 1743329) for causing failures at browser_popupNotification_security_delay.js. CLOSED TREE
Backed out changeset 6d33ea38cd14 (bug 1743329)
Backed out changeset 0f9bffa357a5 (bug 1743329)
Backed out changeset cd96c48488eb (bug 1743329)
Backed out changeset 209a41c449e1 (bug 1743329)
2024-05-29 15:47:23 +03:00
Edgar Chen
625627d9e8 Bug 1743329 - Release pointer lock when xul popup is open; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211620
2024-05-29 07:50:20 +00:00
Masayuki Nakano
ab19f1368c Bug 1879765 - part 2: Make BrowserChild store the last code value of consumed eKeyDown event r=smaug
The builtin legacy IME of Windows to type a Unicode with typing a code point
causes consumed `eKeyDown` events while typing the code point, i.e., without
`eKeyPress` (FYI: The consumed state is not exposed to the web, it's used only
in chrome UI for the compatibility with Chrome).  Then, `BrowserChild` store
whether the last `eKeyDown` was consumed or not to prevent the following
`eKeyPress`.  Finally, a `eKeyPress` event is fired to input the Unicode
character after `eKeyUp` for `Alt`.  The stored value is set to new value only
when another `eKeyDown` event is sent from the parent process.  Therefore,
the last digit inputting `eKeyDown` causes `BrowserChild` thinking the last
`eKeyDown` is consumed so that the last `eKeyPress` is not dispatched.

This patch makes `BrowserChild` to store the `code` value of the last consumed
`eKeyDown` and check the `code` value to consider whether coming `eKeyPress`
should be or not be dispatched to `PresShell` and the DOM.

Differential Revision: https://phabricator.services.mozilla.com/D207957
2024-05-16 02:36:03 +00:00
Tamas Szentpeteri
26e6238bd3 Backed out 2 changesets (bug 1879765) for causing failures on test_nsITextInputProcessor.xhtml. CLOSED TREE
Backed out changeset 6214b15c2021 (bug 1879765)
Backed out changeset 87e77d284071 (bug 1879765)
2024-05-15 15:15:50 +03:00
Masayuki Nakano
cbc30f77ec Bug 1879765 - part 2: Make BrowserChild store the last code value of consumed eKeyDown event r=smaug
The builtin legacy IME of Windows to type a Unicode with typing a code point
causes consumed `eKeyDown` events while typing the code point, i.e., without
`eKeyPress` (FYI: The consumed state is not exposed to the web, it's used only
in chrome UI for the compatibility with Chrome).  Then, `BrowserChild` store
whether the last `eKeyDown` was consumed or not to prevent the following
`eKeyPress`.  Finally, a `eKeyPress` event is fired to input the Unicode
character after `eKeyUp` for `Alt`.  The stored value is set to new value only
when another `eKeyDown` event is sent from the parent process.  Therefore,
the last digit inputting `eKeyDown` causes `BrowserChild` thinking the last
`eKeyDown` is consumed so that the last `eKeyPress` is not dispatched.

This patch makes `BrowserChild` to store the `code` value of the last consumed
`eKeyDown` and check the `code` value to consider whether coming `eKeyPress`
should be or not be dispatched to `PresShell` and the DOM.

Differential Revision: https://phabricator.services.mozilla.com/D207957
2024-05-15 05:42:33 +00:00