mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
bug 382113 set LOAD_DOCUMENT_URI for <object> loads that load a document
so that things like onload events work correctly r+sr=bz
This commit is contained in:
parent
56193ee0c9
commit
41a142ff4f
@ -373,6 +373,13 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aConte
|
||||
notifier.Notify();
|
||||
}
|
||||
|
||||
// We're loading a document, so we have to set LOAD_DOCUMENT_URI
|
||||
// (especially important for firing onload)
|
||||
nsLoadFlags flags = 0;
|
||||
chan->GetLoadFlags(&flags);
|
||||
flags |= nsIChannel::LOAD_DOCUMENT_URI;
|
||||
chan->SetLoadFlags(flags);
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell;
|
||||
rv = mFrameLoader->GetDocShell(getter_AddRefs(docShell));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -83,6 +83,8 @@ _TEST_FILES = test_bug5141.html \
|
||||
test_bug372086.html \
|
||||
test_bug373181.xhtml \
|
||||
test_bug375314.html \
|
||||
test_bug382113.html \
|
||||
bug382113_object.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
6
content/base/test/bug382113_object.html
Normal file
6
content/base/test/bug382113_object.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<title></title>
|
||||
<body onload="parent.childGotOnload = true;">
|
||||
<p>A Document in an <object></p>
|
||||
</body>
|
||||
|
39
content/base/test/test_bug382113.html
Normal file
39
content/base/test/test_bug382113.html
Normal file
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=382113
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 382113</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="checkEvents()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=382113">Mozilla Bug 382113</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
<object type="text/html" data="bug382113_object.html"
|
||||
onload="objectGotOnload = true;"></object>
|
||||
</div>
|
||||
<pre id="test">
|
||||
|
||||
|
||||
<script class="testbody" type="application/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var childGotOnload = false;
|
||||
var objectGotOnload = false;
|
||||
|
||||
/** Test for Bug 100533 **/
|
||||
function checkEvents() {
|
||||
is(childGotOnload, true, "Child got load event");
|
||||
is(objectGotOnload, true, "Object got load event");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user