View Single Post
Old 07-25-2014, 03:53 AM   #37
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by kovidgoyal View Post
If you want to make it robust, you have to do a multisort, sorting primarily on selector specificity and secondarily on selector name. You can use the cssselect module to easily calculate selector specificities.
Thanks, I'll have a look at that. The current sort is purely selector. And of course that doesn't work. Not all the style types have a selector. When I tested with the calibre portable, I hit an error with the "@namespace" that is in the stylesheet for the calibre user guide.
davidfor is offline   Reply With Quote