Skip to content

Instantly share code, notes, and snippets.

@Gekkio
Created January 24, 2017 17:47
Show Gist options
  • Save Gekkio/83d7f2243e6df922eab24057881ea982 to your computer and use it in GitHub Desktop.
Save Gekkio/83d7f2243e6df922eab24057881ea982 to your computer and use it in GitHub Desktop.
(function() {
var result = [];
function isProblematic(style) {
if (style.overflow !== 'visible') {
if (style.borderTopLeftRadius !== '0px' || style.borderTopRightRadius !== '0px') {
return true;
}
if (style.borderBottomLeftRadius !== '0px' || style.borderBottomRightRadius !== '0px') {
return true;
}
}
return false;
}
function visitElement(el, parentStyle) {
var style = window.getComputedStyle(el);
if (isProblematic(style)) {
result.push(el);
}
for (var i = 0; i < el.children.length; i++) {
visitElement(el.children[i], style);
}
}
visitElement(window.document.documentElement, {});
console.log('IE paint performance killers: ' + result.length + ' elements');
result.forEach(function(el) {
console.error(el.nodeName + ' id=' + el.id + ' class=' + el.className);
});
if (result.length > 0) {
window.problematic = result;
console.log('See window.problematic');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment