mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Merge branch 'arrix-child_textnodes' into develop
This commit is contained in:
commit
4c2cfb30ed
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,3 +17,4 @@ chromedriver.log
|
|||||||
*.baseline
|
*.baseline
|
||||||
*.iml
|
*.iml
|
||||||
.idea/
|
.idea/
|
||||||
|
.DS_Store
|
||||||
|
@ -1077,8 +1077,12 @@ _html2canvas.Parse = function (images, options) {
|
|||||||
function init() {
|
function init() {
|
||||||
var stack = renderElement(element, null);
|
var stack = renderElement(element, null);
|
||||||
|
|
||||||
Array.prototype.slice.call(element.children, 0).forEach(function(childElement) {
|
_html2canvas.Util.Children(element).forEach(function(node) {
|
||||||
parseElement(childElement, stack);
|
if (node.nodeType === 1) {
|
||||||
|
parseElement(node, stack);
|
||||||
|
} else if (node.nodeType === 3) {
|
||||||
|
renderText(element, node, stack);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
stack.backgroundColor = getCSS(document.documentElement, "backgroundColor");
|
stack.backgroundColor = getCSS(document.documentElement, "backgroundColor");
|
||||||
|
22
tests/cases/child-textnodes.html
Normal file
22
tests/cases/child-textnodes.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Inline text in the top element</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<script type="text/javascript" src="../test.js"></script>
|
||||||
|
<style>
|
||||||
|
span {
|
||||||
|
color:blue;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
Some inline text <span> followed by text in span </span> followed by more inline text.
|
||||||
|
<p>Then a block level element.</p>
|
||||||
|
Then more inline text.
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user