mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1681800 - Don't notify of refocus when element is non focusable root. r=masayuki
It is unnecessary to notify of IME re-focus when element is root element and not focusable. Differential Revision: https://phabricator.services.mozilla.com/D103980
This commit is contained in:
parent
7067bbd819
commit
b84c89bda5
@ -4888,6 +4888,9 @@ void nsFocusManager::NotifyOfReFocus(nsIContent& aContent) {
|
||||
if (!window || window != mFocusedWindow) {
|
||||
return;
|
||||
}
|
||||
if (!aContent.IsInComposedDoc() || IsNonFocusableRoot(&aContent)) {
|
||||
return;
|
||||
}
|
||||
nsIDocShell* docShell = window->GetDocShell();
|
||||
if (!docShell) {
|
||||
return;
|
||||
|
@ -236,6 +236,7 @@ support-files = file_bug1484371.html
|
||||
skip-if = toolkit == 'android' # Bug 1312791
|
||||
[test_bug1581192.html]
|
||||
[test_bug1673434.html]
|
||||
[test_bug1681800.html]
|
||||
[test_dnd_with_modifiers.html]
|
||||
[test_hover_mouseleave.html]
|
||||
[test_marquee_events.html]
|
||||
|
26
dom/events/test/test_bug1681800.html
Normal file
26
dom/events/test/test_bug1681800.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
bugzilla.mozilla.org/show_bug.cgi?id=1681800
|
||||
-->
|
||||
<head>
|
||||
<title>Test for bug 1681800</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1681800">Mozilla Bug 1681800</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script>
|
||||
add_task(function() {
|
||||
document.documentElement.focus({})
|
||||
document.documentElement.focus({})
|
||||
ok(true, "no crash");
|
||||
})
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user