-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] link set setAttribute disabled not work #169
Comments
The HTML The ponyfill does support the
See the css-vars-ponyfill/src/index.js Lines 65 to 72 in 9811bbd
You are right about the unnecessary processing here though: css-vars-ponyfill/src/index.js Lines 416 to 424 in 9811bbd
Instead of blindly assigning const nodeCSS = cssArray[i];
const hasCSSCache = Boolean(node.__cssVars && node.__cssVars.text);
const hasCSSChanged = hasCSSCache && node.__cssVars.text !== nodeCSS;
// Node data cache
node.__cssVars = node.__cssVars || {};
node.__cssVars.text = nodeCSS;
// Only process CSS if it has changed or contains a
// custom property declarations or function
if ((hasCSSCache && hasCSSChanged) || regex.cssVars.test(nodeCSS)) { I'll have to do some testing to verify that the change is is beneficial. It's been a while since I've looked at the code. |
root.css
root2.css
index.html
Now the text color is green
Enter in console
The text color remains the same. The expected text color should be red
Disabling to become available is normal
Enter in console
The reason is that the listening change function is not supported
Any change to the Disabled property should be reprocessed
by the way:
Parsed cssTree and pasreVars should be cached and not re-parsed the original content of unchanged link and style,
If the cache exists, use it directly. Remove cssTree and VARS caches when link and style elements change again
The text was updated successfully, but these errors were encountered: