Open Bug 1194204 Opened 9 years ago Updated 10 months ago

notification box .priority setter not updating class

Categories

(Toolkit :: PopupNotifications and Notification Bars, defect)

40 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: noitidart, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Build ID: 20150806153638

Steps to reproduce:

Run this code to create a cross-tab notification box:

var win = Services.wm.getMostRecentWindow('navigator:browser'); //this is the target window
var deck = win.document.getElementById('content-deck');
var topDeckBox = win.document.getElementById('myTopDeckBox');
if (!topDeckBox) {
  topDeckBox = win.document.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'notificationbox');
  deck.parentNode.appendChild(topDeckBox);
} else {
  console.log('already there')
}

var message = 'Another pop-up blocked';
var nb = topDeckBox; //win.gBrowser.getNotificationBox(); //use _gNB for window level notification. use `win.gBrowser.getNotificationBox()` for tab level
var n = nb.getNotificationWithValue('popup-blocked2');
console.log('nb:', nb)

if(n) {
    n.label = message;
} else {
    var buttons = [{
        label: 'Button',
        accessKey: 'B',
        popup: 'blockedPopupOptions',
        callback: null
    }, {
        label: 'Button',
        accessKey: 'B',
        popup: 'blockedPopupOptions',
        callback: null
    }, {
        label: 'Buttonbbb',
        accessKey: 'B',
        popup: 'blockedPopupOptions',
        callback: null,
      id: 'boo'
    }];

    var priority = 10;
    var rrrr = nb.appendNotification(message, 'popup-blocked2',
                         'chrome://browser/skin/Info.png',
                          priority, buttons);
}


Actual results:

now from browser console to rrrr.priority = 1

it will not change the styling


Expected results:

it sets priority attribute, as per setter here: https://dxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/notification.xml#413

however it should also set the class per here: https://dxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/notification.xml#151-156
Component: Untriaged → Notifications and Alerts
Product: Firefox → Toolkit
Severity: normal → S3
Component: Notifications and Alerts → PopupNotifications and Notification Bars
You need to log in before you can comment on or make changes to this bug.