src/aria/utils/Dom.js
function (needle, haystack) {
            needle.width = needle.width || 0;
            needle.height = needle.height || 0;
            if (haystack == this.VIEWPORT) {
                return this.isInViewport({
                    left : needle.x,
                    top : needle.y
                }, {
                    width : needle.width,
                    height : needle.height
                });
            }
            haystack.width = haystack.width || 0;
            haystack.height = haystack.height || 0;
            if (needle.x < haystack.x || needle.y < haystack.y || needle.x + needle.width > haystack.x + haystack.width
                    || needle.y + needle.height > haystack.y + haystack.height) {
                return false;
            }
            return true;
        }
function (needle, haystack) {
            needle.width = needle.width || 0;
            needle.height = needle.height || 0;
            if (haystack == this.VIEWPORT) {
                return this.isInViewport({
                    left : needle.x,
                    top : needle.y
                }, {
                    width : needle.width,
                    height : needle.height
                });
            }
            haystack.width = haystack.width || 0;
            haystack.height = haystack.height || 0;
            if (needle.x < haystack.x || needle.y < haystack.y || needle.x + needle.width > haystack.x + haystack.width
                    || needle.y + needle.height > haystack.y + haystack.height) {
                return false;
            }
            return true;
        }
function ( needle , haystack ) { needle . width = needle . width || 0 ; needle . height = needle . height || 0 ; if ( haystack == this . VIEWPORT ) { return this . isInViewport ( { left : needle . x , top : needle . y } , { width : needle . width , height : needle . height } ) ; } haystack . width = haystack . width || 0 ; haystack . height = haystack . height || 0 ; if ( needle . x < haystack . x || needle . y < haystack . y || needle . x + needle . width > haystack . x + haystack . width || needle . y + needle . height > haystack . y + haystack . height ) { return false ; } return true ; }
Compares two geometries to ascertain whether an element is inside another one
@param {aria.utils.DomBeans:Geometry} needle
@param {aria.utils.DomBeans:Geometry|aria.utils.Dom:VIEWPORT:property} haystack
@return {Boolean}
Compares two geometries to ascertain whether an element is inside another one