Bug 1443462 - Copy default browser attributes from the initial browser to dynamically created ones. r=mconley

MozReview-Commit-ID: DGy6W2w75Y2

--HG--
extra : rebase_source : 58d2014b00780b1b8839e0ed847582f5e52896b7
This commit is contained in:
Dão Gottwald 2018-03-15 12:25:35 +01:00
Родитель 27009d1b15
Коммит 80e97e4bf5
1 изменённых файлов: 22 добавлений и 15 удалений

Просмотреть файл

@ -288,10 +288,24 @@ window._gBrowser = {
browser.permanentKey = {};
browser.droppedLinkHandler = handleDroppedLink;
this._autoScrollPopup = browser._createAutoScrollPopup();
this._autoScrollPopup.id = "autoscroller";
document.getElementById("mainPopupSet").appendChild(this._autoScrollPopup);
browser.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
let autoScrollPopup = browser._createAutoScrollPopup();
autoScrollPopup.id = "autoscroller";
document.getElementById("mainPopupSet").appendChild(autoScrollPopup);
browser.setAttribute("autoscrollpopup", autoScrollPopup.id);
this._defaultBrowserAttributes = {
autoscrollpopup: "",
contextmenu: "",
datetimepicker: "",
message: "",
messagemanagergroup: "",
selectmenulist: "",
tooltip: "",
type: "",
};
for (let attribute in this._defaultBrowserAttributes) {
this._defaultBrowserAttributes[attribute] = browser.getAttribute(attribute);
}
let tab = this.tabs[0];
this._selectedTab = tab;
@ -1818,11 +1832,10 @@ window._gBrowser = {
let b = document.createElementNS(this._XUL_NS, "browser");
b.permanentKey = {};
b.setAttribute("type", "content");
b.setAttribute("message", "true");
b.setAttribute("messagemanagergroup", "browsers");
b.setAttribute("contextmenu", "contentAreaContextMenu");
b.setAttribute("tooltip", "aHTMLTooltip");
for (let attribute in this._defaultBrowserAttributes) {
b.setAttribute(attribute, this._defaultBrowserAttributes[attribute]);
}
if (aParams.userContextId) {
b.setAttribute("usercontextid", aParams.userContextId);
@ -1868,12 +1881,6 @@ window._gBrowser = {
b.setAttribute("preloadedState", "preloaded");
}
b.setAttribute("selectmenulist", "ContentSelectDropdown");
b.setAttribute("datetimepicker", "DateTimePickerPanel");
b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
if (aParams.nextTabParentId) {
if (!aParams.remoteType) {
throw new Error("Cannot have nextTabParentId without a remoteType");