src/aria/utils/Ellipsis.js
function (el) {

            var document = Aria.$window.document;
            // Need to make sure the new element has the same exact styling applied as the original element so we use
            // the same tag, class, style and append it to the same parent
            var tempSizerEl = document.createElement(el.tagName);
            tempSizerEl.className = el.className;
            tempSizerEl.setAttribute("style", el.getAttribute("style"));
            el.parentNode.appendChild(tempSizerEl);

            // Now we need to make sure the element displays on one line and is not visible in the page
            tempSizerEl.style.visibility = "hidden";
            tempSizerEl.style.position = "absolute";
            tempSizerEl.style.whiteSpace = "nowrap";

            return tempSizerEl;
        }
function (el) {

            var document = Aria.$window.document;
            // Need to make sure the new element has the same exact styling applied as the original element so we use
            // the same tag, class, style and append it to the same parent
            var tempSizerEl = document.createElement(el.tagName);
            tempSizerEl.className = el.className;
            tempSizerEl.setAttribute("style", el.getAttribute("style"));
            el.parentNode.appendChild(tempSizerEl);

            // Now we need to make sure the element displays on one line and is not visible in the page
            tempSizerEl.style.visibility = "hidden";
            tempSizerEl.style.position = "absolute";
            tempSizerEl.style.whiteSpace = "nowrap";

            return tempSizerEl;
        }
function ( el ) { var document = Aria . $window . document ; // Need to make sure the new element has the same exact styling applied as the original element so we use // the same tag, class, style and append it to the same parent var tempSizerEl = document . createElement ( el . tagName ) ; tempSizerEl . className = el . className ; tempSizerEl . setAttribute ( "style" , el . getAttribute ( "style" ) ) ; el . parentNode . appendChild ( tempSizerEl ) ; // Now we need to make sure the element displays on one line and is not visible in the page tempSizerEl . style . visibility = "hidden" ; tempSizerEl . style . position = "absolute" ; tempSizerEl . style . whiteSpace = "nowrap" ; return tempSizerEl ; }
Create the temporary sizer element to be used internally to measure text
@param {HTMLElement} el The element that will be measured thanks to this sizer
@return {HTMLElement} The sizer element
@private
Create the temporary sizer element to be used internally to measure text