-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Avoid prefixing css vars #302
Conversation
Pull Request Test Coverage Report for Build 50eaf8637b4ed9b8ed9bf6e49adf6cc35f4af1ca-PR-302
💛 - Coveralls |
src/Prefixer.js
Outdated
@@ -8,7 +8,7 @@ import {hash, charat, strlen, indexof, replace, substr, match} from './Utility.j | |||
* @return {string} | |||
*/ | |||
export function prefix (value, length, children) { | |||
switch (hash(value, length)) { | |||
switch (charat(value, 0) != 45 && charat(value, 1) != 45 && hash(value, length)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the expression's type now is false | number
- perhaps we should convert false
to a 0
? would that have any effect on the engine? According to some TS PRs that I've seen lately (like this one) JS engines don't do jump-table optimization for switch statements anyway so perhaps this doesn't matter at all? I'm not sure 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second charat(value, 0) != 45
is probably not needed as we also prefer to not touch -webkit-
already prefixed props.
It'd put charat(value, 0) < 46 ? 0 : ...
inside the hash
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on the function - we believe the jump table optimization didn't happen because forEachChild
was just very large.
fixes #301