mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 454235 - IME events not fired when clicking on text input box, adds IsOffScreenBrowser property to DocShell r=smaug sr=bz
This commit is contained in:
parent
be30cbf4ef
commit
4aa13cc558
@ -299,6 +299,7 @@ nsDocShell::nsDocShell():
|
|||||||
mIsBeingDestroyed(PR_FALSE),
|
mIsBeingDestroyed(PR_FALSE),
|
||||||
mIsExecutingOnLoadHandler(PR_FALSE),
|
mIsExecutingOnLoadHandler(PR_FALSE),
|
||||||
mIsPrintingOrPP(PR_FALSE),
|
mIsPrintingOrPP(PR_FALSE),
|
||||||
|
mIsOffScreenBrowser(PR_FALSE),
|
||||||
mSavingOldViewer(PR_FALSE),
|
mSavingOldViewer(PR_FALSE),
|
||||||
mAppType(nsIDocShell::APP_TYPE_UNKNOWN),
|
mAppType(nsIDocShell::APP_TYPE_UNKNOWN),
|
||||||
mChildOffset(0),
|
mChildOffset(0),
|
||||||
@ -3928,7 +3929,8 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, we must walk up the document and view trees checking
|
// otherwise, we must walk up the document and view trees checking
|
||||||
// for a hidden view.
|
// for a hidden view, unless we're an off screen browser, which
|
||||||
|
// would make this test meaningless.
|
||||||
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> treeItem = this;
|
nsCOMPtr<nsIDocShellTreeItem> treeItem = this;
|
||||||
nsCOMPtr<nsIDocShellTreeItem> parentItem;
|
nsCOMPtr<nsIDocShellTreeItem> parentItem;
|
||||||
@ -3953,7 +3955,9 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
|
|||||||
NS_ASSERTION(shellContent, "subshell not in the map");
|
NS_ASSERTION(shellContent, "subshell not in the map");
|
||||||
|
|
||||||
nsIFrame* frame = pPresShell->GetPrimaryFrameFor(shellContent);
|
nsIFrame* frame = pPresShell->GetPrimaryFrameFor(shellContent);
|
||||||
if (frame && !frame->AreAncestorViewsVisible()) {
|
PRBool isDocShellOffScreen = PR_FALSE;
|
||||||
|
docShell->GetIsOffScreenBrowser(&isDocShellOffScreen);
|
||||||
|
if (frame && !frame->AreAncestorViewsVisible() && !isDocShellOffScreen) {
|
||||||
*aVisibility = PR_FALSE;
|
*aVisibility = PR_FALSE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -3974,6 +3978,20 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
|
|||||||
return treeOwnerAsWin->GetVisibility(aVisibility);
|
return treeOwnerAsWin->GetVisibility(aVisibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDocShell::SetIsOffScreenBrowser(PRBool aIsOffScreen)
|
||||||
|
{
|
||||||
|
mIsOffScreenBrowser = aIsOffScreen;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDocShell::GetIsOffScreenBrowser(PRBool *aIsOffScreen)
|
||||||
|
{
|
||||||
|
*aIsOffScreen = mIsOffScreenBrowser;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::SetVisibility(PRBool aVisibility)
|
nsDocShell::SetVisibility(PRBool aVisibility)
|
||||||
{
|
{
|
||||||
|
@ -562,6 +562,7 @@ protected:
|
|||||||
PRPackedBool mObserveErrorPages;
|
PRPackedBool mObserveErrorPages;
|
||||||
PRPackedBool mAllowAuth;
|
PRPackedBool mAllowAuth;
|
||||||
PRPackedBool mAllowKeywordFixup;
|
PRPackedBool mAllowKeywordFixup;
|
||||||
|
PRPackedBool mIsOffScreenBrowser;
|
||||||
|
|
||||||
// This boolean is set to true right before we fire pagehide and generally
|
// This boolean is set to true right before we fire pagehide and generally
|
||||||
// unset when we embed a new content viewer. While it's true no navigation
|
// unset when we embed a new content viewer. While it's true no navigation
|
||||||
|
@ -68,7 +68,7 @@ interface nsILayoutHistoryState;
|
|||||||
interface nsISecureBrowserUI;
|
interface nsISecureBrowserUI;
|
||||||
interface nsIDOMStorage;
|
interface nsIDOMStorage;
|
||||||
|
|
||||||
[scriptable, uuid(7d1cf6b9-daa3-476d-8f9f-9eb2a971a95c)]
|
[scriptable, uuid(dc4daea1-b43d-406f-bd62-c2ee879192ad)]
|
||||||
interface nsIDocShell : nsISupports
|
interface nsIDocShell : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -463,5 +463,12 @@ interface nsIDocShell : nsISupports
|
|||||||
* editor data in the open document's session history entry.
|
* editor data in the open document's session history entry.
|
||||||
*/
|
*/
|
||||||
[noscript, notxpcom] void DetachEditorFromWindow();
|
[noscript, notxpcom] void DetachEditorFromWindow();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, this browser is not visible in the traditional sense, but
|
||||||
|
* is actively being rendered to the screen (ex. painted on a canvas)
|
||||||
|
* and should be treated accordingly.
|
||||||
|
**/
|
||||||
|
attribute boolean isOffScreenBrowser;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,6 +51,8 @@ _TEST_FILES = \
|
|||||||
test_bug396519.xul \
|
test_bug396519.xul \
|
||||||
bug396519_window.xul \
|
bug396519_window.xul \
|
||||||
test_bug428288.html \
|
test_bug428288.html \
|
||||||
|
test_bug454235.xul \
|
||||||
|
bug454235-subframe.xul \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
libs:: $(_TEST_FILES)
|
libs:: $(_TEST_FILES)
|
||||||
|
7
docshell/test/chrome/bug454235-subframe.xul
Normal file
7
docshell/test/chrome/bug454235-subframe.xul
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<window title="Mozilla Bug 454235 SubFrame"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
<deck flex="1">
|
||||||
|
<browser id="topBrowser" src="about:mozilla"/>
|
||||||
|
<browser id="burriedBrowser" src="about:mozilla"/>
|
||||||
|
</deck>
|
||||||
|
</window>
|
62
docshell/test/chrome/test_bug454235.xul
Normal file
62
docshell/test/chrome/test_bug454235.xul
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||||
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=454235
|
||||||
|
-->
|
||||||
|
<window title="Mozilla Bug 454235"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
|
||||||
|
<!-- test results are displayed in the html:body -->
|
||||||
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=454235"
|
||||||
|
target="_blank">Mozilla Bug 454235</a>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<!-- test code goes here -->
|
||||||
|
<script type="application/javascript"><![CDATA[
|
||||||
|
|
||||||
|
/** Test for Bug 454235 **/
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
|
addLoadEvent(doTest);
|
||||||
|
|
||||||
|
function doTest() {
|
||||||
|
var shownBrowser = document.getElementById("shownBrowser");
|
||||||
|
var hiddenBrowser = document.getElementById("hiddenBrowser");
|
||||||
|
var offScreenBrowser = document.getElementById("offScreenBrowser");
|
||||||
|
var offScreenSubBrowser = offScreenBrowser.contentDocument.getElementById("topBrowser");
|
||||||
|
var offScreenBurriedBrowser = offScreenBrowser.contentDocument.getElementById("burriedBrowser");
|
||||||
|
|
||||||
|
shownBrowser.contentWindow.focus();
|
||||||
|
ok(shownBrowser.contentDocument.hasFocus(), "visible browser is not visible");
|
||||||
|
|
||||||
|
hiddenBrowser.contentWindow.focus();
|
||||||
|
ok(!hiddenBrowser.contentDocument.hasFocus(),"hidden browser is visible");
|
||||||
|
|
||||||
|
offScreenBrowser.docShell.isOffScreenBrowser = true;
|
||||||
|
offScreenBrowser.contentWindow.focus();
|
||||||
|
ok(offScreenBrowser.contentDocument.hasFocus(),"offscreen browser is not visible");
|
||||||
|
|
||||||
|
offScreenSubBrowser.wrappedJSObject.contentWindow.focus();
|
||||||
|
todo(offScreenSubBrowser.wrappedJSObject.contentDocument.hasFocus(),"visible browser in offscreen browser is not visible");
|
||||||
|
|
||||||
|
offScreenBurriedBrowser.wrappedJSObject.contentWindow.focus();
|
||||||
|
ok(!offScreenBurriedBrowser.wrappedJSObject.contentDocument.hasFocus(),"hidden browser in offscreen browser is visible");
|
||||||
|
|
||||||
|
SimpleTest.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]]></script>
|
||||||
|
<deck flex="1" style="border:5px black solid">
|
||||||
|
<browser style="border:5px green solid" id="shownBrowser" src="bug454235-subframe.xul"/>
|
||||||
|
<browser style="border:5px blue solid" id="hiddenBrowser" src="bug454235-subframe.xul"/>
|
||||||
|
<browser style="border:5px yellow solid" id="offScreenBrowser" src="bug454235-subframe.xul"/>
|
||||||
|
</deck>
|
||||||
|
</window>
|
Loading…
Reference in New Issue
Block a user