summaryrefslogtreecommitdiff
path: root/src/stylesheet.c
Commit message (Collapse)AuthorAgeFilesLines
* Given that we're going to be copying selector details, anyway, it seems ↵John Mark Bell2008-12-011-41/+11
| | | | | | pointless to create objects on the heap which can equally well be on the stack, given the shortness of their lifetime. svn path=/trunk/libcss/; revision=5863
* Retain pointer to dictionary entries so we don't have to rediscover it later.John Mark Bell2008-12-011-48/+9
| | | | svn path=/trunk/libcss/; revision=5862
* Divorce css_string from whatever gets stored in lpu hashes.John Mark Bell2008-12-011-4/+6
| | | | | | | | | | | | | | | | | | Use pointers to parserutils_hash_entry directly in stylesheet datastructures. The upshot of this for allzengarden.css is: 5506 slots used (of 8192 => 67.211914%) Data: 8 full blocks: 32768 bytes 9 partial blocks: 35124 bytes (of 36864 => 95.279945%) Total: 69936 (4112) (32) Hash structures: 65584 i.e. a total string dictionary size of 135,520 bytes, which is some 74,056 bytes less than before. svn path=/trunk/libcss/; revision=5859
* Use parserutils_hash instead of parserutils_dict.John Mark Bell2008-11-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | This approximately halves the size of the interned string table. We now have the following for allzengarden.css: 5507 slots used (of 8192 => 67.224121%) Data: 3 full blocks: 12288 bytes 10 partial blocks: 38946 bytes (of 40960 => 95.083008%) Total: 53488 (4112) (32) Entries: 21 full blocks: 86016 bytes 1 partial blocks: 2096 bytes (of 4096 => 51.171875%) Total: 90496 (4112) (32) Hash structures: 65592 Which gives a total dictionary size of 209,576 bytes. Note that 43% of this is parserutils_hash_entry structures (length-pointer pairs). It would be good, therefore, to be able to purge these. svn path=/trunk/libcss/; revision=5852
* Tidy things up somewhat.John Mark Bell2008-11-281-13/+5
| | | | | | css21 is now language, as everything will share the same parsing rules (although there is facility to alter behaviour based upon the language level -- consult language->sheet->level and then decide what to do) svn path=/trunk/libcss/; revision=5815
* Optimise css_stylesheet_add_rule by the cunning approach of not iterating ↵John Mark Bell2008-11-281-9/+6
| | | | | | through a singly linked list to find the end every time we want to insert a rule. This doubles parsing speed. svn path=/trunk/libcss/; revision=5811
* Change the way in which css_rules are defined. This is more compact than the ↵John Mark Bell2008-11-281-25/+61
| | | | | | previous approach. Space requirements for rule objects alone is now 447,120 bytes as opposed to 819,270 bytes previously. This reduces the space requirements for allzengarden.css to 2,041,712 bytes, which is 45% the size of what we had originally. svn path=/trunk/libcss/; revision=5810
* css_string is now the same as a parserutils_dict_entry. This allows us to ↵John Mark Bell2008-11-271-55/+198
| | | | | | | | | | use dict entries directly as strings. iChange the way in which selectors are represented. This significantly reduces memory requirements -- reducing the approximate usage count (excludes the string dictionary, which is about 360k) of allzengarden.css from 4,535,400 bytes to 2,414,312 bytes on a 64bit platform. The string dictionary is now created and owned by the stylesheet object. The parser is just given access to this so that it can store strings in it. svn path=/trunk/libcss/; revision=5809
* Calculate some kind of ballpark figure for the memory requirements of a ↵John Mark Bell2008-11-271-12/+31
| | | | | | stylesheet. Summary: lots. svn path=/trunk/libcss/; revision=5808
* Make stylesheet component constructors/destructors report errorsJohn Mark Bell2008-11-091-50/+84
| | | | svn path=/trunk/libcss/; revision=5675
* Port libcss to new lpu API.John Mark Bell2008-11-091-6/+7
| | | | | | Make lexer, core parser, and css21 parser constructors&destructors return errors svn path=/trunk/libcss/; revision=5674
* Fix memory corruption. This took far too long to debug. Bah.John Mark Bell2008-10-251-1/+2
| | | | svn path=/trunk/libcss/; revision=5628
* A bunch of property parsers.John Mark Bell2008-10-251-0/+17
| | | | | | | | | | Split out !important parsing into a separate function. Support for dumping bytecode to a file handle in some kind of human-readable format. Strings can be represented in the bytecode as a pointer, length pair rather than embedding the string data into the bytecode -- all strings are interned by the core syntax parser. Add todo relating to early destruction of parser object (it shouldn't be needed once parsing is complete). Note documented issue surrounding interned string dictionary, however. In general, it seems wasteful to create a new dictionary containing string representations of keywords for every single parser instance. It would be better to have one central (statically allocated?) dictionary for this and then each parser instance can have a smaller dictionary containing any unknown strings contained within the stylesheet being parsed (e.g. string constants or URLs). svn path=/trunk/libcss/; revision=5627
* Something approximating a parser for clear.John Mark Bell2008-10-231-0/+92
| | | | | | Provide API to create/destroy css_styles and append them to css_rules. svn path=/trunk/libcss/; revision=5625
* Fix stupid.John Mark Bell2008-10-201-4/+8
| | | | svn path=/trunk/libcss/; revision=5606
* Squash warningJohn Mark Bell2008-10-201-1/+1
| | | | svn path=/trunk/libcss/; revision=5605
* Provide an internal mechanism for dumping stylesheets to a file handle.John Mark Bell2008-10-191-0/+172
| | | | | | Make the css21 test driver call this so we can see if it's working. svn path=/trunk/libcss/; revision=5602
* Finish selector list parsingJohn Mark Bell2008-10-191-1/+2
| | | | svn path=/trunk/libcss/; revision=5599
* Modify CSS2.1 frontend test driver to use the public stylesheet API.John Mark Bell2008-09-251-1/+1
| | | | | | Media type handling may need to change -- 32bits may not be large enough in the long term, and there's no sensible way of extending this without causing ABI breakage in the future. svn path=/trunk/libcss/; revision=5439
* Implement css_stylesheet_append_data and css_stylesheet_data_doneJohn Mark Bell2008-09-251-10/+6
| | | | svn path=/trunk/libcss/; revision=5438
* Create a parser instance for a stylesheet. Also create a level-specific ↵John Mark Bell2008-09-251-2/+34
| | | | | | frontend. This probably wants reworking as we don't really want to be switching on the language level every time we want to interact with the parser frontend. svn path=/trunk/libcss/; revision=5437
* Mechanism for the client to select the language level.John Mark Bell2008-09-251-2/+3
| | | | svn path=/trunk/libcss/; revision=5436
* Add API to get/set a stylesheet's disabled stateJohn Mark Bell2008-09-251-0/+36
| | | | svn path=/trunk/libcss/; revision=5435
* Implement most of stylesheet's public APIJohn Mark Bell2008-09-251-19/+77
| | | | svn path=/trunk/libcss/; revision=5434
* Public stylesheet API & stubbed out implementations.John Mark Bell2008-09-251-0/+135
| | | | | | Make public headers use libcss_ as their guard macro prefix. svn path=/trunk/libcss/; revision=5433
* Implement a bunch of css_stylesheet_*John Mark Bell2008-09-201-24/+103
| | | | svn path=/trunk/libcss/; revision=5376
* More API munging. Also stub out implementations of new APIs.John Mark Bell2008-09-131-0/+186
svn path=/trunk/libcss/; revision=5306