summaryrefslogtreecommitdiff
path: root/src/select/hash.h
Commit message (Collapse)AuthorAgeFilesLines
* Media queries: Update selection API to support media queries.Michael Drake2019-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | The API changes are: 1. When building a selection context, stylesheets added with `css_select_ctx_{append|insert}_sheet()` now have to have media strings associcated with them. Previously they took a simple bitfield for CSS media type. 2. When selecting for an element, the client needs to specify the current media requirements. Previously it only had to provide the bitfield for CSS media type. 3. Same for the css_select_font_faces API. The selection handling has been updated to handle the new API, however it is currently only looking at the media type when performing selection. Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
* Various changes which modify API and ABI:Michael Drake2013-12-131-3/+3
| | | | | | | | | - Remove client allocation function. - Change node_classes callback not to yield array ownership to libcss. - Node bloom filters now built by, during selection libcss. - Added selection callbacks to get and set data on document nodes. Test suite, example, and documentation updated to match.
* Just match against universal string intern instead of checking strings ↵Michael Drake2013-12-071-1/+2
| | | | length/data.
* Significantly optimise CSS selection performance.Michael Drake2013-12-011-3/+14
| | | | | | | | | | | | | | | | Now we pass a node bloom filter to css_get_style. That node bloom filter is filled with the node's ancestor element, class, and id names. Internally, libcss also generates a bloom filter for each selector chain. If the selector chain's bloom filter is not a subset of the node bloom filter, we know that the selector chain's rule does not apply to the node. This avoids the slow selector chain matching process. Other smaller optimisations to move the ruling out of selector chains for inapplicable media types and other reasons to before we start comparing rules from different sources to find the next rule. All this is now done in hash.c so select.c never sees the trivially ruled out rules.
* A bunch more microoptimisationsJohn Mark Bell2011-09-061-1/+1
| | | | svn path=/trunk/libcss/; revision=12746
* CSS3 NamespacesJohn Mark Bell2011-03-121-1/+1
| | | | svn path=/trunk/libcss/; revision=11972
* Rename all css_[^_] internal symbols to css__ so that they're nicely namespacedDaniel Silverstone2011-01-261-9/+9
| | | | svn path=/trunk/libcss/; revision=11492
* Fix libcss to use new libwapcaplet behaviour.Daniel Silverstone2010-03-271-2/+1
| | | | | | | TODO: update the tests to include a refcounting proof svn path=/trunk/libcss/; revision=10162
* Change selector hash to segregate:John Mark Bell2009-07-291-3/+16
| | | | | | | | | | | | | 1) element selectors 2) universal selectors with class names 3) universal selectors with ids 4) universal selectors Only bother looking for matching selectors in 2 & 3 if the node being selected for has class names or an id, respectively. In theory, this should speed up style selection somewhat. svn path=/trunk/libcss/; revision=8882
* Calculate the in-memory size of stylesheets and provide some API to access this.John Mark Bell2009-07-271-0/+2
| | | | svn path=/trunk/libcss/; revision=8830
* Fix selector hash some more. It turns out that I'd forgotten how it was ↵John Mark Bell2009-07-171-1/+2
| | | | | | meant to work. svn path=/trunk/libcss/; revision=8607
* Port libcss to libwapcaplet.Daniel Silverstone2009-02-141-2/+2
| | | | | | | | | It passes the tests, perhaps we need more of them. Lifetimes of lwc_string objects really need attention before we can consider this finished. svn path=/trunk/libcss/; revision=6517
* Drop css_error_handler and rename css_alloc to css_allocator_fnDaniel Silverstone2009-02-141-1/+1
| | | | svn path=/trunk/libcss/; revision=6482
* Add ability to delete items from the selector hash (we use lazy deletion, as ↵John Mark Bell2009-01-251-0/+2
| | | | | | it's simpler) svn path=/trunk/libcss/; revision=6272
* Selector hash.John Mark Bell2009-01-251-0/+36
svn path=/trunk/libcss/; revision=6263