cache computed style

This commit is contained in:
Niklas von Hertzen 2012-05-24 14:10:40 +03:00
parent 16022b81c3
commit 8d3a0c2b0d

View File

@ -8,6 +8,8 @@
"use strict";
var _html2canvas = {},
previousElement,
computedCSS,
html2canvas;
@ -106,7 +108,10 @@ _html2canvas.Util.getCSS = function (el, attribute) {
if ( window.getComputedStyle ) {
val = document.defaultView.getComputedStyle(el, null)[ attribute ];
if ( previousElement !== el ) {
computedCSS = document.defaultView.getComputedStyle(el, null);
}
val = computedCSS[ attribute ];
if ( attribute === "backgroundPosition" ) {