How to use the ariatemplates/utils/Dom.getElementById function in ariatemplates

To help you get started, we’ve selected a few ariatemplates examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ariatemplates / ariatemplates / test / aria / widgets / wai / popup / dialog / modal / RobotBase.js View on Github external
var isFirstElementFocused = this._createPredicate(function () {
                return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.firstInputId);
            }, function () {
                return 'Focus was not cycled properly while navigating forward.';
github ariatemplates / ariatemplates / test / aria / widgets / wai / popup / dialog / modal / Base.js View on Github external
var isLastElementFocused = this._createPredicate(function () {
                return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.secondInputId);
            }, function () {
                return 'Focus was not cycled properly while navigating backward.';
github ariatemplates / ariatemplates / test / aria / widgets / wai / popup / dialog / modal / Base.js View on Github external
function check() {
                var dialogInstance = this.getWidgetInstance(id);
                var dialogContainer = dialogInstance._popup.domElement;

                var labelId = dialogContainer.getAttribute(attributeName);

                if (!wai) {
                    this.assertTrue(
                        labelId == null,
                        'Dialog should not have a label.'
                    );
                } else {
                    var labelElement = ariaUtilsDom.getElementById(labelId);

                    this.assertTrue(
                        labelElement != null,
                        ariaUtilsString.substitute(
                            'Label element should exist, id: %1', [
                            labelId
                        ])
                    );

                    var actual = labelElement.textContent;
                    if (actual == null) {
                        actual = labelElement.innerText;
                    }

                    var expected = title;
github ariatemplates / ariatemplates / test / aria / widgets / wai / popup / dialog / modal / Base.js View on Github external
var isFirstElementFocused = this._createPredicate(function () {
                return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.firstInputId);
            }, function () {
                return 'Focus was not cycled properly while navigating forward.';
github ariatemplates / ariatemplates / test / aria / widgets / wai / datePicker / DatePickerRobotTestCase.js View on Github external
assertSelectedAttributeHasLabel: function (attributes, expectedLabel) {
            var selected = findAttribute(attributes, "aria-selected", "true");
            this.assertEquals(selected.length, 1);
            this.assertEquals(selected[0].ownerElement.getAttribute("aria-label"), expectedLabel);
            var focusedElement = this.testDocument.activeElement;
            var activeDescendant = focusedElement.getAttribute("aria-activedescendant");
            if (activeDescendant) {
                focusedElement = ariaUtilsDom.getElementById(activeDescendant) || focusedElement;
            }
            this.assertTrue(ariaUtilsString.endsWith(focusedElement.getAttribute("aria-label"), expectedLabel));
        },
github ariatemplates / ariatemplates / test / aria / widgets / wai / popup / dialog / modal / RobotBase.js View on Github external
var isLastElementFocused = this._createPredicate(function () {
                return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.secondInputId);
            }, function () {
                return 'Focus was not cycled properly while navigating backward.';
github ariatemplates / ariatemplates / test / aria / widgets / wai / popup / dialog / modal / RobotBase.js View on Github external
function check() {
                var dialogInstance = this.getWidgetInstance(id);
                var dialogContainer = dialogInstance._popup.domElement;

                var labelId = dialogContainer.getAttribute(attributeName);

                if (!wai) {
                    this.assertTrue(
                        labelId == null,
                        'Dialog should not have a label.'
                    );
                } else {
                    var labelElement = ariaUtilsDom.getElementById(labelId);

                    this.assertTrue(
                        labelElement != null,
                        subst('Label element should exist, id: %1', labelId)
                    );

                    var actual = labelElement.textContent;
                    if (actual == null) {
                        actual = labelElement.innerText;
                    }

                    var expected = title;

                    this.assertTrue(
                        actual === expected,
                        subst('Label content is not the expected one: "%1" instead of "%2"',