зеркало из https://github.com/mozilla/gecko-dev.git
Bug 673467 - Don't create an extra SHEntry for dynamically-added iframes. r=bz
This commit is contained in:
Родитель
5d94ed35fb
Коммит
663c68a124
|
@ -1335,9 +1335,8 @@ nsDocShell::LoadURI(nsIURI * aURI,
|
|||
PRUint32 selfBusy = BUSY_FLAGS_NONE;
|
||||
parentDS->GetBusyFlags(&parentBusy);
|
||||
GetBusyFlags(&selfBusy);
|
||||
if (((parentBusy & BUSY_FLAGS_BUSY) ||
|
||||
(selfBusy & BUSY_FLAGS_BUSY)) &&
|
||||
shEntry) {
|
||||
if (parentBusy & BUSY_FLAGS_BUSY ||
|
||||
selfBusy & BUSY_FLAGS_BUSY) {
|
||||
loadType = LOAD_NORMAL_REPLACE;
|
||||
shEntry = nsnull;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_bug655270.js \
|
||||
file_bug655270.html \
|
||||
favicon_bug655270.ico \
|
||||
browser_bug673467.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test for bug 673467. In a new tab, load a page which inserts a new iframe
|
||||
// before the load and then sets its location during the load. This should
|
||||
// create just one SHEntry.
|
||||
|
||||
var doc = "data:text/html,<html><body onload='load()'>" +
|
||||
"<script>" +
|
||||
" var iframe = document.createElement('iframe');" +
|
||||
" iframe.id = 'iframe';" +
|
||||
" document.documentElement.appendChild(iframe);" +
|
||||
" function load() {" +
|
||||
" iframe.src = 'data:text/html,Hello!';" +
|
||||
" }" +
|
||||
"</script>" +
|
||||
"</body></html>"
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.addTab(doc);
|
||||
let tabBrowser = tab.linkedBrowser;
|
||||
|
||||
tabBrowser.addEventListener('load', function(aEvent) {
|
||||
tabBrowser.removeEventListener('load', arguments.callee, true);
|
||||
|
||||
// The main page has loaded. Now wait for the iframe to load.
|
||||
let iframe = tabBrowser.contentWindow.document.getElementById('iframe');
|
||||
iframe.addEventListener('load', function(aEvent) {
|
||||
|
||||
// Wait for the iframe to load the new document, not about:blank.
|
||||
if (!iframe.src)
|
||||
return;
|
||||
|
||||
iframe.removeEventListener('load', arguments.callee, true);
|
||||
let shistory = tabBrowser.contentWindow
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.sessionHistory;
|
||||
|
||||
is(shistory.count, 1, 'shistory count should be 1.');
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
finish();
|
||||
|
||||
}, true);
|
||||
}, true);
|
||||
}
|
Загрузка…
Ссылка в новой задаче