From c4c578b44b02308286b2f8c1447ed101bfdac38a Mon Sep 17 00:00:00 2001 From: Sereza7 Date: Mon, 2 Dec 2024 15:25:48 +0100 Subject: [PATCH] XWIKI-22709: XNotifications should have the alert role * Added the `alert` role to xnotifications. --- .../webapp/resources/uicomponents/widgets/notification.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/notification.js b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/notification.js index 2d379bb1c89a..1b725ce93f5a 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/notification.js +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/widgets/notification.js @@ -107,7 +107,9 @@ widgets.Notification = Class.create({ /** Creates the HTML structure for the notification. */ createElement : function() { if (!this.element) { - this.element = new Element("div", {"class" : "xnotification xnotification-" + this.type}).update(this.text); + // The ARIA role `alert` should give implicit values for `aria-live` and `aria-atomic`. + this.element = new Element("div", {"class" : "xnotification xnotification-" + this.type, + "role": "alert"}).update(this.text); if (this.options.icon) { this.element.setStyle({backgroundImage : this.options.icon, paddingLeft : "22px"}); }