Bug 1215335 - Remove unused notification-inner container. r?bgrins
MozReview-Commit-ID: C9kKRpD3AzU
--- a/browser/components/translation/translation-infobar.xml
+++ b/browser/components/translation/translation-infobar.xml
@@ -16,147 +16,145 @@
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="translationbar" extends="chrome://global/content/bindings/notification.xml#notification" role="xul:alert">
<resources>
<stylesheet src="chrome://global/skin/notification.css"/>
</resources>
<content>
- <xul:hbox class="notification-inner" flex="1" xbl:inherits="type">
- <xul:hbox anonid="details" align="center" flex="1">
- <xul:image class="translate-infobar-element messageImage"
- anonid="messageImage"/>
- <xul:panel anonid="welcomePanel" class="translation-welcome-panel"
- type="arrow" align="start">
- <xul:image class="translation-welcome-logo"/>
- <xul:vbox flex="1" class="translation-welcome-content">
- <xul:description class="translation-welcome-headline"
- anonid="welcomeHeadline"/>
- <xul:description class="translation-welcome-body" anonid="welcomeBody"/>
- <xul:hbox align="center">
- <xul:label anonid="learnMore" class="plain text-link"
- onclick="openUILinkIn('https://support.mozilla.org/kb/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
- <xul:spacer flex="1"/>
- <xul:button class="translate-infobar-element" anonid="thanksButton"
- onclick="this.parentNode.parentNode.parentNode.hidePopup();"/>
- </xul:hbox>
- </xul:vbox>
- </xul:panel>
- <xul:deck anonid="translationStates" selectedIndex="0">
+ <xul:hbox anonid="details" align="center" flex="1">
+ <xul:image class="translate-infobar-element messageImage"
+ anonid="messageImage"/>
+ <xul:panel anonid="welcomePanel" class="translation-welcome-panel"
+ type="arrow" align="start">
+ <xul:image class="translation-welcome-logo"/>
+ <xul:vbox flex="1" class="translation-welcome-content">
+ <xul:description class="translation-welcome-headline"
+ anonid="welcomeHeadline"/>
+ <xul:description class="translation-welcome-body" anonid="welcomeBody"/>
+ <xul:hbox align="center">
+ <xul:label anonid="learnMore" class="plain text-link"
+ onclick="openUILinkIn('https://support.mozilla.org/kb/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
+ <xul:spacer flex="1"/>
+ <xul:button class="translate-infobar-element" anonid="thanksButton"
+ onclick="this.parentNode.parentNode.parentNode.hidePopup();"/>
+ </xul:hbox>
+ </xul:vbox>
+ </xul:panel>
+ <xul:deck anonid="translationStates" selectedIndex="0">
- <!-- offer to translate -->
- <xul:hbox class="translate-offer-box" align="center">
- <xul:label class="translate-infobar-element" value="&translation.thisPageIsIn.label;"/>
- <xul:menulist class="translate-infobar-element" anonid="detectedLanguage">
- <xul:menupopup/>
- </xul:menulist>
- <xul:label class="translate-infobar-element" value="&translation.translateThisPage.label;"/>
- <xul:button class="translate-infobar-element"
- label="&translation.translate.button;"
- anonid="translate"
- oncommand="document.getBindingParent(this).translate();"/>
- <xul:button class="translate-infobar-element"
- label="&translation.notNow.button;" anonid="notNow"
- oncommand="document.getBindingParent(this).closeCommand();"/>
- </xul:hbox>
+ <!-- offer to translate -->
+ <xul:hbox class="translate-offer-box" align="center">
+ <xul:label class="translate-infobar-element" value="&translation.thisPageIsIn.label;"/>
+ <xul:menulist class="translate-infobar-element" anonid="detectedLanguage">
+ <xul:menupopup/>
+ </xul:menulist>
+ <xul:label class="translate-infobar-element" value="&translation.translateThisPage.label;"/>
+ <xul:button class="translate-infobar-element"
+ label="&translation.translate.button;"
+ anonid="translate"
+ oncommand="document.getBindingParent(this).translate();"/>
+ <xul:button class="translate-infobar-element"
+ label="&translation.notNow.button;" anonid="notNow"
+ oncommand="document.getBindingParent(this).closeCommand();"/>
+ </xul:hbox>
- <!-- translating -->
- <xul:vbox class="translating-box" pack="center">
- <xul:label class="translate-infobar-element"
- value="&translation.translatingContent.label;"/>
- </xul:vbox>
+ <!-- translating -->
+ <xul:vbox class="translating-box" pack="center">
+ <xul:label class="translate-infobar-element"
+ value="&translation.translatingContent.label;"/>
+ </xul:vbox>
- <!-- translated -->
- <xul:hbox class="translated-box" align="center">
- <xul:label class="translate-infobar-element"
- value="&translation.translatedFrom.label;"/>
- <xul:menulist class="translate-infobar-element"
- anonid="fromLanguage"
- oncommand="document.getBindingParent(this).translate()">
- <xul:menupopup/>
- </xul:menulist>
- <xul:label class="translate-infobar-element"
- value="&translation.translatedTo.label;"/>
- <xul:menulist class="translate-infobar-element"
- anonid="toLanguage"
- oncommand="document.getBindingParent(this).translate()">
- <xul:menupopup/>
- </xul:menulist>
- <xul:label class="translate-infobar-element"
- value="&translation.translatedToSuffix.label;"/>
- <xul:button anonid="showOriginal"
- class="translate-infobar-element"
- label="&translation.showOriginal.button;"
- oncommand="document.getBindingParent(this).showOriginal();"/>
- <xul:button anonid="showTranslation"
- class="translate-infobar-element"
- label="&translation.showTranslation.button;"
- oncommand="document.getBindingParent(this).showTranslation();"/>
- </xul:hbox>
+ <!-- translated -->
+ <xul:hbox class="translated-box" align="center">
+ <xul:label class="translate-infobar-element"
+ value="&translation.translatedFrom.label;"/>
+ <xul:menulist class="translate-infobar-element"
+ anonid="fromLanguage"
+ oncommand="document.getBindingParent(this).translate()">
+ <xul:menupopup/>
+ </xul:menulist>
+ <xul:label class="translate-infobar-element"
+ value="&translation.translatedTo.label;"/>
+ <xul:menulist class="translate-infobar-element"
+ anonid="toLanguage"
+ oncommand="document.getBindingParent(this).translate()">
+ <xul:menupopup/>
+ </xul:menulist>
+ <xul:label class="translate-infobar-element"
+ value="&translation.translatedToSuffix.label;"/>
+ <xul:button anonid="showOriginal"
+ class="translate-infobar-element"
+ label="&translation.showOriginal.button;"
+ oncommand="document.getBindingParent(this).showOriginal();"/>
+ <xul:button anonid="showTranslation"
+ class="translate-infobar-element"
+ label="&translation.showTranslation.button;"
+ oncommand="document.getBindingParent(this).showTranslation();"/>
+ </xul:hbox>
- <!-- error -->
- <xul:hbox class="translation-error" align="center">
- <xul:label class="translate-infobar-element"
- value="&translation.errorTranslating.label;"/>
- <xul:button class="translate-infobar-element"
- label="&translation.tryAgain.button;"
- anonid="tryAgain"
- oncommand="document.getBindingParent(this).translate();"/>
- </xul:hbox>
-
- <!-- unavailable -->
- <xul:vbox class="translation-unavailable" pack="center">
- <xul:label class="translate-infobar-element"
- value="&translation.serviceUnavailable.label;"/>
- </xul:vbox>
+ <!-- error -->
+ <xul:hbox class="translation-error" align="center">
+ <xul:label class="translate-infobar-element"
+ value="&translation.errorTranslating.label;"/>
+ <xul:button class="translate-infobar-element"
+ label="&translation.tryAgain.button;"
+ anonid="tryAgain"
+ oncommand="document.getBindingParent(this).translate();"/>
+ </xul:hbox>
- </xul:deck>
- <xul:spacer flex="1"/>
+ <!-- unavailable -->
+ <xul:vbox class="translation-unavailable" pack="center">
+ <xul:label class="translate-infobar-element"
+ value="&translation.serviceUnavailable.label;"/>
+ </xul:vbox>
+
+ </xul:deck>
+ <xul:spacer flex="1"/>
- <xul:button type="menu"
- class="translate-infobar-element options-menu-button"
- anonid="options"
- label="&translation.options.menu;">
- <xul:menupopup class="translation-menupopup cui-widget-panel cui-widget-panelview
- cui-widget-panelWithFooter PanelUI-subView"
- onpopupshowing="document.getBindingParent(this).optionsShowing();">
- <xul:menuitem anonid="neverForLanguage"
- oncommand="document.getBindingParent(this).neverForLanguage();"/>
- <xul:menuitem anonid="neverForSite"
- oncommand="document.getBindingParent(this).neverForSite();"
- label="&translation.options.neverForSite.label;"
- accesskey="&translation.options.neverForSite.accesskey;"/>
- <xul:menuseparator/>
- <xul:menuitem oncommand="openPreferences('paneGeneral', {origin:'translationInfobar'});"
- label="&translation.options.preferences.label;"
- accesskey="&translation.options.preferences.accesskey;"/>
- <xul:menuitem class="subviewbutton panel-subview-footer"
- oncommand="document.getBindingParent(this).openProviderAttribution();">
- <xul:deck anonid="translationEngine" selectedIndex="0">
- <xul:hbox class="translation-attribution">
- <xul:label>&translation.options.attribution.beforeLogo;</xul:label>
- <xul:image src="chrome://browser/content/microsoft-translator-attribution.png"
- aria-label="Microsoft Translator"/>
- <xul:label>&translation.options.attribution.afterLogo;</xul:label>
- </xul:hbox>
- <xul:label class="translation-attribution">&translation.options.attribution.yandexTranslate;</xul:label>
- </xul:deck>
- </xul:menuitem>
- </xul:menupopup>
- </xul:button>
+ <xul:button type="menu"
+ class="translate-infobar-element options-menu-button"
+ anonid="options"
+ label="&translation.options.menu;">
+ <xul:menupopup class="translation-menupopup cui-widget-panel cui-widget-panelview
+ cui-widget-panelWithFooter PanelUI-subView"
+ onpopupshowing="document.getBindingParent(this).optionsShowing();">
+ <xul:menuitem anonid="neverForLanguage"
+ oncommand="document.getBindingParent(this).neverForLanguage();"/>
+ <xul:menuitem anonid="neverForSite"
+ oncommand="document.getBindingParent(this).neverForSite();"
+ label="&translation.options.neverForSite.label;"
+ accesskey="&translation.options.neverForSite.accesskey;"/>
+ <xul:menuseparator/>
+ <xul:menuitem oncommand="openPreferences('paneGeneral', {origin:'translationInfobar'});"
+ label="&translation.options.preferences.label;"
+ accesskey="&translation.options.preferences.accesskey;"/>
+ <xul:menuitem class="subviewbutton panel-subview-footer"
+ oncommand="document.getBindingParent(this).openProviderAttribution();">
+ <xul:deck anonid="translationEngine" selectedIndex="0">
+ <xul:hbox class="translation-attribution">
+ <xul:label>&translation.options.attribution.beforeLogo;</xul:label>
+ <xul:image src="chrome://browser/content/microsoft-translator-attribution.png"
+ aria-label="Microsoft Translator"/>
+ <xul:label>&translation.options.attribution.afterLogo;</xul:label>
+ </xul:hbox>
+ <xul:label class="translation-attribution">&translation.options.attribution.yandexTranslate;</xul:label>
+ </xul:deck>
+ </xul:menuitem>
+ </xul:menupopup>
+ </xul:button>
- </xul:hbox>
- <xul:toolbarbutton ondblclick="event.stopPropagation();"
- anonid="closeButton"
- class="messageCloseButton close-icon tabbable"
- xbl:inherits="hidden=hideclose"
- tooltiptext="&closeNotification.tooltip;"
- oncommand="document.getBindingParent(this).closeCommand();"/>
</xul:hbox>
+ <xul:toolbarbutton ondblclick="event.stopPropagation();"
+ anonid="closeButton"
+ class="messageCloseButton close-icon tabbable"
+ xbl:inherits="hidden=hideclose"
+ tooltiptext="&closeNotification.tooltip;"
+ oncommand="document.getBindingParent(this).closeCommand();"/>
</content>
<implementation>
<property name="state"
onget="return this._getAnonElt('translationStates').selectedIndex;">
<setter>
<![CDATA[
let deck = this._getAnonElt("translationStates");
--- a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js
+++ b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js
@@ -279,18 +279,18 @@ add_task(async function test_one_pending
*/
add_task(async function test_other_ignored() {
let toIgnore = await createPendingCrashReports(1);
let notification =
await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
Assert.ok(notification, "There should be a notification");
// Dismiss notification, creating the .dmp.ignore file
- let anonyNodes = document.getAnonymousNodes(notification)[0];
- let closeButton = anonyNodes.querySelector(".close-icon");
+ let closeButton =
+ document.getAnonymousElementByAttribute(notification, "anonid", "close-button");
closeButton.click();
gNotificationBox.removeNotification(notification, true);
await waitForIgnoredReports(toIgnore);
notification =
await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
Assert.ok(!notification, "There should not be a notification");
@@ -471,18 +471,18 @@ add_task(async function test_can_auto_su
*/
add_task(async function test_can_ignore() {
let reportIDs = await createPendingCrashReports(3);
let notification =
await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
Assert.ok(notification, "There should be a notification");
// Dismiss the notification by clicking on the "X" button.
- let anonyNodes = document.getAnonymousNodes(notification)[0];
- let closeButton = anonyNodes.querySelector(".close-icon");
+ let closeButton =
+ document.getAnonymousElementByAttribute(notification, "anonid", "close-button");
closeButton.click();
// We'll not wait for the notification to finish its transition -
// we'll just remove it right away.
gNotificationBox.removeNotification(notification, true);
await waitForIgnoredReports(reportIDs);
notification =
await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
@@ -545,18 +545,18 @@ add_task(async function test_shutdown_wh
*/
add_task(async function test_shutdown_while_not_showing() {
let reportIDs = await createPendingCrashReports(1);
let notification =
await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
Assert.ok(notification, "There should be a notification");
// Dismiss the notification by clicking on the "X" button.
- let anonyNodes = document.getAnonymousNodes(notification)[0];
- let closeButton = anonyNodes.querySelector(".close-icon");
+ let closeButton =
+ document.getAnonymousElementByAttribute(notification, "anonid", "close-button");
closeButton.click();
// We'll not wait for the notification to finish its transition -
// we'll just remove it right away.
gNotificationBox.removeNotification(notification, true);
await waitForIgnoredReports(reportIDs);
UnsubmittedCrashHandler.uninit();
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -394,30 +394,29 @@
this._finishAnimation();
]]></handler>
</handlers>
</binding>
<binding id="notification" role="xul:alert">
<content>
- <xul:hbox class="notification-inner" flex="1" xbl:inherits="type">
- <xul:hbox anonid="details" align="center" flex="1"
- oncommand="this.parentNode.parentNode._doButtonCommand(event);">
- <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image,type,value"/>
- <xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/>
- <xul:spacer flex="1"/>
- <children/>
- </xul:hbox>
- <xul:toolbarbutton ondblclick="event.stopPropagation();"
- class="messageCloseButton close-icon tabbable"
- xbl:inherits="hidden=hideclose"
- tooltiptext="&closeNotification.tooltip;"
- oncommand="document.getBindingParent(this).dismiss();"/>
+ <xul:hbox anonid="details" align="center" flex="1"
+ oncommand="this.parentNode._doButtonCommand(event);">
+ <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image,type,value"/>
+ <xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/>
+ <xul:spacer flex="1"/>
+ <children/>
</xul:hbox>
+ <xul:toolbarbutton ondblclick="event.stopPropagation();"
+ class="messageCloseButton close-icon tabbable"
+ anonid="close-button"
+ xbl:inherits="hidden=hideclose"
+ tooltiptext="&closeNotification.tooltip;"
+ oncommand="document.getBindingParent(this).dismiss();"/>
</content>
<resources>
<stylesheet src="chrome://global/skin/notification.css"/>
</resources>
<implementation>
<property name="label" onset="this.setAttribute('label', val); return val;"
onget="return this.getAttribute('label');"/>
<property name="value" onset="this.setAttribute('value', val); return val;"