Backed out changeset c211bfbf59b2 (bug 1585747) for causing mochitest permafailures in /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/BrowsingContextGroup CLOSED TREE

This commit is contained in:
shindli 2019-10-04 12:02:59 +03:00
Родитель ee90478b75
Коммит e123be5213
5 изменённых файлов: 113 добавлений и 0 удалений

Просмотреть файл

@ -259,6 +259,29 @@ void BrowsingContext::SetEmbedderElement(Element* aEmbedder) {
// Notify the parent process of the embedding status. We don't need to do
// this when clearing our embedder, as we're being destroyed either way.
if (aEmbedder) {
// If our embedder element is being mutated to a different embedder, and we
// have a parent edge, bad things might be happening!
//
// XXX: This is a workaround to some parent edges not being immutable in the
// parent process. It can be fixed once bug 1539979 has been fixed.
if (mParent && mEmbedderElement && mEmbedderElement != aEmbedder) {
NS_WARNING("Non root content frameLoader swap! This will crash soon!");
MOZ_DIAGNOSTIC_ASSERT(mType == Type::Chrome, "must be chrome");
MOZ_DIAGNOSTIC_ASSERT(XRE_IsParentProcess(), "must be in parent");
MOZ_DIAGNOSTIC_ASSERT(!mGroup->IsContextCached(this),
"cannot be in bfcache");
RefPtr<BrowsingContext> kungFuDeathGrip(this);
RefPtr<BrowsingContext> newParent(
aEmbedder->OwnerDoc()->GetBrowsingContext());
mParent->mChildren.RemoveElement(this);
if (newParent) {
newParent->mChildren.AppendElement(this);
}
mParent = newParent;
}
if (nsCOMPtr<nsPIDOMWindowInner> inner =
do_QueryInterface(aEmbedder->GetOwnerGlobal())) {
SetEmbedderInnerWindowId(inner->WindowID());

Просмотреть файл

@ -16,8 +16,10 @@ support-files =
file_bug1139964.xul
file_bug1209621.xul
fileconstructor_file.png
frame_bug814638.xul
frame_custom_element_content.html
custom_element_ep.js
host_bug814638.xul
window_nsITextInputProcessor.xul
title_window.xul
window_swapFrameLoaders.xul
@ -51,6 +53,7 @@ skip-if = verify
[test_bug780199.xul]
[test_bug780529.xul]
[test_bug800386.xul]
[test_bug814638.xul]
[test_bug816340.xul]
[test_bug884693.xul]
[test_bug914381.html]

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=814638
-->
<window title="Mozilla Bug 814638"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<keyset>
<key key="T" modifiers="control" oncommand="receivedKeyEvent()"/>
</keyset>
<iframe flex="1" src="about:mozilla"/>
</window>

Просмотреть файл

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=814638
-->
<window title="Mozilla Bug 814638"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<iframe flex="1" src="frame_bug814638.xul"/>
</window>

Просмотреть файл

@ -0,0 +1,63 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=814638
-->
<window title="Mozilla Bug 814638"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- 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=814638"
target="_blank" id="link">Mozilla Bug 814638</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 814638 **/
SimpleTest.waitForExplicitFinish();
function startTest() {
let hostURL = "chrome://mochitests/content/chrome/dom/base/test/chrome/host_bug814638.xul";
let host1 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
let host2 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
let isHost1Loaded = isHost2Loaded = false
host1.onload = function() {
isHost1Loaded = true;
if (isHost2Loaded) swapFrames();
}
host2.onload = function() {
isHost2Loaded = true;
if (isHost1Loaded) swapFrames();
}
function swapFrames() {
let iframe1 = host1.document.querySelector("iframe");
let iframe2 = host2.document.querySelector("iframe");
iframe2.swapFrameLoaders(iframe1);
setTimeout(function() {
iframe2.contentWindow.receivedKeyEvent = receivedKeyEvent;
let innerIframe2 = iframe2.contentDocument.querySelector("iframe");
let e = innerIframe2.contentDocument.createEvent("KeyboardEvent");
e.initKeyEvent("keypress", true, true, null, true, false, false, false, 0, "t".charCodeAt(0));
innerIframe2.contentDocument.documentElement.dispatchEvent(e);
host1.close();
host2.close();
}, 0);
}
}
function receivedKeyEvent() {
ok(true, "Received key event");
SimpleTest.finish();
}
addLoadEvent(startTest);
]]>
</script>
</window>