Backed out changeset b2d82e87b557 (bug 1691314) for causing failures on browser_styleeditor_copyurl.js. CLOSED TREE

This commit is contained in:
Butkovits Atila 2021-02-09 19:02:15 +02:00
parent be192f9dea
commit a9371fd893
14 changed files with 76 additions and 49 deletions

View File

@ -28,6 +28,13 @@ body {
background-color: Field;
}
/**
* Helper for hiding/showing the status message.
*/
#status-message-container[hidden="true"] {
display: none;
}
#status-message-title {
font-size: 14px;
font-weight: bold;

View File

@ -15,7 +15,7 @@
<script src="chrome://browser/content/utilityOverlay.js"></script>
</head>
<body>
<div id="status-message-container" hidden>
<div id="status-message-container" hidden="true">
<div id="status-message-title"></div>
<pre id="status-message"></pre>
</div>

View File

@ -51,7 +51,14 @@ function appendStatusMessage(msg) {
}
function toggleStatusMessage(visible = true) {
document.getElementById("status-message-container").hidden = !visible;
const statusMessageContainer = document.getElementById(
"status-message-container"
);
if (visible) {
statusMessageContainer.removeAttribute("hidden");
} else {
statusMessageContainer.setAttribute("hidden", "true");
}
}
function revealStatusMessage() {

View File

@ -128,11 +128,12 @@ var gDevToolsBrowser = (exports.gDevToolsBrowser = {
function toggleMenuItem(id, isEnabled) {
const cmd = doc.getElementById(id);
cmd.hidden = !isEnabled;
if (isEnabled) {
cmd.removeAttribute("disabled");
cmd.removeAttribute("hidden");
} else {
cmd.setAttribute("disabled", "true");
cmd.setAttribute("hidden", "true");
}
}

View File

@ -1644,13 +1644,18 @@ Toolbox.prototype = {
const openedConsolePanel = this.currentToolId === "webconsole";
if (openedConsolePanel) {
deck.collapsed = true;
splitter.hidden = true;
webconsolePanel.collapsed = false;
deck.setAttribute("collapsed", "true");
splitter.setAttribute("hidden", "true");
webconsolePanel.removeAttribute("collapsed");
} else {
deck.collapsed = false;
splitter.hidden = !this.splitConsole;
webconsolePanel.collapsed = !this.splitConsole;
deck.removeAttribute("collapsed");
if (this.splitConsole) {
webconsolePanel.removeAttribute("collapsed");
splitter.removeAttribute("hidden");
} else {
webconsolePanel.setAttribute("collapsed", "true");
splitter.setAttribute("hidden", "true");
}
}
},

View File

@ -55,9 +55,9 @@
<input id="inspector-searchbox" class="devtools-searchinput"
type="search"
data-localization="placeholder=inspectorSearchHTML.label3"/>
<button id="inspector-searchinput-clear" class="devtools-searchinput-clear" hidden="" tabindex="-1"></button>
<button id="inspector-searchinput-clear" class="devtools-searchinput-clear" hidden="true" tabindex="-1"></button>
</div>
<div id="inspector-searchlabel-container" hidden="">
<div id="inspector-searchlabel-container" hidden="true">
<div class="devtools-separator"></div>
<span id="inspector-searchlabel"></span>
</div>
@ -80,12 +80,12 @@
<!-- Split Sidebar Container -->
<div id="inspector-rules-container">
<div id="inspector-rules-sidebar" hidden=""></div>
<div id="inspector-rules-sidebar" hidden="true"></div>
</div>
<!-- Sidebar Container -->
<div id="inspector-sidebar-container">
<div id="inspector-sidebar" hidden=""></div>
<div id="inspector-sidebar" hidden="true"></div>
</div>
<!-- Sidebar Panel Definitions -->
@ -105,14 +105,14 @@
<button id="pseudo-class-panel-toggle" data-localization="title=inspector.togglePseudo.tooltip" class="devtools-button"></button>
<button id="class-panel-toggle" data-localization="title=inspector.classPanel.toggleClass.tooltip" class="devtools-button"></button>
<button id="ruleview-add-rule-button" data-localization="title=inspector.addRule.tooltip" class="devtools-button"></button>
<button id="color-scheme-simulation-toggle" data-localization="title=inspector.colorSchemeSimulation.tooltip" class="devtools-button" hidden=""></button>
<button id="print-simulation-toggle" data-localization="title=inspector.printSimulation.tooltip" class="devtools-button" hidden=""></button>
<button id="color-scheme-simulation-toggle" data-localization="title=inspector.colorSchemeSimulation.tooltip" class="devtools-button" hidden="true"></button>
<button id="print-simulation-toggle" data-localization="title=inspector.printSimulation.tooltip" class="devtools-button" hidden="true"></button>
</div>
</div>
<div id="pseudo-class-panel" class="theme-toolbar ruleview-reveal-panel" hidden="">
<div id="pseudo-class-panel" class="theme-toolbar ruleview-reveal-panel" hidden="true">
<!-- Populated with checkbox inputs once the Rules view is instantiated -->
</div>
<div id="ruleview-class-panel" class="theme-toolbar ruleview-reveal-panel" hidden=""></div>
<div id="ruleview-class-panel" class="theme-toolbar ruleview-reveal-panel" hidden="true"></div>
</div>
<div id="ruleview-container" class="ruleview" role="document">

View File

@ -975,12 +975,12 @@ TextPropertyEditor.prototype = {
this.expander.removeAttribute("open");
this.computed.removeAttribute("filter-open");
this.computed.removeAttribute("user-open");
this.shorthandOverridden.hidden = false;
this.shorthandOverridden.removeAttribute("hidden");
this._populateShorthandOverridden();
} else {
this.expander.setAttribute("open", "true");
this.computed.setAttribute("user-open", "");
this.shorthandOverridden.hidden = true;
this.shorthandOverridden.setAttribute("hidden", "true");
this._populateComputed();
}

View File

@ -282,7 +282,7 @@ ToolSidebar.prototype = {
* The sidebar tab id to select.
*/
show: function(id) {
this._tabbox.hidden = false;
this._tabbox.removeAttribute("hidden");
// If an id is given, select the corresponding sidebar tab.
if (id) {
@ -296,7 +296,7 @@ ToolSidebar.prototype = {
* Show the sidebar.
*/
hide: function() {
this._tabbox.hidden = true;
this._tabbox.setAttribute("hidden", "true");
this.emit("hide");
},

View File

@ -160,25 +160,25 @@ function createViewControllers(state, elements) {
switch (profilerState) {
case "active":
elements.inactive.hidden = true;
elements.active.hidden = false;
elements.settingsSection.hidden = true;
elements.contentRecording.hidden = false;
elements.locked.hidden = true;
elements.inactive.setAttribute("hidden", "true");
elements.active.setAttribute("hidden", "false");
elements.settingsSection.setAttribute("hidden", "true");
elements.contentRecording.setAttribute("hidden", "false");
elements.locked.setAttribute("hidden", "true");
break;
case "inactive":
elements.inactive.hidden = false;
elements.active.hidden = true;
elements.settingsSection.hidden = false;
elements.contentRecording.hidden = true;
elements.locked.hidden = true;
elements.inactive.setAttribute("hidden", "false");
elements.active.setAttribute("hidden", "true");
elements.settingsSection.setAttribute("hidden", "false");
elements.contentRecording.setAttribute("hidden", "true");
elements.locked.setAttribute("hidden", "true");
break;
case "locked": {
elements.inactive.hidden = true;
elements.active.hidden = true;
elements.settingsSection.hidden = true;
elements.contentRecording.hidden = true;
elements.locked.hidden = false;
elements.inactive.setAttribute("hidden", "true");
elements.active.setAttribute("hidden", "true");
elements.settingsSection.setAttribute("hidden", "true");
elements.contentRecording.setAttribute("hidden", "true");
elements.locked.setAttribute("hidden", "false");
// This works around XULElement height issues.
const { height } = elements.locked.getBoundingClientRect();
elements.locked.style.height = `${height}px`;

View File

@ -389,7 +389,7 @@ LineGraphWidget.prototype = extend(AbstractCanvasGraph.prototype, {
_createGutter: function() {
const gutter = this._document.createElementNS(HTML_NS, "div");
gutter.className = "line-graph-widget-gutter";
gutter.hidden = true;
gutter.setAttribute("hidden", true);
this._container.appendChild(gutter);
return gutter;
@ -417,7 +417,7 @@ LineGraphWidget.prototype = extend(AbstractCanvasGraph.prototype, {
tooltip.className = "line-graph-widget-tooltip";
tooltip.setAttribute("type", type);
tooltip.setAttribute("arrow", arrow);
tooltip.hidden = true;
tooltip.setAttribute("hidden", true);
const infoNode = this._document.createElementNS(HTML_NS, "span");
infoNode.textContent = info;

View File

@ -724,7 +724,7 @@ TableWidget.prototype = {
menuitem.setAttribute("label", column.header.getAttribute("value"));
menuitem.setAttribute("data-id", column.id);
menuitem.setAttribute("type", "checkbox");
menuitem.setAttribute("checked", !column.wrapper.hidden);
menuitem.setAttribute("checked", !column.wrapper.getAttribute("hidden"));
if (column.id == this.uniqueId) {
menuitem.setAttribute("disabled", "true");
}
@ -1164,7 +1164,7 @@ Column.prototype = {
* Returns a boolean indicating whether the column is hidden.
*/
get hidden() {
return this.wrapper.hidden;
return this.wrapper.hasAttribute("hidden");
},
/**
@ -1435,16 +1435,16 @@ Column.prototype = {
if (arguments.length == 0) {
// Act like a toggling method when called with no params
id = this.id;
checked = this.wrapper.hidden;
checked = this.wrapper.hasAttribute("hidden");
}
if (id != this.id) {
return;
}
if (checked) {
this.wrapper.hidden = false;
this.wrapper.removeAttribute("hidden");
this.tbody.insertBefore(this.splitter, this.wrapper.nextSibling);
} else {
this.wrapper.hidden = true;
this.wrapper.setAttribute("hidden", "true");
this.splitter.remove();
}
},
@ -1657,11 +1657,15 @@ Cell.prototype = {
},
get hidden() {
return this.label.hidden;
return this.label.hasAttribute("hidden");
},
set hidden(value) {
this.label.hidden = value;
if (value) {
this.label.setAttribute("hidden", "hidden");
} else {
this.label.removeAttribute("hidden");
}
},
set value(value) {

View File

@ -57,7 +57,7 @@
class="devtools-button add-button"></html:button>
<html:button id="refresh-button"
class="devtools-button refresh-button"></html:button>
<html:button class="devtools-button sidebar-toggle" hidden=""></html:button>
<html:button class="devtools-button sidebar-toggle" hidden="true"></html:button>
</hbox>
<vbox id="storage-table" class="theme-sidebar" flex="1"/>
</vbox>

View File

@ -530,8 +530,11 @@ StyleEditorUI.prototype = {
* below the list): hide the context menu
*/
_updateContextMenuItems: function() {
this._openLinkNewTabItem.hidden = !this._contextMenuStyleSheet;
this._copyUrlItem.hidden = !this._contextMenuStyleSheet;
this._openLinkNewTabItem.setAttribute(
"hidden",
!this._contextMenuStyleSheet
);
this._copyUrlItem.setAttribute("hidden", !this._contextMenuStyleSheet);
if (this._contextMenuStyleSheet) {
this._openLinkNewTabItem.setAttribute(

View File

@ -123,7 +123,7 @@
<splitter class="devtools-side-splitter devtools-invisible-splitter"/>
<box class="splitview-side-details devtools-main-content"/>
<html:div id="splitview-templates" hidden="">
<html:div id="splitview-templates" hidden="true">
<html:li id="splitview-tpl-summary-stylesheet" tabindex="0">
<label class="stylesheet-enabled" tabindex="0"
data-l10n-id="styleeditor-visibility-toggle"></label>