Re: Issue 39 in fizzler: Calculate the specificity of a given selector

1 view
Skip to first unread message

fiz...@googlecode.com

unread,
Oct 29, 2009, 7:50:30 PM10/29/09
to fizzler...@googlegroups.com
Updates:
Summary: Calculate the specificity of a given selector

Comment #2 on issue 39 by azizatif: Calculate the specificity of a given
selector
http://code.google.com/p/fizzler/issues/detail?id=39

I'm looking at the implementation of CssParser.calculate_specificity and
it's so
dead simple that it would stand on its own fine without any help from
Fizzler. The
only downside is that this implementation assumes a valid selector syntax.
I've
attached a C# port with tests.

The Fizzler way to address this, though slightly more involved, would be to
write an
ISelectorGenerator implementation that carries out the calculation. The
upside here
would be calculation over a validated syntax.

Thoughts?


Attachments:
specificity.zip 5.4 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

fiz...@googlecode.com

unread,
Oct 29, 2009, 9:28:26 PM10/29/09
to fizzler...@googlegroups.com

Comment #3 on issue 39 by jake.net: Calculate the specificity of a given
selector
http://code.google.com/p/fizzler/issues/detail?id=39

Wow! Thanks for the help and code thats pretty cool and very helpful. I
tried to read
the ruby code and maybe I should take a better look!

I am not to sure how I would go about implementing an ISelectorGenerator in
Fizzler
so hopefully you can help :)

I basically want to be able to loop through a list of selectors in
descending order
of specificity so that with each pass I can add css rules to the style
attribute if
it does not already exist.

I guess I will need a way to parse any existing rules within the style
attribute. I
dont think HtmlAgility pack has this ability.. but that should not be too
difficult.

Any help would be awesome!

fiz...@googlecode.com

unread,
Aug 23, 2015, 9:42:38 AM8/23/15
to fizzler...@googlegroups.com

Comment #4 on issue 39 by azizatif: Calculate the specificity of a given
selector
https://code.google.com/p/fizzler/issues/detail?id=39

This issue has been migrated to:
https://github.com/atifaziz/Fizzler/issues/39
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it
is shutting down.
You can also just subscribe to the issue on GitHub to receive notifications
of any further development.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages