Commit Graph
282 Commits
Author SHA1 Message Date
Masayuki Nakano f15f8cc1c7 Bug 2040148 - Make TSFTextStore hack the wrong TS_E_NOLAYOUT error handling of WeChat Input Method r=m_kato
When we return `TS_E_NOLAYOUT` from `ITextStoreACP::GetTextExt()`,
WeChat Input Method does not handle the error correctly and shows its
UI to the top-left corner of the screen. Therefore, we need not to
return `TS_E_NOLAYOUT` if it's the active TIP.

However, I found 2 extant bugs and they block fixing this bug.

First one is, `TSFTextStore::MaybeHackNoErrorLayoutBugs()` does nothing
if `IsHandlingCompositionInContent()` return `false`. [1] This means
that we don't hack `GetTextExt()` behavior when the composition starts
and not yet dispatched the first event. So, this causes temporarily
appear the UI in odd place, like top-left corner of the screen even with
some other IMEs.

The other one is, `TSFTextStore::GetTextExt()` may query a line break
rect when the user starts composition at end of a line. [2] So, only
when starting composition, the UI may (maybe temporarily) appear at
start of next line. Therefore, if the line scanning range in the
original content has a linefeed, we should query a rect before the
first linefeed, i.e., only the text rect in the start line even if it's
0-length. The difference between the caret rect and the new character
rect should be smaller than the difference from the start of the next
line.

1. https://searchfox.org/firefox-main/rev/e28b34ab33dbf49364999070168cbb7e11e8e5bd/widget/windows/TSFTextStore.cpp#2156,2172,2175
2. https://searchfox.org/firefox-main/rev/e28b34ab33dbf49364999070168cbb7e11e8e5bd/widget/windows/TSFTextStore.cpp#2070

Differential Revision: https://phabricator.services.mozilla.com/D303266
2026-06-01 03:37:56 +00:00
Masayuki Nakano 5760fed2c7 Bug 2034887 - Make TSFTextStore lock mPendingActions while referring an extant pending action r=m_kato,win-reviewers,gstoll
While referring an extant item in the pending action array,
`TSFTextStore::PendingActions` shouldn't delete the extant item.
Therefore, while referring an extant item, `TSFTextStore` needs to
lock the array.

Note that removing array items during a lock should be caused by
a malware or a bug of the TIP. Therefore, we don't need to try to
recover the normal condition with complicated handling.

Differential Revision: https://phabricator.services.mozilla.com/D297551
2026-05-16 08:09:30 +00:00
Masayuki Nakano 986c0e8944 Bug 2034887 - Make TSFTextStore::PendingActions to allow to lock the array r=m_kato,win-reviewers,gstoll
Let's wrap `nsTArray<PendingAction>` within a nested class. The
following patch adds a lock feature.

Differential Revision: https://phabricator.services.mozilla.com/D297550
2026-05-16 08:09:27 +00:00
Sylvestre Ledru 4f6b8b516d Bug 2023419 - Remove Emacs/Vim modelines from widget/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287877
2026-03-16 17:22:02 +00:00
Masayuki Nakano 57daabe7f5 Bug 2019547 - Use ContiguousEnumSerializerInclusive more at receiving/sending IME messages r=m_kato,geckoview-reviewers,win-reviewers,gstoll
We should use `ContiguousEnumSerializerInclusive` to receive/send an
`enum` value.

`IMENotificationRequests` has an enum whose values are used as bit
field. So, we can use `EnumSet` for it and then, we don't need to write
`ParamTraits` for it directly.

Differential Revision: https://phabricator.services.mozilla.com/D285200
2026-03-05 02:34:56 +00:00
Masayuki Nakano 905d0f6bed Bug 1824143 - part 2: Make TSFTextStore::FlushPendingActions() set mDeferNotifyingTSFUntilNextUpdate before dispatching composition events r=m_kato
This fixes a regression of bug 1137561.  That made `TSFTextStore` stop
dispatching composition events directly.  However, its dispatcher sets
`mDeferNotifyingTSFUntilNextUpdate` to notify TSF of anything until
it receives `NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED` since
`GetTextExt()` etc will return error if the layout has not be updated.
So, we started return `E_FAIL` a lot from various `ITextStoreACP`
methods if TSF/TIP queries something immediately after updating
the composition.

Differential Revision: https://phabricator.services.mozilla.com/D271560
2025-11-12 22:54:23 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Masayuki Nakano 3f7df7a20f Bug 1959493 - Restore the check in TSFTextStoreBase::SetInputContext to avoid unnecessary focus change emulation r=m_kato
Although I'm not sure why this breaks the legacy MS-IME for Japanese.

When `InputContext` is set, we may need to emulate focus to recreate
`TSFTextStoreBase` instance.  This is not required if the editable state is not
changed, but the check was removed by D242682.  This patch restores the check.
However, instead, making it sure to update the document URL and private browsing
mode for the privacy.

Additionally, I found another difference.  D242682 made `TSFEmptyTextStore`
starts associating its document manager with the active window.  However,
this is not required and that may cause making TSF calling `SetFocus()` of the
document manager even when editable `TSFTextStore` already got focus.
Therefore, this removes the unnecessary new thing too.  Therefore,
`TSFUtils::OnFocusChange` skips to disassociate document manager from a
window handle.

Differential Revision: https://phabricator.services.mozilla.com/D245348
2025-04-16 05:30:07 +00:00
Masayuki Nakano b401605f20 Bug 1953047 - part 4: Implement TSFEmptyTextStore for the disabled document manager and context r=m_kato
Even while IME is disabled (i.e., when non-editable element or nobody has
focus), we'll expose active tab's URL and whether it's in the private browsing
mode via the input scope.  Therefore, we need to handle requests for retrieving
attributes.  So, we need a TextStore instance for that.  However, they may
require special behavior due to its context is marked as empty and not editable.
Unfortunately, `TSFTextStore` is enough complicated and big even after some
features are moved to `TSFUtils` and `TSFTextStoreBase`.  Therefore, this patch
creates `TSFEmptyTextStore` to isolate the implementation from `TSFTextStore`.

Differential Revision: https://phabricator.services.mozilla.com/D242682
2025-03-31 22:03:19 +00:00
Masayuki Nakano be5c66ce93 Bug 1953047 - part 3: Move attributes handlers of TSFTextStore into TSFTextStoreBase r=m_kato
`TSFEmptyTextStore` will share them. For making the changes for it clearer in
the previous patch, this patch moves them.

Differential Revision: https://phabricator.services.mozilla.com/D242681
2025-03-31 22:03:19 +00:00
Masayuki Nakano bd2de2da87 Bug 1953047 - part 2: Move most static staff of TSFTextStore to TSFUtils r=m_kato
This should've already been done when creating `TSFUtils`, though.

Differential Revision: https://phabricator.services.mozilla.com/D242680
2025-03-31 22:03:19 +00:00
Masayuki Nakano 54267e0b08 Bug 1953047 - part 1: Split TSFTextStore with new its base class r=m_kato
We want another `TSFTextStore` class which always has empty content but
allows to reply to retrieving the properties and supports sink.

For avoiding to duplicate some methods and basic parameter checks, we
should have a base class, `TSFTextStoreBase`.

Differential Revision: https://phabricator.services.mozilla.com/D242679
2025-03-31 22:03:18 +00:00
Masayuki Nakano f259acf13b Bug 1953688 - Split TSFTextStore.cpp for each class definition and declaration r=m_kato
It's too big and the code in it is really complicated.  Therefore, I don't
like to make it bigger to implement new `ITfTextStore` subclass.  Therefore,
this patch splits the file for `TSFStaticSink`, `InputScopeImpl` (renamed to
`TSFInputScope`) and the others (named `TSFUtils`).

This patch sorts out some logging helper methods/classes.  Therefore, this
patch contains some changes in `TSFTextStore.cpp`.

Differential Revision: https://phabricator.services.mozilla.com/D241348
2025-03-18 06:06:10 +00:00
Masayuki Nakano 4a29806dfa Bug 1953046 - Clean up TSFTextStore.h and TSFTextStore.cpp r=m_kato,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D240970
2025-03-18 03:56:25 +00:00
Norisz Fay c662f8a9f9 Backed out changeset dd3f6e2c4bd4 (bug 1953046) for causing bustage on WinUtils.cpp CLOSED TREE 2025-03-18 04:48:38 +02:00
Masayuki Nakano e0c2d06b67 Bug 1953046 - Clean up TSFTextStore.h and TSFTextStore.cpp r=m_kato,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D240970
2025-03-18 00:16:19 +00:00
Masayuki Nakano c88222578d Bug 1952814 - Make TSFTextStore push the disabled context to the disabled document manager r=m_kato
We create a document manager for disabling IME and create a context for it.
However, we don't push the context into the document manager.  Therefore,
TSF cannot work with the context unless an editable element has focus.

Differential Revision: https://phabricator.services.mozilla.com/D240969
2025-03-14 01:21:14 +00:00
Florian Quèze 9609e47f62 Bug 1879329 - script generated replacement of the GleanMetrics.h includes, r=chutten,valentin,media-playback-reviewers,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,rkraesig,emz,aabh,padenot.
Differential Revision: https://phabricator.services.mozilla.com/D234744
2025-01-21 11:21:45 +00:00
serge-sans-paille 2a089b2a01 Bug 1929261 - Use std::clamp instead of min/max chain in widget/windows r=m_kato,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D227973
2024-11-06 10:21:58 +00:00
serge-sans-paille 262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille 07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc 004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille 2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Florian Quèze f254ff6fe1 Bug 1923028 - Migrate scalars to use Glean APIs for widget.*, r=chutten,win-reviewers,gstoll.
Differential Revision: https://phabricator.services.mozilla.com/D225861
2024-10-18 10:58:18 +00:00
Masayuki Nakano 15fa6d5c65 Bug 1840568 - Make TSFTextStore allow to flush layout at query content only when it's not called recursively r=m_kato
By default, query content allows to flushing layout.  In most cases, this should
not cause recursive call of the caching content/selection methods.  However,
according to a crash report, this may occur with no chance to avoid the loop
from `TSFTextStore` point of view.  Fortunately, the recursive call may happen
only when an element in chrome in the main process has focus.  Therefore, I
think that we can keep current `MOZ_DIAGNOSTIC_ASSERT`s in the methods, but the
nested call should not allow to flush pending layout to avoid an infinite loop
in the release channel.

Differential Revision: https://phabricator.services.mozilla.com/D209992
2024-05-14 01:08:37 +00:00
Masayuki Nakano 46739e7118 Bug 1840568 - Make TSFTextStore::CreateNativeCaret put off to creating the native caret if called during querying the selection r=m_kato
It requires selection, but it may be called during `SelectionRef()` is called
by another method.  In that case, it should do nothing and `SelectionRef()`
should call `CreateNativeCaret` when it gets the result.

Depends on D209990

Differential Revision: https://phabricator.services.mozilla.com/D209991
2024-05-14 01:08:37 +00:00
Masayuki Nakano 9d2b6b0df5 Bug 1892600 - Make IMEHandler try to commit compositions in all contexts in the TSF mode before disassociating IM context r=m_kato
Currently, we try to commit composition only when we know there is a composition
in `TSFTextStore`.  However, according to the crash report, TIP may have a
hidden composition and may fail to manage ref-count of something when we
disassociate IM context from the window when they have a hidden composition.
Therefore, we could avoid the crash if we try to commit all composition in the
all contexts.

Note that a document manager can have at most 2 contexts, according to MSDN [1].

1. https://learn.microsoft.com/en-us/windows/win32/api/msctf/nf-msctf-itfdocumentmgr-push

Differential Revision: https://phabricator.services.mozilla.com/D209993
2024-05-13 23:51:51 +00:00
Masayuki Nakano 2f30d9dff5 Bug 1865256 - Add a telemetry probe to collect IME names which inserted CRLFs on Windows r=chutten,m_kato,win-reviewers,mhowell
It'll be notify IMEs on Windows of text/selection with only LFs instead of
CRLFs because the conversion cost from LFs to CRLFs is serious for DOM tree
change performance and Chrome also uses only LFs too.

However, we know some old TIPs inserted CRLFs.  TIPs should use emulating
`Enter` key press instead for the issue, "insert paragraph" vs.
"insert line break" in rich text editors, some IMEs may still insert CRLFs
directly.  However, nobody knows whether there is such TIPs.

Therefore, let's collect the IME names which inserted CRLFs via TSF directly.

Differential Revision: https://phabricator.services.mozilla.com/D193879
2023-11-21 03:32:22 +00:00
Emilio Cobos Álvarez c1cbae5730 Bug 1863035 - Implement a native WinRegistry key. r=win-reviewers,rkraesig
Use it to implement nsIWindowsRegKey, and to replace existing native
callers like WinUtils and nsLookAndFeel.

Differential Revision: https://phabricator.services.mozilla.com/D192756
2023-11-20 10:08:09 +00:00
Masayuki Nakano 33c777c972 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 02ef83ec78 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 861dcd8b88 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
Masatoshi Kimura a3e419385e Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-26 08:52:54 +00:00
Natalia Csoregi 42e803a2dd Backed out 19 changesets (bug 1844908) for causing win bustage on AvailableMemoryTracker.cpp. CLOSED TREE
Backed out changeset 44c66f2233cf (bug 1844908)
Backed out changeset a8010ff534bf (bug 1844908)
Backed out changeset 225dc3aeb220 (bug 1844908)
Backed out changeset a1414db64e33 (bug 1844908)
Backed out changeset 7f1e0a527839 (bug 1844908)
Backed out changeset 6dc7646d1ffa (bug 1844908)
Backed out changeset 8d715131510f (bug 1844908)
Backed out changeset 4b6fe8a4e7db (bug 1844908)
Backed out changeset 2b419fabf1e8 (bug 1844908)
Backed out changeset af84e701d616 (bug 1844908)
Backed out changeset 2fa203969ec5 (bug 1844908)
Backed out changeset 2b3d2df94db3 (bug 1844908)
Backed out changeset 7eca452f5fd7 (bug 1844908)
Backed out changeset 3d961cf25afe (bug 1844908)
Backed out changeset 3c59143f8dd7 (bug 1844908)
Backed out changeset ab50c6c5425a (bug 1844908)
Backed out changeset b2c5636df673 (bug 1844908)
Backed out changeset e9a0f1c6760c (bug 1844908)
Backed out changeset 945ccbedde0b (bug 1844908)
2023-07-25 19:55:35 +03:00
Masatoshi Kimura 4182954d50 Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-25 14:41:05 +00:00
Masayuki Nakano 95da043efb Bug 1840568 - Let's collect unexpected cases with diagnostic assertions of initializing TSFTextStore::mContentForTSF and TSFTextStore::mSelectionForTSF r=m_kato
I still don't understand what causes a recursive call while `TSFTextStore`
initializes content or selection cache.  According to the crash rate, we
can stop doing this before the next merge.

Differential Revision: https://phabricator.services.mozilla.com/D182639
2023-07-05 06:00:02 +00:00
Masayuki Nakano dd83642593 Bug 1807495 - part 2: Make TextStore stop creating its instance when gets IME enabled but focus notification has not been received r=m_kato
In some cases, focus notification is not correctly sent to widget.  Therefore,
creating `TextStore` instance may cause memory leak because blur notification
is never sent for destroying the instance.  Just for preventing memory leak
in browser-chrome tests, we need to avoid to create it without focus
notification.

Differential Revision: https://phabricator.services.mozilla.com/D171197
2023-04-11 23:26:04 +00:00
Tom Ritter 09f7a68e17 Bug 1815967: Add defines for MinGW in TSFTextStore r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D169377
2023-02-15 19:01:57 +00:00
Masayuki Nakano c005de3401 Bug 1796044 - part 16: Make intl.tsf.enable a static pref and rename it r=m_kato
Some users may keep disabling TSF while we were improving TSF implementation due
to avoiding some bugs.

Currently, we don't test IMM handler.  Therefore, I think that we should rename
the pref and make users run well-tested path to handle IME.

Depends on D159818

Differential Revision: https://phabricator.services.mozilla.com/D159819
2022-10-25 07:07:01 +00:00
Masayuki Nakano 3767218e5c Bug 1796044 - part 12: Make intl.tsf.hack.ms_traditional_chinese.query_insert_result a static pref r=m_kato
Depends on D159814

Differential Revision: https://phabricator.services.mozilla.com/D159815
2022-10-25 07:06:59 +00:00
Masayuki Nakano 4b4e784210 Bug 1796044 - part 11: Make intl.tsf.hack.ms_simplified_chinese.query_insert_result a static pref r=m_kato
Depends on D159813

Differential Revision: https://phabricator.services.mozilla.com/D159814
2022-10-25 07:06:58 +00:00
Masayuki Nakano 27ce10f5e4 Bug 1796044 - part 10: Make intl.tsf.hack.ms_japanese_ime.do_not_return_no_layout_error_at_caret a static pref r=m_kato
Depends on D159812

Differential Revision: https://phabricator.services.mozilla.com/D159813
2022-10-25 07:06:58 +00:00
Masayuki Nakano 24e37a91aa Bug 1796044 - part 9: Make intl.tsf.hack.ms_japanese_ime.do_not_return_no_layout_error_at_first_char a static pref r=m_kato
Depends on D159811

Differential Revision: https://phabricator.services.mozilla.com/D159812
2022-10-25 07:06:58 +00:00