<commit_before>if (window.devicePixelRatio && window.devicePixelRatio > 1) {
    Kwf.onElementReady('.kwcAbstractImage', function(el) {
        var dpr2src = el.dom.getAttribute('data-dpr2src');
        if (dpr2src) {
            var img = el.child('img');
            img.dom.src = dpr2src;
        }
    });
}

Kwf.onContentReady(function(readyEl) {
    Ext.get(readyEl).select('.kwcAbstractImage img', true).each(function(el) {
        var s = el.getSize();
        if (el.dom.imgSizeInitDone) return;
        el.dom.imgSizeInitDone = true;
        if (!el.dom.getAttribute('width') || !el.dom.getAttribute('height')) {
            return;
        }
        //img tags that set width/height: auto in css don't have size until they are loaded
        //move the size attribute into inline style with respecting aspect ratio
        //also always set width as style for dpr2 images as width: auto would display them in double size
        el.dom.style.width = el.dom.getAttribute('width')+'px';
        el.dom.style.height = el.dom.getAttribute('height')+'px';
        if (el.getWidth() < el.dom.getAttribute('width')) {
            //image is responsive, adapt height accordingly
            var ratio = el.dom.getAttribute('height') / el.dom.getAttribute('width');
            el.dom.style.height = (ratio * el.getWidth())+'px';
        }
        el.on('load', function() {
            //once the img is loaded remove the style again and let css with: auto do it's work
            //required to be able to react to browser window change
            //this.style.width = ''; //don't remove width as that would break with dpr2 images
            this.style.height = '';
        }, el.dom);
    }, this);
}, this, { priority: -1 });
<commit_msg>don't use inline style sizes for <=ie8<commit_after>if (window.devicePixelRatio && window.devicePixelRatio > 1) {
    Kwf.onElementReady('.kwcAbstractImage', function(el) {
        var dpr2src = el.dom.getAttribute('data-dpr2src');
        if (dpr2src) {
            var img = el.child('img');
            img.dom.src = dpr2src;
        }
    });
}

Kwf.onContentReady(function(readyEl) {
    Ext.get(readyEl).select('.kwcAbstractImage img', true).each(function(el) {
        var s = el.getSize();
        if (el.dom.imgSizeInitDone) return;
        el.dom.imgSizeInitDone = true;
        if (!el.dom.getAttribute('width') || !el.dom.getAttribute('height')) {
            return;
        }
        if (Ext.isIE8 || Ext.isIE7 || Ext.isIE6) return; //those suckers don't support responsiveness or dpr2, so all below is not needed

        //img tags that set width/height: auto in css don't have size until they are loaded
        //move the size attribute into inline style with respecting aspect ratio
        //also always set width as style for dpr2 images as width: auto would display them in double size
        el.dom.style.width = el.dom.getAttribute('width')+'px';
        el.dom.style.height = el.dom.getAttribute('height')+'px';
        if (el.getWidth() < el.dom.getAttribute('width')) {
            //image is responsive, adapt height accordingly
            var ratio = el.dom.getAttribute('height') / el.dom.getAttribute('width');
            el.dom.style.height = (ratio * el.getWidth())+'px';
        }
        el.on('load', function() {
            //once the img is loaded remove the style again and let css with: auto do it's work
            //required to be able to react to browser window change
            //this.style.width = ''; //don't remove width as that would break with dpr2 images
            this.style.height = '';
        }, el.dom);
    }, this);
}, this, { priority: -1 });

{'fraction_non_alphanumeric': 0.1337527352297593, 'fraction_numerical': 0.0057439824945295405, 'mean_word_length': 2.3705069124423965, 'pattern_counts': {'":': 0, '<': 6, '<?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': '3286196', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1064, 'n_words': 308}