summaryrefslogtreecommitdiff
path: root/src/select/select.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix leak. Coverity #1137921.Michael Drake2013-12-151-1/+1
|
* Improve explanation of TODO.Michael Drake2013-12-131-1/+5
|
* Hideous casing to avoid warning (treated as error) with RO toolchain.Michael Drake2013-12-131-1/+3
|
* Various changes which modify API and ABI:Michael Drake2013-12-131-61/+200
| | | | | | | | | - 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-0/+1
| | | | length/data.
* Significantly optimise CSS selection performance.Michael Drake2013-12-011-55/+27
| | | | | | | | | | | | | | | | 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.
* Fix NULL check of array. Coverity #1127067.Michael Drake2013-11-081-5/+3
|
* Prioritise id and class hashes over element hash when inserting rules.Michael Drake2012-08-261-22/+83
|
* Skip empty/broken rules early, before we match their selector chains.Michael Drake2012-08-261-11/+13
|
* Fix not([node_name]) selection.Michael Drake2012-08-071-1/+7
|
* @font-face support. Credit: James MontgomerieJohn Mark Bell2011-12-041-19/+310
| | | | | | Things missing: parser tests; the following descriptors: font-feature-settings, font-stretch, font-variant, unicode-range. svn path=/trunk/libcss/; revision=13244
* Simplify cache loop criterion.Michael Drake2011-11-071-2/+3
| | | | svn path=/trunk/libcss/; revision=13134
* Fill reject cache backwards from end.Michael Drake2011-11-071-6/+7
| | | | svn path=/trunk/libcss/; revision=13133
* Code style tweak.Michael Drake2011-11-061-1/+1
| | | | svn path=/trunk/libcss/; revision=13132
* Avoid trying to add already-cached selectors to reject cache. Remove ↵Michael Drake2011-11-061-24/+15
| | | | | | pre-insertion search. svn path=/trunk/libcss/; revision=13131
* Fix regression introduced by reject cache: do not cache failure to match ↵John Mark Bell2011-11-051-0/+1
| | | | | | multi-detailed selectors svn path=/trunk/libcss/; revision=13126
* Selection micro optimisation.Michael Drake2011-11-041-15/+17
| | | | svn path=/trunk/libcss/; revision=13120
* Don't need to match CSS_SELECTOR_ELEMENT detail since it will always match.Michael Drake2011-11-041-8/+13
| | | | svn path=/trunk/libcss/; revision=13119
* Cache rejected ancestor class/ID selectors to improve selection efficiencyJohn Mark Bell2011-11-041-8/+91
| | | | svn path=/trunk/libcss/; revision=13118
* A bunch more microoptimisationsJohn Mark Bell2011-09-061-38/+51
| | | | svn path=/trunk/libcss/; revision=12746
* Iterate over pseudo elements, then properties, and reject unused pseudo ↵John Mark Bell2011-09-051-16/+15
| | | | | | | | elements at the earliest opportunity. Avoids pointlessly iterating over count(unused-pseudo-element) * count(properties) properties. svn path=/trunk/libcss/; revision=12744
* Compute node name, id, and classes once, instead of once per stylesheetJohn Mark Bell2011-09-051-48/+46
| | | | svn path=/trunk/libcss/; revision=12743
* Hoist string internment into selection context constructor.John Mark Bell2011-09-051-276/+302
| | | | | | Destroy interned strings from selection context destructor. svn path=/trunk/libcss/; revision=12742
* Add structure versioning for client inputJohn Mark Bell2011-03-131-1/+3
| | | | svn path=/trunk/libcss/; revision=12007
* CSS3 NamespacesJohn Mark Bell2011-03-121-51/+53
| | | | svn path=/trunk/libcss/; revision=11972
* The document root element cannot be the child of anythingJohn Mark Bell2011-01-311-12/+25
| | | | svn path=/trunk/libcss/; revision=11572
* Fix specificity calculation for prefix, suffix, and substring attribute ↵John Mark Bell2011-01-311-0/+21
| | | | | | | | selectors. Fix dumping of these selectors when debugging selector chains svn path=/trunk/libcss/; revision=11569
* CSS3 SelectorsJohn Mark Bell2011-01-311-4/+293
| | | | svn path=/trunk/libcss/; revision=11557
* Rename all css_[^_] internal symbols to css__ so that they're nicely namespacedDaniel Silverstone2011-01-261-4/+4
| | | | svn path=/trunk/libcss/; revision=11492
* Ensure there are zero global symbols without css_ or css__ in front of them. ↵Daniel Silverstone2011-01-201-3/+3
| | | | | | This helps prevent confusion if someone else wants a function called parse_background or similar svn path=/trunk/libcss/; revision=11416
* Merge parser autogeneration and string handling refactor branch ↵Vincent Sanders2011-01-191-2/+2
| | | | | | r=jmb,kinnison,vince svn path=/trunk/libcss/; revision=11408
* Turns out, we know the size of the styles block up-front.John Mark Bell2011-01-051-3/+1
| | | | svn path=/trunk/libcss/; revision=11214
* Simultaneously select styles for base + pseudo elements.John Mark Bell2011-01-051-118/+195
| | | | svn path=/trunk/libcss/; revision=11211
* Complete the fix for pseudo element selection: inline styles and ↵John Mark Bell2011-01-021-6/+18
| | | | | | presentational hints must not be applied to pseudo elements. svn path=/trunk/libcss/; revision=11181
* When selecting for a node's pseudo elements, only match rules which apply to ↵Michael Drake2011-01-011-11/+24
| | | | | | the pseudo element, and not the raw node as well. svn path=/trunk/libcss/; revision=11177
* Remove ownerNode and ownerRule fields from stylesheet objects.John Mark Bell2010-06-271-3/+11
| | | | | | | | | | | These prevent stylesheets being used in multiple contexts simultaneously. Their values can be inferred from the context in which the stylesheet is used. Replace use of ownerRule to backtrack in style selection with a (fixed-size) stack of rules to process. This prevents crashes when a sheet that was previously imported somewhere is reused as a top-level sheet. svn path=/trunk/libcss/; revision=10581
* Really fix hint leaks. Hint data ownership is passed to libcss.John Mark Bell2010-04-291-0/+3
| | | | | | Ensure that hint is initialised before asking client to populate it (so as to guard against broken clients) svn path=/trunk/libcss/; revision=10520
* Fix libcss to use new libwapcaplet behaviour.Daniel Silverstone2010-03-271-51/+29
| | | | | | | TODO: update the tests to include a refcounting proof svn path=/trunk/libcss/; revision=10162
* Origin and media are not properties of the stylesheet. John Mark Bell2010-01-121-44/+74
| | | | | | | | | They are properties of the context in which the stylesheet is used. Therefore, for top-level sheets, this information must be provided at selection time. For child sheets, the origin is inherited from their parent and the applicable media types are specified on the linking mechanism. svn path=/trunk/libcss/; revision=9802
* Lose redundant assignments.John Mark Bell2009-11-221-3/+0
| | | | | | | | Drop some dead code. Avoid a potential NULL dereference. Add missing "break" in initial substate of block context parser svn path=/trunk/libcss/; revision=9678
* s/opcode/opcode_t/John Mark Bell2009-08-031-1/+1
| | | | svn path=/trunk/libcss/; revision=9020
* Change selector hash to segregate:John Mark Bell2009-07-291-35/+162
| | | | | | | | | | | | | 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
* Match details before considering combinators.John Mark Bell2009-07-221-14/+13
| | | | svn path=/trunk/libcss/; revision=8667
* Change mechanism for handling case sensitivity of element names. Now has ↵John Mark Bell2009-07-171-13/+2
| | | | | | | | another selection handler callback for this. Change selector hash to use an ASCII case-insensitive hash function. svn path=/trunk/libcss/; revision=8602
* It is necessary to consider the element name when matching selectors. John Mark Bell2009-07-171-6/+27
| | | | | | | Firstly, the chains being processed are from a hashtable, so aren't guaranteed to apply to the element being selected. Secondly, when processing combinators, we have a completely different node object to compare. svn path=/trunk/libcss/; revision=8593
* Ensure that we merge-sort the element and universal selector chains during ↵John Mark Bell2009-07-171-44/+51
| | | | | | selection. svn path=/trunk/libcss/; revision=8592
* Fix matching of named ancestor combinators.John Mark Bell2009-07-171-34/+166
| | | | | | Add some helpful debug -- disabled by default. svn path=/trunk/libcss/; revision=8591
* Fix selection from selectors within @media blocks.John Mark Bell2009-07-151-8/+14
| | | | svn path=/trunk/libcss/; revision=8549
* Fix processing of rules after @import -- previously, they were completely ↵John Mark Bell2009-07-081-1/+1
| | | | | | ignored. svn path=/trunk/libcss/; revision=8386
* Compute absolute values for all length properties.John Mark Bell2009-07-041-1/+1
| | | | | | | Make initial border-*-color match the computed color. Compute correct value of display/float wrt position. svn path=/trunk/libcss/; revision=8317