Bug 1849192 - Replace hbox.panel-footer with moz-button-group in popupnotification r=hjones,desktop-theme-reviewers,dao,reusable-components-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D183231
This commit is contained in:
ganna 2023-09-07 17:47:57 +00:00
parent 963c8ec383
commit 912571dec7
4 changed files with 11 additions and 13 deletions

View File

@ -121,6 +121,11 @@ add_task(async function test_timeShownMultipleNotifications() {
let notificationHiddenPromise = waitForNotificationPanelHidden();
info("Trigger main action via button click during security delay");
// Wait for a tick of the event loop to ensure the button we're clicking
// has been slotted into moz-button-group
await new Promise(resolve => setTimeout(resolve, 0));
triggerMainCommand(PopupNotifications.panel);
await new Promise(resolve => setTimeout(resolve, 0));

View File

@ -486,7 +486,7 @@ menupopup::part(drop-indicator) {
background-color: transparent;
flex-direction: row-reverse;
/* Override proton-doorhanger default styles that increase the size of the button */
margin: 0;
margin: 4px;
}
#contextual-feature-recommendation-notification[data-notification-bucket="CFR_MILESTONE_MESSAGE"] .popup-notification-primary-button {
@ -494,7 +494,6 @@ menupopup::part(drop-indicator) {
color: white;
border: none;
border-radius: 2px;
margin: 4px;
padding: 3px 12px;
flex: 1;
}

View File

@ -95,14 +95,14 @@
</vbox>
</hbox>
<hbox class="popup-notification-footer-container"></hbox>
<hbox class="panel-footer">
<html:moz-button-group class="panel-footer">
<button class="popup-notification-secondary-button panel-footer-button"/>
<button type="menu" class="popup-notification-dropmarker panel-footer-button" data-l10n-id="popup-notification-more-actions-button">
<menupopup position="after_end" data-l10n-id="popup-notification-more-actions-button">
</menupopup>
</button>
<button class="popup-notification-primary-button panel-footer-button" data-l10n-id="popup-notification-default-button"/>
</hbox>
<button class="popup-notification-primary-button primary panel-footer-button" data-l10n-id="popup-notification-default-button"/>
</html:moz-button-group>
`;
}
@ -115,6 +115,8 @@
MozXULElement.insertFTLIfNeeded("toolkit/global/popupnotification.ftl");
this.appendChild(this.constructor.fragment);
window.ensureCustomElements("moz-button-group");
this.button = this.querySelector(".popup-notification-primary-button");
if (
this.hasAttribute("buttonlabel") ||

View File

@ -72,14 +72,6 @@ popupnotificationcontent {
display: none;
}
@media (-moz-platform: windows) {
/* Swap the primary and secondary action, because Windows
* platform conventions put the primary action on the left. */
.panel-footer > .popup-notification-primary-button:not([default]) {
order: -1;
}
}
.popup-notification-secondary-button:not([dropmarkerhidden="true"]) {
border-start-end-radius: 0;
border-end-end-radius: 0;