mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 457050. Don't mess up our background load flag. r+sr=biesi
This commit is contained in:
parent
35a7c2aa13
commit
201d1593d9
8
dom/src/jsurl/crashtests/457050-1-inner.html
Normal file
8
dom/src/jsurl/crashtests/457050-1-inner.html
Normal file
@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="javascript:'p { color: green }'">
|
||||
</head>
|
||||
<body onload="parent.next(window);">
|
||||
<p>Hello</p>
|
||||
</body>
|
||||
</html>
|
18
dom/src/jsurl/crashtests/457050-1.html
Normal file
18
dom/src/jsurl/crashtests/457050-1.html
Normal file
@ -0,0 +1,18 @@
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
var i = 0;
|
||||
function next(w)
|
||||
{
|
||||
++i;
|
||||
if (i == 1)
|
||||
w.location.reload();
|
||||
if (i == 2)
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="457050-1-inner.html"></iframe>
|
||||
</body>
|
||||
</html>
|
@ -1,3 +1,4 @@
|
||||
load 341963-1.html
|
||||
load 344874-1.html
|
||||
load 344996-1.xhtml
|
||||
load 457050-1.html
|
||||
|
@ -849,6 +849,25 @@ nsJSChannel::GetLoadFlags(nsLoadFlags *aLoadFlags)
|
||||
NS_IMETHODIMP
|
||||
nsJSChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
|
||||
{
|
||||
// Figure out whether the LOAD_BACKGROUND bit in aLoadFlags is
|
||||
// actually right.
|
||||
PRBool bogusLoadBackground = PR_FALSE;
|
||||
if (mIsActive && !(mActualLoadFlags & LOAD_BACKGROUND) &&
|
||||
(aLoadFlags & LOAD_BACKGROUND)) {
|
||||
// We're getting a LOAD_BACKGROUND, but it's probably just our own fake
|
||||
// flag being mirrored to us. The one exception is if our loadgroup is
|
||||
// LOAD_BACKGROUND.
|
||||
PRBool loadGroupIsBackground = PR_FALSE;
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
mStreamChannel->GetLoadGroup(getter_AddRefs(loadGroup));
|
||||
if (loadGroup) {
|
||||
nsLoadFlags loadGroupFlags;
|
||||
loadGroup->GetLoadFlags(&loadGroupFlags);
|
||||
loadGroupIsBackground = ((loadGroupFlags & LOAD_BACKGROUND) != 0);
|
||||
}
|
||||
bogusLoadBackground = !loadGroupIsBackground;
|
||||
}
|
||||
|
||||
// Since the javascript channel is never the actual channel that
|
||||
// any data is loaded through, don't ever set the
|
||||
// LOAD_DOCUMENT_URI flag on it, since that could lead to two
|
||||
@ -860,6 +879,12 @@ nsJSChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
|
||||
|
||||
mLoadFlags = aLoadFlags & ~LOAD_DOCUMENT_URI;
|
||||
|
||||
if (bogusLoadBackground) {
|
||||
aLoadFlags = aLoadFlags & ~LOAD_BACKGROUND;
|
||||
}
|
||||
|
||||
mActualLoadFlags = aLoadFlags;
|
||||
|
||||
// ... but the underlying stream channel should get this bit, if
|
||||
// set, since that'll be the real document channel if the
|
||||
// javascript: URL generated data.
|
||||
|
Loading…
Reference in New Issue
Block a user