-
Notifications
You must be signed in to change notification settings - Fork 98
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
Crossbrowser version? #11
Comments
Way to go man! Really handy library that is missing in javascript world. Personally, I have a LOT of need to parse custom css declarations in my interface library. Features I'm personally interested in:
And well, that's not even a full list. I'd like ie7 support, but currently i don't support it either, so it's only for future. I told about my needs to sir subtleGradient, but apparently he's too busy right now. P.S. Right now i have to use very fucked up techniques, because my parser cant handle complex expressions: `background-color: "['gradient', rgba(0, 0, 0, 1), rgba(0, 0, 0, 2)]" - already-parsed-evallable-representation-in-string |
I see you are creating some custom CSS properties. I haven't yet used CSS parser for that.
|
No custom properties? That's sad :) On expressions, i'm not absolutely sure. I don't see a reasonable way to represent an expression with parenthesizes and multiple variables that is later easy to use. On the other hand, gecko does it like gradient(from(...), to(...)) so if we could have such expression parsed (nested functions support would be hot) i will re-do the expressions to something like: calc(subtract(width("parent"), width("left"))) which is basically calc(width("parent") - width("right") sans need to parse expressions. I have a workaround for complex values setting them in evallable array that gets mapped to a setter function and sets properties in a loop. I'm not proud of this and it's slower. I've seen a webkit spec by your link on parsing complex values and i see that it's much better to have them parsed from the start. |
CSSOM.js already can parse -webkit-gradient (or -moz-gradient, whatever). However, it does not parse the value into tokens. It keeps it intact. This is all you can do according to the CSSOM spec:
The CSSOM spec does not define any API to parse values like gradients into primitives. I'm not sure I can help you here. You have to parse values using something else. |
yeah, that's already something. I could manually parse the funciton calls out. So then, my personal requests are: Custom properties and consistent parsing of things in media queries without problems with comments and such. I'd be very happy to use the thing. |
So if I understand this correctly, basically there wont be support for setting the background-image of an element with multiple declarations for cross-browser compatibility? i.e. something akin to:
The way it parses out to now is to only return the last declaration, which is problematic (this property isn't well supported now) |
See #16. |
I have the need for IE compatibility including IE7 and ideally IE6 for use in a CSS authoring tool. |
You'd have to tear up all getters and setters such as I'll probably replace |
Fair enough. |
If someone needs a crossbrowser version of CSSOM.js please describe what are you intend to do with that. It is possible to remove all these
__proto__
andObject.defineProperty
, but I don't feel the need right now.The text was updated successfully, but these errors were encountered: