@@ -1402,15 +1402,14 @@ function asFloat(str) {
14021402function getBounds ( node ) {
14031403 if ( node . getBoundingClientRect ) {
14041404 var clientRect = node . getBoundingClientRect ( ) ;
1405- var isBody = node . nodeName === "BODY" ;
1406- var width = isBody ? node . scrollWidth : ( node . offsetWidth == null ? clientRect . width : node . offsetWidth ) ;
1405+ var width = node . offsetWidth == null ? clientRect . width : node . offsetWidth ;
14071406 return {
14081407 top : clientRect . top ,
14091408 bottom : clientRect . bottom || ( clientRect . top + clientRect . height ) ,
14101409 right : clientRect . left + width ,
14111410 left : clientRect . left ,
14121411 width : width ,
1413- height : isBody ? node . scrollHeight : ( node . offsetHeight == null ? clientRect . height : node . offsetHeight )
1412+ height : node . offsetHeight == null ? clientRect . height : node . offsetHeight
14141413 } ;
14151414 }
14161415 return { } ;
@@ -1438,8 +1437,10 @@ function NodeParser(element, renderer, support, imageLoader, options) {
14381437 this . renderQueue = [ ] ;
14391438 this . stack = new StackingContext ( true , 1 , element . ownerDocument , null ) ;
14401439 var parent = new NodeContainer ( element , null ) ;
1441- if ( element !== element . ownerDocument . documentElement && this . renderer . isTransparent ( parent . css ( 'backgroundColor' ) ) ) {
1442- renderer . rectangle ( 0 , 0 , renderer . width , renderer . height , new NodeContainer ( element . ownerDocument . documentElement , null ) . css ( 'backgroundColor' ) ) ;
1440+ if ( element === element . ownerDocument . documentElement ) {
1441+ // http://www.w3.org/TR/css3-background/#special-backgrounds
1442+ var canvasBackground = new NodeContainer ( this . renderer . isTransparent ( parent . css ( 'backgroundColor' ) ) ? element . ownerDocument . body : element . ownerDocument . documentElement , null ) ;
1443+ renderer . rectangle ( 0 , 0 , renderer . width , renderer . height , canvasBackground . css ( 'backgroundColor' ) ) ;
14431444 }
14441445 parent . visibile = parent . isElementVisible ( ) ;
14451446 this . createPseudoHideStyles ( element . ownerDocument ) ;
0 commit comments