mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 726734: Reload plugin instances when the src/data URL changes. r=jst
This commit is contained in:
parent
29574f8e2e
commit
c2fa9afffa
@ -1283,13 +1283,14 @@ nsObjectLoadingContent::LoadObject(nsIURI* aURI,
|
||||
// Only do a URI equality check for things that aren't stopped plugins.
|
||||
// This is because we still need to load again if the plugin has been stopped.
|
||||
if (mType == eType_Document || mType == eType_Image || mInstanceOwner) {
|
||||
if (mURI && aURI && !aForceLoad) {
|
||||
if (mURI && aURI) {
|
||||
bool equal;
|
||||
nsresult rv = mURI->Equals(aURI, &equal);
|
||||
if (NS_SUCCEEDED(rv) && equal) {
|
||||
if (NS_SUCCEEDED(rv) && equal && !aForceLoad) {
|
||||
// URI didn't change, do nothing
|
||||
return NS_OK;
|
||||
}
|
||||
StopPluginInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,6 +111,7 @@ _MOCHITEST_FILES = \
|
||||
test_instance_unparent3.html \
|
||||
test_pluginstream_referer.html \
|
||||
plugin-stream-referer.sjs \
|
||||
test_src_url_change.html \
|
||||
$(NULL)
|
||||
|
||||
# test_plugin_scroll_painting.html \ bug 596491
|
||||
|
40
dom/plugins/test/mochitest/test_src_url_change.html
Normal file
40
dom/plugins/test/mochitest/test_src_url_change.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test changing src attribute</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.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="runTests()">
|
||||
<p id="display"></p>
|
||||
|
||||
<embed id="plugin1" src="about:blank" type="application/x-test" width="200" height="200"></embed>
|
||||
|
||||
<script type="application/javascript;version=1.8">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var p = document.getElementById('plugin1');
|
||||
|
||||
var destroyed = false;
|
||||
function onDestroy() {
|
||||
destroyed = true;
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
p.startWatchingInstanceCount();
|
||||
p.callOnDestroy(onDestroy);
|
||||
|
||||
p.setAttribute("src", "loremipsum.txt");
|
||||
|
||||
is(destroyed, true, "Instance should have been destroyed.");
|
||||
is(p.getInstanceCount(), 1, "One new instance should have been created.");
|
||||
|
||||
p.stopWatchingInstanceCount();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user