PuppetWidget::GetInputContext() needs to communicate with its parent process with synchronous IPC. This is very expensive for focus move.
Currently, IMEStateManager uses nsIWidget::GetInputContext() only for checking the IME enabled state. Therefore, it's enough to cache input context when nsIWidget::SetInputContext() is called. Then, we can avoid to communicate with synchronous IPC with PuppetWidget::GetInputContext() in most cases.
This patch makes IMEStateManager stores the last widget which sets input context. When PuppetWidget uses its input context cache, it should check if it is the last widget to set input context with IMEStateManager since an input context may be shared with other widgets and another one may have update the input context. I.e., PuppetWidget's input context cache may be already outdated after IMEStateManager sets input context with another widget.
This patch gives up to support retrieving IME open state from child process. However, perhaps, this is not necessary for everybody including add-on developers because the only user of IME open state in child process is nsIDOMWindowUtils. So, add-ons can send IME open state from chrome process instead. If this decision is wrong, unfortunately, we should support it again in another bug. It's easy to support with creating another nsIWidget::GetInputContext() or adding additional argument to it.
MozReview-Commit-ID: B2d2CCTsPKj
--HG--
extra : rebase_source : 4117330ba7871753176da960063b612e96f11752
Backed out changeset 5a92875424b0
Backed out changeset 79ba5815f9aa
Backed out changeset b084784405ef
Backed out changeset 67bf9ee17564
--HG--
extra : rebase_source : 9604d138e1d333d7bcf6edc8b886340b8371524d
The web platform tests changes are just a cherrypick of
https://github.com/w3c/web-platform-tests/pull/2926 so I don't have to add
failure annotations until the next test uplift.
I've audited our uses of nsIFormControl, and this patch looks to me like it
preserves existing behavior in all but the following cases:
1) nsXBLPrototypeHandler::DispatchXBLCommand, the case of scrolling when space
is pressed while something inside a <label> is focused. We used to not scroll
in this situation; I think this is a bug, so I'm changing that behavior to
scroll instead.
2) In Accessible::RelationByType for the RelationType::DEFAULT_BUTTON case,
when mContent is a <label> we used to return its form's default submit element.
Now we will just return Relation().
KEYCODE_HOME was temporarily named as "MozHomeScreen" and KEYCODE_FOCUS was temprarily named as "MozCameraFocusAdjust" since they were not defined by the spec. However, in the latest spec, they are defined as "GoHome" and "CameraFocus". So, it is the time to rename them.
However, these temporary key names are still used by Gaia. Until it's fixed, we should keep using the temporary names only on B2G.
MozReview-Commit-ID: 9ILtZdf6EUQ
--HG--
extra : rebase_source : f673ca6e128705af3071dafbd7ab1eb8e310297d
Android's KEYCODE_CALL was temporarily named as "MozPhoneCall" since proper key name was not defined in the spec. However, now, it's defined as "Call" in the latest spec. Therefore, we should rename this key name.
Note that this isn't available on Android because the key event is never fired on applications. However, this key may be useful on B2G. Although, the key is not used by current Gaia.
MozReview-Commit-ID: GF4STYrGMig
--HG--
extra : rebase_source : 7d94c0a3c47d9ba1fadc4de475d71967d6281545
VolumeMute was renamed to AudioVolumeMute in the latest draft and Chromium uses the new name. Therefore, we need to update this but Gaia uses the old name. So, we shouldn't rename on B2G until Gaia is fixed.
Note that this patch changes tests but they are not used by B2G. Therefore, just replacing with new name is enough.
Only forms.js is necessary #ifdef because the main purpose of forms.js is for B2G's IME framework. However, it's available on the other platforms if chrome needs to use it.
MozReview-Commit-ID: KSkcPbIovin
--HG--
extra : rebase_source : 4ff5d92b000599806367b002fd08aa5ae858ee4d
VolumeUp was renamed to AudioVolumeUp in the latest draft and Chromium uses the new name. Therefore, we need to update this but Gaia uses the old name. So, we shouldn't rename on B2G until Gaia is fixed.
Note that this patch changes tests but they are not used by B2G. Therefore, just replacing with new name is enough.
Only forms.js is necessary #ifdef because the main purpose of forms.js is for B2G's IME framework. However, it's available on the other platforms if chrome needs to use it.
MozReview-Commit-ID: KzLVL5Y2dIN
--HG--
extra : rebase_source : d7a70f556684cdc99989e408e0e87a04e2da43d9
VolumeDown was renamed to AudioVolumeDown in the latest draft and Chromium uses the new name. Therefore, we need to update this but Gaia uses the old name. So, we shouldn't rename on B2G until Gaia is fixed.
Note that this patch changes tests but they are not used by B2G. Therefore, just replacing with new name is enough.
Only forms.js is necessary #ifdef because the main purpose of forms.js is for B2G's IME framework. However, it's available on the other platforms if chrome needs to use it.
MozReview-Commit-ID: cq98qJnS8M
--HG--
extra : rebase_source : 98653e5427d9d4720d19011673cbb0f9cdf36f1a
"MediaSelect" is merged into "LanuchMediaPlayer" in the spec since there is no difference between them and "LaunchMediaPlayer" explains the meaning clearer.
This patch removes "MediaSelect" key value and maps all keys which are mapped to "MediaSelect" to "LaunchMediaPlayer".
MozReview-Commit-ID: IEZhV4p6Qag
And mCharCode shouldn't be compared with NS_VK_*, nsIDOMKeyEvent::DOM_VK_*. Additionally, when it's compared with a character constant, cast isn't necessary.
MozReview-Commit-ID: JMT614copjG
--HG--
extra : rebase_source : 69ee3c589e5a71c814ec9a40ac3aab39c789c11d
And also WidgetKeyboardEvent::mKeyCode should be compared with NS_VK_* rather than nsIDOMKeyEvent::DOM_VK_*.
MozReview-Commit-ID: IKjQ1nr8XYe
--HG--
extra : rebase_source : 83125cd2523f6b70759f621470aad23b00aae8ae