jamietre / CsQuery

CsQuery is a complete CSS selector engine, HTML parser, and jQuery port for C# and .NET 4.
Other
1.16k stars 250 forks source link

Allow Calc for width #126

Open benjamingr opened 11 years ago

benjamingr commented 11 years ago

At the moment it is impossible to assign a calc expression as an element's width. This is pretty useful.

Edit Sorry for the undetailed issues, I report issues as I run into them. I tried setting .Css("width","calc(100%-100px)") and it failed.

jamietre commented 11 years ago

No problem - keep reporting them.

You can get around this by by using the DOMElement.SetStyles(string styles, bool strict) method to set styles (false for strict to disable syntax checking). There should probably be a global setting to disable strict mode too. This can easily be fixed of course but I don't think an outdated CSS spec should make things hard to work around.

benjamingr commented 11 years ago

Yeah, it doesn't make things too hard to work with (and I ended up using SetStyles to resolve the issue). How hard is this to fix? Does it require touching validator.nu ?

jamietre commented 11 years ago

Not hard to fix, it's purely a CsQuery thing.