( instance: ComponentInternalInstance, vnode: VNode, expectedMap: Map<string, string>, )
| 945 | } |
| 946 | |
| 947 | function resolveCssVars( |
| 948 | instance: ComponentInternalInstance, |
| 949 | vnode: VNode, |
| 950 | expectedMap: Map<string, string>, |
| 951 | ) { |
| 952 | const root = instance.subTree |
| 953 | if ( |
| 954 | instance.getCssVars && |
| 955 | (vnode === root || |
| 956 | (root && |
| 957 | root.type === Fragment && |
| 958 | (root.children as VNode[]).includes(vnode))) |
| 959 | ) { |
| 960 | const cssVars = instance.getCssVars() |
| 961 | for (const key in cssVars) { |
| 962 | const value = normalizeCssVarValue(cssVars[key]) |
| 963 | expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value) |
| 964 | } |
| 965 | } |
| 966 | if (vnode === root && instance.parent) { |
| 967 | resolveCssVars(instance.parent, instance.vnode, expectedMap) |
| 968 | } |
| 969 | } |
| 970 | |
| 971 | const allowMismatchAttr = 'data-allow-mismatch' |
| 972 |
no test coverage detected