Skip to content

Commit

Permalink
Switch back to hasOwnProperty
Browse files Browse the repository at this point in the history
Attempt to fix issue #184
  • Loading branch information
IDisposable committed Aug 26, 2024
1 parent 68e143a commit 77d9236
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
4 changes: 2 additions & 2 deletions dist/dom-to-image-more.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dom-to-image-more.min.js.map

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "dom-to-image-more",
"version": "3.4.0",
"version": "3.4.1",
"description": "Generates an image from a DOM node using HTML5 canvas and SVG",
"main": "dist/dom-to-image-more.min.js",
"devDependencies": {
"chai": "^4.3.10",
"eslint": "^9.9.0",
"eslint": "^9.9.1",
"grunt": "^1.6.1",
"grunt-cli": "^1.5.0",
"grunt-contrib-jshint": "^3.2.0",
Expand Down
9 changes: 7 additions & 2 deletions src/dom-to-image-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
function isInShadowRoot(value) {
return (
value !== null &&
'getRootNode' in value &&
Object.prototype.hasOwnProperty.call(value, 'getRootNode') &&
isShadowRoot(value.getRootNode())
);
}
Expand Down Expand Up @@ -1124,7 +1124,12 @@
function getCssRules(styleSheets) {
const cssRules = [];
styleSheets.forEach(function (sheet) {
if ('cssRules' in Object.getPrototypeOf(sheet)) {
if (
Object.prototype.hasOwnProperty.call(
Object.getPrototypeOf(sheet),
'cssRules'
)
) {
try {
util.asArray(sheet.cssRules || []).forEach(
cssRules.push.bind(cssRules)
Expand Down

0 comments on commit 77d9236

Please sign in to comment.