@@ -493,7 +493,11 @@ _html2canvas.Parse = function (images, options) {
493493 valueWrap . style . top = bounds . top + "px" ;
494494 valueWrap . style . left = bounds . left + "px" ;
495495
496- textValue = ( el . nodeName === "SELECT" ) ? el . options [ el . selectedIndex ] . text : el . value ;
496+ textValue = ( el . nodeName === "SELECT" ) ? ( el . options [ el . selectedIndex ] || 0 ) . text : el . value ;
497+ if ( ! textValue ) {
498+ textValue = el . placeholder ;
499+ }
500+
497501 textNode = doc . createTextNode ( textValue ) ;
498502
499503 valueWrap . appendChild ( textNode ) ;
@@ -754,17 +758,17 @@ _html2canvas.Parse = function (images, options) {
754758 case "INPUT" :
755759 // TODO add all relevant type's, i.e. HTML5 new stuff
756760 // todo add support for placeholder attribute for browsers which support it
757- if ( / ^ ( t e x t | u r l | e m a i l | s u b m i t | b u t t o n | r e s e t ) $ / . test ( element . type ) && element . value . length > 0 ) {
761+ if ( / ^ ( t e x t | u r l | e m a i l | s u b m i t | b u t t o n | r e s e t ) $ / . test ( element . type ) && ( element . value || element . placeholder ) . length > 0 ) {
758762 renderFormValue ( element , bounds , stack ) ;
759763 }
760764 break ;
761765 case "TEXTAREA" :
762- if ( element . value . length > 0 ) {
766+ if ( ( element . value || element . placeholder ) . length > 0 ) {
763767 renderFormValue ( element , bounds , stack ) ;
764768 }
765769 break ;
766770 case "SELECT" :
767- if ( element . options . length > 0 ) {
771+ if ( ( element . options || element . placeholder ) . length > 0 ) {
768772 renderFormValue ( element , bounds , stack ) ;
769773 }
770774 break ;
0 commit comments