@percy/dom 1.31.4-beta.2 → 1.31.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +5 -3
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -374,9 +374,11 @@
|
|
|
374
374
|
img.setAttribute('data-percy-canvas-serialized', '');
|
|
375
375
|
img.setAttribute('data-percy-serialized-attribute-src', imageUrl);
|
|
376
376
|
|
|
377
|
-
// set
|
|
378
|
-
if (
|
|
379
|
-
|
|
377
|
+
// set a default max width to account for canvases that might resize with JS
|
|
378
|
+
// Check if width is "static" (fixed pixels) vs "dynamic" (%, vw, etc.)
|
|
379
|
+
const hasStaticWidth = canvas.style.width && canvas.style.width.match(/^\d+px$/);
|
|
380
|
+
if (!hasStaticWidth) {
|
|
381
|
+
img.style.maxWidth = img.style.maxWidth || '100%';
|
|
380
382
|
}
|
|
381
383
|
|
|
382
384
|
// insert the image into the cloned DOM and remove the cloned canvas element
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/dom",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.5-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"interactor.js": "^2.0.0-beta.10"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "06352b66b8e5ebb2281e1111d71b3972a6713ed3"
|
|
39
39
|
}
|