From 5fb9122986fd08cb8e637ba499f53c0bc75974f1 Mon Sep 17 00:00:00 2001 From: zepumph Date: Fri, 15 Jun 2018 14:35:13 -0800 Subject: [PATCH] never pass undefined to HTMLElement.insertBefore(), https://github.com/phetsims/scenery/issues/715 --- js/accessibility/AccessiblePeer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/accessibility/AccessiblePeer.js b/js/accessibility/AccessiblePeer.js index 235c521d2..c04810cd9 100644 --- a/js/accessibility/AccessiblePeer.js +++ b/js/accessibility/AccessiblePeer.js @@ -86,8 +86,8 @@ define( function( require ) { // The first child of the container parent element should be the peer dom element // if undefined, the insertBefore method will insert the primarySiblingDOMElement as the first child var primarySiblingDOMElement = this.primarySibling; - var firstChild = this.containerParent.children[ 0 ]; - this.containerParent.insertBefore( primarySiblingDOMElement, firstChild ); + var firstChild = this.containerParent.children[ 0 ] || null; + this.containerParent.insertBefore( primarySiblingDOMElement, firstChild ); } // @private {boolean} - Whether we are currently in a "disposed" (in the pool) state, or are available to be @@ -143,6 +143,9 @@ define( function( require ) { return this.containerParent || this.primarySibling; }, + getTopLevelElements: function(){ + }, + /** * Get an element on this node, looked up by the association flag passed in. * @public (scenery-internal)