Skip to content

Commit

Permalink
Revert "instrument Display.focusProperty for all a11y sims, not just …
Browse files Browse the repository at this point in the history
…based on query parameter, #936"

This reverts commit ab99d0f.
  • Loading branch information
zepumph committed May 7, 2019
1 parent ab99d0f commit d584f45
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions js/display/Display.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,20 +274,6 @@ define( function( require ) {
this.scenery = scenery;

if ( this.options.accessibility ) {

// If the display supports accessibility, we want to overwrite the focusProperty, instead instrumenting it with
// PhET-iO, see https://github.com/phetsims/scenery/issues/936
// NOTE: Do not move this below FocusOverlay's creation below.
Display.focusProperty = new Property( null, {

// Make this a static tandem so that it can be added to PhET-iO Studio correctly (batched and then flushed when the
// listener is added).
tandem: Tandem.generalTandem.createTandem( 'focusProperty' ),
phetioType: PropertyIO( NullableIO( FocusIO ) ),
phetioState: false,
phetioReadOnly: true
} );

if ( this.options.isApplication ) {
this._domElement.setAttribute( 'aria-role', 'application' );
}
Expand Down Expand Up @@ -1795,12 +1781,23 @@ define( function( require ) {
'scenery-grabbing-pointer': [ 'grabbing', '-moz-grabbing', '-webkit-grabbing', 'pointer' ]
};

// @public (a11y, read-only, scenery-internal setable) {Property.<Focus|null>} - Display has an axon Property to
// indicate which component is focused (or null if no scenery node has focus).
// NOTE: DO NOT LINK TO THIS!!! It is potentially overridden in Display's constructor
// to support PhET-iO Instrumentation. see https://github.com/phetsims/scenery/issues/936
// FocusOverlay links to this as an exception, but only after it is overwritten, see Display's constructor.
Display.focusProperty = new Property( null );
// @public (a11y, read-only, scenery-internal setable) {Property.<Focus|null>} - Display has an axon Property to indicate which
// component is focused (or null if no scenery node has focus). By passing the tandem and phetioValueType,
// PhET-iO is able to interoperate (save, restore, control, observe what is currently focused. See Display.focus
// for setting the Display's focus. Don't set the value of this Property directly.
Display.focusProperty = new Property( null,

// Only instrument if accessibility is enabled
( window.phet && phet.chipper && phet.chipper.accessibility ) ? {

// Make this a static tandem so that it can be added to PhET-iO Studio correctly (batched and then flushed when the
// listener is added).
tandem: Tandem.generalTandem.createTandem( 'focusProperty' ),
phetioType: PropertyIO( NullableIO( FocusIO ) ),
phetioState: false,
phetioReadOnly: true
} : {}
);

// @public {Emitter} - Fires when we detect an input event that would be considered a "user gesture" by Chrome, so
// that we can trigger browser actions that are only allowed as a result.
Expand Down

0 comments on commit d584f45

Please sign in to comment.