-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Style checks force code to go polymorphic or worse #64
Comments
Totally! The js version has not been written with performance in mind. If you send a pull request i'd gladly accept it :) |
Hey! |
Please send out pull requests :) |
👍 |
@JonathonSonesen were you going to PR with those fixes? |
Actually you can see my changes at PR #94 but they were wrong, I haven't really had time to work on it but finals are next week then I'll have about five weeks free at that point I might look at it some more at that time. |
Ok cool :) good luck with finals |
Thanks man! I plan to slay them, with the sweet knowledge blades I've been forging ;) |
Js version is gone, closing this. |
width/height/top/left use isDimDefined and isPosDefined which checks for undefined. margin and padding properties use the "in" operator which isn't fast and also means you need to totally omit those properties from your object if you want them to have "no value" for layout.
ex.
should just be return node.style[pos] || 0;
For getSpacing it should do:
This means your style object can have that property all the time and just use the value undefined to get the default. The current code forces you to have many different "types" of Style objects which makes v8 and other JS engines go slow.
The text was updated successfully, but these errors were encountered: