mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 550565: Calling history.pushState during onDOMContentLoaded drops a favicon. r=dao
This commit is contained in:
parent
ecbe0b409d
commit
968d7bb30d
@ -437,9 +437,13 @@
|
||||
if (this.mBrowser.userTypedClear > 0)
|
||||
this.mBrowser.userTypedValue = null;
|
||||
|
||||
// Don't clear the favicon if this onLocationChange was triggered
|
||||
// by a pushState or a replaceState. See bug 550565.
|
||||
if (aWebProgress.DOMWindow == this.mBrowser.contentWindow &&
|
||||
aWebProgress.isLoadingDocument)
|
||||
this.mTabBrowser.getBrowserForTab(this.mTab).mIconURL = null;
|
||||
aWebProgress.isLoadingDocument &&
|
||||
!(this.mBrowser.docShell.loadType & Ci.nsIDocShell.LOAD_CMD_PUSHSTATE)) {
|
||||
this.mBrowser.mIconURL = null;
|
||||
}
|
||||
|
||||
// changing location, clear out the missing plugins list
|
||||
this.mBrowser.missingPlugins = null;
|
||||
|
@ -49,7 +49,10 @@ _BROWSER_TEST_FILES = \
|
||||
browser_bug388121-2.js \
|
||||
browser_bug441169.js \
|
||||
browser_bug503832.js \
|
||||
browser_bug550565.js \
|
||||
file_bug503832.html \
|
||||
file_bug550565_popup.html \
|
||||
file_bug550565_favicon.ico \
|
||||
$(NULL)
|
||||
|
||||
# the tests below use FUEL, which is a Firefox-specific feature
|
||||
|
19
docshell/test/browser/browser_bug550565.js
Normal file
19
docshell/test/browser/browser_bug550565.js
Normal file
@ -0,0 +1,19 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let testPath = "chrome://mochikit/content/browser/docshell/test/browser/";
|
||||
|
||||
let tab = gBrowser.addTab(testPath + "file_bug550565_popup.html");
|
||||
|
||||
tab.linkedBrowser.addEventListener('DOMContentLoaded', function() {
|
||||
let expectedIcon = testPath + "file_bug550565_favicon.ico";
|
||||
|
||||
is(gBrowser.getIcon(tab), expectedIcon, "Correct icon before pushState.");
|
||||
tab.linkedBrowser.contentWindow.history.pushState("page2", "page2", "page2");
|
||||
is(gBrowser.getIcon(tab), expectedIcon, "Correct icon after pushState.");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
finish();
|
||||
}, true);
|
||||
}
|
BIN
docshell/test/browser/file_bug550565_favicon.ico
Normal file
BIN
docshell/test/browser/file_bug550565_favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
12
docshell/test/browser/file_bug550565_popup.html
Normal file
12
docshell/test/browser/file_bug550565_popup.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test file for bug 550565.</title>
|
||||
|
||||
<!--Set a favicon; that's the whole point of this file.-->
|
||||
<link rel="icon" href="chrome://mochikit/content/browser/docshell/test/browser/file_bug550565_favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
Test file for bug 550565.
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user