From 8e925dc194e852e26718aba3084d34d5315f7bf4 Mon Sep 17 00:00:00 2001 From: zepumph Date: Sat, 14 Jul 2018 13:30:24 -0800 Subject: [PATCH] work on making accessible attributes mutable, added tests, see https://github.com/phetsims/scenery/issues/814 --- js/accessibility/Accessibility.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/accessibility/Accessibility.js b/js/accessibility/Accessibility.js index 94e428062..5f9bef404 100644 --- a/js/accessibility/Accessibility.js +++ b/js/accessibility/Accessibility.js @@ -2011,13 +2011,16 @@ define( function( require ) { // {string|null} - If non-null, will remove the attribute with the specified namespace. This can be required // for removing certain attributes (e.g. MathML). - namespace: null + namespace: null, + + elementName: AccessiblePeer.PRIMARY_SIBLING // see AccessiblePeer.getElementName() for valid values, default to the primary sibling }, options ); var attributeRemoved = false; for ( var i = 0; i < this._accessibleAttributes.length; i++ ) { if ( this._accessibleAttributes[ i ].attribute === attribute && - this._accessibleAttributes[ i ].options.namespace === options.namespace ) { + this._accessibleAttributes[ i ].options.namespace === options.namespace && + this._accessibleAttributes[ i ].options.elementName === options.elementName ) { this._accessibleAttributes.splice( i, 1 ); attributeRemoved = true; }