mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 486791 - BrowserStartup() throws exception when sidebars are inserted by code. r=gavin
This commit is contained in:
parent
d24ef01513
commit
9fc1f9ebcf
@ -998,21 +998,30 @@ function BrowserStartup() {
|
|||||||
// The opener can be the hidden window too, if we're coming from the state
|
// The opener can be the hidden window too, if we're coming from the state
|
||||||
// where no windows are open, and the hidden window has no sidebar box.
|
// where no windows are open, and the hidden window has no sidebar box.
|
||||||
if (openerSidebarBox && !openerSidebarBox.hidden) {
|
if (openerSidebarBox && !openerSidebarBox.hidden) {
|
||||||
let sidebarBox = document.getElementById("sidebar-box");
|
|
||||||
let sidebarTitle = document.getElementById("sidebar-title");
|
|
||||||
sidebarTitle.setAttribute("value", window.opener.document.getElementById("sidebar-title").getAttribute("value"));
|
|
||||||
sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width);
|
|
||||||
let sidebarCmd = openerSidebarBox.getAttribute("sidebarcommand");
|
let sidebarCmd = openerSidebarBox.getAttribute("sidebarcommand");
|
||||||
sidebarBox.setAttribute("sidebarcommand", sidebarCmd);
|
let sidebarCmdElem = document.getElementById(sidebarCmd);
|
||||||
// Note: we're setting 'src' on sidebarBox, which is a <vbox>, not on the
|
|
||||||
// <browser id="sidebar">. This lets us delay the actual load until
|
|
||||||
// delayedStartup().
|
|
||||||
sidebarBox.setAttribute("src", window.opener.document.getElementById("sidebar").getAttribute("src"));
|
|
||||||
mustLoadSidebar = true;
|
|
||||||
|
|
||||||
sidebarBox.hidden = false;
|
// dynamically generated sidebars will fail this check.
|
||||||
document.getElementById("sidebar-splitter").hidden = false;
|
if (sidebarCmdElem) {
|
||||||
document.getElementById(sidebarCmd).setAttribute("checked", "true");
|
let sidebarBox = document.getElementById("sidebar-box");
|
||||||
|
let sidebarTitle = document.getElementById("sidebar-title");
|
||||||
|
|
||||||
|
sidebarTitle.setAttribute(
|
||||||
|
"value", window.opener.document.getElementById("sidebar-title").getAttribute("value"));
|
||||||
|
sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width);
|
||||||
|
|
||||||
|
sidebarBox.setAttribute("sidebarcommand", sidebarCmd);
|
||||||
|
// Note: we're setting 'src' on sidebarBox, which is a <vbox>, not on
|
||||||
|
// the <browser id="sidebar">. This lets us delay the actual load until
|
||||||
|
// delayedStartup().
|
||||||
|
sidebarBox.setAttribute(
|
||||||
|
"src", window.opener.document.getElementById("sidebar").getAttribute("src"));
|
||||||
|
mustLoadSidebar = true;
|
||||||
|
|
||||||
|
sidebarBox.hidden = false;
|
||||||
|
document.getElementById("sidebar-splitter").hidden = false;
|
||||||
|
sidebarCmdElem.setAttribute("checked", "true");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1028,7 +1037,7 @@ function BrowserStartup() {
|
|||||||
command.setAttribute("checked", "true");
|
command.setAttribute("checked", "true");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Remove the |sidebarcommand| attribute, because the element it
|
// Remove the |sidebarcommand| attribute, because the element it
|
||||||
// refers to no longer exists, so we should assume this sidebar
|
// refers to no longer exists, so we should assume this sidebar
|
||||||
// panel has been uninstalled. (249883)
|
// panel has been uninstalled. (249883)
|
||||||
box.removeAttribute("sidebarcommand");
|
box.removeAttribute("sidebarcommand");
|
||||||
|
Loading…
Reference in New Issue
Block a user