File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
_html2canvas . Renderer = function ( parseQueue , options ) {
2
+ function sortZindex ( a , b ) {
3
+ if ( a === 'children' ) {
4
+ return - 1 ;
5
+ } else if ( b === 'children' ) {
6
+ return 1 ;
7
+ } else {
8
+ return a - b ;
9
+ }
10
+ }
2
11
3
12
// http://www.w3.org/TR/CSS21/zindex.html
4
13
function createRenderQueue ( parseQueue ) {
@@ -16,8 +25,9 @@ _html2canvas.Renderer = function(parseQueue, options){
16
25
childrenDest = specialParent ; // where children without z-index should be pushed into
17
26
18
27
if ( node . zIndex . ownStacking ) {
19
- // '!' comes before numbers in sorted array
20
- contextForChildren = stub . context = { '!' : [ { node :node , children : [ ] } ] } ;
28
+ contextForChildren = stub . context = {
29
+ children : [ { node :node , children : [ ] } ]
30
+ } ;
21
31
childrenDest = undefined ;
22
32
} else if ( isPositioned || isFloated ) {
23
33
childrenDest = stub . children = [ ] ;
@@ -39,7 +49,7 @@ _html2canvas.Renderer = function(parseQueue, options){
39
49
} ) ( parseQueue ) ;
40
50
41
51
function sortZ ( context ) {
42
- Object . keys ( context ) . sort ( function ( a , b ) { return a - b ; } ) . forEach ( function ( zi ) {
52
+ Object . keys ( context ) . sort ( sortZindex ) . forEach ( function ( zi ) {
43
53
var nonPositioned = [ ] ,
44
54
floated = [ ] ,
45
55
positioned = [ ] ,
You can’t perform that action at this time.
0 commit comments