notification box .priority setter not updating class

UNCONFIRMED
Unassigned

Status

()

Toolkit
Notifications and Alerts
UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: noitidart, Unassigned)

Tracking

40 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
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

Updated

3 years ago
Component: Untriaged → Notifications and Alerts
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.