From 160026ea1160c3862a4f5f048db646b534775665 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Thu, 14 May 2009 13:27:40 +0800 Subject: [PATCH] Bug 491443 - Fire OBJECT_NAMECHANGE events when the HTML 5 media Play/Pause or Mute/Unmute buttons are pressed and the caption changes, r=marcoz, davidb --- accessible/src/base/nsDocAccessible.cpp | 4 +- accessible/tests/mochitest/common.js | 10 ++++- .../tests/mochitest/test_elm_media.html | 41 ++++++++++++------- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index deb1943d8da..96d2290e10e 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -1140,7 +1140,9 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID } if (aAttribute == nsAccessibilityAtoms::alt || - aAttribute == nsAccessibilityAtoms::title) { + aAttribute == nsAccessibilityAtoms::title || + aAttribute == nsAccessibilityAtoms::aria_label || + aAttribute == nsAccessibilityAtoms::aria_labelledby) { FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, targetNode); return; diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js index 243d9d62ac4..d51b1e9fe9c 100644 --- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -347,8 +347,14 @@ function prettyName(aIdentifier) { if (aIdentifier instanceof nsIAccessible) { var acc = getAccessible(aIdentifier, [nsIAccessNode]); - return getNodePrettyName(acc.DOMNode) + ", role: " + - roleToString(acc.role); + var msg = "[" + getNodePrettyName(acc.DOMNode) + + ", role: " + roleToString(acc.role); + + if (acc.name) + msg += ", name: '" + acc.name + "'" + msg += "]"; + + return msg; } if (aIdentifier instanceof nsIDOMNode) diff --git a/accessible/tests/mochitest/test_elm_media.html b/accessible/tests/mochitest/test_elm_media.html index 87672335eaa..9f4053f4e8f 100644 --- a/accessible/tests/mochitest/test_elm_media.html +++ b/accessible/tests/mochitest/test_elm_media.html @@ -23,23 +23,28 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573