Gitweb links:
...log
http://git.netsurf-browser.org/libcss.git/shortlog/f420dd16136de1dc07f18824c6d0f5540d5df6d1
...commit
http://git.netsurf-browser.org/libcss.git/commit/f420dd16136de1dc07f18824c6d0f5540d5df6d1
...tree
http://git.netsurf-browser.org/libcss.git/tree/f420dd16136de1dc07f18824c6d0f5540d5df6d1
The branch, master has been updated
via f420dd16136de1dc07f18824c6d0f5540d5df6d1 (commit)
via b88595eb72302cf40e13b78e2d2917c7e98b66c4 (commit)
via d27f9ac52cd51d84df24074fa3d2f3fe57bb987c (commit)
via 0e764d0ddaaebdcea4a9a33657d1bc758387cf4a (commit)
via ed913230ad4f3bd57996111541a5f69ccac6d01f (commit)
from 46f33e50b75cb9636a285a702b1dd647e21ba6e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libcss.git/commit/?id=f420dd16136de1dc07f18824c6d0f5540d5df6d1
commit f420dd16136de1dc07f18824c6d0f5540d5df6d1
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Select: Hash: Fix bloom instrumentation for size != 4.
diff --git a/src/select/hash.c b/src/select/hash.c
index 16aebf7..0d85d6f 100644
--- a/src/select/hash.c
+++ b/src/select/hash.c
@@ -761,7 +761,7 @@ static void print_chain_bloom_details(css_bloom
bloom[CSS_BLOOM_SIZE])
{
printf("Chain bloom:\t");
int total = 0, i;
- int set[4];
+ int set[CSS_BLOOM_SIZE];
for (i = 0; i < CSS_BLOOM_SIZE; i++) {
set[i] = bits_set(bloom[i]);
total += set[i];
commitdiff
http://git.netsurf-browser.org/libcss.git/commit/?id=b88595eb72302cf40e13b78e2d2917c7e98b66c4
commit b88595eb72302cf40e13b78e2d2917c7e98b66c4
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Bloom: Init: Switch to memset.
GCC is a bit better at optimising a memset.
For clang it makes no difference.
diff --git a/src/select/bloom.h b/src/select/bloom.h
index 90328cc..dda4cca 100644
--- a/src/select/bloom.h
+++ b/src/select/bloom.h
@@ -32,6 +32,7 @@
#define libcss_bloom_h_
#include <stdint.h>
+#include <string.h>
/* Size of bloom filter as multiple of 32 bits.
* Has to be 4, 8, or 16.
@@ -179,27 +180,7 @@ static inline void css_bloom_merge(
*/
static inline void css_bloom_init(css_bloom bloom[CSS_BLOOM_SIZE])
{
- bloom[0] = 0;
- bloom[1] = 0;
- bloom[2] = 0;
- bloom[3] = 0;
-#if (CSS_BLOOM_SIZE > 4)
- bloom[4] = 0;
- bloom[5] = 0;
- bloom[6] = 0;
- bloom[7] = 0;
-#endif
-#if (CSS_BLOOM_SIZE > 8)
- bloom[8] = 0;
- bloom[9] = 0;
- bloom[10] = 0;
- bloom[11] = 0;
- bloom[12] = 0;
- bloom[13] = 0;
- bloom[14] = 0;
- bloom[15] = 0;
-#endif
+ memset(bloom, 0, sizeof(*bloom) * CSS_BLOOM_SIZE);
}
#endif
-
commitdiff
http://git.netsurf-browser.org/libcss.git/commit/?id=d27f9ac52cd51d84df24074fa3d2f3fe57bb987c
commit d27f9ac52cd51d84df24074fa3d2f3fe57bb987c
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Bloom: Style: Align function parameters.
diff --git a/src/select/bloom.h b/src/select/bloom.h
index d6597f1..90328cc 100644
--- a/src/select/bloom.h
+++ b/src/select/bloom.h
@@ -95,7 +95,8 @@ static inline bool css_bloom_has_hash(const css_bloom
bloom[CSS_BLOOM_SIZE],
* \param b superset bloom
* \return true iff 'a' is subset of 'b'
*/
-static inline bool css_bloom_in_bloom(const css_bloom a[CSS_BLOOM_SIZE],
+static inline bool css_bloom_in_bloom(
+ const css_bloom a[CSS_BLOOM_SIZE],
const css_bloom b[CSS_BLOOM_SIZE])
{
if ((a[0] & b[0]) != a[0])
@@ -146,7 +147,7 @@ static inline bool css_bloom_in_bloom(const css_bloom
a[CSS_BLOOM_SIZE],
*/
static inline void css_bloom_merge(
const css_bloom a[restrict CSS_BLOOM_SIZE],
- css_bloom b[restrict CSS_BLOOM_SIZE])
+ css_bloom b[restrict CSS_BLOOM_SIZE])
{
b[0] |= a[0];
b[1] |= a[1];
commitdiff
http://git.netsurf-browser.org/libcss.git/commit/?id=0e764d0ddaaebdcea4a9a33657d1bc758387cf4a
commit 0e764d0ddaaebdcea4a9a33657d1bc758387cf4a
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Bloom: Docs: Sync comments with reality.
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
commitdiff
http://git.netsurf-browser.org/libcss.git/commit/?id=ed913230ad4f3bd57996111541a5f69ccac6d01f
commit ed913230ad4f3bd57996111541a5f69ccac6d01f
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Bloom: Docs: Fix comment typo.
diff --git a/src/select/bloom.h b/src/select/bloom.h
index db7332d..31e2f88 100644
--- a/src/select/bloom.h
+++ b/src/select/bloom.h
@@ -16,7 +16,7 @@
* Generate the bloom filter by adding calling css_bloom_add_hash() on each
* ancestor element name, class name and id name for the node.
*
- * Use the insesnsitive hash value:
+ * Use the insensitive hash value:
*
* lwc_err = lwc_string_caseless_hash_value(str, &hash);
*/
-----------------------------------------------------------------------
Summary of changes:
src/select/bloom.h | 45 +++++++++++++++++----------------------------
src/select/hash.c | 2 +-
2 files changed, 18 insertions(+), 29 deletions(-)
diff --git a/src/select/bloom.h b/src/select/bloom.h
index db7332d..dda4cca 100644
--- a/src/select/bloom.h
+++ b/src/select/bloom.h
@@ -9,22 +9,30 @@
* 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.
*
- * Use the insesnsitive hash value:
+ * 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_
#define libcss_bloom_h_
#include <stdint.h>
+#include <string.h>
/* Size of bloom filter as multiple of 32 bits.
* Has to be 4, 8, or 16.
@@ -88,7 +96,8 @@ static inline bool css_bloom_has_hash(const css_bloom
bloom[CSS_BLOOM_SIZE],
* \param b superset bloom
* \return true iff 'a' is subset of 'b'
*/
-static inline bool css_bloom_in_bloom(const css_bloom a[CSS_BLOOM_SIZE],
+static inline bool css_bloom_in_bloom(
+ const css_bloom a[CSS_BLOOM_SIZE],
const css_bloom b[CSS_BLOOM_SIZE])
{
if ((a[0] & b[0]) != a[0])
@@ -132,14 +141,14 @@ 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
*/
static inline void css_bloom_merge(
const css_bloom a[restrict CSS_BLOOM_SIZE],
- css_bloom b[restrict CSS_BLOOM_SIZE])
+ css_bloom b[restrict CSS_BLOOM_SIZE])
{
b[0] |= a[0];
b[1] |= a[1];
@@ -171,27 +180,7 @@ static inline void css_bloom_merge(
*/
static inline void css_bloom_init(css_bloom bloom[CSS_BLOOM_SIZE])
{
- bloom[0] = 0;
- bloom[1] = 0;
- bloom[2] = 0;
- bloom[3] = 0;
-#if (CSS_BLOOM_SIZE > 4)
- bloom[4] = 0;
- bloom[5] = 0;
- bloom[6] = 0;
- bloom[7] = 0;
-#endif
-#if (CSS_BLOOM_SIZE > 8)
- bloom[8] = 0;
- bloom[9] = 0;
- bloom[10] = 0;
- bloom[11] = 0;
- bloom[12] = 0;
- bloom[13] = 0;
- bloom[14] = 0;
- bloom[15] = 0;
-#endif
+ memset(bloom, 0, sizeof(*bloom) * CSS_BLOOM_SIZE);
}
#endif
-
diff --git a/src/select/hash.c b/src/select/hash.c
index 16aebf7..0d85d6f 100644
--- a/src/select/hash.c
+++ b/src/select/hash.c
@@ -761,7 +761,7 @@ static void print_chain_bloom_details(css_bloom
bloom[CSS_BLOOM_SIZE])
{
printf("Chain bloom:\t");
int total = 0, i;
- int set[4];
+ int set[CSS_BLOOM_SIZE];
for (i = 0; i < CSS_BLOOM_SIZE; i++) {
set[i] = bits_set(bloom[i]);
total += set[i];
--
Cascading Style Sheets library
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]