Skip to content

Commit

Permalink
Merge pull request #112 from 1904labs/ensure-sandbox-cleanup
Browse files Browse the repository at this point in the history
Ensure the sandbox iframe is discarded.
  • Loading branch information
IDisposable authored Jan 30, 2023
2 parents 9e5810f + 3203be2 commit 9602281
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 90 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: ${{ matrix.node-version }}
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
- name: Check dependencies
run: npm ci --dry-run
- name: Install dependencies
run: npm ci
- name: Run build only
run: npm run build:ci
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ module.exports = function (grunt) {

grunt.registerTask('test', ['karma']);
grunt.registerTask('default', ['jshint', 'test', 'uglify']);
grunt.registerTask('ci', ['jshint', 'uglify']);
};
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.

291 changes: 210 additions & 81 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dom-to-image-more",
"version": "3.0.1-rc.1",
"version": "3.0.2-rc.0",
"description": "Generates an image from a DOM node using HTML5 canvas and SVG",
"main": "dist/dom-to-image-more.min.js",
"devDependencies": {
Expand Down Expand Up @@ -28,6 +28,7 @@
"lint": "eslint --max-warnings=0 src && prettier --check .",
"test": "grunt test",
"build": "grunt",
"build:ci": "grunt ci",
"beta-version-patch": "npm version $(semver $npm_package_version -i prerelease --preid beta)",
"beta-version-minor": "npm version $(semver $npm_package_version -i preminor --preid beta)",
"beta-version-major": "npm version $(semver $npm_package_version -i premajor --preid beta)",
Expand Down
2 changes: 1 addition & 1 deletion spec/dom-to-image-more.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
.catch(done);
});

it.only('should render open shadow DOM roots with assigned nodes intact', function (done) {
it.skip('should render open shadow DOM roots with assigned nodes intact', function (done) {
this.timeout(60000);
loadTestPage(
'shadow-dom/dom-node.html',
Expand Down
2 changes: 2 additions & 0 deletions spec/resources/testcontrol.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h2>Control</h2>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs4c6QAAFltJREFUeF7t3Fu221QCBFDMrHguFmNhKkyF8fRP93BILwdEK6ePdCTfEKqSzU83+Nou7/JVWXLg8f3337/7yl8ECBAgQOCmwOM5II/H46+7vXv37it/z2N7Q3g/+H1wPHA8ODoevB+Qm6PjxwkQIECAwFePH374wYB4IxAgQIDAbYHHzz//vByQ52WM51/7U9nbz+QOBAgQIPBZCTx++eWX6YBso3H0ao3JZ/U+8GIIECBwW+Dx66+/vluNxfNRr/zMNiqznx2/iBvPaPb3Gcdp9Xj7Vz17npnK6qzq7DnPsm6va3b/I8OzMZ7lPPtne9ez51tlWfnsTVf9zLxWhtvj+6By+3faHQh8MoHHb7/9djogz1/0qweT5y/7laEZDz6zg8RsjMYcRweX8U8OnQ3I2ZCN9zt73NVArkZ4NZqv2B69i1Y+s+c6s77zbj167rOhMCJ3hP0sgU8n8PjXv//zwSWsDwbgz+8+9v/s/f/f/bHf//0Btz9D727bfxp/3u/rr7/+4JWtzjrOziaet80OLFc+2R6N3OqsY/YaxrOfo+f//fff//rRozHYj+b42o7uczTuR2cps3z7xz4zfX/bn++JvwZx0vfztufrHfvej+hsMI86HUf+0/16eCYCBM4EHj/99NPxgCzsVp9kT594OPDc/YR+djAaz3BmOa5e6rr7Gm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k5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0ChgQBpbk5kAAQIBAgYkoAQRCBAg0CjwXyzJlLOUQXmIAAAAAElFTkSuQmCC" />
2 changes: 2 additions & 0 deletions spec/resources/testimg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h2>Rendered</h2>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs4c6QAAFu5JREFUeF7t3G1y3EayBVDRu3L4M7wWb8Vb8Xrmz8TbjfSiKUNTqqkCQIm6I12diXBoqG4ikSe766LQpJ5+/vnnd09PT2/evXv3xp8cvA68D6wD1oG768DTI0DevHmzDY/H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QINAiIEBaJqkPAgQIhAUESBhcOQIECLQICJCWSeqDAAECYQEBEgZXjgABAi0CAqRlkvogQIBAWECAhMGVI0CAQIuAAGmZpD4IECAQFhAgYXDlCBAg0CIgQFomqQ8CBAiEBQRIGFw5AgQItAgIkJZJ6oMAAQJhAQESBleOAAECLQICpGWS+iBAgEBYQICEwZUjQIBAi4AAaZmkPggQIBAWECBhcOUIECDQIiBAWiapDwIECIQFBEgYXDkCBAi0CAiQlknqgwABAmEBARIGV44AAQItAgKkZZL6IECAQFhAgITBlSNAgECLgABpmaQ+CBAgEBYQIGFw5QgQINAiIEBaJqkPAgQIhAUESBhcOQIECLQICJCWSeqDAAECYQEBEgZXjgABAi0CAqRlkvogQIBAWECAhMGVI0CAQIuAAGmZpD4IECAQFhAgYXDlCBAg0CIgQFomqQ8CBAiEBQRIGFw5AgQItAgIkJZJ6oMAAQJhAQESBleOAAECLQICpGWS+iBAgEBYQICEwZUjQIBAi4AAaZmkPggQIBAWECBhcOUIECDQIiBAWiapDwIECIQFBEgYXDkCBAi0CAiQlknqgwABAmEBARIGV44AAQItAgKkZZL6IECAQFhAgITBlSNAgECLgABpmaQ+CBAgEBYQIGFw5QgQINAiIEBaJqkPAgQIhAUESBhcOQIECLQICJCWSeqDAAECYQEBEgZXjgABAi0CAqRlkvogQIBAWECAhMGVI0CAQIuAAGmZpD4IECAQFhAgYXDlCBAg0CIgQFomqQ8CBAiEBQRIGFw5AgQItAgIkJZJ6oMAAQJhAQESBleOAAECLQICpGWS+iBAgEBYQICEwZUjQIBAi4AAaZmkPggQIBAWECBhcOUIECDQIiBAWiapDwIECIQFBEgYXDkCBAi0CAiQlknqgwABAmEBARIGV44AAQItAgKkZZL6IECAQFhAgITBlSNAgECLgABpmaQ+CBAgEBYQIGFw5QgQINAiIEBaJqkPAgQIhAX+H/OwMJXTkez6AAAAAElFTkSuQmCC" />
7 changes: 4 additions & 3 deletions src/dom-to-image-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@

function clearCache(result) {
domtoimage.impl.urlCache = [];
removeSandbox();
return result;
}

Expand Down Expand Up @@ -224,7 +225,6 @@
ctx.scale(scale, scale);
ctx.drawImage(image, 0, 0);
}
removeSandbox();
return canvas;
});

Expand Down Expand Up @@ -1181,9 +1181,10 @@

function computeTagKey(tagHierarchy) {
if (options.styleCaching === 'relaxed') {
// pick up only the ascent-stopping element tag and the element tag itsel
// pick up only the ascent-stopping element tag and the element tag itself
/* jshint unused:true */
return tagHierarchy
.filter((_e, i, a) => i === 0 || i === a.length - 1)
.filter((_, i, a) => i === 0 || i === a.length - 1)
.join('>');
}
// for all other cases, fall back the the entire path
Expand Down

0 comments on commit 9602281

Please sign in to comment.