diff --git a/accessible/public/Makefile.in b/accessible/public/Makefile.in index 4f9ee7d8ec9c..380a5ac6347a 100644 --- a/accessible/public/Makefile.in +++ b/accessible/public/Makefile.in @@ -72,6 +72,7 @@ XPIDLSRCS = \ nsIAccessibleText.idl \ nsIAccessibleValue.idl \ nsIAccessibleImage.idl \ + nsIXBLAccessible.idl \ $(NULL) ifdef MOZ_XUL diff --git a/accessible/public/nsIXBLAccessible.idl b/accessible/public/nsIXBLAccessible.idl new file mode 100644 index 000000000000..ef0dac7b3ae5 --- /dev/null +++ b/accessible/public/nsIXBLAccessible.idl @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Mozilla browser. + * + * The Initial Developer of the Original Code is + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsISupports.idl" + +/** + * XBL controls can implement this interface to provide own implementation of + * accessible properties. + */ +[scriptable, uuid(3716eb86-166b-445b-a94a-9b522fee96e6)] +interface nsIXBLAccessible : nsISupports +{ + /** + * Return accessible name. + */ + readonly attribute DOMString accessibleName; +}; diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index 0635ffce67e1..e5c0e2f4aa35 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -43,6 +43,7 @@ #include "nsIAccessibleDocument.h" #include "nsIAccessibleHyperText.h" +#include "nsIXBLAccessible.h" #include "nsAccessibleTreeWalker.h" #include "nsIDOMElement.h" @@ -283,6 +284,13 @@ nsAccessible::GetName(nsAString& aName) if (!aName.IsEmpty()) return NS_OK; + nsCOMPtr xblAccessible(do_QueryInterface(mDOMNode)); + if (xblAccessible) { + nsresult rv = xblAccessible->GetAccessibleName(aName); + if (!aName.IsEmpty()) + return NS_OK; + } + nsresult rv = GetNameInternal(aName); NS_ENSURE_SUCCESS(rv, rv); diff --git a/accessible/tests/mochitest/test_elm_media.html b/accessible/tests/mochitest/test_elm_media.html index 9f4053f4e8f6..7adf945f234c 100644 --- a/accessible/tests/mochitest/test_elm_media.html +++ b/accessible/tests/mochitest/test_elm_media.html @@ -67,10 +67,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573 role: ROLE_PROGRESSBAR }, { // slider of progress bar - role: ROLE_SLIDER + role: ROLE_SLIDER, + name: "0:00 of 0:01 elapsed" }, - { // duration label - role: ROLE_LABEL + { // duration label, role="presentation" + role: ROLE_NOTHING }, { // mute button role: ROLE_PUSHBUTTON, diff --git a/toolkit/content/widgets/videocontrols.xml b/toolkit/content/widgets/videocontrols.xml index 07eb15642560..cfa302ecd057 100644 --- a/toolkit/content/widgets/videocontrols.xml +++ b/toolkit/content/widgets/videocontrols.xml @@ -78,7 +78,24 @@ - + + + + + if (this.type != "scrubber") + return ""; + + var currTime = this.thumb.timeLabel.getAttribute("value"); + var totalTime = this.durationValue; + + return this.scrubberNameFormat.replace(/#1/, currTime). + replace(/#2/, totalTime); + + + + + "&scrubberScale.nameFormat;" + "" null null @@ -159,7 +176,7 @@ -