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