html2canvas
Advanced tools
Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8
### Changelog ### | ||
#### v1.0.0-alpha.8 - 2.1.2018 #### | ||
* Use correct doctype in cloned Document (Fix #1298) | ||
* Fix individual border rendering (Fix #1349) | ||
#### v1.0.0-alpha.7 - 31.12.2017 #### | ||
@@ -4,0 +8,0 @@ * Fix form input rendering (#1338) |
@@ -520,3 +520,3 @@ 'use strict'; | ||
documentClone.open(); | ||
documentClone.write('<!DOCTYPE html><html></html>'); | ||
documentClone.write(serializeDoctype(document.doctype) + '<html></html>'); | ||
// Chrome scrolls the parent document for some reason after the write to the cloned window??? | ||
@@ -529,2 +529,28 @@ restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY); | ||
}); | ||
}; | ||
var serializeDoctype = function serializeDoctype(doctype) { | ||
var str = ''; | ||
if (doctype) { | ||
str += '<!DOCTYPE '; | ||
if (doctype.name) { | ||
str += doctype.name; | ||
} | ||
if (doctype.internalSubset) { | ||
str += doctype.internalSubset; | ||
} | ||
if (doctype.publicId) { | ||
str += '"' + doctype.publicId + '"'; | ||
} | ||
if (doctype.systemId) { | ||
str += '"' + doctype.systemId + '"'; | ||
} | ||
str += '>'; | ||
} | ||
return str; | ||
}; |
@@ -91,3 +91,3 @@ 'use strict'; | ||
var renderableBorders = container.style.border.filter(function (border) { | ||
var hasRenderableBorders = container.style.border.some(function (border) { | ||
return border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent(); | ||
@@ -109,8 +109,10 @@ }); | ||
renderableBorders.forEach(function (border, side) { | ||
_this2.renderBorder(border, side, container.curvedBounds); | ||
container.style.border.forEach(function (border, side) { | ||
if (border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent()) { | ||
_this2.renderBorder(border, side, container.curvedBounds); | ||
} | ||
}); | ||
}; | ||
if (HAS_BACKGROUND || renderableBorders.length) { | ||
if (HAS_BACKGROUND || hasRenderableBorders) { | ||
var paths = container.parent ? container.parent.getClipPaths() : []; | ||
@@ -117,0 +119,0 @@ if (paths.length) { |
@@ -6,3 +6,3 @@ { | ||
"main": "dist/npm/index.js", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.8", | ||
"author": { | ||
@@ -9,0 +9,0 @@ "name": "Niklas von Hertzen", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1080456
20820