Bug 949380 - [Australis] Add @hidden=true initially to UITour panels. r=Unfocused
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -192,25 +192,27 @@
oncommand="StarUI.panel.hidePopup();"/>
#endif
</hbox>
</panel>
<!-- UI tour experience -->
<panel id="UITourTooltip"
type="arrow"
+ hidden="true"
noautofocus="true"
noautohide="true"
align="start"
orient="vertical"
role="alert">
<label id="UITourTooltipTitle" flex="1"/>
<description id="UITourTooltipDescription" flex="1"/>
</panel>
<panel id="UITourHighlightContainer"
+ hidden="true"
noautofocus="true"
noautohide="true"
consumeoutsideclicks="false">
<box id="UITourHighlight"></box>
</panel>
<panel id="socialActivatedNotification"
type="arrow"
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -459,16 +459,17 @@ this.UITour = {
if (effect == "random") {
// Exclude "random" from the randomly selected effects.
let randomEffect = 1 + Math.floor(Math.random() * (this.highlightEffects.length - 1));
if (randomEffect == this.highlightEffects.length)
randomEffect--; // On the order of 1 in 2^62 chance of this happening.
effect = this.highlightEffects[randomEffect];
}
highlighter.setAttribute("active", effect);
+ highlighter.parentElement.hidden = false;
let targetRect = aTargetEl.getBoundingClientRect();
highlighter.style.height = targetRect.height + "px";
highlighter.style.width = targetRect.width + "px";
// Close a previous highlight so we can relocate the panel.
if (highlighter.parentElement.state == "open") {
@@ -509,26 +510,25 @@ this.UITour = {
function showInfoPanel(aAnchorEl) {
aAnchorEl.focus();
let document = aAnchorEl.ownerDocument;
let tooltip = document.getElementById("UITourTooltip");
let tooltipTitle = document.getElementById("UITourTooltipTitle");
let tooltipDesc = document.getElementById("UITourTooltipDescription");
- tooltip.hidePopup();
+ if (tooltip.state == "open") {
+ tooltip.hidePopup();
+ }
tooltipTitle.textContent = aTitle;
tooltipDesc.textContent = aDescription;
+ tooltip.hidden = false;
let alignment = "bottomcenter topright";
-
- if (tooltip.state == "open") {
- tooltip.hidePopup();
- }
tooltip.openPopup(aAnchorEl, alignment);
}
this._setAppMenuStateForAnnotation(aAnchor.node.ownerDocument.defaultView, "info",
this.targetIsInAppMenu(aAnchor),
showInfoPanel.bind(this, aAnchor.node));
},