mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
cache computed style
This commit is contained in:
parent
16022b81c3
commit
8d3a0c2b0d
@ -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" ) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user