This patch does not make some header files stop including the inline
header because fixing them require more changes.
Note that `#include "nsComponentManagerUtils.h"` is fixing a bustage
caused by "use of undeclared identifier 'do_CreateInstance'" error.
Differential Revision: https://phabricator.services.mozilla.com/D304432
First, while `IMMHandler` handles a composition, it should store the
composing window with a strong pointer because it's required to
clean up the resource before its destroyed.
Then, if the window is destroyed during a composition, `IMMHandler`
should clear the strong pointer with canceling the composition.
This should be done during the emulation of `blur` in
`IMEHandler::OnDestroyWindow()`. However, now, it's called after the
window handle is destroyed [1] and fails to clean up some things, e.g.,
in `IMEHandler::SetInputScopeForIMM32()` [2]. Therefore,
`nsWindow::OnDestroy()` and `nsWindow::Destroy()` call
`IMEHandler::OnDestroyWindow()` before destroying the native window.
Finally, to avoid the race condition of the destruction and the focus
move, `IMEHandler::OnDestroyWindow()` notifies `IMMHandler` of that
for ensuring the clean up.
1. https://searchfox.org/firefox-main/rev/f98aa512e7b7d557ec2d57dbf67b0c4285e9cd3a/widget/windows/nsWindow.cpp#1327,1334
2. https://searchfox.org/firefox-main/rev/f98aa512e7b7d557ec2d57dbf67b0c4285e9cd3a/widget/windows/WinIMEHandler.cpp#542-543,561-562
Differential Revision: https://phabricator.services.mozilla.com/D296902
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
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
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
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
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
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
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
Win11's tablet mode is different from Win10's tablet mode in ways both
subtle and gross. Avoid unifying them implicitly, and make it clear that
they should not be unified _explicitly_ without testing.
Unfortunately, Windows 11's API for checking whether the device is in
tablet mode is broken -- it requires one to know whether the device is a
tablet to interpret the return value, but there is no documented API
providing that information. We use a heuristic partly borrowed from
Chromium and partly based on independent investigation.
As all of the code using WindowsUIUtils effectively only checked for
Win10's tablet mode, this commit technically has no functional
changes.
Differential Revision: https://phabricator.services.mozilla.com/D224244
Win11's tablet mode is different from Win10's tablet mode in ways both
subtle and gross. Avoid unifying them implicitly, and make it clear that
they should not be unified _explicitly_ without testing.
Unfortunately, Windows 11's API for checking whether the device is in
tablet mode is broken -- it requires one to know whether the device is a
tablet to interpret the return value, but there is no documented API
providing that information. We use a heuristic partly borrowed from
Chromium and partly based on independent investigation.
As all of the code using WindowsUIUtils effectively only checked for
Win10's tablet mode, this commit technically has no functional
changes.
Differential Revision: https://phabricator.services.mozilla.com/D224244
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
As far as I've tested on Win 11, we can put it off to load it when first needed
of the keyboard layout data. `ToUnicodeEx` API changes the dead key state and
it's called a lot in `KeyboardLayout::LoadLayout`, however, this patch does
not newly call `LoadLayout` after `TranslateMessage` API at least while handling
a key message. Therefore, this should be safe but regressions of this change
could be serious, so this makes it enabled only in early beta and earlier for
now.
Differential Revision: https://phabricator.services.mozilla.com/D200600
As far as I've tested on Win 11, we can put it off to load it when first needed
of the keyboard layout data. `ToUnicodeEx` API changes the dead key state and
it's called a lot in `KeyboardLayout::LoadLayout`, however, this patch does
not newly call `LoadLayout` after `TranslateMessage` API at least while handling
a key message. Therefore, this should be safe but regressions of this change
could be serious, so this makes it enabled only in early beta and earlier for
now.
Differential Revision: https://phabricator.services.mozilla.com/D200600
This pref is used for behavior check of how newer TSF behave without IMC.
Therefore, this shouldn't be used by users. However, like bug 1367692 and
bug 1409155, this may be useful when we meet a critical bug of old IME in
newer Windows. Thus we should keep this pref.
Depends on D159817
Differential Revision: https://phabricator.services.mozilla.com/D159818
It's introduced in bug 1367692 to make it possible to test the bug of old
MS-IME on Windows 10 with later versions. Now, the bug and the old versions
have gone. Therefore, we don't need this pref anymore.
Depends on D159816
Differential Revision: https://phabricator.services.mozilla.com/D159817
Now, `inputmode` attribute (`inputMode` in the DOM interface) is a global
attribute for `contenteditable`. Therefore, `Input` is not necessary and
`Inputmode` should be `InputMode`.
Differential Revision: https://phabricator.services.mozilla.com/D158244
Now, `inputmode` attribute (`inputMode` in the DOM interface) is a global
attribute for `contenteditable`. Therefore, `Input` is not necessary and
`Inputmode` should be `InputMode`.
Depends on D157894
Differential Revision: https://phabricator.services.mozilla.com/D158244
It looks like it was added to abstract commonalities between Win32 and
WinRT. But we dropped support for WinRT a long time ago, and there hasn't been
any work on this area of code in 8 years. In the meantime, it just adds an
extra layer of indirection that doesn't need to exist.
Differential Revision: https://phabricator.services.mozilla.com/D139771
When "search" is set to the input scope, there is a case ATOK stop their
suggestions depending on thire setting. To resolve the issue, we need to avoid
sending "search" input scope when ATOK is active. If using the touch keyboard
for touch screens, this change makes user cannot access some specific features
for a "search" input field. Therefore, we introduce a new pref
`intl.tsf.hack.atok.search_input_scope_disabled`, make user can control this
feature.
Differential Revision: https://phabricator.services.mozilla.com/D136448
This fix simply ignores tablet mode when running on Windows 11. The
reasoning behind this is that per Microsoft documentation tablet mode
is specific to Windows 10 and not supported anymore on Windows 11. This
seems consistent in the behavior of the APIs we use to detect the
presence of a keyboard: Windows 10-specific APIs return unexpected
results while APIs that predate them return values that seem consistent
and reliable.
Differential Revision: https://phabricator.services.mozilla.com/D128229
For bug 1670539, I would like to move each on software keyboard code to
own class at first.
Actually, MaybeShowOnScreenKeyboard handels VR keyboard if VR mode. But
I would like to move VR code to ShowOnScreenKeyboard or own class.
Differential Revision: https://phabricator.services.mozilla.com/D109259
Before deleting `IMEState::Enabled::PLUGIN`, let's make it an enum class
for making the change safer. Almost all of this change is done by
"replace" of VSCode.
Differential Revision: https://phabricator.services.mozilla.com/D100100
Sorry for this big patch.
This makes `WidgetQueryContentEvent::Reply` is stored with `Maybe` to get
rid of `WidgetQueryContentEvent`. And `Reply` stores offset and string
with `Maybe` and ``OffsetAndData<uint32_t>`, and also tentative caret offset
with `Maybe`. Then, we can get rid of `WidgetQueryContentEvent::NOT_FOUND`.
Note that I tried to make `OffsetAndData` have a method to create `NSRange`
for cocoa widget. However, it causes the column limit`to 100 or longer
and that causes unrelated changes in `TextEvents.h` and `IMEData.h`.
Therefore, I create an inline function in `TextInputHandler.mm` instead.
Differential Revision: https://phabricator.services.mozilla.com/D98264