src/aria/utils/VisualFocus.js
function (element) {
            if (this.__focusedElement) {
                this.removeVisualFocus();
            }
            this.__focusedElement = element;

            if (this.__style) {
                var document = Aria.$window.document;
                // for anchors and buttons it looks better to have the outline property set directly on them. Otherwise
                // we look for the first span containing the element under focus
                if (this.__focusedElement.tagName != "A" && this.__focusedElement.tagName != "BUTTON") {
                    for (var curNode = this.__focusedElement; curNode.tagName != "SPAN" && curNode != document.body; curNode = curNode.parentNode) {}
                    if (curNode != document.body) {
                        this.__outlinedElement = curNode;
                    }
                } else {
                    this.__outlinedElement = this.__focusedElement;
                }
                if (this.__outlinedElement) {
                    // see comments on top of this.__previousOutline to uderstand the reason for this if statement
                    if (ariaCoreBrowser.isIE8) {
                        this.__previousStyle = this.__outlinedElement.style.cssText;// aria.utils.Dom.getStyle(this.__outlinedElement,
                        // "outline");
                    } else {
                        this.__previousStyle = (this.__outlinedElement.style.outline)
                                ? this.__outlinedElement.style.outline
                                : "";
                    }
                    // finally ste the outline property in inline style attribute
                    this.__outlinedElement.style.outline = this.__style;
                }
            }
        }
function (element) {
            if (this.__focusedElement) {
                this.removeVisualFocus();
            }
            this.__focusedElement = element;

            if (this.__style) {
                var document = Aria.$window.document;
                // for anchors and buttons it looks better to have the outline property set directly on them. Otherwise
                // we look for the first span containing the element under focus
                if (this.__focusedElement.tagName != "A" && this.__focusedElement.tagName != "BUTTON") {
                    for (var curNode = this.__focusedElement; curNode.tagName != "SPAN" && curNode != document.body; curNode = curNode.parentNode) {}
                    if (curNode != document.body) {
                        this.__outlinedElement = curNode;
                    }
                } else {
                    this.__outlinedElement = this.__focusedElement;
                }
                if (this.__outlinedElement) {
                    // see comments on top of this.__previousOutline to uderstand the reason for this if statement
                    if (ariaCoreBrowser.isIE8) {
                        this.__previousStyle = this.__outlinedElement.style.cssText;// aria.utils.Dom.getStyle(this.__outlinedElement,
                        // "outline");
                    } else {
                        this.__previousStyle = (this.__outlinedElement.style.outline)
                                ? this.__outlinedElement.style.outline
                                : "";
                    }
                    // finally ste the outline property in inline style attribute
                    this.__outlinedElement.style.outline = this.__style;
                }
            }
        }
function ( element ) { if ( this . __focusedElement ) { this . removeVisualFocus ( ) ; } this . __focusedElement = element ; if ( this . __style ) { var document = Aria . $window . document ; // for anchors and buttons it looks better to have the outline property set directly on them. Otherwise // we look for the first span containing the element under focus if ( this . __focusedElement . tagName != "A" && this . __focusedElement . tagName != "BUTTON" ) { for ( var curNode = this . __focusedElement ; curNode . tagName != "SPAN" && curNode != document . body ; curNode = curNode . parentNode ) { } if ( curNode != document . body ) { this . __outlinedElement = curNode ; } } else { this . __outlinedElement = this . __focusedElement ; } if ( this . __outlinedElement ) { // see comments on top of this.__previousOutline to uderstand the reason for this if statement if ( ariaCoreBrowser . isIE8 ) { this . __previousStyle = this . __outlinedElement . style . cssText ; // aria.utils.Dom.getStyle(this.__outlinedElement, // "outline"); } else { this . __previousStyle = ( this . __outlinedElement . style . outline ) ? this . __outlinedElement . style . outline : "" ; } // finally ste the outline property in inline style attribute this . __outlinedElement . style . outline = this . __style ; } } }
Add visual focus. It sets the outline CSS property of the appropriate HTML Element to the value specified in
the appOutLineStyle of the application configuration
@param {HTMLElement} Element on focus
Add visual focus . It sets the outline CSS property of the appropriate HTML Element to the value specified in the appOutLineStyle of the application configuration