diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-16 10:58:17 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-16 11:00:31 +0000 |
commit | 0e764d0ddaaebdcea4a9a33657d1bc758387cf4a (patch) | |
tree | 3158fd08e1bc29594dd55a78462132f2f91f7be1 | |
parent | ed913230ad4f3bd57996111541a5f69ccac6d01f (diff) | |
download | libcss-0e764d0ddaaebdcea4a9a33657d1bc758387cf4a.tar.gz libcss-0e764d0ddaaebdcea4a9a33657d1bc758387cf4a.tar.bz2 |
Bloom: Docs: Sync comments with reality.
-rw-r--r-- | src/select/bloom.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/select/bloom.h b/src/select/bloom.h index 31e2f88..d6597f1 100644 --- a/src/select/bloom.h +++ b/src/select/bloom.h @@ -9,9 +9,13 @@ * Bloom filter for CSS style selection optimisation. * * Attempting to match CSS rules by querying the client about DOM nodes via - * the selection callbacks is slow. To avoid this, clients may pass a node - * bloom filter to css_get_style. This bloom filter has bits set according - * to the node's ancestor element names, class names and id names. + * the selection callbacks is slow. To avoid the slow matching of CSS rule + * selector chains, we build up two bloom filters. One describing the rule + * selector chain, and one describing the node we are selecting for in + * css_get_style. + * + * These bloom filters have bits set according to the node's ancestor element + * names, class names and id names. * * Generate the bloom filter by adding calling css_bloom_add_hash() on each * ancestor element name, class name and id name for the node. @@ -19,6 +23,9 @@ * Use the insensitive hash value: * * lwc_err = lwc_string_caseless_hash_value(str, &hash); + * + * We avoid matching most selector chains by checking whether the rule bloom + * is a subset of the node bloom. */ #ifndef libcss_bloom_h_ @@ -132,7 +139,7 @@ static inline bool css_bloom_in_bloom(const css_bloom a[CSS_BLOOM_SIZE], /** - * Merge bloom 'a' into bloom 'b'. + * Merge bloom \ref a into bloom \ref b. * * \param a bloom to insert * \param b target bloom |