summaryrefslogtreecommitdiff
path: root/src/select/select.c
Commit message (Collapse)AuthorAgeFilesLines
* Computed styles: Remove last traces of extension blocks.Michael Drake2019-05-121-23/+0
|
* Computed styles: Drop uncommon extension blocks.Michael Drake2019-05-121-4/+0
| | | | | | | | | | | | | | They were a space saving feature, but they became largely redundant with computed style sharing. They also made the code complex and buggy in many places. E.g. the cascade, inheritance / composition, and intial values all needed to behave corretly when they, or their parent, had or didn't have an uncommon block. Also, only the uncommon block was really used. Fixes: https://bugs.netsurf-browser.org/mantis/view.php?id=2641
* Media queries: Update selection API to support media queries.Michael Drake2019-05-041-16/+38
| | | | | | | | | | | | | | | | | | | | | 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>
* Media Queries: Update stylesheet import for media query lists.Michael Drake2019-03-101-2/+4
|
* Selection: Unify rule good for media helper.Michael Drake2018-07-271-24/+2
|
* Strip trailing whitespace.Michael Drake2017-09-041-169/+169
|
* Fix: Read beyond allocated memory when removing sheet from selection context.Michael Drake2017-06-271-2/+2
| | | | Thanks to 'effin' on #netsurf.
* Select: Squash error-path leak.Michael Drake2017-02-031-1/+0
| | | | | If we allocated a font-face array previously, and failed to extend it, then we failed to free it on the error path.
* Selection: Inline styles prevent computed style sharing.Michael Drake2016-11-291-4/+18
|
* Selection: Try all previous sibling nodes for sharable styles.Michael Drake2016-11-201-7/+8
| | | | Previously we would only consider the first candidate.
* Selection: Turn off style sharing debug output.Michael Drake2016-11-191-1/+0
|
* Enable sharing where pseudo common pseudo classes are the same.Michael Drake2016-11-191-1/+58
|
* Selection: Abstract common node flags setting code into helper.Michael Drake2016-11-191-44/+22
|
* Debug for recording which nodes fail to share style and why.Michael Drake2016-11-191-0/+50
|
* Documentation: Function param comment fix.Michael Drake2016-11-191-1/+0
|
* Optimisation: Bypass selection by sharing previous sibling's style.Michael Drake2016-11-191-15/+303
|
* Selection: Split out selection state {initi|fin}alisation.Michael Drake2016-11-191-95/+149
|
* Make node data contain list of partial node styles.Michael Drake2016-11-191-2/+24
|
* Separate node data creation and node bloom creation.Michael Drake2016-11-191-18/+37
|
* Allow more than just bloom to be stored on nodes.Michael Drake2016-11-191-44/+85
| | | | | We now have a css_node_data struct which is sored on nodes. It currently contians just the bloom filter.
* Split bloom filter get/set out into helpers.Michael Drake2016-11-191-93/+148
|
* Remove redundant API surface.Michael Drake2016-11-191-5/+5
|
* Intern partial styles.Michael Drake2016-11-191-0/+91
| | | | | Note this changes the public API. We can't compose directly over child style now, since it may be interned.
* Move trivially compared parts of computed styles to sub-structures.Michael Drake2016-11-191-2/+2
|
* Access lwc caseless hash through supported API.Michael Drake2016-10-151-26/+18
|
* Fix up error path.Michael Drake2016-02-081-1/+1
|
* Change how presentational hints are handled.Michael Drake2016-02-021-33/+36
| | | | | | | | | | | | | | | Previously, we performed normal selection from CSS sources, and then iterated over all the properties in the populated computed style. If the properties were unset or their values were not from either a UA stylesheet or user stylesheet with !important set, then we asked the client program (e.g. NetSurf) if there were any presentational hints for that node, for each such property. In the worst case this triggered N_PROPERTIES * N_NODES calls back to the client program, even for properties that can't be set via HTML attributes. The new API asks the client to supply a list of all the presentational hints that apply to the given node. For most nodes on modern documents, this is 0. Any presentational hints are applied before selection from CSS sources.
* Slight simplification of set_initial group checks.Michael Drake2015-08-191-19/+18
|
* Use calloc instead of malloc/memset.Michael Drake2015-01-241-3/+1
|
* 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