<commit_before>var _ = require("./utils"),
    $Element = require("./element"),
    features = require("./features"),
    importStyles = require("./dom.importstyles"),
    animationEvents = features.WEBKIT_PREFIX ? ["webkitAnimationEnd", "webkitTransitionEnd"] : ["animationend", "transitionend"],
    createCallback = function(el, callback, fn) {
        return function() {
            el.legacy(function(node, el, index, ref) {
                var value = typeof fn === "function" ? fn(el) : fn,
                    transitionDelay = parseFloat(el.style("transition-duration")),
                    animationDelay = parseFloat(el.style("animation-duration")),
                    iterationCount = el.style("animation-iteration-count"),
                    completeCallback = function() {
                        // always use inline style because they have the highest priority
                        if (value) el.style({ visibility: "hidden", position: "absolute" });

                        if (callback) callback(el, index, ref);
                    };

                if (features.CSS3_ANIMATIONS && (transitionDelay || animationDelay && iterationCount !== "infinite")) {
                    if (callback || value) {
                        // choose max delay
                        el.once(animationEvents[animationDelay > transitionDelay ? 0 : 1], completeCallback);
                    }
                } else {
                    if (callback || value) {
                        // use setTimeout to make a safe call
                        setTimeout(completeCallback, 0);
                    }
                }

                if (value) {
                    // store inline styles
                    el._oldstyle = {
                        visibility: node.style.visibility,
                        position: node.style.position
                    };

                    el.style({
                        visibility: el.style("visibility"),
                        position: el.style("position")
                    });
                } else {
                    if (el._oldstyle) {
                        // restore inline styles
                        el.style(el._oldstyle);

                        delete el._oldstyle;
                    }
                }

                el.set("aria-hidden", value);
            });
        };
    },
    makeVisibilityMethod = function(name, fn) {
        return function(delay, callback) {
            var delayType = typeof delay;
<commit_msg>do not use inline style on hidden state to avoid extra !important declarations<commit_after>var _ = require("./utils"),
    $Element = require("./element"),
    features = require("./features"),
    importStyles = require("./dom.importstyles"),
    animationEvents = features.WEBKIT_PREFIX ? ["webkitAnimationEnd", "webkitTransitionEnd"] : ["animationend", "transitionend"],
    createCallback = function(el, callback, fn) {
        return function() {
            el.legacy(function(node, el, index, ref) {
                var hidden = typeof fn === "function" ? fn(el) : fn,
                    transitionDelay = parseFloat(el.style("transition-duration")),
                    animationDelay = parseFloat(el.style("animation-duration")),
                    iterationCount = el.style("animation-iteration-count"),
                    completeCallback = (callback || hidden) && function() {
                        // remove temporary inline styles
                        if (hidden) el.style({ visibility: null, position: null });

                        if (callback) callback(el, index, ref);
                    };

                if (features.CSS3_ANIMATIONS && (transitionDelay || animationDelay && iterationCount !== "infinite")) {
                    if (completeCallback) {
                        // choose max delay
                        el.once(animationEvents[animationDelay > transitionDelay ? 0 : 1], completeCallback);
                    }
                } else {
                    // use setTimeout to make a safe call
                    if (completeCallback) setTimeout(completeCallback, 0);
                }

                if (hidden) {
                    // store inline styles because they'll be temporary overwritten
                    el._oldstyle = { visibility: node.style.visibility, position: node.style.position };
                    // set current styles inline to override inherited from
                    // the [aria-hidden=true] rule until the element animation ends
                    el.style(el.style(["visibility", "position"]));
                } else {
                    if (el._oldstyle) {
                        // restore inline styles
                        el.style(el._oldstyle);

                        delete el._oldstyle;
                    }
                }

                el.set("aria-hidden", hidden);
            });
        };
    },
    makeVisibilityMethod = function(name, fn) {
        return function(delay, callback) {
            var delayType = typeof delay;

{'fraction_non_alphanumeric': 0.10738916256157635, 'fraction_numerical': 0.0015763546798029558, 'mean_word_length': 1.4091124822021832, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7288350', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1077, 'n_words': 278}