@percy/dom 1.31.14-beta.4 → 1.31.15-alpha.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.
Files changed (2) hide show
  1. package/dist/bundle.js +11 -1
  2. package/package.json +3 -3
package/dist/bundle.js CHANGED
@@ -398,7 +398,17 @@
398
398
  if (!sheetA.cssRules || !sheetB.cssRules) return false;
399
399
  const lenA = sheetA.cssRules.length;
400
400
  const lenB = sheetB.cssRules.length;
401
- if (lenA !== lenB) return false;
401
+
402
+ // Only treat as mismatch when the live sheet has MORE rules than the
403
+ // clone — that signals rules were added via CSSOM (insertRule/adopted)
404
+ // and must be re-serialized. When lenA <= lenB, the clone already
405
+ // contains all of the live rules (often duplicated by clone-dom's
406
+ // <style> textContent handling); trust the clone's source text so that
407
+ // CSS shorthand semantics (e.g. `all: initial; border-radius: var(...)`)
408
+ // survive — `cssRule.cssText` expansion appends logical longhands like
409
+ // `border-end-end-radius: initial` AFTER the shorthand, which silently
410
+ // overrides it and breaks the cascade.
411
+ if (lenA > lenB) return false;
402
412
  for (let i = 0; i < lenA; i++) {
403
413
  const ruleA = sheetA.cssRules[i] && sheetA.cssRules[i].cssText;
404
414
  const ruleB = sheetB.cssRules[i] && sheetB.cssRules[i].cssText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/dom",
3
- "version": "1.31.14-beta.4",
3
+ "version": "1.31.15-alpha.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "beta"
12
+ "tag": "alpha"
13
13
  },
14
14
  "main": "dist/bundle.js",
15
15
  "browser": "dist/bundle.js",
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "interactor.js": "^2.0.0-beta.10"
37
37
  },
38
- "gitHead": "b52f1d2fb6272c0b3694e1e9ff584c5622a118c7"
38
+ "gitHead": "726ab78fcd37479a0904996a88400a0b6626daac"
39
39
  }