Skip to content

Commit 564634b

Browse files
committed
stacking context creator should be at the bottom
passes z-index12. issue niklasvh#256
1 parent dd7468c commit 564634b

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/Renderer.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@ _html2canvas.Renderer = function(parseQueue, options){
1515
stub = {node: node},
1616
childrenDest = specialParent; // where children without z-index should be pushed into
1717

18-
if (!context[zi]) { context[zi] = []; }
1918
if (node.zIndex.ownStacking) {
20-
contextForChildren = stub.context = { 0: [{node:node}]};
21-
if (isPositioned || isFloated) {
22-
childrenDest = contextForChildren[0][0].children = [];
23-
}
19+
// '!' comes before numbers in sorted array
20+
contextForChildren = stub.context = { '!': [{node:node, children: []}]};
21+
childrenDest = undefined;
2422
} else if (isPositioned || isFloated) {
2523
childrenDest = stub.children = [];
2624
}
2725

2826
if (zi === 0 && specialParent) {
2927
specialParent.push(stub);
3028
} else {
29+
if (!context[zi]) { context[zi] = []; }
3130
context[zi].push(stub);
3231
}
3332

0 commit comments

Comments
 (0)