todo: implement an option to follow aria-owns
187511
function matchesTag(node, exp) {
	return (
		node.nodeType === 1 &&
		(exp.tag === '*' || node.nodeName.toLowerCase() === exp.tag)
	);
}
1170050
function(value) {

			var container = this.get('element'),
				text = Lang.substitute(this.get(ARIA_TEXT_TEMPLATE),{
					value:value,
					minValue:this.get(MIN_VALUE),
					maxValue:this.get(MAX_VALUE)
				});
			container.setAttribute('aria-valuenow',value);
			container.setAttribute('aria-valuetext',text);
		}
802858
function prepareContext(virtualNode, context) {
	const { actualNode } = virtualNode;
	if (!context.startNode) {
		context = { startNode: virtualNode, ...context };
	}
	/**
	 * When `aria-labelledby` directly references a `hidden` element
	 * the element needs to be included in the accessible name.
	 *
	 * When a descendent of the `aria-labelledby` reference is `hidden`
	 * the element should not be included in the accessible name.
	 *
	 * This is done by setting `includeHidden` for the `aria-labelledby` reference.
	 */
	if (
		actualNode.nodeType === 1 &&
		context.inLabelledByContext &&
		context.includeHidden === undefined
	) {
		context = {
			includeHidden: !dom.isVisible(actualNode, true),
			...context
		};
	}
	return context;
}
630068
function () {
            if (this._cfg.waiAria) {
                var field = this.getTextInputField();
                field.removeAttribute("aria-owns");

                var dropDownIcon = this._getDropdownIcon();
                if (dropDownIcon) {
                    dropDownIcon.setAttribute("aria-expanded", "false");
                }
           }
            this.$DropDownListTrait._afterDropdownClose.apply(this, arguments);
        }
944167
function (config, options) {
            if (this._subWindow) {
                if (this._subWindow.closed) {
                    // we probably did not catch correctly the unload event
                    this.close();
                } else {
                    // TODO: log error
                    return;
                }
            }

            var skinPath = config.skinPath;
            if (!skinPath && !(aria.widgets && aria.widgets.AriaSkin)) {
                var frameworkHref = ariaUtilsFrameATLoader.getFrameworkHref();
                var urlMatch = /aria\/aria-?templates-([^\/]+)\.js/.exec(frameworkHref);
                if (urlMatch && urlMatch.length > 1) {
                    skinPath = ariaCoreDownloadMgr.resolveURL("aria/css/atskin-" + urlMatch[1] + ".js", true);
                } else if (/aria\/bootstrap.js/.test(frameworkHref)) {
                    skinPath = ariaCoreDownloadMgr.resolveURL("aria/css/atskin.js", true);
                } else {
                    return;
                }
            }

            // default options
            if (!options) {
                options = "width=1024, height=800";
            }

            // create sub window. Use date to create a new one each time
            this._subWindow = Aria.$frameworkWindow.open("", config.title + ("" + (new Date()).getTime()), options);
            // this is for creating the same window (usefull for debugging)
            //this._subWindow = Aria.$frameworkWindow.open("", config.title, options);

            // The _subWindow can be null if the popup blocker is enabled in the browser
            if (this._subWindow == null) {
                return;
            }

            this._config = config;
            ariaUtilsAriaWindow.attachWindow();
            ariaUtilsAriaWindow.$on({
                "unloadWindow" : this._onMainWindowUnload,
                scope : this
            });

            ariaUtilsFrameATLoader.loadAriaTemplatesInFrame(this._subWindow, {
                fn: this._onFrameLoaded,
                scope: this
            }, {
                crossDomain: true,
                skipSkinCopy: !!skinPath,
                extraScripts: skinPath ? [skinPath] : [],
                keepLoadingIndicator: true,
                onBeforeLoadingAria: {
                    fn: this._registerOnPopupUnload,
                    scope: this
                }
            });
        }
1225494
function watchAttributes() {
      attr.$observe('value', function(value) {
        var percentValue = clamp(value);
        element.attr('aria-valuenow', percentValue);

        if (mode() != MODE_QUERY) animateIndicator(bar2, percentValue);
      });

      attr.$observe('mdBufferValue', function(value) {
        animateIndicator(bar1, clamp(value));
      });

      attr.$observe('disabled', function(value) {
        if (value === true || value === false) {
          isDisabled = !!value;
        } else {
          isDisabled = angular.isDefined(value);
        }

        element.toggleClass(DISABLED_CLASS, isDisabled);
        container.toggleClass(lastMode, !isDisabled);
      });

      attr.$observe('mdMode', function(mode) {
        if (lastMode) container.removeClass(lastMode);

        switch (mode) {
          case MODE_QUERY:
          case MODE_BUFFER:
          case MODE_DETERMINATE:
          case MODE_INDETERMINATE:
            container.addClass(lastMode = "md-mode-" + mode);
            break;
          default:
            container.addClass(lastMode = "md-mode-" + MODE_INDETERMINATE);
            break;
        }
      });
    }
393718
function showDropDown(scope, element, opts) {
        if (opts.parent !== element.parent()) {
          element.parent().attr('aria-owns', element.attr('id'));
        }
        element.parent().find('md-select-value').attr('aria-hidden', 'true');

        opts.parent.append(element);

        return $q(function(resolve, reject) {

          try {

            $animateCss(element, {removeClass: 'md-leave', duration: 0})
              .start()
              .then(positionAndFocusMenu)
              .then(resolve);

          } catch (e) {
            reject(e);
          }

        });
      }
885482
function(ctx) {
		// Set classes for current status
		var node = ctx.node,
			tree = ctx.tree,
			opts = ctx.options,
//			nodeContainer = node[tree.nodeContainerAttrName],
			hasChildren = node.hasChildren(),
			isLastSib = node.isLastSibling(),
			aria = opts.aria,
//            $ariaElem = aria ? $(node[tree.ariaPropName]) : null,
			$ariaElem = $(node.span).find(".fancytree-title"),
			cn = opts._classNames,
			cnList = [],
			statusElem = node[tree.statusClassPropName];

		if( !statusElem ){
			// if this function is called for an unrendered node, ignore it (will be updated on nect render anyway)
			return;
		}
		// Build a list of class names that we will add to the node <span>
		cnList.push(cn.node);
		if( tree.activeNode === node ){
			cnList.push(cn.active);
//			$(">span.fancytree-title", statusElem).attr("tabindex", "0");
//			tree.$container.removeAttr("tabindex");
		// }else{
//			$(">span.fancytree-title", statusElem).removeAttr("tabindex");
//			tree.$container.attr("tabindex", "0");
		}
		if( tree.focusNode === node ){
			cnList.push(cn.focused);
			if(aria){
//              $(">span.fancytree-title", statusElem).attr("tabindex", "0");
//                $(">span.fancytree-title", statusElem).attr("tabindex", "-1");
				// TODO: is this the right element for this attribute?
				$ariaElem
					.attr("aria-activedescendant", true);
//					.attr("tabindex", "-1");
			}
		}else if(aria){
//			$(">span.fancytree-title", statusElem).attr("tabindex", "-1");
			$ariaElem
				.removeAttr("aria-activedescendant");
//				.removeAttr("tabindex");
		}
		if( node.expanded ){
			cnList.push(cn.expanded);
			if(aria){
				$ariaElem.attr("aria-expanded", true);
			}
		}else if(aria){
			$ariaElem.removeAttr("aria-expanded");
		}
		if( node.folder ){
			cnList.push(cn.folder);
		}
		if( hasChildren !== false ){
			cnList.push(cn.hasChildren);
		}
		// TODO: required?
		if( isLastSib ){
			cnList.push(cn.lastsib);
		}
		if( node.lazy && node.children == null ){
			cnList.push(cn.lazy);
		}
		if( node.partsel ){
			cnList.push(cn.partsel);
		}
		if( node._isLoading ){
			cnList.push(cn.loading);
		}
		if( node._error ){
			cnList.push(cn.error);
		}
		if( node.selected ){
			cnList.push(cn.selected);
			if(aria){
				$ariaElem.attr("aria-selected", true);
			}
		}else if(aria){
			$ariaElem.attr("aria-selected", false);
		}
		if( node.extraClasses ){
			cnList.push(node.extraClasses);
		}
		// IE6 doesn't correctly evaluate multiple class names,
		// so we create combined class names that can be used in the CSS
		if( hasChildren === false ){
			cnList.push(cn.combinedExpanderPrefix + "n" +
					(isLastSib ? "l" : "")
					);
		}else{
			cnList.push(cn.combinedExpanderPrefix +
					(node.expanded ? "e" : "c") +
					(node.lazy && node.children == null ? "d" : "") +
					(isLastSib ? "l" : "")
					);
		}
		cnList.push(cn.combinedIconPrefix +
				(node.expanded ? "e" : "c") +
				(node.folder ? "f" : "")
				);
//        node.span.className = cnList.join(" ");
		statusElem.className = cnList.join(" ");

		// TODO: we should not set this in the <span> tag also, if we set it here:
		// Maybe most (all) of the classes should be set in LI instead of SPAN?
		if(node.li){
			node.li.className = isLastSib ? cn.lastsib : "";
		}
	}
1363275
private void followOwner() {
        if (owner.isVisible() && owner.isShowing()) {
            try {
                Point screenLocation = owner.getLocationOnScreen();
                Point relativeSlaveLocation = anchorLink.getRelativeSlaveLocation(owner.getSize(),
                        TransparentToolTipDialog.this.getSize());
                setLocation(screenLocation.x + relativeSlaveLocation.x, screenLocation.y + relativeSlaveLocation.y);
            } catch (IllegalComponentStateException e) {
                LOGGER.error("Failed getting location of component: " + owner, e);
            }
        }
    }
312024
function () {
            // start working in subwindow
            var Aria = this._subWindow.Aria, aria = this._subWindow.aria;
            // link the url map and the root map in the sub-window
            // to the corresponding maps in the main window:
            Aria.rootFolderPath = this.getAria().rootFolderPath;
            aria.core.DownloadMgr._urlMap = ariaCoreDownloadMgr._urlMap;
            aria.core.DownloadMgr._rootMap = ariaCoreDownloadMgr._rootMap;
            Aria.setRootDim({
                width : {
                    min : 16
                },
                height : {
                    min : 16
                }
            });
            Aria.load({
                classes : ['aria.templates.ModuleCtrlFactory'],
                oncomplete : {
                    fn : this._templatesReady,
                    scope : this
                }
            });
        }
762925
function () {
                if (this._hasPlaceholder) {
                    var element = this._domElt;
                    var cssClass = new aria.utils.ClassList(element);
                    element.value = "";
                    this._hasPlaceholder = false;
                    cssClass.remove('placeholder');
                    cssClass.$dispose();
                    this._domElt.unselectable = "off";
                }
            }
1289420
function( startMenu ) {
		if ( !startMenu ) {
			startMenu = this.active ? this.active.parent() : this.element;
		}

		startMenu
			.find( ".ui-menu" )
				.hide()
				.attr( "aria-hidden", "true" )
				.attr( "aria-expanded", "false" )
			.end()
			.find( "a.ui-state-active" )
				.removeClass( "ui-state-active" );
	}
405319
function replaceDirect(brstars, replacer) {
    replacer(['require'], function(node) {
      var caller = node.parent
      if (!node.arguments.length) return
      if (!caller.arguments) return
      if (!caller.arguments.length) return
      var value = evaluate(caller.arguments[0])
      if (!value) return
      var source = evaluate(node.arguments[0])
      if (!source) return

      source = resolve.sync(source, {
        basedir: dirname
      })

      var index = brstars.indexOf(source)
      if (index === -1) return

      value = require(source)(value)
      replaceCount += 1
      hijack(caller, value)
    })
  }
445010
function (callback) {
            var debug = this.isDebug();
            if (debug != Aria.debug) {
                // always usefull as a shortcut
                Aria.debug = debug;
                this.$raiseEvent("debugChanged");
            }
            if (aria.core.ResMgr) {
                // the resource manager may not be already loaded
                require("../ResMgr").changeLocale(this.getLanguage(), callback);
            } else {
                this.$callback(callback);
            }
        }
288655
function (selector, incremental) {
        if (!selector) {
            if (incremental) {
                // Everything was removed
                refreshCSS();
            } else {
                // Nothing was be removed
                return;
            }
        } else {
            // Simply put back the original style
            aria.templates.CSSMgr.__textLoaded[selector.location].text = selector.original;
            refreshCSS();
        }
    }
400978
function () {
            // continue working in subwindow
            // var Aria = this._subWindow.Aria;
            var aria = this._subWindow.aria;
            // creates module instance first to be able to dispose it when window close
            var self = this;
            aria.templates.ModuleCtrlFactory.createModuleCtrl({
                classpath : this._config.moduleCtrlClasspath,
                autoDispose : false,
                initArgs : {
                    bridge : this
                }
            }, {
                fn : function (res) {
                    // For some obscure reason on IE 9 only, it is needed to put
                    // this closure here in order to call _moduleLoaded with
                    // the right scope:
                    self._moduleLoaded(res);
                },
                scope : this
            }, false);
        }
43257
function () {
        /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
        /**
         * <b>Deprecated, use aria.core.Browser.ua instead.</b>
         *
         * <p>
         * The user agent string.
         * </p>
         *
         * @type String
         * @deprecated use aria.core.Browser.ua instead
         */
        this.ua = null;
         */

        /**
         * Previous orientation value to check if event should be raised (value changed or not).
         * @type Boolean
         * @private
         */
        this._previousIsPortrait = this.isPortrait(true);

        /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
        this._deprecatedProperties = []; // for init to process well
         */

        /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
        var properties = [
            {
                name: "ua",
                alternative: "aria.core.Browser.ua"
            },

            {
                name: "isMobile",
                type: "method",
                underlying: "isPhone"
            },
            {
                name: "isPhoneGap",
                type: "method",
                underlying: {
                    name: "isPhoneGap",
                    container: ariaCoreBrowser,
                    containerName: "aria.core.Browser"
                }
            },
            {
                name: "is2DTransformCapable",
                type: "method",
                underlying: {
                    name: "is2DTransformCapable",
                    container: ariaCoreBrowser,
                    containerName: "aria.core.Browser"
                }
            },
            {
                name: "is3DTransformCapable",
                type: "method",
                underlying: {
                    name: "is3DTransformCapable",
                    container: ariaCoreBrowser,
                    containerName: "aria.core.Browser"
                }
            }
        ];

        var deprecatedProperties = [];
        var isString = ariaUtilsType.isString;
        ariaUtilsArray.forEach(properties, function(property) {
            // ------------------------------------------------ property factory

            if (ariaUtilsType.isString(property)) {
                property = {name: property};
            }

            // ------------------------------------------------------------ name

            var name = property.name;

            // ------------------------------------------------------------ type

            var type = property.type;

            if (type == null) {
                type = "attribute";
            }

            property.type = type;

            // ----------------------------------------------- underlying method

            var possibleAlternative;

            if (type == "method") {
                var underlying = property.underlying;

                if (isString(underlying)) {
                    underlying = {name: underlying};
                }

                var underlyingName = underlying.name;

                var underlyingContainer = underlying.container;
                if (underlyingContainer == null) {
                    underlyingContainer = this;
                }
                underlying.container = underlyingContainer;

                var underlyingContainerName = underlying.containerName;

                // -------------------------------------------------------------

                possibleAlternative = "";
                if (underlyingContainerName != null) {
                    possibleAlternative += underlyingContainerName + ".";
                }
                possibleAlternative += underlyingName;

                underlying = function() {
                    return underlyingContainer[underlyingName].apply(underlyingContainer, arguments);
                };

                property.underlying = underlying;
            }

            // ----------------------------------------------------- alternative

            var alternative = property.alternative;

            if (alternative == null && possibleAlternative != null) {
                alternative = possibleAlternative;
            }

            property.alternative = alternative;

            // --------------------------------------------------- extrapolation

            var loggingMessage;
            var loggingMessageArguments = [name];

            if (alternative != null) {
                loggingMessage = type == "attribute" ? "DEPRECATED_REPLACED_PROPERTY" : "DEPRECATED_REPLACED_METHOD";
                loggingMessageArguments.push(alternative);
            } else {
                loggingMessage = type == "attribute" ? "DEPRECATED_REMOVED_PROPERTY" : "DEPRECATED_REMOVED_METHOD";
            }

            property.loggingMessage = this[loggingMessage];
            property.loggingMessageArguments = loggingMessageArguments;

            // ---------------------------------------------------------- result

            deprecatedProperties.push(property);
        }, this);

        this._deprecatedProperties = deprecatedProperties;
        this.__deprecateProperties();
         */

        this.init();
    }