mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Don't parse/render input hidden nodes
This commit is contained in:
parent
645fcd60b3
commit
9907149513
8
dist/html2canvas.js
vendored
8
dist/html2canvas.js
vendored
@ -52,7 +52,6 @@ window.html2canvas = function(nodeList, options) {
|
||||
|
||||
var node = ((nodeList === undefined) ? [document.documentElement] : ((nodeList.length) ? nodeList : [nodeList]))[0];
|
||||
node.setAttribute(html2canvasNodeAttribute, "true");
|
||||
|
||||
return renderDocument(node.ownerDocument, options, window.innerWidth, window.innerHeight).then(function(canvas) {
|
||||
if (typeof(options.onrendered) === "function") {
|
||||
log("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");
|
||||
@ -541,7 +540,12 @@ NodeContainer.prototype.assignStack = function(stack) {
|
||||
};
|
||||
|
||||
NodeContainer.prototype.isElementVisible = function() {
|
||||
return this.node.nodeType === Node.TEXT_NODE ? this.parent.visible : (this.css('display') !== "none" && this.css('visibility') !== "hidden" && !this.node.hasAttribute("data-html2canvas-ignore"));
|
||||
return this.node.nodeType === Node.TEXT_NODE ? this.parent.visible : (
|
||||
this.css('display') !== "none" &&
|
||||
this.css('visibility') !== "hidden" &&
|
||||
!this.node.hasAttribute("data-html2canvas-ignore") &&
|
||||
(this.node.nodeName !== "INPUT" || this.node.getAttribute("type") !== "hidden")
|
||||
);
|
||||
};
|
||||
|
||||
NodeContainer.prototype.css = function(attribute) {
|
||||
|
4
dist/html2canvas.min.js
vendored
4
dist/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
@ -18,7 +18,12 @@ NodeContainer.prototype.assignStack = function(stack) {
|
||||
};
|
||||
|
||||
NodeContainer.prototype.isElementVisible = function() {
|
||||
return this.node.nodeType === Node.TEXT_NODE ? this.parent.visible : (this.css('display') !== "none" && this.css('visibility') !== "hidden" && !this.node.hasAttribute("data-html2canvas-ignore"));
|
||||
return this.node.nodeType === Node.TEXT_NODE ? this.parent.visible : (
|
||||
this.css('display') !== "none" &&
|
||||
this.css('visibility') !== "hidden" &&
|
||||
!this.node.hasAttribute("data-html2canvas-ignore") &&
|
||||
(this.node.nodeName !== "INPUT" || this.node.getAttribute("type") !== "hidden")
|
||||
);
|
||||
};
|
||||
|
||||
NodeContainer.prototype.css = function(attribute) {
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<input type="hidden" value="THIS SHOULD NOT BE VISIBLE!" />
|
||||
<input type="text" value="textbox" />
|
||||
<input type="text" value="textbox" style="border:5px solid navy;" />
|
||||
<input type="text" value="textbox" style="border:5px solid navy;height:40px;" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user