function getActiveElement(doc) {
        doc = doc || (isBrowser
            ? document
            : undefined);
        if (typeof doc === "undefined") {