libcss: branch master updated. release/0.9.1-17-g0504194
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/0504194e51a35a88ceba06...
...commit http://git.netsurf-browser.org/libcss.git/commit/0504194e51a35a88ceba0628...
...tree http://git.netsurf-browser.org/libcss.git/tree/0504194e51a35a88ceba06288a...
The branch, master has been updated
via 0504194e51a35a88ceba06288a6a2d8243b27516 (commit)
from dbccd7cceb79d0fabebe5e183d85f750c058cd7e (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=0504194e51a35a88ceba...
commit 0504194e51a35a88ceba06288a6a2d8243b27516
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
add css 3.1 complex predefined counter styles for addative systems
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index a5569d0..ae00551 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -638,7 +638,12 @@ enum css_list_style_type_e {
CSS_LIST_STYLE_TYPE_HIAGANA = 0x2c,
CSS_LIST_STYLE_TYPE_HIAGANA_IROHA = 0x2d,
CSS_LIST_STYLE_TYPE_KATAKANA = 0x2e,
- CSS_LIST_STYLE_TYPE_KATAKANA_IROHA = 0x2f
+ CSS_LIST_STYLE_TYPE_KATAKANA_IROHA = 0x2f,
+ CSS_LIST_STYLE_TYPE_JAPANESE_INFORMAL = 0x30,
+ CSS_LIST_STYLE_TYPE_JAPANESE_FORMAL = 0x31,
+ CSS_LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL = 0x32,
+ CSS_LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL = 0x33,
+ CSS_LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL = 0x34
};
enum css_margin_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 1e561e5..01ea25a 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -523,7 +523,12 @@ enum op_list_style_type {
LIST_STYLE_TYPE_HIAGANA = 0x002b,
LIST_STYLE_TYPE_HIAGANA_IROHA = 0x002c,
LIST_STYLE_TYPE_KATAKANA = 0x002d,
- LIST_STYLE_TYPE_KATAKANA_IROHA = 0x002e
+ LIST_STYLE_TYPE_KATAKANA_IROHA = 0x002e,
+ LIST_STYLE_TYPE_JAPANESE_INFORMAL = 0x002f,
+ LIST_STYLE_TYPE_JAPANESE_FORMAL = 0x0030,
+ LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL = 0x0031,
+ LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL = 0x0032,
+ LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL = 0x0033
};
enum op_margin {
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index c82c88f..707a22b 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -34,7 +34,7 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
* upper-latin, armenian, georgian, lower-alpha, upper-alpha,
* none)
*/
- #define MAP_ENTRIES 47
+ #define MAP_ENTRIES 52
bool match;
int midx;
const struct {
@@ -87,7 +87,12 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
{ HIAGANA, LIST_STYLE_TYPE_HIAGANA },
{ HIAGANA_IROHA, LIST_STYLE_TYPE_HIAGANA_IROHA },
{ KATAKANA, LIST_STYLE_TYPE_KATAKANA },
- { KATAKANA_IROHA, LIST_STYLE_TYPE_KATAKANA_IROHA }
+ { KATAKANA_IROHA, LIST_STYLE_TYPE_KATAKANA_IROHA },
+ { JAPANESE_INFORMAL, LIST_STYLE_TYPE_JAPANESE_INFORMAL },
+ { JAPANESE_FORMAL, LIST_STYLE_TYPE_JAPANESE_FORMAL },
+ { KOREAN_HANGUL_FORMAL, LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL },
+ { KOREAN_HANJA_INFORMAL, LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL },
+ { KOREAN_HANJA_FORMAL, LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL }
};
for (midx = 0; midx < MAP_ENTRIES; midx++) {
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index a2d9175..7d723e1 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -345,6 +345,11 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
SMAP("hiragana-iroha"),
SMAP("katakana"),
SMAP("katakana-iroha"),
+ SMAP("japanese-informal"),
+ SMAP("japanese-formal"),
+ SMAP("korean-hangul-formal"),
+ SMAP("korean-hanja-informal"),
+ SMAP("korean-hanja-formal"),
SMAP("invert"),
SMAP("visible"),
SMAP("always"),
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index f011231..fd24a47 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -88,7 +88,8 @@ enum {
DEVANAGARI, GUJARATI, GURMUKHI, HEBREW, KANNADA, LAO, MALAYALAM,
MONGOLIAN, MYANMAR, ORIYA, PERSIAN, TAMIL, TELUGU, THAI, TIBETAN,
CJK_EARTHLY_BRANCH, CJK_HEAVENLY_STEM, HIAGANA, HIAGANA_IROHA,
- KATAKANA, KATAKANA_IROHA,
+ KATAKANA, KATAKANA_IROHA, JAPANESE_INFORMAL, JAPANESE_FORMAL,
+ KOREAN_HANGUL_FORMAL, KOREAN_HANJA_INFORMAL, KOREAN_HANJA_FORMAL,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
RELATIVE, ABSOLUTE, ONCE, DIGITS, CONTINUOUS, CODE, SPELL_OUT, X_SLOW,
SLOW, FAST, X_FAST, FASTER, SLOWER, CENTER, JUSTIFY, CAPITALIZE,
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 9cc5de7..0e3a39e 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -8,7 +8,7 @@
#include "select/propget.h"
#include "utils/utils.h"
-#define SYMBOL_SIZE 5
+#define SYMBOL_SIZE 8
typedef char symbol_t[SYMBOL_SIZE];
/**
@@ -330,6 +330,9 @@ calc_additive_system(int value,
/* iterate over the available weights */
for (widx = 0; widx < cstyle->items; widx++) {
+ if (cstyle->weights[widx] == 0) {
+ break;
+ }
times = value / cstyle->weights[widx];
if (times > 0) {
for (idx = 0;idx < times;idx++) {
@@ -975,6 +978,106 @@ static struct list_counter_style lcs_katakana_iroha = {
.suffix = "���",
};
+/**
+ * weights suitable for the five complex addative styles
+ */
+static const int complex_counter_weights[] = {
+ 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000,
+ 900, 800, 700, 600, 500, 400, 300, 200, 100,
+ 90, 80, 70, 60, 50, 40, 30, 20, 10,
+ 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+};
+static const symbol_t japanese_informal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���",
+};
+static const struct list_counter_style lcs_japanese_informal = {
+ .name = "japanese-informal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = japanese_informal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(japanese_informal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "������������" },
+ .suffix = "\xE3\x80\x81",
+};
+
+static const symbol_t japanese_formal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���",
+};
+static const struct list_counter_style lcs_japanese_formal = {
+ .name = "japanese-formal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = japanese_formal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(japanese_formal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "������������" },
+ .suffix = "\xE3\x80\x81",
+};
+
+static const symbol_t korean_hangul_formal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_korean_hangul_formal = {
+ .name = "korean-hangul-formal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = korean_hangul_formal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(korean_hangul_formal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "\xEB\xA7\x88\xEC\x9D\xB4\xEB\x84\x88\xEC\x8A\xA4 " },
+ .suffix = ", ",
+};
+
+static const symbol_t korean_hanja_informal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_korean_hanja_informal = {
+ .name = "korean-hanja-informal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = korean_hanja_informal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(korean_hanja_informal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "\xEB\xA7\x88\xEC\x9D\xB4\xEB\x84\x88\xEC\x8A\xA4 " },
+ .suffix = ", ",
+};
+
+static const symbol_t korean_hanja_formal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_korean_hanja_formal = {
+ .name = "korean-hanja-formal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = korean_hanja_formal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(korean_hanja_formal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "\xEB\xA7\x88\xEC\x9D\xB4\xEB\x84\x88\xEC\x8A\xA4 " },
+ .suffix = ", ",
+};
+
+
static const struct list_counter_style *
counter_style_from_computed_style(const css_computed_style *style)
@@ -1070,6 +1173,16 @@ counter_style_from_computed_style(const css_computed_style *style)
return &lcs_katakana;
case CSS_LIST_STYLE_TYPE_KATAKANA_IROHA:
return &lcs_katakana_iroha;
+ case CSS_LIST_STYLE_TYPE_JAPANESE_INFORMAL:
+ return &lcs_japanese_informal;
+ case CSS_LIST_STYLE_TYPE_JAPANESE_FORMAL:
+ return &lcs_japanese_formal;
+ case CSS_LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL:
+ return &lcs_korean_hangul_formal;
+ case CSS_LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL:
+ return &lcs_korean_hanja_informal;
+ case CSS_LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL:
+ return &lcs_korean_hanja_formal;
}
return NULL;
}
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index 7560c3b..e32d1b1 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -164,6 +164,21 @@ css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
case LIST_STYLE_TYPE_KATAKANA_IROHA:
value = CSS_LIST_STYLE_TYPE_KATAKANA_IROHA;
break;
+ case LIST_STYLE_TYPE_JAPANESE_INFORMAL:
+ value = CSS_LIST_STYLE_TYPE_JAPANESE_INFORMAL;
+ break;
+ case LIST_STYLE_TYPE_JAPANESE_FORMAL:
+ value = CSS_LIST_STYLE_TYPE_JAPANESE_FORMAL;
+ break;
+ case LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL:
+ value = CSS_LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL;
+ break;
+ case LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL:
+ value = CSS_LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL;
+ break;
+ case LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL:
+ value = CSS_LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL;
+ break;
}
}
-----------------------------------------------------------------------
Summary of changes:
include/libcss/properties.h | 7 +-
src/bytecode/opcodes.h | 7 +-
src/parse/properties/utils.c | 9 ++-
src/parse/propstrings.c | 5 ++
src/parse/propstrings.h | 3 +-
src/select/format_list_style.c | 115 ++++++++++++++++++++++++++++++-
src/select/properties/list_style_type.c | 15 ++++
7 files changed, 155 insertions(+), 6 deletions(-)
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index a5569d0..ae00551 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -638,7 +638,12 @@ enum css_list_style_type_e {
CSS_LIST_STYLE_TYPE_HIAGANA = 0x2c,
CSS_LIST_STYLE_TYPE_HIAGANA_IROHA = 0x2d,
CSS_LIST_STYLE_TYPE_KATAKANA = 0x2e,
- CSS_LIST_STYLE_TYPE_KATAKANA_IROHA = 0x2f
+ CSS_LIST_STYLE_TYPE_KATAKANA_IROHA = 0x2f,
+ CSS_LIST_STYLE_TYPE_JAPANESE_INFORMAL = 0x30,
+ CSS_LIST_STYLE_TYPE_JAPANESE_FORMAL = 0x31,
+ CSS_LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL = 0x32,
+ CSS_LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL = 0x33,
+ CSS_LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL = 0x34
};
enum css_margin_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 1e561e5..01ea25a 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -523,7 +523,12 @@ enum op_list_style_type {
LIST_STYLE_TYPE_HIAGANA = 0x002b,
LIST_STYLE_TYPE_HIAGANA_IROHA = 0x002c,
LIST_STYLE_TYPE_KATAKANA = 0x002d,
- LIST_STYLE_TYPE_KATAKANA_IROHA = 0x002e
+ LIST_STYLE_TYPE_KATAKANA_IROHA = 0x002e,
+ LIST_STYLE_TYPE_JAPANESE_INFORMAL = 0x002f,
+ LIST_STYLE_TYPE_JAPANESE_FORMAL = 0x0030,
+ LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL = 0x0031,
+ LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL = 0x0032,
+ LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL = 0x0033
};
enum op_margin {
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index c82c88f..707a22b 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -34,7 +34,7 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
* upper-latin, armenian, georgian, lower-alpha, upper-alpha,
* none)
*/
- #define MAP_ENTRIES 47
+ #define MAP_ENTRIES 52
bool match;
int midx;
const struct {
@@ -87,7 +87,12 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
{ HIAGANA, LIST_STYLE_TYPE_HIAGANA },
{ HIAGANA_IROHA, LIST_STYLE_TYPE_HIAGANA_IROHA },
{ KATAKANA, LIST_STYLE_TYPE_KATAKANA },
- { KATAKANA_IROHA, LIST_STYLE_TYPE_KATAKANA_IROHA }
+ { KATAKANA_IROHA, LIST_STYLE_TYPE_KATAKANA_IROHA },
+ { JAPANESE_INFORMAL, LIST_STYLE_TYPE_JAPANESE_INFORMAL },
+ { JAPANESE_FORMAL, LIST_STYLE_TYPE_JAPANESE_FORMAL },
+ { KOREAN_HANGUL_FORMAL, LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL },
+ { KOREAN_HANJA_INFORMAL, LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL },
+ { KOREAN_HANJA_FORMAL, LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL }
};
for (midx = 0; midx < MAP_ENTRIES; midx++) {
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index a2d9175..7d723e1 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -345,6 +345,11 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
SMAP("hiragana-iroha"),
SMAP("katakana"),
SMAP("katakana-iroha"),
+ SMAP("japanese-informal"),
+ SMAP("japanese-formal"),
+ SMAP("korean-hangul-formal"),
+ SMAP("korean-hanja-informal"),
+ SMAP("korean-hanja-formal"),
SMAP("invert"),
SMAP("visible"),
SMAP("always"),
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index f011231..fd24a47 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -88,7 +88,8 @@ enum {
DEVANAGARI, GUJARATI, GURMUKHI, HEBREW, KANNADA, LAO, MALAYALAM,
MONGOLIAN, MYANMAR, ORIYA, PERSIAN, TAMIL, TELUGU, THAI, TIBETAN,
CJK_EARTHLY_BRANCH, CJK_HEAVENLY_STEM, HIAGANA, HIAGANA_IROHA,
- KATAKANA, KATAKANA_IROHA,
+ KATAKANA, KATAKANA_IROHA, JAPANESE_INFORMAL, JAPANESE_FORMAL,
+ KOREAN_HANGUL_FORMAL, KOREAN_HANJA_INFORMAL, KOREAN_HANJA_FORMAL,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
RELATIVE, ABSOLUTE, ONCE, DIGITS, CONTINUOUS, CODE, SPELL_OUT, X_SLOW,
SLOW, FAST, X_FAST, FASTER, SLOWER, CENTER, JUSTIFY, CAPITALIZE,
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 9cc5de7..0e3a39e 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -8,7 +8,7 @@
#include "select/propget.h"
#include "utils/utils.h"
-#define SYMBOL_SIZE 5
+#define SYMBOL_SIZE 8
typedef char symbol_t[SYMBOL_SIZE];
/**
@@ -330,6 +330,9 @@ calc_additive_system(int value,
/* iterate over the available weights */
for (widx = 0; widx < cstyle->items; widx++) {
+ if (cstyle->weights[widx] == 0) {
+ break;
+ }
times = value / cstyle->weights[widx];
if (times > 0) {
for (idx = 0;idx < times;idx++) {
@@ -975,6 +978,106 @@ static struct list_counter_style lcs_katakana_iroha = {
.suffix = "���",
};
+/**
+ * weights suitable for the five complex addative styles
+ */
+static const int complex_counter_weights[] = {
+ 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000,
+ 900, 800, 700, 600, 500, 400, 300, 200, 100,
+ 90, 80, 70, 60, 50, 40, 30, 20, 10,
+ 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+};
+static const symbol_t japanese_informal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���",
+};
+static const struct list_counter_style lcs_japanese_informal = {
+ .name = "japanese-informal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = japanese_informal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(japanese_informal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "������������" },
+ .suffix = "\xE3\x80\x81",
+};
+
+static const symbol_t japanese_formal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���",
+};
+static const struct list_counter_style lcs_japanese_formal = {
+ .name = "japanese-formal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = japanese_formal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(japanese_formal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "������������" },
+ .suffix = "\xE3\x80\x81",
+};
+
+static const symbol_t korean_hangul_formal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_korean_hangul_formal = {
+ .name = "korean-hangul-formal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = korean_hangul_formal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(korean_hangul_formal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "\xEB\xA7\x88\xEC\x9D\xB4\xEB\x84\x88\xEC\x8A\xA4 " },
+ .suffix = ", ",
+};
+
+static const symbol_t korean_hanja_informal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "������", "������", "������", "������", "������", "������", "������", "������", "���",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_korean_hanja_informal = {
+ .name = "korean-hanja-informal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = korean_hanja_informal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(korean_hanja_informal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "\xEB\xA7\x88\xEC\x9D\xB4\xEB\x84\x88\xEC\x8A\xA4 " },
+ .suffix = ", ",
+};
+
+static const symbol_t korean_hanja_formal_symbols[] = {
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "������", "������", "������", "������", "������", "������", "������", "������", "������",
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_korean_hanja_formal = {
+ .name = "korean-hanja-formal",
+ .system = calc_additive_system,
+ .fallback = &lcs_cjk_decimal,
+ .symbols = korean_hanja_formal_symbols,
+ .weights = complex_counter_weights,
+ .items = (sizeof(korean_hanja_formal_symbols) / SYMBOL_SIZE),
+ .range = { .start = -9999, .end = 9999 },
+ .negative = { .pre = "\xEB\xA7\x88\xEC\x9D\xB4\xEB\x84\x88\xEC\x8A\xA4 " },
+ .suffix = ", ",
+};
+
+
static const struct list_counter_style *
counter_style_from_computed_style(const css_computed_style *style)
@@ -1070,6 +1173,16 @@ counter_style_from_computed_style(const css_computed_style *style)
return &lcs_katakana;
case CSS_LIST_STYLE_TYPE_KATAKANA_IROHA:
return &lcs_katakana_iroha;
+ case CSS_LIST_STYLE_TYPE_JAPANESE_INFORMAL:
+ return &lcs_japanese_informal;
+ case CSS_LIST_STYLE_TYPE_JAPANESE_FORMAL:
+ return &lcs_japanese_formal;
+ case CSS_LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL:
+ return &lcs_korean_hangul_formal;
+ case CSS_LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL:
+ return &lcs_korean_hanja_informal;
+ case CSS_LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL:
+ return &lcs_korean_hanja_formal;
}
return NULL;
}
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index 7560c3b..e32d1b1 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -164,6 +164,21 @@ css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
case LIST_STYLE_TYPE_KATAKANA_IROHA:
value = CSS_LIST_STYLE_TYPE_KATAKANA_IROHA;
break;
+ case LIST_STYLE_TYPE_JAPANESE_INFORMAL:
+ value = CSS_LIST_STYLE_TYPE_JAPANESE_INFORMAL;
+ break;
+ case LIST_STYLE_TYPE_JAPANESE_FORMAL:
+ value = CSS_LIST_STYLE_TYPE_JAPANESE_FORMAL;
+ break;
+ case LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL:
+ value = CSS_LIST_STYLE_TYPE_KOREAN_HANGUL_FORMAL;
+ break;
+ case LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL:
+ value = CSS_LIST_STYLE_TYPE_KOREAN_HANJA_INFORMAL;
+ break;
+ case LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL:
+ value = CSS_LIST_STYLE_TYPE_KOREAN_HANJA_FORMAL;
+ break;
}
}
--
Cascading Style Sheets library
1 year, 11 months
netsurf: branch master updated. release/3.10-111-g9783296
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/9783296c4ffd83dfdb18e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/9783296c4ffd83dfdb18e1e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/9783296c4ffd83dfdb18e1e29...
The branch, master has been updated
via 9783296c4ffd83dfdb18e1e293ad635f214d2fd0 (commit)
via 32d9de461e4cb9c287dbafb0745ac64358a0b561 (commit)
via 496b1eca087490346a29c6c062c53a21e679ddd5 (commit)
via d29f6d6c1e8433f718b6de3d31626cd6f06c352f (commit)
via e18bb8fde15d860f198b9555ddac123273ea2e30 (commit)
via 4c941254c8cfd1cf0e6f005d39ed0cc8f8ff077c (commit)
via 64680a8edbebcfbcb5f2f2ddcce9a998aeef19f3 (commit)
via 41a0c21812ed1fb59bf75cbe26a8b8c5e19e71a0 (commit)
via 9434fe1ff08cb9e009efa9cd434177d91948d12e (commit)
via 839fb8570a4fb8a31a76605b4614e7384d60f039 (commit)
from dcec1d0cd58343f64d4dd0b7d52e2c5d6193dfe8 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box.h | 4 +
content/handlers/html/box_construct.c | 101 +-------
content/handlers/html/box_manipulate.c | 1 +
content/handlers/html/layout.c | 393 ++++++++++++++++++++++++++++++--
utils/corestringlist.h | 2 +
5 files changed, 390 insertions(+), 111 deletions(-)
diff --git a/content/handlers/html/box.h b/content/handlers/html/box.h
index d0df735..1059556 100644
--- a/content/handlers/html/box.h
+++ b/content/handlers/html/box.h
@@ -404,6 +404,10 @@ struct box {
*/
struct column *col;
+ /**
+ * List item value.
+ */
+ int list_value;
/**
* List marker box if this is a list-item, or NULL.
diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c
index a133578..7bfc35e 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -350,61 +350,6 @@ box_construct_generate(dom_node *n,
/**
- * compute the index for a list marker
- *
- * calculates a one based index of a list item
- */
-static unsigned int compute_list_marker_index(struct box *last)
-{
- /* Drill down into last child of parent
- * to find the list marker (if any)
- *
- * Floated list boxes end up as:
- *
- * parent
- * BOX_INLINE_CONTAINER
- * BOX_FLOAT_{LEFT,RIGHT}
- * BOX_BLOCK <-- list box
- * ...
- */
- while ((last != NULL) && (last->list_marker == NULL)) {
- struct box *last_inner = last;
-
- while (last_inner != NULL) {
- if (last_inner->list_marker != NULL) {
- break;
- }
- if (last_inner->type == BOX_INLINE_CONTAINER ||
- last_inner->type == BOX_FLOAT_LEFT ||
- last_inner->type == BOX_FLOAT_RIGHT) {
- last_inner = last_inner->last;
- } else {
- last_inner = NULL;
- }
- }
- if (last_inner != NULL) {
- last = last_inner;
- } else {
- last = last->prev;
- }
- }
-
- if ((last == NULL) || (last->list_marker == NULL)) {
- return 1;
- }
-
- return last->list_marker->rows + 1;
-}
-
-/**
- * initial length of a list marker buffer
- *
- * enough for 9,999,999,999,999,999,999 in decimal
- * or five characters for 4byte utf8
- */
-#define LIST_MARKER_SIZE 20
-
-/**
* Construct a list marker box
*
* \param box Box to attach marker to
@@ -422,8 +367,6 @@ box_construct_marker(struct box *box,
lwc_string *image_uri;
struct box *marker;
enum css_list_style_type_e list_style_type;
- size_t counter_len;
- css_error css_res;
marker = box_create(NULL, box->style, false, NULL, NULL, title,
NULL, ctx->bctx);
@@ -454,51 +397,13 @@ box_construct_marker(struct box *box,
marker->length = 3;
break;
+ default:
+ /* Numerical list counters get handled in layout. */
+ /* Fall through. */
case CSS_LIST_STYLE_TYPE_NONE:
marker->text = NULL;
marker->length = 0;
break;
-
- default:
- marker->rows = compute_list_marker_index(parent->last);
-
- marker->text = talloc_array(ctx->bctx, char, LIST_MARKER_SIZE);
- if (marker->text == NULL) {
- return false;
- }
-
- css_res = css_computed_format_list_style(box->style,
- marker->rows,
- marker->text,
- LIST_MARKER_SIZE,
- &counter_len);
- if (css_res == CSS_OK) {
- if (counter_len > LIST_MARKER_SIZE) {
- /*
- * use computed size as marker did not fit
- * in default allocation
- */
- marker->text = talloc_realloc(ctx->bctx,
- marker->text,
- char,
- counter_len);
- if (marker->text == NULL) {
- return false;
- }
- css_computed_format_list_style(box->style,
- marker->rows,
- marker->text,
- counter_len,
- &counter_len);
- }
- marker->length = counter_len;
- } else {
- /* failed to format marker so use none type */
- marker->text = NULL;
- marker->length = 0;
- }
- break;
-
}
if (css_computed_list_style_image(box->style, &image_uri) == CSS_LIST_STYLE_IMAGE_URI &&
diff --git a/content/handlers/html/box_manipulate.c b/content/handlers/html/box_manipulate.c
index d23091b..8073a7f 100644
--- a/content/handlers/html/box_manipulate.c
+++ b/content/handlers/html/box_manipulate.c
@@ -143,6 +143,7 @@ box_create(css_select_results *styles,
box->float_container = NULL;
box->next_float = NULL;
box->cached_place_below_level = 0;
+ box->list_value = 1;
box->list_marker = NULL;
box->col = NULL;
box->gadget = NULL;
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index ddf1d16..94cdf8f 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -47,6 +47,7 @@
#include "utils/talloc.h"
#include "utils/utils.h"
#include "utils/nsoption.h"
+#include "utils/corestrings.h"
#include "utils/nsurl.h"
#include "netsurf/inttypes.h"
#include "netsurf/content.h"
@@ -4412,34 +4413,399 @@ layout_block_context(struct box *block,
/**
+ * Check a node's tag type.
+ *
+ * Assumes node is an HTML element.
+ *
+ * \param[in] node Node to ckeck tag type of.
+ * \param[in] type Tag type to test for.
+ * \return true if if node has given type, false otherwise.
+ */
+static inline bool
+layout__check_element_type(
+ const dom_node *node,
+ dom_html_element_type type)
+{
+ dom_html_element_type node_type;
+ dom_exception exc;
+
+ exc = dom_html_element_get_tag_type(node, &node_type);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ return node_type == type;
+}
+
+
+/**
+ * Helper to get attribute value from a LI node.
+ *
+ * \param[in] li_node DOM node for the LI element;
+ * \param[out] value_out Returns the value on success.
+ * \return true if node has value, otherwise false.
+ */
+static bool
+layout__get_li_value(dom_node *li_node, dom_long *value_out)
+{
+ dom_exception exc;
+ dom_long value;
+ bool has_value;
+
+ /** \todo
+ * dom_html_li_element_get_value() is rubbish and we can't tell
+ * a lack of value attribute or invalid value from a perfectly
+ * valid '-1'.
+ *
+ * This helps for the common case of no value. However we should
+ * fix libdom to have some kind of sane interface to get numerical
+ * attributes.
+ */
+ exc = dom_element_has_attribute(li_node,
+ corestring_dom_value,
+ &has_value);
+ if (exc != DOM_NO_ERR || has_value == false) {
+ return false;
+ }
+
+ exc = dom_html_li_element_get_value(
+ (dom_html_li_element *)li_node,
+ &value);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ *value_out = value;
+ return true;
+}
+
+
+/**
+ * Helper to get start attribute value from a OL node.
+ *
+ * \param[in] ol_node DOM node for the OL element;
+ * \param[out] start_out Returns the value on success.
+ * \return true if node has value, otherwise false.
+ */
+static bool
+layout__get_ol_start(dom_node *ol_node, dom_long *start_out)
+{
+ dom_exception exc;
+ dom_long start;
+ bool has_start;
+
+ /** \todo
+ * see layout__get_li_value().
+ */
+ exc = dom_element_has_attribute(ol_node,
+ corestring_dom_start,
+ &has_start);
+ if (exc != DOM_NO_ERR || has_start == false) {
+ return false;
+ }
+
+ exc = dom_html_olist_element_get_start(
+ (dom_html_olist_element *)ol_node,
+ &start);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ *start_out = start;
+ return true;
+}
+
+
+/**
+ * Helper to get reversed attribute value from a OL node.
+ *
+ * \param[in] ol_node DOM node for the OL element;
+ * \return true if node has reversed, otherwise false.
+ */
+static bool
+layout__get_ol_reversed(dom_node *ol_node)
+{
+ dom_exception exc;
+ bool has_reversed;
+
+ exc = dom_element_has_attribute(ol_node,
+ corestring_dom_reversed,
+ &has_reversed);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ return has_reversed;
+}
+
+
+/**
+ * Get the number of list items for a list owner.
+ *
+ * \param[in] list_owner DOM node to count list items for.
+ * \param[in] count_out Returns list item count on success.
+ * \return true on success, otherwise false.
+ */
+static bool
+layout__get_list_item_count(
+ dom_node *list_owner, int *count_out)
+{
+ dom_html_element_type tag_type;
+ dom_exception exc;
+ dom_node *child;
+ int count;
+
+ if (list_owner == NULL) {
+ return false;
+ }
+
+ exc = dom_html_element_get_tag_type(list_owner, &tag_type);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ if (tag_type != DOM_HTML_ELEMENT_TYPE_OL &&
+ tag_type != DOM_HTML_ELEMENT_TYPE_UL) {
+ return false;
+ }
+
+ exc = dom_node_get_first_child(list_owner, &child);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ count = 0;
+ while (child != NULL) {
+ dom_node *temp_node;
+
+ if (layout__check_element_type(child,
+ DOM_HTML_ELEMENT_TYPE_LI)) {
+ struct box *child_box;
+ if (dom_node_get_user_data(child,
+ corestring_dom___ns_key_box_node_data,
+ &child_box) != DOM_NO_ERR) {
+ dom_node_unref(child);
+ return false;
+ }
+
+ if (child_box != NULL &&
+ child_box->list_marker != NULL) {
+ count++;
+ }
+ }
+
+ exc = dom_node_get_next_sibling(child, &temp_node);
+ dom_node_unref(child);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ child = temp_node;
+ }
+
+ *count_out = count;
+ return true;
+}
+
+
+/**
+ * Handle list item counting, if this is a list owner box.
+ *
+ * \param[in] box Box to do list item counting for.
+ */
+static void
+layout__ordered_list_count(
+ struct box *box)
+{
+ dom_html_element_type tag_type;
+ dom_exception exc;
+ dom_node *child;
+ int step = 1;
+ int next;
+
+ if (box->node == NULL) {
+ return;
+ }
+
+ exc = dom_html_element_get_tag_type(box->node, &tag_type);
+ if (exc != DOM_NO_ERR) {
+ return;
+ }
+
+ if (tag_type != DOM_HTML_ELEMENT_TYPE_OL &&
+ tag_type != DOM_HTML_ELEMENT_TYPE_UL) {
+ return;
+ }
+
+ next = 1;
+ if (tag_type == DOM_HTML_ELEMENT_TYPE_OL) {
+ bool have_start = layout__get_ol_start(box->node, &next);
+ bool have_reversed = layout__get_ol_reversed(box->node);
+
+ if (have_reversed) {
+ step = -1;
+ }
+
+ if (!have_start && have_reversed) {
+ layout__get_list_item_count(box->node, &next);
+ }
+ }
+
+ exc = dom_node_get_first_child(box->node, &child);
+ if (exc != DOM_NO_ERR) {
+ return;
+ }
+
+ while (child != NULL) {
+ dom_node *temp_node;
+
+ if (layout__check_element_type(child,
+ DOM_HTML_ELEMENT_TYPE_LI)) {
+ struct box *child_box;
+
+ if (dom_node_get_user_data(child,
+ corestring_dom___ns_key_box_node_data,
+ &child_box) != DOM_NO_ERR) {
+ dom_node_unref(child);
+ return;
+ }
+
+ if (child_box != NULL &&
+ child_box->list_marker != NULL) {
+ dom_long value;
+ struct box *marker = child_box->list_marker;
+ if (layout__get_li_value(child, &value)) {
+ marker->list_value = value;
+ next = marker->list_value;
+ } else {
+ marker->list_value = next;
+ }
+ next += step;
+ }
+ }
+
+ exc = dom_node_get_next_sibling(child, &temp_node);
+ dom_node_unref(child);
+ if (exc != DOM_NO_ERR) {
+ return;
+ }
+
+ child = temp_node;
+ }
+}
+
+/**
+ * Set up the marker text for a numerical list item.
+ *
+ * \param[in] content The HTML content.
+ * \param[in] box The list item's main box.
+ */
+static void
+layout__set_numerical_marker_text(
+ const html_content *content,
+ struct box *box)
+{
+ struct box *marker = box->list_marker;
+ size_t counter_len;
+ css_error css_res;
+ enum {
+ /**
+ * initial length of a list marker buffer
+ *
+ * enough for 9,999,999,999,999,999,999 in decimal
+ * or five characters for 4-byte UTF-8.
+ */
+ LIST_MARKER_SIZE = 20,
+ };
+
+ marker->text = talloc_array(content->bctx, char, LIST_MARKER_SIZE);
+ if (marker->text == NULL) {
+ return;
+ }
+
+ css_res = css_computed_format_list_style(box->style, marker->list_value,
+ marker->text, LIST_MARKER_SIZE, &counter_len);
+ if (css_res == CSS_OK) {
+ if (counter_len > LIST_MARKER_SIZE) {
+ /* Use computed size as marker did not fit in
+ * default allocation. */
+ marker->text = talloc_realloc(content->bctx,
+ marker->text,
+ char,
+ counter_len);
+ if (marker->text == NULL) {
+ return;
+ }
+ css_computed_format_list_style(box->style,
+ marker->list_value, marker->text,
+ counter_len, &counter_len);
+ }
+ marker->length = counter_len;
+ }
+}
+
+/**
+ * Find out if box's style represents a numerical list style type.
+ *
+ * \param[in] b Box with style to test.
+ * \return true if box has numerical list style type, false otherwise.
+ */
+static bool
+layout__list_item_is_numerical(
+ const struct box *b)
+{
+ enum css_list_style_type_e t = css_computed_list_style_type(b->style);
+
+ switch (t) {
+ case CSS_LIST_STYLE_TYPE_DISC: /* Fall through. */
+ case CSS_LIST_STYLE_TYPE_CIRCLE: /* Fall through. */
+ case CSS_LIST_STYLE_TYPE_SQUARE: /* Fall through. */
+ case CSS_LIST_STYLE_TYPE_NONE:
+ return false;
+
+ default:
+ return true;
+ }
+}
+
+/**
* Layout list markers.
*/
static void
-layout_lists(struct box *box,
- const struct gui_layout_table *font_func,
- const nscss_len_ctx *len_ctx)
+layout_lists(const html_content *content, struct box *box)
{
struct box *child;
- struct box *marker;
- plot_font_style_t fstyle;
+
+ layout__ordered_list_count(box);
for (child = box->children; child; child = child->next) {
if (child->list_marker) {
- marker = child->list_marker;
+ struct box *marker = child->list_marker;
+
+ if (layout__list_item_is_numerical(child)) {
+ if (marker->text == NULL) {
+ layout__set_numerical_marker_text(
+ content, child);
+ }
+ }
if (marker->object) {
marker->width =
content_get_width(marker->object);
marker->x = -marker->width;
marker->height =
content_get_height(marker->object);
- marker->y = (line_height(len_ctx,
+ marker->y = (line_height(
+ &content->len_ctx,
marker->style) -
marker->height) / 2;
} else if (marker->text) {
if (marker->width == UNKNOWN_WIDTH) {
- font_plot_style_from_css(len_ctx,
- marker->style, &fstyle);
- font_func->width(&fstyle,
+ plot_font_style_t fstyle;
+ font_plot_style_from_css(
+ &content->len_ctx,
+ marker->style,
+ &fstyle);
+ content->font_func->width(&fstyle,
marker->text,
marker->length,
&marker->width);
@@ -4447,7 +4813,8 @@ layout_lists(struct box *box,
}
marker->x = -marker->width;
marker->y = 0;
- marker->height = line_height(len_ctx,
+ marker->height = line_height(
+ &content->len_ctx,
marker->style);
} else {
marker->x = 0;
@@ -4458,7 +4825,7 @@ layout_lists(struct box *box,
/* Gap between marker and content */
marker->x -= 4;
}
- layout_lists(child, font_func, len_ctx);
+ layout_lists(content, child);
}
}
@@ -5436,7 +5803,7 @@ bool layout_document(html_content *content, int width, int height)
doc->children->margin[BOTTOM]);
}
- layout_lists(doc, font_func, &content->len_ctx);
+ layout_lists(content, doc);
layout_position_absolute(doc, doc, 0, 0, content);
layout_position_relative(&content->len_ctx, doc, doc, 0, 0);
diff --git a/utils/corestringlist.h b/utils/corestringlist.h
index d6be3c4..b253b3b 100644
--- a/utils/corestringlist.h
+++ b/utils/corestringlist.h
@@ -295,6 +295,7 @@ CORESTRING_DOM_STRING(rect);
CORESTRING_DOM_STRING(rel);
CORESTRING_DOM_STRING(reset);
CORESTRING_DOM_STRING(resize);
+CORESTRING_DOM_STRING(reversed);
CORESTRING_DOM_STRING(rows);
CORESTRING_DOM_STRING(rowspan);
CORESTRING_DOM_STRING(scroll);
@@ -309,6 +310,7 @@ CORESTRING_DOM_STRING(size);
CORESTRING_DOM_STRING(sizes);
CORESTRING_DOM_STRING(src);
CORESTRING_DOM_STRING(stalled);
+CORESTRING_DOM_STRING(start);
CORESTRING_DOM_STRING(storage);
CORESTRING_DOM_STRING(style);
CORESTRING_DOM_STRING(submit);
--
NetSurf Browser
1 year, 11 months
libcss: branch master updated. release/0.9.1-16-gdbccd7c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/dbccd7cceb79d0fabebe5e...
...commit http://git.netsurf-browser.org/libcss.git/commit/dbccd7cceb79d0fabebe5e18...
...tree http://git.netsurf-browser.org/libcss.git/tree/dbccd7cceb79d0fabebe5e183d...
The branch, master has been updated
via dbccd7cceb79d0fabebe5e183d85f750c058cd7e (commit)
from febbc5cb05e4ce82d3990418ee011c4b54090f27 (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=dbccd7cceb79d0fabebe...
commit dbccd7cceb79d0fabebe5e183d85f750c058cd7e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve list style fallback styling and range processing
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 46861a4..9cc5de7 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -11,37 +11,54 @@
#define SYMBOL_SIZE 5
typedef char symbol_t[SYMBOL_SIZE];
+/**
+ * numeric representation of the value using a system
+ */
+struct numeric {
+ uint8_t *val; /* buffer containing the numeric values */
+ size_t len; /* length of alen */
+ size_t used; /* number of numeric values used */
+ bool negative; /* if the value is negative */
+};
+
+/**
+ * list counter style
+ */
struct list_counter_style {
- const char *name; /**< style name for debug purposes */
+ /** style name for debug purposes */
+ const char *name;
+ /** function to calculate the system */
+ css_error (*system)(int value, const struct list_counter_style *cstyle, struct numeric *nval);
+ /** fallback style if this system fails */
+ const struct list_counter_style* fallback;
+ /** array of symbols which represent this style */
+ const symbol_t *symbols;
+ /** symbol weights for additive schemes */
+ const int *weights;
+ /** number of items in symbol and weight table */
+ const size_t items;
+ /** range of acceptable values */
struct {
const int start; /**< first acceptable value for this style */
const int end; /**< last acceptable value for this style */
} range;
+
+ /** padding formatting */
struct {
const unsigned int length;
const symbol_t value;
} pad;
+ /** negative value formating */
struct {
const char *pre;
const char *post;
} negative;
+ /** prefix formatting */
const char *prefix;
+ /** suffix formatting */
const char *suffix;
- const symbol_t *symbols; /**< array of symbols which represent this style */
- const int *weights; /**< symbol weights for additive schemes */
- const size_t items; /**< items in symbol and weight table */
- size_t (*calc)(uint8_t *ares, const size_t alen, int value, const struct list_counter_style *cstyle); /**< function to calculate the system */
};
-/**
- * numeric representation of the value using a system
- */
-struct numeric {
- uint8_t *val; /* buffer containing the numeric values */
- size_t len; /* length of alen */
- size_t used; /* number of numeric values used */
- bool negative; /* if the value is negative */
-};
/**
* Copy a null-terminated UTF-8 string to buffer at offset, if there is space
@@ -143,7 +160,7 @@ nval_to_symbols(struct numeric *nval,
}
/* map symbols */
- for (aidx=0; aidx < nval->used; aidx++) {
+ for (aidx = 0; aidx < nval->used; aidx++) {
oidx += copy_symbol(buf, buflen, oidx,
cstyle->symbols[nval->val[aidx]]);
}
@@ -174,41 +191,45 @@ nval_to_symbols(struct numeric *nval,
* \param cstyle The counter style in use
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_numeric_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_numeric_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
size_t idx = 0;
uint8_t *first;
uint8_t *last;
if (value == 0) {
- if (alen >= 1) {
- ares[0] = 0;
+ if (nval->len >= 1) {
+ nval->val[0] = 0;
}
- return 1;
+ nval->used = 1;
+ return CSS_OK;
}
- value = abs(value);
-
+ if (value < 0) {
+ nval->negative = true;
+ value = abs(value);
+ } else {
+ nval->negative = false;
+ }
/* generate alphabet values in ascending order */
while (value > 0) {
- if (idx < alen) {
- ares[idx] = value % cstyle->items;
+ if (idx < nval->len) {
+ nval->val[idx] = value % cstyle->items;
}
idx++;
value = value / cstyle->items;
}
/* put the values in decending order */
- first = ares;
- if (idx < alen) {
+ first = nval->val;
+ if (idx < nval->len) {
last = first + (idx - 1);
} else {
- last = first + (alen - 1);
+ last = first + (nval->len - 1);
}
while (first < last) {
*first ^= *last;
@@ -218,7 +239,9 @@ calc_numeric_system(uint8_t *ares,
last--;
}
- return idx;
+ nval->used = idx;
+
+ return CSS_OK;
}
@@ -233,22 +256,24 @@ calc_numeric_system(uint8_t *ares,
* \param cstyle The counter style in use
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_cyclic_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_cyclic_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
- if (alen == 0) {
- return 0;
+ if (nval->len == 0) {
+ return CSS_INVALID;
}
if (cstyle->items == 1) {
/* there is only one symbol so select it */
- ares[0] = 0;
+ nval->val[0] = 0;
} else {
- ares[0] = (value - 1) % cstyle->items;
+ nval->val[0] = (value - 1) % cstyle->items;
}
- return 1;
+ nval->used = 1;
+ nval->negative = false;
+
+ return CSS_OK;
}
@@ -263,34 +288,53 @@ calc_cyclic_system(uint8_t *ares,
* \param wlen The number of weights
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_additive_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_additive_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
size_t widx; /* weight index */
- size_t aidx = 0;
+ size_t aidx = 0; /* numerals used */
size_t idx;
size_t times; /* number of times a weight occours */
/* ensure value is within acceptable range of this system */
if ((value < cstyle->range.start) || (value > cstyle->range.end)) {
- return 0;
+ return CSS_INVALID;
}
- /* implementation cannot cope with negatives */
- if (value < 1) {
- return 0;
+ /* zero needs a specific weight */
+ if (value == 0) {
+ /* search weights for a zero entry */
+ for (widx = 0; widx < cstyle->items; widx++) {
+ if (cstyle->weights[widx] == 0) {
+ if (nval->len > 0) {
+ nval->val[0] = widx;
+ }
+
+ nval->used = 1;
+ nval->negative = false;
+ return CSS_OK;
+ }
+ }
+ return CSS_INVALID;
+ }
+
+ /* negative values */
+ if (value < 0) {
+ nval->negative = true;
+ value = abs(value);
+ } else {
+ nval->negative = false;
}
/* iterate over the available weights */
- for (widx = 0; widx < cstyle->items;widx++) {
+ for (widx = 0; widx < cstyle->items; widx++) {
times = value / cstyle->weights[widx];
if (times > 0) {
- for (idx=0;idx < times;idx++) {
- if (aidx < alen) {
- ares[aidx] = widx;
+ for (idx = 0;idx < times;idx++) {
+ if (aidx < nval->len) {
+ nval->val[aidx] = widx;
}
aidx++;
}
@@ -299,7 +343,9 @@ calc_additive_system(uint8_t *ares,
}
}
- return aidx;
+ nval->used = aidx;
+
+ return CSS_OK;
}
@@ -314,32 +360,35 @@ calc_additive_system(uint8_t *ares,
* \param slen The number of symbols in the alphabet
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_alphabet_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_alphabet_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
size_t idx = 0;
uint8_t *first;
uint8_t *last;
+ if (value < 1) {
+ return CSS_INVALID;
+ }
+
/* generate alphabet values in ascending order */
while (value > 0) {
--value;
- if (idx < alen) {
- ares[idx] = value % cstyle->items;
+ if (idx < nval->len) {
+ nval->val[idx] = value % cstyle->items;
}
idx++;
value = value / cstyle->items;
}
/* put the values in decending order */
- first = ares;
- if (idx < alen) {
+ first = nval->val;
+ if (idx < nval->len) {
last = first + (idx - 1);
} else {
- last = first + (alen - 1);
+ last = first + (nval->len - 1);
}
while (first < last) {
*first ^= *last;
@@ -349,7 +398,10 @@ calc_alphabet_system(uint8_t *ares,
last--;
}
- return idx;
+ nval->used = idx;
+ nval->negative = false;
+
+ return CSS_OK;
}
@@ -358,11 +410,10 @@ calc_alphabet_system(uint8_t *ares,
*
* \return The number of numerals that are nesesary for full output
*/
-static size_t
-calc_roman_system(uint8_t *buf,
- const size_t maxlen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_roman_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
const int S[] = { 0, 2, 4, 2, 4, 2, 4 };
size_t k = 0; /* index into output buffer */
@@ -375,7 +426,7 @@ calc_roman_system(uint8_t *buf,
/* ensure value is within acceptable range of this system */
if ((value < cstyle->range.start) || (value > cstyle->range.end)) {
- return 0;
+ return CSS_INVALID;
}
L = cstyle->items - 1;
@@ -391,27 +442,47 @@ calc_roman_system(uint8_t *buf,
if (i < L && r2 >= S[i+1]) {
/* will violate repeat boundary on next pass */
value = value - (r2 * cstyle->weights[i+1]);
- if (k < maxlen) buf[k++] = i+1;
- if (k < maxlen) buf[k++] = i-1;
+ if (k < nval->len) {
+ nval->val[k++] = i+1;
+ }
+ if (k < nval->len) {
+ nval->val[k++] = i-1;
+ }
} else if (S[i] && r >= S[i]) {
/* violated repeat boundary on this pass */
- if (k < maxlen) buf[k++] = i;
- if (k < maxlen) buf[k++] = i-1;
+ if (k < nval->len) {
+ nval->val[k++] = i;
+ }
+ if (k < nval->len) {
+ nval->val[k++] = i-1;
+ }
} else {
- while (r-- > 0 && k < maxlen) {
- buf[k++] = i;
+ while ((r-- > 0) && (k < nval->len)) {
+ nval->val[k++] = i;
}
}
}
i++;
}
- return k;
+ nval->used = k;
+ nval->negative = false;
+
+ return CSS_OK;
}
/* tables for all the counter styles */
+static const symbol_t decimal_symbols[] = {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
+};
+static const struct list_counter_style lcs_decimal = {
+ .name = "decimal",
+ .system = calc_numeric_system,
+ .symbols = decimal_symbols,
+ .items = (sizeof(decimal_symbols) / SYMBOL_SIZE),
+};
static const symbol_t georgian_symbols[] = {
"���",
@@ -429,13 +500,12 @@ static const int georgian_weights[] = {
};
static const struct list_counter_style lcs_georgian = {
.name="georgian",
- .range = {
- .start = 1,
- .end = 19999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = georgian_symbols,
.weights = georgian_weights,
.items = (sizeof(georgian_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
+ .range = { .start = 1, .end = 19999 },
};
@@ -453,13 +523,12 @@ static const int armenian_weights[] = {
};
static const struct list_counter_style lcs_upper_armenian = {
.name = "upper-armenian",
- .range = {
- .start = 1,
- .end = 9999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = upper_armenian_symbols,
.weights = armenian_weights,
.items = (sizeof(upper_armenian_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
+ .range = { .start = 1, .end = 9999 },
};
@@ -471,35 +540,21 @@ static const symbol_t lower_armenian_symbols[] = {
};
static const struct list_counter_style lcs_lower_armenian = {
.name = "lower-armenian",
- .range = {
- .start = 1,
- .end = 9999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = lower_armenian_symbols,
.weights = armenian_weights,
.items = (sizeof(lower_armenian_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
-};
-
-
-static const symbol_t decimal_symbols[] = {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
-};
-static const struct list_counter_style lcs_decimal = {
- .name = "decimal",
- .symbols = decimal_symbols,
- .items = (sizeof(decimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
+ .range = { .start = 1, .end = 9999 },
};
static const struct list_counter_style lcs_decimal_leading_zero = {
.name = "decimal-leading-zero",
- .pad = {
- .length = 2,
- .value = "0",},
+ .system = calc_numeric_system,
.symbols = decimal_symbols,
.items = (sizeof(decimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
+ .pad = { .length = 2, .value = "0" },
};
@@ -510,9 +565,10 @@ static const symbol_t lower_greek_symbols[] = {
};
static const struct list_counter_style lcs_lower_greek = {
.name = "lower-greek",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = lower_greek_symbols,
.items = (sizeof(lower_greek_symbols) / SYMBOL_SIZE),
- .calc = calc_alphabet_system,
};
@@ -523,9 +579,10 @@ static const symbol_t upper_alpha_symbols[] = {
};
static const struct list_counter_style lcs_upper_alpha = {
.name = "upper-alpha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = upper_alpha_symbols,
.items = (sizeof(upper_alpha_symbols) / SYMBOL_SIZE),
- .calc = calc_alphabet_system,
};
@@ -536,9 +593,10 @@ static const symbol_t lower_alpha_symbols[] = {
};
static struct list_counter_style lcs_lower_alpha = {
.name = "lower-alpha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = lower_alpha_symbols,
.items = (sizeof(lower_alpha_symbols) / SYMBOL_SIZE),
- .calc = calc_alphabet_system,
};
@@ -550,13 +608,12 @@ static const symbol_t upper_roman_symbols[] = {
};
static const struct list_counter_style lcs_upper_roman = {
.name = "upper-roman",
- .range = {
- .start = 1,
- .end = 3999,},
+ .system = calc_roman_system,
+ .fallback = &lcs_decimal,
.symbols = upper_roman_symbols,
.weights = roman_weights,
.items = (sizeof(upper_roman_symbols) / SYMBOL_SIZE),
- .calc = calc_roman_system,
+ .range = { .start = 1, .end = 3999 },
};
@@ -565,48 +622,47 @@ static const symbol_t lower_roman_symbols[] = {
};
static const struct list_counter_style lcs_lower_roman = {
.name = "lower-roman",
- .range = {
- .start = 1,
- .end = 3999,},
+ .system = calc_roman_system,
+ .fallback = &lcs_decimal,
.symbols = lower_roman_symbols,
.weights = roman_weights,
.items = (sizeof(lower_roman_symbols) / SYMBOL_SIZE),
- .calc = calc_roman_system,
+ .range = { .start = 1, .end = 3999 },
};
static const symbol_t disc_symbols[] = { "\xE2\x80\xA2"}; /* 2022 BULLET */
static const struct list_counter_style lcs_disc = {
.name = "disc",
+ .system = calc_cyclic_system,
.symbols = disc_symbols,
.items = (sizeof(disc_symbols) / SYMBOL_SIZE),
.suffix = " ",
- .calc = calc_cyclic_system,
};
static const symbol_t circle_symbols[] = { "\342\227\213"}; /* 25CB WHITE CIRCLE */
static const struct list_counter_style lcs_circle = {
.name = "circle",
+ .system = calc_cyclic_system,
.symbols = circle_symbols,
.items = (sizeof(circle_symbols) / SYMBOL_SIZE),
.suffix = " ",
- .calc = calc_cyclic_system,
};
static const symbol_t square_symbols[] = { "\342\226\252"}; /* 25AA BLACK SMALL SQUARE */
static const struct list_counter_style lcs_square = {
.name = "square",
+ .system = calc_cyclic_system,
.symbols = square_symbols,
.items = (sizeof(square_symbols) / SYMBOL_SIZE),
.suffix = " ",
- .calc = calc_cyclic_system,
};
static const symbol_t binary_symbols[] = { "0", "1" };
static const struct list_counter_style lcs_binary = {
.name = "binary",
+ .system = calc_numeric_system,
.symbols = binary_symbols,
.items = (sizeof(binary_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t octal_symbols[] = {
@@ -614,9 +670,9 @@ static const symbol_t octal_symbols[] = {
};
static const struct list_counter_style lcs_octal = {
.name = "octal",
+ .system = calc_numeric_system,
.symbols = octal_symbols,
.items = (sizeof(octal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
@@ -626,9 +682,9 @@ static const symbol_t lower_hexadecimal_symbols[] = {
};
static const struct list_counter_style lcs_lower_hexadecimal = {
.name = "lower-hexadecimal",
+ .system = calc_numeric_system,
.symbols = lower_hexadecimal_symbols,
.items = (sizeof(lower_hexadecimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t upper_hexadecimal_symbols[] = {
@@ -637,9 +693,9 @@ static const symbol_t upper_hexadecimal_symbols[] = {
};
static const struct list_counter_style lcs_upper_hexadecimal = {
.name = "upper-hexadecimal",
+ .system = calc_numeric_system,
.symbols = upper_hexadecimal_symbols,
.items = (sizeof(upper_hexadecimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t arabic_indic_symbols[] = {
@@ -647,9 +703,9 @@ static const symbol_t arabic_indic_symbols[] = {
};
static const struct list_counter_style lcs_arabic_indic = {
.name = "arabic-indic",
+ .system = calc_numeric_system,
.symbols = arabic_indic_symbols,
.items = (sizeof(arabic_indic_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t bengali_symbols[] = {
@@ -657,9 +713,9 @@ static const symbol_t bengali_symbols[] = {
};
static const struct list_counter_style lcs_bengali = {
.name = "bengali",
+ .system = calc_numeric_system,
.symbols = bengali_symbols,
.items = (sizeof(bengali_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t cambodian_symbols[] = {
@@ -667,9 +723,9 @@ static const symbol_t cambodian_symbols[] = {
};
static const struct list_counter_style lcs_cambodian = {
.name = "cambodian",
+ .system = calc_numeric_system,
.symbols = cambodian_symbols,
.items = (sizeof(cambodian_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t cjk_decimal_symbols[] = {
@@ -677,10 +733,10 @@ static const symbol_t cjk_decimal_symbols[] = {
};
static const struct list_counter_style lcs_cjk_decimal = {
.name = "cjk-decimal",
+ .system = calc_numeric_system,
.symbols = cjk_decimal_symbols,
.suffix = "���",
.items = (sizeof(cjk_decimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t devanagari_symbols[] = {
@@ -688,9 +744,9 @@ static const symbol_t devanagari_symbols[] = {
};
static const struct list_counter_style lcs_devanagari = {
.name = "devanagari",
+ .system = calc_numeric_system,
.symbols = devanagari_symbols,
.items = (sizeof(devanagari_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t gujarati_symbols[] = {
@@ -698,9 +754,9 @@ static const symbol_t gujarati_symbols[] = {
};
static const struct list_counter_style lcs_gujarati = {
.name = "gujarati",
+ .system = calc_numeric_system,
.symbols = gujarati_symbols,
.items = (sizeof(gujarati_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t gurmukhi_symbols[] = {
@@ -708,9 +764,9 @@ static const symbol_t gurmukhi_symbols[] = {
};
static const struct list_counter_style lcs_gurmukhi = {
.name = "gurmukhi",
+ .system = calc_numeric_system,
.symbols = gurmukhi_symbols,
.items = (sizeof(gurmukhi_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const int hebrew_weights[] = {
@@ -729,13 +785,12 @@ static const symbol_t hebrew_symbols[] = {
};
static const struct list_counter_style lcs_hebrew = {
.name = "hebrew",
- .range = {
- .start = 1,
- .end = 10999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = hebrew_symbols,
.weights = hebrew_weights,
.items = (sizeof(hebrew_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
+ .range = { .start = 1, .end = 10999 },
};
static const symbol_t kannada_symbols[] = {
@@ -743,9 +798,9 @@ static const symbol_t kannada_symbols[] = {
};
static const struct list_counter_style lcs_kannada = {
.name = "kannada",
+ .system = calc_numeric_system,
.symbols = kannada_symbols,
.items = (sizeof(kannada_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t lao_symbols[] = {
@@ -753,9 +808,9 @@ static const symbol_t lao_symbols[] = {
};
static const struct list_counter_style lcs_lao = {
.name = "lao",
+ .system = calc_numeric_system,
.symbols = lao_symbols,
.items = (sizeof(lao_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t malayalam_symbols[] = {
@@ -763,9 +818,9 @@ static const symbol_t malayalam_symbols[] = {
};
static const struct list_counter_style lcs_malayalam = {
.name = "malayalam",
+ .system = calc_numeric_system,
.symbols = malayalam_symbols,
.items = (sizeof(malayalam_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t mongolian_symbols[] = {
@@ -773,9 +828,9 @@ static const symbol_t mongolian_symbols[] = {
};
static const struct list_counter_style lcs_mongolian = {
.name = "mongolian",
+ .system = calc_numeric_system,
.symbols = mongolian_symbols,
.items = (sizeof(mongolian_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t myanmar_symbols[] = {
@@ -783,9 +838,9 @@ static const symbol_t myanmar_symbols[] = {
};
static const struct list_counter_style lcs_myanmar = {
.name = "myanmar",
+ .system = calc_numeric_system,
.symbols = myanmar_symbols,
.items = (sizeof(myanmar_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t oriya_symbols[] = {
@@ -793,9 +848,9 @@ static const symbol_t oriya_symbols[] = {
};
static const struct list_counter_style lcs_oriya = {
.name = "oriya",
+ .system = calc_numeric_system,
.symbols = oriya_symbols,
.items = (sizeof(oriya_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t persian_symbols[] = {
@@ -803,9 +858,9 @@ static const symbol_t persian_symbols[] = {
};
static const struct list_counter_style lcs_persian = {
.name = "persian",
+ .system = calc_numeric_system,
.symbols = persian_symbols,
.items = (sizeof(persian_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t tamil_symbols[] = {
@@ -813,9 +868,9 @@ static const symbol_t tamil_symbols[] = {
};
static const struct list_counter_style lcs_tamil = {
.name = "tamil",
+ .system = calc_numeric_system,
.symbols = tamil_symbols,
.items = (sizeof(tamil_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t telugu_symbols[] = {
@@ -823,9 +878,9 @@ static const symbol_t telugu_symbols[] = {
};
static const struct list_counter_style lcs_telugu = {
.name = "telugu",
+ .system = calc_numeric_system,
.symbols = telugu_symbols,
.items = (sizeof(telugu_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t thai_symbols[] = {
@@ -833,9 +888,9 @@ static const symbol_t thai_symbols[] = {
};
static const struct list_counter_style lcs_thai = {
.name = "thai",
+ .system = calc_numeric_system,
.symbols = thai_symbols,
.items = (sizeof(thai_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t tibetan_symbols[] = {
@@ -843,9 +898,9 @@ static const symbol_t tibetan_symbols[] = {
};
static const struct list_counter_style lcs_tibetan = {
.name = "tibetan",
+ .system = calc_numeric_system,
.symbols = tibetan_symbols,
.items = (sizeof(tibetan_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t cjk_earthly_branch_symbols[] = {
@@ -853,10 +908,11 @@ static const symbol_t cjk_earthly_branch_symbols[] = {
};
static struct list_counter_style lcs_cjk_earthly_branch = {
.name = "cjk-earthly-branch",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = cjk_earthly_branch_symbols,
.items = (sizeof(cjk_earthly_branch_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t cjk_heavenly_stem_symbols[] = {
@@ -864,10 +920,11 @@ static const symbol_t cjk_heavenly_stem_symbols[] = {
};
static struct list_counter_style lcs_cjk_heavenly_stem = {
.name = "cjk-heavenly-stem",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = cjk_heavenly_stem_symbols,
.items = (sizeof(cjk_heavenly_stem_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t hiragana_symbols[] = {
@@ -875,10 +932,11 @@ static const symbol_t hiragana_symbols[] = {
};
static struct list_counter_style lcs_hiragana = {
.name = "hiragana",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = hiragana_symbols,
.items = (sizeof(hiragana_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t hiragana_iroha_symbols[] = {
@@ -886,10 +944,11 @@ static const symbol_t hiragana_iroha_symbols[] = {
};
static struct list_counter_style lcs_hiragana_iroha = {
.name = "hiragana-iroha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = hiragana_iroha_symbols,
.items = (sizeof(hiragana_iroha_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t katakana_symbols[] = {
@@ -897,10 +956,11 @@ static const symbol_t katakana_symbols[] = {
};
static struct list_counter_style lcs_katakana = {
.name = "katakana",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = katakana_symbols,
.items = (sizeof(katakana_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t katakana_iroha_symbols[] = {
@@ -908,10 +968,11 @@ static const symbol_t katakana_iroha_symbols[] = {
};
static struct list_counter_style lcs_katakana_iroha = {
.name = "katakana-iroha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = katakana_iroha_symbols,
.items = (sizeof(katakana_iroha_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
@@ -1022,8 +1083,9 @@ css_error css_computed_format_list_style(
size_t buffer_length,
size_t *format_length)
{
- uint8_t aval[20];
+ css_error res = CSS_INVALID;
const struct list_counter_style *cstyle;
+ uint8_t aval[20];
struct numeric nval = {
.val = aval,
.len = sizeof(aval),
@@ -1031,31 +1093,24 @@ css_error css_computed_format_list_style(
.negative = false
};
- nval.negative = (value < 0)?true:false;
cstyle = counter_style_from_computed_style(style);
- if (cstyle == NULL) {
- return CSS_BADPARM;
- }
-
- nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
-
- /* ensure it is possible to calculate with the selected system */
- if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
- /* retry in decimal */
- cstyle = &lcs_decimal;
-
- nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
- if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
- /* failed in decimal, give up */
- return CSS_INVALID;
+ while (cstyle != NULL) {
+ res = cstyle->system(value, cstyle, &nval);
+
+ if ((res == CSS_OK) &&
+ (nval.used < nval.len)) {
+ /* system sucessfully generated numeric values */
+ *format_length = nval_to_symbols(&nval,
+ cstyle,
+ buffer,
+ buffer_length);
+ break;
}
- }
- *format_length = nval_to_symbols(&nval,
- cstyle,
- buffer,
- buffer_length);
+ res = CSS_INVALID;
+ cstyle = cstyle->fallback;
+ }
- return CSS_OK;
+ return res;
}
-----------------------------------------------------------------------
Summary of changes:
src/select/format_list_style.c | 407 +++++++++++++++++++++++-----------------
1 file changed, 231 insertions(+), 176 deletions(-)
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 46861a4..9cc5de7 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -11,37 +11,54 @@
#define SYMBOL_SIZE 5
typedef char symbol_t[SYMBOL_SIZE];
+/**
+ * numeric representation of the value using a system
+ */
+struct numeric {
+ uint8_t *val; /* buffer containing the numeric values */
+ size_t len; /* length of alen */
+ size_t used; /* number of numeric values used */
+ bool negative; /* if the value is negative */
+};
+
+/**
+ * list counter style
+ */
struct list_counter_style {
- const char *name; /**< style name for debug purposes */
+ /** style name for debug purposes */
+ const char *name;
+ /** function to calculate the system */
+ css_error (*system)(int value, const struct list_counter_style *cstyle, struct numeric *nval);
+ /** fallback style if this system fails */
+ const struct list_counter_style* fallback;
+ /** array of symbols which represent this style */
+ const symbol_t *symbols;
+ /** symbol weights for additive schemes */
+ const int *weights;
+ /** number of items in symbol and weight table */
+ const size_t items;
+ /** range of acceptable values */
struct {
const int start; /**< first acceptable value for this style */
const int end; /**< last acceptable value for this style */
} range;
+
+ /** padding formatting */
struct {
const unsigned int length;
const symbol_t value;
} pad;
+ /** negative value formating */
struct {
const char *pre;
const char *post;
} negative;
+ /** prefix formatting */
const char *prefix;
+ /** suffix formatting */
const char *suffix;
- const symbol_t *symbols; /**< array of symbols which represent this style */
- const int *weights; /**< symbol weights for additive schemes */
- const size_t items; /**< items in symbol and weight table */
- size_t (*calc)(uint8_t *ares, const size_t alen, int value, const struct list_counter_style *cstyle); /**< function to calculate the system */
};
-/**
- * numeric representation of the value using a system
- */
-struct numeric {
- uint8_t *val; /* buffer containing the numeric values */
- size_t len; /* length of alen */
- size_t used; /* number of numeric values used */
- bool negative; /* if the value is negative */
-};
/**
* Copy a null-terminated UTF-8 string to buffer at offset, if there is space
@@ -143,7 +160,7 @@ nval_to_symbols(struct numeric *nval,
}
/* map symbols */
- for (aidx=0; aidx < nval->used; aidx++) {
+ for (aidx = 0; aidx < nval->used; aidx++) {
oidx += copy_symbol(buf, buflen, oidx,
cstyle->symbols[nval->val[aidx]]);
}
@@ -174,41 +191,45 @@ nval_to_symbols(struct numeric *nval,
* \param cstyle The counter style in use
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_numeric_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_numeric_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
size_t idx = 0;
uint8_t *first;
uint8_t *last;
if (value == 0) {
- if (alen >= 1) {
- ares[0] = 0;
+ if (nval->len >= 1) {
+ nval->val[0] = 0;
}
- return 1;
+ nval->used = 1;
+ return CSS_OK;
}
- value = abs(value);
-
+ if (value < 0) {
+ nval->negative = true;
+ value = abs(value);
+ } else {
+ nval->negative = false;
+ }
/* generate alphabet values in ascending order */
while (value > 0) {
- if (idx < alen) {
- ares[idx] = value % cstyle->items;
+ if (idx < nval->len) {
+ nval->val[idx] = value % cstyle->items;
}
idx++;
value = value / cstyle->items;
}
/* put the values in decending order */
- first = ares;
- if (idx < alen) {
+ first = nval->val;
+ if (idx < nval->len) {
last = first + (idx - 1);
} else {
- last = first + (alen - 1);
+ last = first + (nval->len - 1);
}
while (first < last) {
*first ^= *last;
@@ -218,7 +239,9 @@ calc_numeric_system(uint8_t *ares,
last--;
}
- return idx;
+ nval->used = idx;
+
+ return CSS_OK;
}
@@ -233,22 +256,24 @@ calc_numeric_system(uint8_t *ares,
* \param cstyle The counter style in use
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_cyclic_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_cyclic_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
- if (alen == 0) {
- return 0;
+ if (nval->len == 0) {
+ return CSS_INVALID;
}
if (cstyle->items == 1) {
/* there is only one symbol so select it */
- ares[0] = 0;
+ nval->val[0] = 0;
} else {
- ares[0] = (value - 1) % cstyle->items;
+ nval->val[0] = (value - 1) % cstyle->items;
}
- return 1;
+ nval->used = 1;
+ nval->negative = false;
+
+ return CSS_OK;
}
@@ -263,34 +288,53 @@ calc_cyclic_system(uint8_t *ares,
* \param wlen The number of weights
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_additive_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_additive_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
size_t widx; /* weight index */
- size_t aidx = 0;
+ size_t aidx = 0; /* numerals used */
size_t idx;
size_t times; /* number of times a weight occours */
/* ensure value is within acceptable range of this system */
if ((value < cstyle->range.start) || (value > cstyle->range.end)) {
- return 0;
+ return CSS_INVALID;
}
- /* implementation cannot cope with negatives */
- if (value < 1) {
- return 0;
+ /* zero needs a specific weight */
+ if (value == 0) {
+ /* search weights for a zero entry */
+ for (widx = 0; widx < cstyle->items; widx++) {
+ if (cstyle->weights[widx] == 0) {
+ if (nval->len > 0) {
+ nval->val[0] = widx;
+ }
+
+ nval->used = 1;
+ nval->negative = false;
+ return CSS_OK;
+ }
+ }
+ return CSS_INVALID;
+ }
+
+ /* negative values */
+ if (value < 0) {
+ nval->negative = true;
+ value = abs(value);
+ } else {
+ nval->negative = false;
}
/* iterate over the available weights */
- for (widx = 0; widx < cstyle->items;widx++) {
+ for (widx = 0; widx < cstyle->items; widx++) {
times = value / cstyle->weights[widx];
if (times > 0) {
- for (idx=0;idx < times;idx++) {
- if (aidx < alen) {
- ares[aidx] = widx;
+ for (idx = 0;idx < times;idx++) {
+ if (aidx < nval->len) {
+ nval->val[aidx] = widx;
}
aidx++;
}
@@ -299,7 +343,9 @@ calc_additive_system(uint8_t *ares,
}
}
- return aidx;
+ nval->used = aidx;
+
+ return CSS_OK;
}
@@ -314,32 +360,35 @@ calc_additive_system(uint8_t *ares,
* \param slen The number of symbols in the alphabet
* \return The length a complete conversion which may be larger than \a alen
*/
-static size_t
-calc_alphabet_system(uint8_t *ares,
- const size_t alen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_alphabet_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
size_t idx = 0;
uint8_t *first;
uint8_t *last;
+ if (value < 1) {
+ return CSS_INVALID;
+ }
+
/* generate alphabet values in ascending order */
while (value > 0) {
--value;
- if (idx < alen) {
- ares[idx] = value % cstyle->items;
+ if (idx < nval->len) {
+ nval->val[idx] = value % cstyle->items;
}
idx++;
value = value / cstyle->items;
}
/* put the values in decending order */
- first = ares;
- if (idx < alen) {
+ first = nval->val;
+ if (idx < nval->len) {
last = first + (idx - 1);
} else {
- last = first + (alen - 1);
+ last = first + (nval->len - 1);
}
while (first < last) {
*first ^= *last;
@@ -349,7 +398,10 @@ calc_alphabet_system(uint8_t *ares,
last--;
}
- return idx;
+ nval->used = idx;
+ nval->negative = false;
+
+ return CSS_OK;
}
@@ -358,11 +410,10 @@ calc_alphabet_system(uint8_t *ares,
*
* \return The number of numerals that are nesesary for full output
*/
-static size_t
-calc_roman_system(uint8_t *buf,
- const size_t maxlen,
- int value,
- const struct list_counter_style *cstyle)
+static css_error
+calc_roman_system(int value,
+ const struct list_counter_style *cstyle,
+ struct numeric *nval)
{
const int S[] = { 0, 2, 4, 2, 4, 2, 4 };
size_t k = 0; /* index into output buffer */
@@ -375,7 +426,7 @@ calc_roman_system(uint8_t *buf,
/* ensure value is within acceptable range of this system */
if ((value < cstyle->range.start) || (value > cstyle->range.end)) {
- return 0;
+ return CSS_INVALID;
}
L = cstyle->items - 1;
@@ -391,27 +442,47 @@ calc_roman_system(uint8_t *buf,
if (i < L && r2 >= S[i+1]) {
/* will violate repeat boundary on next pass */
value = value - (r2 * cstyle->weights[i+1]);
- if (k < maxlen) buf[k++] = i+1;
- if (k < maxlen) buf[k++] = i-1;
+ if (k < nval->len) {
+ nval->val[k++] = i+1;
+ }
+ if (k < nval->len) {
+ nval->val[k++] = i-1;
+ }
} else if (S[i] && r >= S[i]) {
/* violated repeat boundary on this pass */
- if (k < maxlen) buf[k++] = i;
- if (k < maxlen) buf[k++] = i-1;
+ if (k < nval->len) {
+ nval->val[k++] = i;
+ }
+ if (k < nval->len) {
+ nval->val[k++] = i-1;
+ }
} else {
- while (r-- > 0 && k < maxlen) {
- buf[k++] = i;
+ while ((r-- > 0) && (k < nval->len)) {
+ nval->val[k++] = i;
}
}
}
i++;
}
- return k;
+ nval->used = k;
+ nval->negative = false;
+
+ return CSS_OK;
}
/* tables for all the counter styles */
+static const symbol_t decimal_symbols[] = {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
+};
+static const struct list_counter_style lcs_decimal = {
+ .name = "decimal",
+ .system = calc_numeric_system,
+ .symbols = decimal_symbols,
+ .items = (sizeof(decimal_symbols) / SYMBOL_SIZE),
+};
static const symbol_t georgian_symbols[] = {
"���",
@@ -429,13 +500,12 @@ static const int georgian_weights[] = {
};
static const struct list_counter_style lcs_georgian = {
.name="georgian",
- .range = {
- .start = 1,
- .end = 19999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = georgian_symbols,
.weights = georgian_weights,
.items = (sizeof(georgian_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
+ .range = { .start = 1, .end = 19999 },
};
@@ -453,13 +523,12 @@ static const int armenian_weights[] = {
};
static const struct list_counter_style lcs_upper_armenian = {
.name = "upper-armenian",
- .range = {
- .start = 1,
- .end = 9999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = upper_armenian_symbols,
.weights = armenian_weights,
.items = (sizeof(upper_armenian_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
+ .range = { .start = 1, .end = 9999 },
};
@@ -471,35 +540,21 @@ static const symbol_t lower_armenian_symbols[] = {
};
static const struct list_counter_style lcs_lower_armenian = {
.name = "lower-armenian",
- .range = {
- .start = 1,
- .end = 9999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = lower_armenian_symbols,
.weights = armenian_weights,
.items = (sizeof(lower_armenian_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
-};
-
-
-static const symbol_t decimal_symbols[] = {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
-};
-static const struct list_counter_style lcs_decimal = {
- .name = "decimal",
- .symbols = decimal_symbols,
- .items = (sizeof(decimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
+ .range = { .start = 1, .end = 9999 },
};
static const struct list_counter_style lcs_decimal_leading_zero = {
.name = "decimal-leading-zero",
- .pad = {
- .length = 2,
- .value = "0",},
+ .system = calc_numeric_system,
.symbols = decimal_symbols,
.items = (sizeof(decimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
+ .pad = { .length = 2, .value = "0" },
};
@@ -510,9 +565,10 @@ static const symbol_t lower_greek_symbols[] = {
};
static const struct list_counter_style lcs_lower_greek = {
.name = "lower-greek",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = lower_greek_symbols,
.items = (sizeof(lower_greek_symbols) / SYMBOL_SIZE),
- .calc = calc_alphabet_system,
};
@@ -523,9 +579,10 @@ static const symbol_t upper_alpha_symbols[] = {
};
static const struct list_counter_style lcs_upper_alpha = {
.name = "upper-alpha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = upper_alpha_symbols,
.items = (sizeof(upper_alpha_symbols) / SYMBOL_SIZE),
- .calc = calc_alphabet_system,
};
@@ -536,9 +593,10 @@ static const symbol_t lower_alpha_symbols[] = {
};
static struct list_counter_style lcs_lower_alpha = {
.name = "lower-alpha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = lower_alpha_symbols,
.items = (sizeof(lower_alpha_symbols) / SYMBOL_SIZE),
- .calc = calc_alphabet_system,
};
@@ -550,13 +608,12 @@ static const symbol_t upper_roman_symbols[] = {
};
static const struct list_counter_style lcs_upper_roman = {
.name = "upper-roman",
- .range = {
- .start = 1,
- .end = 3999,},
+ .system = calc_roman_system,
+ .fallback = &lcs_decimal,
.symbols = upper_roman_symbols,
.weights = roman_weights,
.items = (sizeof(upper_roman_symbols) / SYMBOL_SIZE),
- .calc = calc_roman_system,
+ .range = { .start = 1, .end = 3999 },
};
@@ -565,48 +622,47 @@ static const symbol_t lower_roman_symbols[] = {
};
static const struct list_counter_style lcs_lower_roman = {
.name = "lower-roman",
- .range = {
- .start = 1,
- .end = 3999,},
+ .system = calc_roman_system,
+ .fallback = &lcs_decimal,
.symbols = lower_roman_symbols,
.weights = roman_weights,
.items = (sizeof(lower_roman_symbols) / SYMBOL_SIZE),
- .calc = calc_roman_system,
+ .range = { .start = 1, .end = 3999 },
};
static const symbol_t disc_symbols[] = { "\xE2\x80\xA2"}; /* 2022 BULLET */
static const struct list_counter_style lcs_disc = {
.name = "disc",
+ .system = calc_cyclic_system,
.symbols = disc_symbols,
.items = (sizeof(disc_symbols) / SYMBOL_SIZE),
.suffix = " ",
- .calc = calc_cyclic_system,
};
static const symbol_t circle_symbols[] = { "\342\227\213"}; /* 25CB WHITE CIRCLE */
static const struct list_counter_style lcs_circle = {
.name = "circle",
+ .system = calc_cyclic_system,
.symbols = circle_symbols,
.items = (sizeof(circle_symbols) / SYMBOL_SIZE),
.suffix = " ",
- .calc = calc_cyclic_system,
};
static const symbol_t square_symbols[] = { "\342\226\252"}; /* 25AA BLACK SMALL SQUARE */
static const struct list_counter_style lcs_square = {
.name = "square",
+ .system = calc_cyclic_system,
.symbols = square_symbols,
.items = (sizeof(square_symbols) / SYMBOL_SIZE),
.suffix = " ",
- .calc = calc_cyclic_system,
};
static const symbol_t binary_symbols[] = { "0", "1" };
static const struct list_counter_style lcs_binary = {
.name = "binary",
+ .system = calc_numeric_system,
.symbols = binary_symbols,
.items = (sizeof(binary_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t octal_symbols[] = {
@@ -614,9 +670,9 @@ static const symbol_t octal_symbols[] = {
};
static const struct list_counter_style lcs_octal = {
.name = "octal",
+ .system = calc_numeric_system,
.symbols = octal_symbols,
.items = (sizeof(octal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
@@ -626,9 +682,9 @@ static const symbol_t lower_hexadecimal_symbols[] = {
};
static const struct list_counter_style lcs_lower_hexadecimal = {
.name = "lower-hexadecimal",
+ .system = calc_numeric_system,
.symbols = lower_hexadecimal_symbols,
.items = (sizeof(lower_hexadecimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t upper_hexadecimal_symbols[] = {
@@ -637,9 +693,9 @@ static const symbol_t upper_hexadecimal_symbols[] = {
};
static const struct list_counter_style lcs_upper_hexadecimal = {
.name = "upper-hexadecimal",
+ .system = calc_numeric_system,
.symbols = upper_hexadecimal_symbols,
.items = (sizeof(upper_hexadecimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t arabic_indic_symbols[] = {
@@ -647,9 +703,9 @@ static const symbol_t arabic_indic_symbols[] = {
};
static const struct list_counter_style lcs_arabic_indic = {
.name = "arabic-indic",
+ .system = calc_numeric_system,
.symbols = arabic_indic_symbols,
.items = (sizeof(arabic_indic_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t bengali_symbols[] = {
@@ -657,9 +713,9 @@ static const symbol_t bengali_symbols[] = {
};
static const struct list_counter_style lcs_bengali = {
.name = "bengali",
+ .system = calc_numeric_system,
.symbols = bengali_symbols,
.items = (sizeof(bengali_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t cambodian_symbols[] = {
@@ -667,9 +723,9 @@ static const symbol_t cambodian_symbols[] = {
};
static const struct list_counter_style lcs_cambodian = {
.name = "cambodian",
+ .system = calc_numeric_system,
.symbols = cambodian_symbols,
.items = (sizeof(cambodian_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t cjk_decimal_symbols[] = {
@@ -677,10 +733,10 @@ static const symbol_t cjk_decimal_symbols[] = {
};
static const struct list_counter_style lcs_cjk_decimal = {
.name = "cjk-decimal",
+ .system = calc_numeric_system,
.symbols = cjk_decimal_symbols,
.suffix = "���",
.items = (sizeof(cjk_decimal_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t devanagari_symbols[] = {
@@ -688,9 +744,9 @@ static const symbol_t devanagari_symbols[] = {
};
static const struct list_counter_style lcs_devanagari = {
.name = "devanagari",
+ .system = calc_numeric_system,
.symbols = devanagari_symbols,
.items = (sizeof(devanagari_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t gujarati_symbols[] = {
@@ -698,9 +754,9 @@ static const symbol_t gujarati_symbols[] = {
};
static const struct list_counter_style lcs_gujarati = {
.name = "gujarati",
+ .system = calc_numeric_system,
.symbols = gujarati_symbols,
.items = (sizeof(gujarati_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t gurmukhi_symbols[] = {
@@ -708,9 +764,9 @@ static const symbol_t gurmukhi_symbols[] = {
};
static const struct list_counter_style lcs_gurmukhi = {
.name = "gurmukhi",
+ .system = calc_numeric_system,
.symbols = gurmukhi_symbols,
.items = (sizeof(gurmukhi_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const int hebrew_weights[] = {
@@ -729,13 +785,12 @@ static const symbol_t hebrew_symbols[] = {
};
static const struct list_counter_style lcs_hebrew = {
.name = "hebrew",
- .range = {
- .start = 1,
- .end = 10999,},
+ .system = calc_additive_system,
+ .fallback = &lcs_decimal,
.symbols = hebrew_symbols,
.weights = hebrew_weights,
.items = (sizeof(hebrew_symbols) / SYMBOL_SIZE),
- .calc = calc_additive_system,
+ .range = { .start = 1, .end = 10999 },
};
static const symbol_t kannada_symbols[] = {
@@ -743,9 +798,9 @@ static const symbol_t kannada_symbols[] = {
};
static const struct list_counter_style lcs_kannada = {
.name = "kannada",
+ .system = calc_numeric_system,
.symbols = kannada_symbols,
.items = (sizeof(kannada_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t lao_symbols[] = {
@@ -753,9 +808,9 @@ static const symbol_t lao_symbols[] = {
};
static const struct list_counter_style lcs_lao = {
.name = "lao",
+ .system = calc_numeric_system,
.symbols = lao_symbols,
.items = (sizeof(lao_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t malayalam_symbols[] = {
@@ -763,9 +818,9 @@ static const symbol_t malayalam_symbols[] = {
};
static const struct list_counter_style lcs_malayalam = {
.name = "malayalam",
+ .system = calc_numeric_system,
.symbols = malayalam_symbols,
.items = (sizeof(malayalam_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t mongolian_symbols[] = {
@@ -773,9 +828,9 @@ static const symbol_t mongolian_symbols[] = {
};
static const struct list_counter_style lcs_mongolian = {
.name = "mongolian",
+ .system = calc_numeric_system,
.symbols = mongolian_symbols,
.items = (sizeof(mongolian_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t myanmar_symbols[] = {
@@ -783,9 +838,9 @@ static const symbol_t myanmar_symbols[] = {
};
static const struct list_counter_style lcs_myanmar = {
.name = "myanmar",
+ .system = calc_numeric_system,
.symbols = myanmar_symbols,
.items = (sizeof(myanmar_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t oriya_symbols[] = {
@@ -793,9 +848,9 @@ static const symbol_t oriya_symbols[] = {
};
static const struct list_counter_style lcs_oriya = {
.name = "oriya",
+ .system = calc_numeric_system,
.symbols = oriya_symbols,
.items = (sizeof(oriya_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t persian_symbols[] = {
@@ -803,9 +858,9 @@ static const symbol_t persian_symbols[] = {
};
static const struct list_counter_style lcs_persian = {
.name = "persian",
+ .system = calc_numeric_system,
.symbols = persian_symbols,
.items = (sizeof(persian_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t tamil_symbols[] = {
@@ -813,9 +868,9 @@ static const symbol_t tamil_symbols[] = {
};
static const struct list_counter_style lcs_tamil = {
.name = "tamil",
+ .system = calc_numeric_system,
.symbols = tamil_symbols,
.items = (sizeof(tamil_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t telugu_symbols[] = {
@@ -823,9 +878,9 @@ static const symbol_t telugu_symbols[] = {
};
static const struct list_counter_style lcs_telugu = {
.name = "telugu",
+ .system = calc_numeric_system,
.symbols = telugu_symbols,
.items = (sizeof(telugu_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t thai_symbols[] = {
@@ -833,9 +888,9 @@ static const symbol_t thai_symbols[] = {
};
static const struct list_counter_style lcs_thai = {
.name = "thai",
+ .system = calc_numeric_system,
.symbols = thai_symbols,
.items = (sizeof(thai_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t tibetan_symbols[] = {
@@ -843,9 +898,9 @@ static const symbol_t tibetan_symbols[] = {
};
static const struct list_counter_style lcs_tibetan = {
.name = "tibetan",
+ .system = calc_numeric_system,
.symbols = tibetan_symbols,
.items = (sizeof(tibetan_symbols) / SYMBOL_SIZE),
- .calc = calc_numeric_system,
};
static const symbol_t cjk_earthly_branch_symbols[] = {
@@ -853,10 +908,11 @@ static const symbol_t cjk_earthly_branch_symbols[] = {
};
static struct list_counter_style lcs_cjk_earthly_branch = {
.name = "cjk-earthly-branch",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = cjk_earthly_branch_symbols,
.items = (sizeof(cjk_earthly_branch_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t cjk_heavenly_stem_symbols[] = {
@@ -864,10 +920,11 @@ static const symbol_t cjk_heavenly_stem_symbols[] = {
};
static struct list_counter_style lcs_cjk_heavenly_stem = {
.name = "cjk-heavenly-stem",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = cjk_heavenly_stem_symbols,
.items = (sizeof(cjk_heavenly_stem_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t hiragana_symbols[] = {
@@ -875,10 +932,11 @@ static const symbol_t hiragana_symbols[] = {
};
static struct list_counter_style lcs_hiragana = {
.name = "hiragana",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = hiragana_symbols,
.items = (sizeof(hiragana_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t hiragana_iroha_symbols[] = {
@@ -886,10 +944,11 @@ static const symbol_t hiragana_iroha_symbols[] = {
};
static struct list_counter_style lcs_hiragana_iroha = {
.name = "hiragana-iroha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = hiragana_iroha_symbols,
.items = (sizeof(hiragana_iroha_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t katakana_symbols[] = {
@@ -897,10 +956,11 @@ static const symbol_t katakana_symbols[] = {
};
static struct list_counter_style lcs_katakana = {
.name = "katakana",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = katakana_symbols,
.items = (sizeof(katakana_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
static const symbol_t katakana_iroha_symbols[] = {
@@ -908,10 +968,11 @@ static const symbol_t katakana_iroha_symbols[] = {
};
static struct list_counter_style lcs_katakana_iroha = {
.name = "katakana-iroha",
+ .system = calc_alphabet_system,
+ .fallback = &lcs_decimal,
.symbols = katakana_iroha_symbols,
.items = (sizeof(katakana_iroha_symbols) / SYMBOL_SIZE),
.suffix = "���",
- .calc = calc_alphabet_system,
};
@@ -1022,8 +1083,9 @@ css_error css_computed_format_list_style(
size_t buffer_length,
size_t *format_length)
{
- uint8_t aval[20];
+ css_error res = CSS_INVALID;
const struct list_counter_style *cstyle;
+ uint8_t aval[20];
struct numeric nval = {
.val = aval,
.len = sizeof(aval),
@@ -1031,31 +1093,24 @@ css_error css_computed_format_list_style(
.negative = false
};
- nval.negative = (value < 0)?true:false;
cstyle = counter_style_from_computed_style(style);
- if (cstyle == NULL) {
- return CSS_BADPARM;
- }
-
- nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
-
- /* ensure it is possible to calculate with the selected system */
- if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
- /* retry in decimal */
- cstyle = &lcs_decimal;
-
- nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
- if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
- /* failed in decimal, give up */
- return CSS_INVALID;
+ while (cstyle != NULL) {
+ res = cstyle->system(value, cstyle, &nval);
+
+ if ((res == CSS_OK) &&
+ (nval.used < nval.len)) {
+ /* system sucessfully generated numeric values */
+ *format_length = nval_to_symbols(&nval,
+ cstyle,
+ buffer,
+ buffer_length);
+ break;
}
- }
- *format_length = nval_to_symbols(&nval,
- cstyle,
- buffer,
- buffer_length);
+ res = CSS_INVALID;
+ cstyle = cstyle->fallback;
+ }
- return CSS_OK;
+ return res;
}
--
Cascading Style Sheets library
1 year, 11 months
libcss: branch master updated. release/0.9.1-15-gfebbc5c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/febbc5cb05e4ce82d39904...
...commit http://git.netsurf-browser.org/libcss.git/commit/febbc5cb05e4ce82d3990418...
...tree http://git.netsurf-browser.org/libcss.git/tree/febbc5cb05e4ce82d3990418ee...
The branch, master has been updated
via febbc5cb05e4ce82d3990418ee011c4b54090f27 (commit)
from ed2a8a561a2062fc7a5ae412e651203da9e942cf (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=febbc5cb05e4ce82d399...
commit febbc5cb05e4ce82d3990418ee011c4b54090f27
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix list style formatting with negative values
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 8636c03..46861a4 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -21,8 +21,12 @@ struct list_counter_style {
const unsigned int length;
const symbol_t value;
} pad;
+ struct {
+ const char *pre;
+ const char *post;
+ } negative;
const char *prefix;
- const char *postfix;
+ const char *suffix;
const symbol_t *symbols; /**< array of symbols which represent this style */
const int *weights; /**< symbol weights for additive schemes */
const size_t items; /**< items in symbol and weight table */
@@ -30,6 +34,16 @@ struct list_counter_style {
};
/**
+ * numeric representation of the value using a system
+ */
+struct numeric {
+ uint8_t *val; /* buffer containing the numeric values */
+ size_t len; /* length of alen */
+ size_t used; /* number of numeric values used */
+ bool negative; /* if the value is negative */
+};
+
+/**
* Copy a null-terminated UTF-8 string to buffer at offset, if there is space
*
* \param[in] buf The output buffer
@@ -82,12 +96,12 @@ copy_symbol(char *buf, const size_t buflen, size_t pos, const symbol_t symbol)
}
/**
- * maps alphabet values to output values with a symbol table
+ * maps numeric values to output values with a symbol table
*
- * Takes a list of alphabet values and for each one outputs the
+ * Takes a list of numeric values and for each one outputs the
* compete symbol (in utf8) to an output buffer.
*
- * \param buf The oputput buffer
+ * \param buf The output buffer
* \param buflen the length of \a buf
* \param aval array of alphabet values
* \param alen The number of values in \a alen
@@ -97,33 +111,53 @@ copy_symbol(char *buf, const size_t buflen, size_t pos, const symbol_t symbol)
* larger than \a buflen but the buffer will not be overrun
*/
static size_t
-map_aval_to_symbols(char *buf, const size_t buflen,
- const uint8_t *aval, const size_t alen,
- const struct list_counter_style *cstyle)
+nval_to_symbols(struct numeric *nval,
+ const struct list_counter_style *cstyle,
+ char *buf, const size_t buflen)
{
size_t oidx = 0;
size_t aidx; /* numeral index */
- const symbol_t postfix = "."; /* default postfix string */
+ const char *suffix = "."; /* default sufffix string */
+ const char *negative_pre = "-"; /* default negative string */
+
+ /* prefix */
+ if (cstyle->prefix != NULL) {
+ oidx += copy_string(buf, buflen, oidx, cstyle->prefix);
+ }
+
+ /* negative pre */
+ if (nval->negative) {
+ if (cstyle->negative.pre != NULL) {
+ negative_pre = cstyle->negative.pre;
+ }
+ oidx += copy_string(buf, buflen, oidx, negative_pre);
+ }
/* add padding if required */
- if (alen < cstyle->pad.length) {
+ if (nval->used < cstyle->pad.length) {
size_t pidx; /* padding index */
- for (pidx=cstyle->pad.length - alen; pidx > 0; pidx--) {
+ for (pidx = cstyle->pad.length - nval->used; pidx > 0; pidx--) {
oidx += copy_symbol(buf, buflen, oidx,
cstyle->pad.value);
}
}
/* map symbols */
- for (aidx=0; aidx < alen; aidx++) {
+ for (aidx=0; aidx < nval->used; aidx++) {
oidx += copy_symbol(buf, buflen, oidx,
- cstyle->symbols[aval[aidx]]);
+ cstyle->symbols[nval->val[aidx]]);
}
- /* postfix */
- oidx += copy_string(buf, buflen, oidx,
- (cstyle->postfix != NULL) ?
- cstyle->postfix : postfix);
+ /* negative post */
+ if ((nval->negative) && (cstyle->negative.post != NULL)) {
+ oidx += copy_string(buf, buflen, oidx, cstyle->negative.post);
+ }
+
+ /* suffix */
+ if (cstyle->suffix != NULL) {
+ suffix = cstyle->suffix;
+ }
+ oidx += copy_string(buf, buflen, oidx, suffix);
return oidx;
}
@@ -150,6 +184,16 @@ calc_numeric_system(uint8_t *ares,
uint8_t *first;
uint8_t *last;
+ if (value == 0) {
+ if (alen >= 1) {
+ ares[0] = 0;
+ }
+ return 1;
+ }
+
+ value = abs(value);
+
+
/* generate alphabet values in ascending order */
while (value > 0) {
if (idx < alen) {
@@ -230,6 +274,16 @@ calc_additive_system(uint8_t *ares,
size_t idx;
size_t times; /* number of times a weight occours */
+ /* ensure value is within acceptable range of this system */
+ if ((value < cstyle->range.start) || (value > cstyle->range.end)) {
+ return 0;
+ }
+
+ /* implementation cannot cope with negatives */
+ if (value < 1) {
+ return 0;
+ }
+
/* iterate over the available weights */
for (widx = 0; widx < cstyle->items;widx++) {
times = value / cstyle->weights[widx];
@@ -525,7 +579,7 @@ static const struct list_counter_style lcs_disc = {
.name = "disc",
.symbols = disc_symbols,
.items = (sizeof(disc_symbols) / SYMBOL_SIZE),
- .postfix = " ",
+ .suffix = " ",
.calc = calc_cyclic_system,
};
@@ -534,7 +588,7 @@ static const struct list_counter_style lcs_circle = {
.name = "circle",
.symbols = circle_symbols,
.items = (sizeof(circle_symbols) / SYMBOL_SIZE),
- .postfix = " ",
+ .suffix = " ",
.calc = calc_cyclic_system,
};
@@ -543,7 +597,7 @@ static const struct list_counter_style lcs_square = {
.name = "square",
.symbols = square_symbols,
.items = (sizeof(square_symbols) / SYMBOL_SIZE),
- .postfix = " ",
+ .suffix = " ",
.calc = calc_cyclic_system,
};
@@ -624,7 +678,7 @@ static const symbol_t cjk_decimal_symbols[] = {
static const struct list_counter_style lcs_cjk_decimal = {
.name = "cjk-decimal",
.symbols = cjk_decimal_symbols,
- .postfix = "���",
+ .suffix = "���",
.items = (sizeof(cjk_decimal_symbols) / SYMBOL_SIZE),
.calc = calc_numeric_system,
};
@@ -679,7 +733,7 @@ static const struct list_counter_style lcs_hebrew = {
.start = 1,
.end = 10999,},
.symbols = hebrew_symbols,
- .weights = hebrew_weights,
+ .weights = hebrew_weights,
.items = (sizeof(hebrew_symbols) / SYMBOL_SIZE),
.calc = calc_additive_system,
};
@@ -801,7 +855,7 @@ static struct list_counter_style lcs_cjk_earthly_branch = {
.name = "cjk-earthly-branch",
.symbols = cjk_earthly_branch_symbols,
.items = (sizeof(cjk_earthly_branch_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -812,7 +866,7 @@ static struct list_counter_style lcs_cjk_heavenly_stem = {
.name = "cjk-heavenly-stem",
.symbols = cjk_heavenly_stem_symbols,
.items = (sizeof(cjk_heavenly_stem_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -823,7 +877,7 @@ static struct list_counter_style lcs_hiragana = {
.name = "hiragana",
.symbols = hiragana_symbols,
.items = (sizeof(hiragana_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -834,7 +888,7 @@ static struct list_counter_style lcs_hiragana_iroha = {
.name = "hiragana-iroha",
.symbols = hiragana_iroha_symbols,
.items = (sizeof(hiragana_iroha_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -845,7 +899,7 @@ static struct list_counter_style lcs_katakana = {
.name = "katakana",
.symbols = katakana_symbols,
.items = (sizeof(katakana_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -856,203 +910,152 @@ static struct list_counter_style lcs_katakana_iroha = {
.name = "katakana-iroha",
.symbols = katakana_iroha_symbols,
.items = (sizeof(katakana_iroha_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
-/* exported interface defined in select.h */
-css_error css_computed_format_list_style(
- const css_computed_style *style,
- int value,
- char *buffer,
- size_t buffer_length,
- size_t *format_length)
+static const struct list_counter_style *
+counter_style_from_computed_style(const css_computed_style *style)
{
- uint8_t type = get_list_style_type(style);
-
- size_t alen;
- uint8_t aval[20];
- const struct list_counter_style *cstyle;
-
- switch (type) {
+ switch (get_list_style_type(style)) {
case CSS_LIST_STYLE_TYPE_DISC:
- cstyle = &lcs_disc;
- break;
-
+ return &lcs_disc;
case CSS_LIST_STYLE_TYPE_CIRCLE:
- cstyle = &lcs_circle;
- break;
-
+ return &lcs_circle;
case CSS_LIST_STYLE_TYPE_SQUARE:
- cstyle = &lcs_square;
- break;
-
+ return &lcs_square;
case CSS_LIST_STYLE_TYPE_DECIMAL:
- cstyle = &lcs_decimal;
- break;
-
+ return &lcs_decimal;
case CSS_LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO:
- cstyle = &lcs_decimal_leading_zero;
- break;
-
+ return &lcs_decimal_leading_zero;
case CSS_LIST_STYLE_TYPE_LOWER_ROMAN:
- cstyle = &lcs_lower_roman;
- break;
-
+ return &lcs_lower_roman;
case CSS_LIST_STYLE_TYPE_UPPER_ROMAN:
- cstyle = &lcs_upper_roman;
- break;
-
+ return &lcs_upper_roman;
case CSS_LIST_STYLE_TYPE_LOWER_GREEK:
- cstyle = &lcs_lower_greek;
- break;
-
+ return &lcs_lower_greek;
case CSS_LIST_STYLE_TYPE_LOWER_ALPHA:
case CSS_LIST_STYLE_TYPE_LOWER_LATIN:
- cstyle = &lcs_lower_alpha;
- break;
-
+ return &lcs_lower_alpha;
case CSS_LIST_STYLE_TYPE_UPPER_ALPHA:
case CSS_LIST_STYLE_TYPE_UPPER_LATIN:
- cstyle = &lcs_upper_alpha;
- break;
-
+ return &lcs_upper_alpha;
case CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN:
case CSS_LIST_STYLE_TYPE_ARMENIAN:
- cstyle = &lcs_upper_armenian;
- break;
-
+ return &lcs_upper_armenian;
case CSS_LIST_STYLE_TYPE_GEORGIAN:
- cstyle = &lcs_georgian;
- break;
-
+ return &lcs_georgian;
case CSS_LIST_STYLE_TYPE_NONE:
- *format_length = 0;
- return CSS_OK;
-
+ return NULL;
case CSS_LIST_STYLE_TYPE_BINARY:
- cstyle = &lcs_binary;
- break;
-
+ return &lcs_binary;
case CSS_LIST_STYLE_TYPE_OCTAL:
- cstyle = &lcs_octal;
- break;
-
+ return &lcs_octal;
case CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL:
- cstyle = &lcs_lower_hexadecimal;
- break;
-
+ return &lcs_lower_hexadecimal;
case CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL:
- cstyle = &lcs_upper_hexadecimal;
- break;
-
+ return &lcs_upper_hexadecimal;
case CSS_LIST_STYLE_TYPE_ARABIC_INDIC:
- cstyle = &lcs_arabic_indic;
- break;
-
+ return &lcs_arabic_indic;
case CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN:
- cstyle = &lcs_lower_armenian;
- break;
-
+ return &lcs_lower_armenian;
case CSS_LIST_STYLE_TYPE_BENGALI:
- cstyle = &lcs_bengali;
- break;
-
+ return &lcs_bengali;
case CSS_LIST_STYLE_TYPE_CAMBODIAN:
case CSS_LIST_STYLE_TYPE_KHMER:
- cstyle = &lcs_cambodian;
- break;
-
+ return &lcs_cambodian;
case CSS_LIST_STYLE_TYPE_CJK_DECIMAL:
- cstyle = &lcs_cjk_decimal;
- break;
-
+ return &lcs_cjk_decimal;
case CSS_LIST_STYLE_TYPE_DEVANAGARI:
- cstyle = &lcs_devanagari;
- break;
-
+ return &lcs_devanagari;
case CSS_LIST_STYLE_TYPE_GUJARATI:
- cstyle = &lcs_gujarati;
- break;
-
+ return &lcs_gujarati;
case CSS_LIST_STYLE_TYPE_GURMUKHI:
- cstyle = &lcs_gurmukhi;
- break;
-
+ return &lcs_gurmukhi;
case CSS_LIST_STYLE_TYPE_HEBREW:
- cstyle = &lcs_hebrew;
- break;
+ return &lcs_hebrew;
case CSS_LIST_STYLE_TYPE_KANNADA:
- cstyle = &lcs_kannada;
- break;
+ return &lcs_kannada;
case CSS_LIST_STYLE_TYPE_LAO:
- cstyle = &lcs_lao;
- break;
+ return &lcs_lao;
case CSS_LIST_STYLE_TYPE_MALAYALAM:
- cstyle = &lcs_malayalam;
- break;
+ return &lcs_malayalam;
case CSS_LIST_STYLE_TYPE_MONGOLIAN:
- cstyle = &lcs_mongolian;
- break;
+ return &lcs_mongolian;
case CSS_LIST_STYLE_TYPE_MYANMAR:
- cstyle = &lcs_myanmar;
- break;
+ return &lcs_myanmar;
case CSS_LIST_STYLE_TYPE_ORIYA:
- cstyle = &lcs_oriya;
- break;
+ return &lcs_oriya;
case CSS_LIST_STYLE_TYPE_PERSIAN:
- cstyle = &lcs_persian;
- break;
+ return &lcs_persian;
case CSS_LIST_STYLE_TYPE_TAMIL:
- cstyle = &lcs_tamil;
- break;
+ return &lcs_tamil;
case CSS_LIST_STYLE_TYPE_TELUGU:
- cstyle = &lcs_telugu;
- break;
+ return &lcs_telugu;
case CSS_LIST_STYLE_TYPE_THAI:
- cstyle = &lcs_thai;
- break;
+ return &lcs_thai;
case CSS_LIST_STYLE_TYPE_TIBETAN:
- cstyle = &lcs_tibetan;
- break;
+ return &lcs_tibetan;
case CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH:
- cstyle = &lcs_cjk_earthly_branch;
- break;
+ return &lcs_cjk_earthly_branch;
case CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM:
- cstyle = &lcs_cjk_heavenly_stem;
- break;
+ return &lcs_cjk_heavenly_stem;
case CSS_LIST_STYLE_TYPE_HIAGANA:
- cstyle = &lcs_hiragana;
- break;
+ return &lcs_hiragana;
case CSS_LIST_STYLE_TYPE_HIAGANA_IROHA:
- cstyle = &lcs_hiragana_iroha;
- break;
+ return &lcs_hiragana_iroha;
case CSS_LIST_STYLE_TYPE_KATAKANA:
- cstyle = &lcs_katakana;
- break;
+ return &lcs_katakana;
case CSS_LIST_STYLE_TYPE_KATAKANA_IROHA:
- cstyle = &lcs_katakana_iroha;
- break;
- default:
+ return &lcs_katakana_iroha;
+ }
+ return NULL;
+}
+
+
+/* exported interface defined in select.h */
+css_error css_computed_format_list_style(
+ const css_computed_style *style,
+ int value,
+ char *buffer,
+ size_t buffer_length,
+ size_t *format_length)
+{
+ uint8_t aval[20];
+ const struct list_counter_style *cstyle;
+ struct numeric nval = {
+ .val = aval,
+ .len = sizeof(aval),
+ .used = 0,
+ .negative = false
+ };
+
+ nval.negative = (value < 0)?true:false;
+
+ cstyle = counter_style_from_computed_style(style);
+ if (cstyle == NULL) {
return CSS_BADPARM;
}
- alen = cstyle->calc(aval, sizeof(aval), value, cstyle);
+ nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
/* ensure it is possible to calculate with the selected system */
- if ((alen == 0) || (alen >= sizeof(aval))) {
+ if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
/* retry in decimal */
cstyle = &lcs_decimal;
- alen = cstyle->calc(aval, sizeof(aval), value, cstyle);
- if ((alen == 0) || (alen >= sizeof(aval))) {
+ nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
+ if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
/* failed in decimal, give up */
return CSS_INVALID;
}
}
- *format_length = map_aval_to_symbols(buffer, buffer_length, aval, alen, cstyle);
+ *format_length = nval_to_symbols(&nval,
+ cstyle,
+ buffer,
+ buffer_length);
return CSS_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/select/format_list_style.c | 319 ++++++++++++++++++++--------------------
1 file changed, 161 insertions(+), 158 deletions(-)
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 8636c03..46861a4 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -21,8 +21,12 @@ struct list_counter_style {
const unsigned int length;
const symbol_t value;
} pad;
+ struct {
+ const char *pre;
+ const char *post;
+ } negative;
const char *prefix;
- const char *postfix;
+ const char *suffix;
const symbol_t *symbols; /**< array of symbols which represent this style */
const int *weights; /**< symbol weights for additive schemes */
const size_t items; /**< items in symbol and weight table */
@@ -30,6 +34,16 @@ struct list_counter_style {
};
/**
+ * numeric representation of the value using a system
+ */
+struct numeric {
+ uint8_t *val; /* buffer containing the numeric values */
+ size_t len; /* length of alen */
+ size_t used; /* number of numeric values used */
+ bool negative; /* if the value is negative */
+};
+
+/**
* Copy a null-terminated UTF-8 string to buffer at offset, if there is space
*
* \param[in] buf The output buffer
@@ -82,12 +96,12 @@ copy_symbol(char *buf, const size_t buflen, size_t pos, const symbol_t symbol)
}
/**
- * maps alphabet values to output values with a symbol table
+ * maps numeric values to output values with a symbol table
*
- * Takes a list of alphabet values and for each one outputs the
+ * Takes a list of numeric values and for each one outputs the
* compete symbol (in utf8) to an output buffer.
*
- * \param buf The oputput buffer
+ * \param buf The output buffer
* \param buflen the length of \a buf
* \param aval array of alphabet values
* \param alen The number of values in \a alen
@@ -97,33 +111,53 @@ copy_symbol(char *buf, const size_t buflen, size_t pos, const symbol_t symbol)
* larger than \a buflen but the buffer will not be overrun
*/
static size_t
-map_aval_to_symbols(char *buf, const size_t buflen,
- const uint8_t *aval, const size_t alen,
- const struct list_counter_style *cstyle)
+nval_to_symbols(struct numeric *nval,
+ const struct list_counter_style *cstyle,
+ char *buf, const size_t buflen)
{
size_t oidx = 0;
size_t aidx; /* numeral index */
- const symbol_t postfix = "."; /* default postfix string */
+ const char *suffix = "."; /* default sufffix string */
+ const char *negative_pre = "-"; /* default negative string */
+
+ /* prefix */
+ if (cstyle->prefix != NULL) {
+ oidx += copy_string(buf, buflen, oidx, cstyle->prefix);
+ }
+
+ /* negative pre */
+ if (nval->negative) {
+ if (cstyle->negative.pre != NULL) {
+ negative_pre = cstyle->negative.pre;
+ }
+ oidx += copy_string(buf, buflen, oidx, negative_pre);
+ }
/* add padding if required */
- if (alen < cstyle->pad.length) {
+ if (nval->used < cstyle->pad.length) {
size_t pidx; /* padding index */
- for (pidx=cstyle->pad.length - alen; pidx > 0; pidx--) {
+ for (pidx = cstyle->pad.length - nval->used; pidx > 0; pidx--) {
oidx += copy_symbol(buf, buflen, oidx,
cstyle->pad.value);
}
}
/* map symbols */
- for (aidx=0; aidx < alen; aidx++) {
+ for (aidx=0; aidx < nval->used; aidx++) {
oidx += copy_symbol(buf, buflen, oidx,
- cstyle->symbols[aval[aidx]]);
+ cstyle->symbols[nval->val[aidx]]);
}
- /* postfix */
- oidx += copy_string(buf, buflen, oidx,
- (cstyle->postfix != NULL) ?
- cstyle->postfix : postfix);
+ /* negative post */
+ if ((nval->negative) && (cstyle->negative.post != NULL)) {
+ oidx += copy_string(buf, buflen, oidx, cstyle->negative.post);
+ }
+
+ /* suffix */
+ if (cstyle->suffix != NULL) {
+ suffix = cstyle->suffix;
+ }
+ oidx += copy_string(buf, buflen, oidx, suffix);
return oidx;
}
@@ -150,6 +184,16 @@ calc_numeric_system(uint8_t *ares,
uint8_t *first;
uint8_t *last;
+ if (value == 0) {
+ if (alen >= 1) {
+ ares[0] = 0;
+ }
+ return 1;
+ }
+
+ value = abs(value);
+
+
/* generate alphabet values in ascending order */
while (value > 0) {
if (idx < alen) {
@@ -230,6 +274,16 @@ calc_additive_system(uint8_t *ares,
size_t idx;
size_t times; /* number of times a weight occours */
+ /* ensure value is within acceptable range of this system */
+ if ((value < cstyle->range.start) || (value > cstyle->range.end)) {
+ return 0;
+ }
+
+ /* implementation cannot cope with negatives */
+ if (value < 1) {
+ return 0;
+ }
+
/* iterate over the available weights */
for (widx = 0; widx < cstyle->items;widx++) {
times = value / cstyle->weights[widx];
@@ -525,7 +579,7 @@ static const struct list_counter_style lcs_disc = {
.name = "disc",
.symbols = disc_symbols,
.items = (sizeof(disc_symbols) / SYMBOL_SIZE),
- .postfix = " ",
+ .suffix = " ",
.calc = calc_cyclic_system,
};
@@ -534,7 +588,7 @@ static const struct list_counter_style lcs_circle = {
.name = "circle",
.symbols = circle_symbols,
.items = (sizeof(circle_symbols) / SYMBOL_SIZE),
- .postfix = " ",
+ .suffix = " ",
.calc = calc_cyclic_system,
};
@@ -543,7 +597,7 @@ static const struct list_counter_style lcs_square = {
.name = "square",
.symbols = square_symbols,
.items = (sizeof(square_symbols) / SYMBOL_SIZE),
- .postfix = " ",
+ .suffix = " ",
.calc = calc_cyclic_system,
};
@@ -624,7 +678,7 @@ static const symbol_t cjk_decimal_symbols[] = {
static const struct list_counter_style lcs_cjk_decimal = {
.name = "cjk-decimal",
.symbols = cjk_decimal_symbols,
- .postfix = "���",
+ .suffix = "���",
.items = (sizeof(cjk_decimal_symbols) / SYMBOL_SIZE),
.calc = calc_numeric_system,
};
@@ -679,7 +733,7 @@ static const struct list_counter_style lcs_hebrew = {
.start = 1,
.end = 10999,},
.symbols = hebrew_symbols,
- .weights = hebrew_weights,
+ .weights = hebrew_weights,
.items = (sizeof(hebrew_symbols) / SYMBOL_SIZE),
.calc = calc_additive_system,
};
@@ -801,7 +855,7 @@ static struct list_counter_style lcs_cjk_earthly_branch = {
.name = "cjk-earthly-branch",
.symbols = cjk_earthly_branch_symbols,
.items = (sizeof(cjk_earthly_branch_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -812,7 +866,7 @@ static struct list_counter_style lcs_cjk_heavenly_stem = {
.name = "cjk-heavenly-stem",
.symbols = cjk_heavenly_stem_symbols,
.items = (sizeof(cjk_heavenly_stem_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -823,7 +877,7 @@ static struct list_counter_style lcs_hiragana = {
.name = "hiragana",
.symbols = hiragana_symbols,
.items = (sizeof(hiragana_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -834,7 +888,7 @@ static struct list_counter_style lcs_hiragana_iroha = {
.name = "hiragana-iroha",
.symbols = hiragana_iroha_symbols,
.items = (sizeof(hiragana_iroha_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -845,7 +899,7 @@ static struct list_counter_style lcs_katakana = {
.name = "katakana",
.symbols = katakana_symbols,
.items = (sizeof(katakana_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
@@ -856,203 +910,152 @@ static struct list_counter_style lcs_katakana_iroha = {
.name = "katakana-iroha",
.symbols = katakana_iroha_symbols,
.items = (sizeof(katakana_iroha_symbols) / SYMBOL_SIZE),
- .postfix = "���",
+ .suffix = "���",
.calc = calc_alphabet_system,
};
-/* exported interface defined in select.h */
-css_error css_computed_format_list_style(
- const css_computed_style *style,
- int value,
- char *buffer,
- size_t buffer_length,
- size_t *format_length)
+static const struct list_counter_style *
+counter_style_from_computed_style(const css_computed_style *style)
{
- uint8_t type = get_list_style_type(style);
-
- size_t alen;
- uint8_t aval[20];
- const struct list_counter_style *cstyle;
-
- switch (type) {
+ switch (get_list_style_type(style)) {
case CSS_LIST_STYLE_TYPE_DISC:
- cstyle = &lcs_disc;
- break;
-
+ return &lcs_disc;
case CSS_LIST_STYLE_TYPE_CIRCLE:
- cstyle = &lcs_circle;
- break;
-
+ return &lcs_circle;
case CSS_LIST_STYLE_TYPE_SQUARE:
- cstyle = &lcs_square;
- break;
-
+ return &lcs_square;
case CSS_LIST_STYLE_TYPE_DECIMAL:
- cstyle = &lcs_decimal;
- break;
-
+ return &lcs_decimal;
case CSS_LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO:
- cstyle = &lcs_decimal_leading_zero;
- break;
-
+ return &lcs_decimal_leading_zero;
case CSS_LIST_STYLE_TYPE_LOWER_ROMAN:
- cstyle = &lcs_lower_roman;
- break;
-
+ return &lcs_lower_roman;
case CSS_LIST_STYLE_TYPE_UPPER_ROMAN:
- cstyle = &lcs_upper_roman;
- break;
-
+ return &lcs_upper_roman;
case CSS_LIST_STYLE_TYPE_LOWER_GREEK:
- cstyle = &lcs_lower_greek;
- break;
-
+ return &lcs_lower_greek;
case CSS_LIST_STYLE_TYPE_LOWER_ALPHA:
case CSS_LIST_STYLE_TYPE_LOWER_LATIN:
- cstyle = &lcs_lower_alpha;
- break;
-
+ return &lcs_lower_alpha;
case CSS_LIST_STYLE_TYPE_UPPER_ALPHA:
case CSS_LIST_STYLE_TYPE_UPPER_LATIN:
- cstyle = &lcs_upper_alpha;
- break;
-
+ return &lcs_upper_alpha;
case CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN:
case CSS_LIST_STYLE_TYPE_ARMENIAN:
- cstyle = &lcs_upper_armenian;
- break;
-
+ return &lcs_upper_armenian;
case CSS_LIST_STYLE_TYPE_GEORGIAN:
- cstyle = &lcs_georgian;
- break;
-
+ return &lcs_georgian;
case CSS_LIST_STYLE_TYPE_NONE:
- *format_length = 0;
- return CSS_OK;
-
+ return NULL;
case CSS_LIST_STYLE_TYPE_BINARY:
- cstyle = &lcs_binary;
- break;
-
+ return &lcs_binary;
case CSS_LIST_STYLE_TYPE_OCTAL:
- cstyle = &lcs_octal;
- break;
-
+ return &lcs_octal;
case CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL:
- cstyle = &lcs_lower_hexadecimal;
- break;
-
+ return &lcs_lower_hexadecimal;
case CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL:
- cstyle = &lcs_upper_hexadecimal;
- break;
-
+ return &lcs_upper_hexadecimal;
case CSS_LIST_STYLE_TYPE_ARABIC_INDIC:
- cstyle = &lcs_arabic_indic;
- break;
-
+ return &lcs_arabic_indic;
case CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN:
- cstyle = &lcs_lower_armenian;
- break;
-
+ return &lcs_lower_armenian;
case CSS_LIST_STYLE_TYPE_BENGALI:
- cstyle = &lcs_bengali;
- break;
-
+ return &lcs_bengali;
case CSS_LIST_STYLE_TYPE_CAMBODIAN:
case CSS_LIST_STYLE_TYPE_KHMER:
- cstyle = &lcs_cambodian;
- break;
-
+ return &lcs_cambodian;
case CSS_LIST_STYLE_TYPE_CJK_DECIMAL:
- cstyle = &lcs_cjk_decimal;
- break;
-
+ return &lcs_cjk_decimal;
case CSS_LIST_STYLE_TYPE_DEVANAGARI:
- cstyle = &lcs_devanagari;
- break;
-
+ return &lcs_devanagari;
case CSS_LIST_STYLE_TYPE_GUJARATI:
- cstyle = &lcs_gujarati;
- break;
-
+ return &lcs_gujarati;
case CSS_LIST_STYLE_TYPE_GURMUKHI:
- cstyle = &lcs_gurmukhi;
- break;
-
+ return &lcs_gurmukhi;
case CSS_LIST_STYLE_TYPE_HEBREW:
- cstyle = &lcs_hebrew;
- break;
+ return &lcs_hebrew;
case CSS_LIST_STYLE_TYPE_KANNADA:
- cstyle = &lcs_kannada;
- break;
+ return &lcs_kannada;
case CSS_LIST_STYLE_TYPE_LAO:
- cstyle = &lcs_lao;
- break;
+ return &lcs_lao;
case CSS_LIST_STYLE_TYPE_MALAYALAM:
- cstyle = &lcs_malayalam;
- break;
+ return &lcs_malayalam;
case CSS_LIST_STYLE_TYPE_MONGOLIAN:
- cstyle = &lcs_mongolian;
- break;
+ return &lcs_mongolian;
case CSS_LIST_STYLE_TYPE_MYANMAR:
- cstyle = &lcs_myanmar;
- break;
+ return &lcs_myanmar;
case CSS_LIST_STYLE_TYPE_ORIYA:
- cstyle = &lcs_oriya;
- break;
+ return &lcs_oriya;
case CSS_LIST_STYLE_TYPE_PERSIAN:
- cstyle = &lcs_persian;
- break;
+ return &lcs_persian;
case CSS_LIST_STYLE_TYPE_TAMIL:
- cstyle = &lcs_tamil;
- break;
+ return &lcs_tamil;
case CSS_LIST_STYLE_TYPE_TELUGU:
- cstyle = &lcs_telugu;
- break;
+ return &lcs_telugu;
case CSS_LIST_STYLE_TYPE_THAI:
- cstyle = &lcs_thai;
- break;
+ return &lcs_thai;
case CSS_LIST_STYLE_TYPE_TIBETAN:
- cstyle = &lcs_tibetan;
- break;
+ return &lcs_tibetan;
case CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH:
- cstyle = &lcs_cjk_earthly_branch;
- break;
+ return &lcs_cjk_earthly_branch;
case CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM:
- cstyle = &lcs_cjk_heavenly_stem;
- break;
+ return &lcs_cjk_heavenly_stem;
case CSS_LIST_STYLE_TYPE_HIAGANA:
- cstyle = &lcs_hiragana;
- break;
+ return &lcs_hiragana;
case CSS_LIST_STYLE_TYPE_HIAGANA_IROHA:
- cstyle = &lcs_hiragana_iroha;
- break;
+ return &lcs_hiragana_iroha;
case CSS_LIST_STYLE_TYPE_KATAKANA:
- cstyle = &lcs_katakana;
- break;
+ return &lcs_katakana;
case CSS_LIST_STYLE_TYPE_KATAKANA_IROHA:
- cstyle = &lcs_katakana_iroha;
- break;
- default:
+ return &lcs_katakana_iroha;
+ }
+ return NULL;
+}
+
+
+/* exported interface defined in select.h */
+css_error css_computed_format_list_style(
+ const css_computed_style *style,
+ int value,
+ char *buffer,
+ size_t buffer_length,
+ size_t *format_length)
+{
+ uint8_t aval[20];
+ const struct list_counter_style *cstyle;
+ struct numeric nval = {
+ .val = aval,
+ .len = sizeof(aval),
+ .used = 0,
+ .negative = false
+ };
+
+ nval.negative = (value < 0)?true:false;
+
+ cstyle = counter_style_from_computed_style(style);
+ if (cstyle == NULL) {
return CSS_BADPARM;
}
- alen = cstyle->calc(aval, sizeof(aval), value, cstyle);
+ nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
/* ensure it is possible to calculate with the selected system */
- if ((alen == 0) || (alen >= sizeof(aval))) {
+ if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
/* retry in decimal */
cstyle = &lcs_decimal;
- alen = cstyle->calc(aval, sizeof(aval), value, cstyle);
- if ((alen == 0) || (alen >= sizeof(aval))) {
+ nval.used = cstyle->calc(aval, sizeof(aval), value, cstyle);
+ if ((nval.used == 0) || (nval.used >= sizeof(aval))) {
/* failed in decimal, give up */
return CSS_INVALID;
}
}
- *format_length = map_aval_to_symbols(buffer, buffer_length, aval, alen, cstyle);
+ *format_length = nval_to_symbols(&nval,
+ cstyle,
+ buffer,
+ buffer_length);
return CSS_OK;
}
--
Cascading Style Sheets library
1 year, 11 months
netsurf-test: branch master updated. e271bc41b3a8820d57b4d1fec95495a194d30849
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-test.git/shortlog/e271bc41b3a8820d...
...commit http://git.netsurf-browser.org/netsurf-test.git/commit/e271bc41b3a8820d57...
...tree http://git.netsurf-browser.org/netsurf-test.git/tree/e271bc41b3a8820d57b4...
The branch, master has been updated
via e271bc41b3a8820d57b4d1fec95495a194d30849 (commit)
from 0ed395f733752fb58a77c7cc20922dedba2944f2 (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/netsurf-test.git/commit/?id=e271bc41b3a882...
commit e271bc41b3a8820d57b4d1fec95495a194d30849
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
add start and reversed parameters to ordered list generator cgi
diff --git a/cgi-bin/ordered-list.cgi b/cgi-bin/ordered-list.cgi
index 6548699..838e81d 100755
--- a/cgi-bin/ordered-list.cgi
+++ b/cgi-bin/ordered-list.cgi
@@ -25,15 +25,25 @@ def main():
liststyle = 'decimal'
listcount = 1000
+ liststart = 1
+ listreverse = 0
+ # get cgi parameters
if 'liststyle' in params and re.match('^[A-Za-z0-9-]+$', params['liststyle'].value):
liststyle = params['liststyle'].value
if 'listcount' in params and re.match('^[0-9]+$', params['listcount'].value):
listcount = int(params['listcount'].value)
- if listcount > 10000:
- listcount = 10000
+ if 'liststart' in params and re.match('^[0-9-]+$', params['liststart'].value):
+ liststart = int(params['liststart'].value)
+
+ if 'listreverse' in params and re.match('^[0-1]+$', params['listreverse'].value):
+ listreverse = int(params['listreverse'].value)
+
+ # ensure count is reasonable
+ if listcount > 100000:
+ listcount = 100000
print('Content-Type: text/html')
print('')
@@ -47,8 +57,13 @@ def main():
print('</head>')
print('<body>')
print('<h1>ordered list marker test with',liststyle,'style</h1>')
- print('<ol class="a">')
- for num in range(1, listcount):
+ print('<ol class="a"', end='')
+ if liststart != 1:
+ print(' start="{}"'.format(liststart), end='')
+ if listreverse != 0:
+ print(' reversed', end='')
+ print('>')
+ for num in range(liststart, (liststart + listcount)):
print('<li>',num,'</li>', sep="")
print('</ol>')
-----------------------------------------------------------------------
Summary of changes:
cgi-bin/ordered-list.cgi | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/cgi-bin/ordered-list.cgi b/cgi-bin/ordered-list.cgi
index 6548699..838e81d 100755
--- a/cgi-bin/ordered-list.cgi
+++ b/cgi-bin/ordered-list.cgi
@@ -25,15 +25,25 @@ def main():
liststyle = 'decimal'
listcount = 1000
+ liststart = 1
+ listreverse = 0
+ # get cgi parameters
if 'liststyle' in params and re.match('^[A-Za-z0-9-]+$', params['liststyle'].value):
liststyle = params['liststyle'].value
if 'listcount' in params and re.match('^[0-9]+$', params['listcount'].value):
listcount = int(params['listcount'].value)
- if listcount > 10000:
- listcount = 10000
+ if 'liststart' in params and re.match('^[0-9-]+$', params['liststart'].value):
+ liststart = int(params['liststart'].value)
+
+ if 'listreverse' in params and re.match('^[0-1]+$', params['listreverse'].value):
+ listreverse = int(params['listreverse'].value)
+
+ # ensure count is reasonable
+ if listcount > 100000:
+ listcount = 100000
print('Content-Type: text/html')
print('')
@@ -47,8 +57,13 @@ def main():
print('</head>')
print('<body>')
print('<h1>ordered list marker test with',liststyle,'style</h1>')
- print('<ol class="a">')
- for num in range(1, listcount):
+ print('<ol class="a"', end='')
+ if liststart != 1:
+ print(' start="{}"'.format(liststart), end='')
+ if listreverse != 0:
+ print(' reversed', end='')
+ print('>')
+ for num in range(liststart, (liststart + listcount)):
print('<li>',num,'</li>', sep="")
print('</ol>')
--
NetSurf test cases
1 year, 11 months
libcss: branch master updated. release/0.9.1-14-ged2a8a5
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/ed2a8a561a2062fc7a5ae4...
...commit http://git.netsurf-browser.org/libcss.git/commit/ed2a8a561a2062fc7a5ae412...
...tree http://git.netsurf-browser.org/libcss.git/tree/ed2a8a561a2062fc7a5ae412e6...
The branch, master has been updated
via ed2a8a561a2062fc7a5ae412e651203da9e942cf (commit)
from 7e7bb2cde575d6ce2c01231b7759fe30c918b400 (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=ed2a8a561a2062fc7a5a...
commit ed2a8a561a2062fc7a5ae412e651203da9e942cf
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Initialise the string map with a better macro
To avoid duplicating the string for every string map entry use a
simple macro.
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 5528645..a2d9175 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -10,6 +10,10 @@
#include <assert.h>
+/** build string map entry with a string constant */
+#define SMAP(s) { s, (sizeof((s)) - 1) /* -1 for '\0' */ }
+
+
typedef struct stringmap_entry {
const char *data;
size_t len;
@@ -24,608 +28,608 @@ static css__propstrings_ctx css__propstrings;
/* Must be synchronised with enum in propstrings.h */
const stringmap_entry stringmap[LAST_KNOWN] = {
- { "*", SLEN("*") },
+ SMAP("*"),
- { ":", SLEN(":") },
- { ",", SLEN(",") },
- { ";", SLEN(";") },
- { "{", SLEN("{") },
- { "}", SLEN("}") },
- { "0", SLEN("0") },
+ SMAP(":"),
+ SMAP(","),
+ SMAP(";"),
+ SMAP("{"),
+ SMAP("}"),
+ SMAP("0"),
- { "charset", SLEN("charset") },
- { "import", SLEN("import") },
- { "media", SLEN("media") },
- { "namespace", SLEN("namespace") },
- { "font-face", SLEN("font-face") },
- { "page", SLEN("page") },
+ SMAP("charset"),
+ SMAP("import"),
+ SMAP("media"),
+ SMAP("namespace"),
+ SMAP("font-face"),
+ SMAP("page"),
- { "aural", SLEN("aural") },
- { "braille", SLEN("braille") },
- { "embossed", SLEN("embossed") },
- { "handheld", SLEN("handheld") },
- { "print", SLEN("print") },
- { "projection", SLEN("projection") },
- { "screen", SLEN("screen") },
- { "speech", SLEN("speech") },
- { "tty", SLEN("tty") },
- { "tv", SLEN("tv") },
- { "all", SLEN("all") },
+ SMAP("aural"),
+ SMAP("braille"),
+ SMAP("embossed"),
+ SMAP("handheld"),
+ SMAP("print"),
+ SMAP("projection"),
+ SMAP("screen"),
+ SMAP("speech"),
+ SMAP("tty"),
+ SMAP("tv"),
+ SMAP("all"),
- { "first-child", SLEN("first-child") },
- { "link", SLEN("link") },
- { "visited", SLEN("visited") },
- { "hover", SLEN("hover") },
- { "active", SLEN("active") },
- { "focus", SLEN("focus") },
- { "lang", SLEN("lang") },
- { "first", SLEN("first") },
- { "root", SLEN("root") },
- { "nth-child", SLEN("nth-child") },
- { "nth-last-child", SLEN("nth-last-child") },
- { "nth-of-type", SLEN("nth-of-type") },
- { "nth-last-of-type", SLEN("nth-last-of-type") },
- { "last-child", SLEN("last-child") },
- { "first-of-type", SLEN("first-of-type") },
- { "last-of-type", SLEN("last-of-type") },
- { "only-child", SLEN("only-child") },
- { "only-of-type", SLEN("only-of-type") },
- { "empty", SLEN("empty") },
- { "target", SLEN("target") },
- { "enabled", SLEN("enabled") },
- { "disabled", SLEN("disabled") },
- { "checked", SLEN("checked") },
- { "not", SLEN("not") },
+ SMAP("first-child"),
+ SMAP("link"),
+ SMAP("visited"),
+ SMAP("hover"),
+ SMAP("active"),
+ SMAP("focus"),
+ SMAP("lang"),
+ SMAP("first"),
+ SMAP("root"),
+ SMAP("nth-child"),
+ SMAP("nth-last-child"),
+ SMAP("nth-of-type"),
+ SMAP("nth-last-of-type"),
+ SMAP("last-child"),
+ SMAP("first-of-type"),
+ SMAP("last-of-type"),
+ SMAP("only-child"),
+ SMAP("only-of-type"),
+ SMAP("empty"),
+ SMAP("target"),
+ SMAP("enabled"),
+ SMAP("disabled"),
+ SMAP("checked"),
+ SMAP("not"),
- { "first-line", SLEN("first-line") },
- { "first-letter", SLEN("first-letter") },
- { "before", SLEN("before") },
- { "after", SLEN("after") },
+ SMAP("first-line"),
+ SMAP("first-letter"),
+ SMAP("before"),
+ SMAP("after"),
- { "align-content", SLEN("align-content") },
- { "align-items", SLEN("align-items") },
- { "align-self", SLEN("align-self") },
- { "azimuth", SLEN("azimuth") },
- { "background", SLEN("background") },
- { "background-attachment", SLEN("background-attachment") },
- { "background-color", SLEN("background-color") },
- { "background-image", SLEN("background-image") },
- { "background-position", SLEN("background-position") },
- { "background-repeat", SLEN("background-repeat") },
- { "border", SLEN("border") },
- { "border-bottom", SLEN("border-bottom") },
- { "border-bottom-color", SLEN("border-bottom-color") },
- { "border-bottom-style", SLEN("border-bottom-style") },
- { "border-bottom-width", SLEN("border-bottom-width") },
- { "border-collapse", SLEN("border-collapse") },
- { "border-color", SLEN("border-color") },
- { "border-left", SLEN("border-left") },
- { "border-left-color", SLEN("border-left-color") },
- { "border-left-style", SLEN("border-left-style") },
- { "border-left-width", SLEN("border-left-width") },
- { "border-right", SLEN("border-right") },
- { "border-right-color", SLEN("border-right-color") },
- { "border-right-style", SLEN("border-right-style") },
- { "border-right-width", SLEN("border-right-width") },
- { "border-spacing", SLEN("border-spacing") },
- { "border-style", SLEN("border-style") },
- { "border-top", SLEN("border-top") },
- { "border-top-color", SLEN("border-top-color") },
- { "border-top-style", SLEN("border-top-style") },
- { "border-top-width", SLEN("border-top-width") },
- { "border-width", SLEN("border-width") },
- { "bottom", SLEN("bottom") },
- { "box-sizing", SLEN("box-sizing") },
- { "break-after", SLEN("break-after") },
- { "break-before", SLEN("break-before") },
- { "break-inside", SLEN("break-inside") },
- { "caption-side", SLEN("caption-side") },
- { "clear", SLEN("clear") },
- { "clip", SLEN("clip") },
- { "color", SLEN("color") },
- { "columns", SLEN("columns") },
- { "column-count", SLEN("column-count") },
- { "column-fill", SLEN("column-fill") },
- { "column-gap", SLEN("column-gap") },
- { "column-rule", SLEN("column-rule") },
- { "column-rule-color", SLEN("column-rule-color") },
- { "column-rule-style", SLEN("column-rule-style") },
- { "column-rule-width", SLEN("column-rule_width") },
- { "column-span", SLEN("column-span") },
- { "column-width", SLEN("column-width") },
- { "content", SLEN("content") },
- { "counter-increment", SLEN("counter-increment") },
- { "counter-reset", SLEN("counter-reset") },
- { "cue", SLEN("cue") },
- { "cue-after", SLEN("cue-after") },
- { "cue-before", SLEN("cue-before") },
- { "cursor", SLEN("cursor") },
- { "direction", SLEN("direction") },
- { "display", SLEN("display") },
- { "elevation", SLEN("elevation") },
- { "empty-cells", SLEN("empty-cells") },
- { "flex", SLEN("flex") },
- { "flex-basis", SLEN("flex-basis") },
- { "flex-direction", SLEN("flex-direction") },
- { "flex-flow", SLEN("flex-flow") },
- { "flex-grow", SLEN("flex-grow") },
- { "flex-shrink", SLEN("flex-shrink") },
- { "flex-wrap", SLEN("flex-wrap") },
- { "float", SLEN("float") },
- { "font", SLEN("font") },
- { "font-family", SLEN("font-family") },
- { "font-size", SLEN("font-size") },
- { "font-style", SLEN("font-style") },
- { "font-variant", SLEN("font-variant") },
- { "font-weight", SLEN("font-weight") },
- { "height", SLEN("height") },
- { "justify-content", SLEN("justify-content") },
- { "left", SLEN("left") },
- { "letter-spacing", SLEN("letter-spacing") },
- { "line-height", SLEN("line-height") },
- { "list-style", SLEN("list-style") },
- { "list-style-image", SLEN("list-style-image") },
- { "list-style-position", SLEN("list-style-position") },
- { "list-style-type", SLEN("list-style-type") },
- { "margin", SLEN("margin") },
- { "margin-bottom", SLEN("margin-bottom") },
- { "margin-left", SLEN("margin-left") },
- { "margin-right", SLEN("margin-right") },
- { "margin-top", SLEN("margin-top") },
- { "max-height", SLEN("max-height") },
- { "max-width", SLEN("max-width") },
- { "min-height", SLEN("min-height") },
- { "min-width", SLEN("min-width") },
- { "opacity", SLEN("opacity") },
- { "order", SLEN("order") },
- { "orphans", SLEN("orphans") },
- { "outline", SLEN("outline") },
- { "outline-color", SLEN("outline-color") },
- { "outline-style", SLEN("outline-style") },
- { "outline-width", SLEN("outline-width") },
- { "overflow", SLEN("overflow") },
- { "overflow-x", SLEN("overflow-x") },
- { "overflow-y", SLEN("overflow-y") },
- { "padding", SLEN("padding") },
- { "padding-bottom", SLEN("padding-bottom") },
- { "padding-left", SLEN("padding-left") },
- { "padding-right", SLEN("padding-right") },
- { "padding-top", SLEN("padding-top") },
- { "page-break-after", SLEN("page-break-after") },
- { "page-break-before", SLEN("page-break-before") },
- { "page-break-inside", SLEN("page-break-inside") },
- { "pause", SLEN("pause") },
- { "pause-after", SLEN("pause-after") },
- { "pause-before", SLEN("pause-before") },
- { "pitch-range", SLEN("pitch-range") },
- { "pitch", SLEN("pitch") },
- { "play-during", SLEN("play-during") },
- { "position", SLEN("position") },
- { "quotes", SLEN("quotes") },
- { "richness", SLEN("richness") },
- { "right", SLEN("right") },
- { "speak-header", SLEN("speak-header") },
- { "speak-numeral", SLEN("speak-numeral") },
- { "speak-punctuation", SLEN("speak-punctuation") },
- { "speak", SLEN("speak") },
- { "speech-rate", SLEN("speech-rate") },
- { "stress", SLEN("stress") },
- { "table-layout", SLEN("table-layout") },
- { "text-align", SLEN("text-align") },
- { "text-decoration", SLEN("text-decoration") },
- { "text-indent", SLEN("text-indent") },
- { "text-transform", SLEN("text-transform") },
- { "top", SLEN("top") },
- { "unicode-bidi", SLEN("unicode-bidi") },
- { "vertical-align", SLEN("vertical-align") },
- { "visibility", SLEN("visibility") },
- { "voice-family", SLEN("voice-family") },
- { "volume", SLEN("volume") },
- { "white-space", SLEN("white-space") },
- { "widows", SLEN("widows") },
- { "width", SLEN("width") },
- { "word-spacing", SLEN("word-spacing") },
- { "writing-mode", SLEN("writing-mode") },
- { "z-index", SLEN("z-index") },
+ SMAP("align-content"),
+ SMAP("align-items"),
+ SMAP("align-self"),
+ SMAP("azimuth"),
+ SMAP("background"),
+ SMAP("background-attachment"),
+ SMAP("background-color"),
+ SMAP("background-image"),
+ SMAP("background-position"),
+ SMAP("background-repeat"),
+ SMAP("border"),
+ SMAP("border-bottom"),
+ SMAP("border-bottom-color"),
+ SMAP("border-bottom-style"),
+ SMAP("border-bottom-width"),
+ SMAP("border-collapse"),
+ SMAP("border-color"),
+ SMAP("border-left"),
+ SMAP("border-left-color"),
+ SMAP("border-left-style"),
+ SMAP("border-left-width"),
+ SMAP("border-right"),
+ SMAP("border-right-color"),
+ SMAP("border-right-style"),
+ SMAP("border-right-width"),
+ SMAP("border-spacing"),
+ SMAP("border-style"),
+ SMAP("border-top"),
+ SMAP("border-top-color"),
+ SMAP("border-top-style"),
+ SMAP("border-top-width"),
+ SMAP("border-width"),
+ SMAP("bottom"),
+ SMAP("box-sizing"),
+ SMAP("break-after"),
+ SMAP("break-before"),
+ SMAP("break-inside"),
+ SMAP("caption-side"),
+ SMAP("clear"),
+ SMAP("clip"),
+ SMAP("color"),
+ SMAP("columns"),
+ SMAP("column-count"),
+ SMAP("column-fill"),
+ SMAP("column-gap"),
+ SMAP("column-rule"),
+ SMAP("column-rule-color"),
+ SMAP("column-rule-style"),
+ SMAP("column-rule-width"),
+ SMAP("column-span"),
+ SMAP("column-width"),
+ SMAP("content"),
+ SMAP("counter-increment"),
+ SMAP("counter-reset"),
+ SMAP("cue"),
+ SMAP("cue-after"),
+ SMAP("cue-before"),
+ SMAP("cursor"),
+ SMAP("direction"),
+ SMAP("display"),
+ SMAP("elevation"),
+ SMAP("empty-cells"),
+ SMAP("flex"),
+ SMAP("flex-basis"),
+ SMAP("flex-direction"),
+ SMAP("flex-flow"),
+ SMAP("flex-grow"),
+ SMAP("flex-shrink"),
+ SMAP("flex-wrap"),
+ SMAP("float"),
+ SMAP("font"),
+ SMAP("font-family"),
+ SMAP("font-size"),
+ SMAP("font-style"),
+ SMAP("font-variant"),
+ SMAP("font-weight"),
+ SMAP("height"),
+ SMAP("justify-content"),
+ SMAP("left"),
+ SMAP("letter-spacing"),
+ SMAP("line-height"),
+ SMAP("list-style"),
+ SMAP("list-style-image"),
+ SMAP("list-style-position"),
+ SMAP("list-style-type"),
+ SMAP("margin"),
+ SMAP("margin-bottom"),
+ SMAP("margin-left"),
+ SMAP("margin-right"),
+ SMAP("margin-top"),
+ SMAP("max-height"),
+ SMAP("max-width"),
+ SMAP("min-height"),
+ SMAP("min-width"),
+ SMAP("opacity"),
+ SMAP("order"),
+ SMAP("orphans"),
+ SMAP("outline"),
+ SMAP("outline-color"),
+ SMAP("outline-style"),
+ SMAP("outline-width"),
+ SMAP("overflow"),
+ SMAP("overflow-x"),
+ SMAP("overflow-y"),
+ SMAP("padding"),
+ SMAP("padding-bottom"),
+ SMAP("padding-left"),
+ SMAP("padding-right"),
+ SMAP("padding-top"),
+ SMAP("page-break-after"),
+ SMAP("page-break-before"),
+ SMAP("page-break-inside"),
+ SMAP("pause"),
+ SMAP("pause-after"),
+ SMAP("pause-before"),
+ SMAP("pitch-range"),
+ SMAP("pitch"),
+ SMAP("play-during"),
+ SMAP("position"),
+ SMAP("quotes"),
+ SMAP("richness"),
+ SMAP("right"),
+ SMAP("speak-header"),
+ SMAP("speak-numeral"),
+ SMAP("speak-punctuation"),
+ SMAP("speak"),
+ SMAP("speech-rate"),
+ SMAP("stress"),
+ SMAP("table-layout"),
+ SMAP("text-align"),
+ SMAP("text-decoration"),
+ SMAP("text-indent"),
+ SMAP("text-transform"),
+ SMAP("top"),
+ SMAP("unicode-bidi"),
+ SMAP("vertical-align"),
+ SMAP("visibility"),
+ SMAP("voice-family"),
+ SMAP("volume"),
+ SMAP("white-space"),
+ SMAP("widows"),
+ SMAP("width"),
+ SMAP("word-spacing"),
+ SMAP("writing-mode"),
+ SMAP("z-index"),
- { "inherit", SLEN("inherit") },
- { "important", SLEN("important") },
- { "none", SLEN("none") },
- { "both", SLEN("both") },
- { "fixed", SLEN("fixed") },
- { "scroll", SLEN("scroll") },
- { "transparent", SLEN("transparent") },
- { "no-repeat", SLEN("no-repeat") },
- { "repeat-x", SLEN("repeat-x") },
- { "repeat-y", SLEN("repeat-y") },
- { "repeat", SLEN("repeat") },
- { "hidden", SLEN("hidden") },
- { "dotted", SLEN("dotted") },
- { "dashed", SLEN("dashed") },
- { "solid", SLEN("solid") },
- { "double", SLEN("double") },
- { "groove", SLEN("groove") },
- { "ridge", SLEN("ridge") },
- { "inset", SLEN("inset") },
- { "outset", SLEN("outset") },
- { "thin", SLEN("thin") },
- { "medium", SLEN("medium") },
- { "thick", SLEN("thick") },
- { "collapse", SLEN("collapse") },
- { "separate", SLEN("separate") },
- { "auto", SLEN("auto") },
- { "ltr", SLEN("ltr") },
- { "rtl", SLEN("rtl") },
- { "inline", SLEN("inline") },
- { "block", SLEN("block") },
- { "list-item", SLEN("list-item") },
- { "run-in", SLEN("run-in") },
- { "inline-block", SLEN("inline-block") },
- { "table", SLEN("table") },
- { "inline-table", SLEN("inline-table") },
- { "table-row-group", SLEN("table-row-group") },
- { "table-header-group", SLEN("table-header-group") },
- { "table-footer-group", SLEN("table-footer-group") },
- { "table-row", SLEN("table-row") },
- { "table-column-group", SLEN("table-column-group") },
- { "table-column", SLEN("table-column") },
- { "table-cell", SLEN("table-cell") },
- { "table-caption", SLEN("table-caption") },
- { "below", SLEN("below") },
- { "level", SLEN("level") },
- { "above", SLEN("above") },
- { "higher", SLEN("higher") },
- { "lower", SLEN("lower") },
- { "show", SLEN("show") },
- { "hide", SLEN("hide") },
- { "xx-small", SLEN("xx-small") },
- { "x-small", SLEN("x-small") },
- { "small", SLEN("small") },
- { "large", SLEN("large") },
- { "x-large", SLEN("x-large") },
- { "xx-large", SLEN("xx-large") },
- { "larger", SLEN("larger") },
- { "smaller", SLEN("smaller") },
- { "normal", SLEN("normal") },
- { "italic", SLEN("italic") },
- { "oblique", SLEN("oblique") },
- { "small-caps", SLEN("small-caps") },
- { "bold", SLEN("bold") },
- { "bolder", SLEN("bolder") },
- { "lighter", SLEN("lighter") },
- { "inside", SLEN("inside") },
- { "outside", SLEN("outside") },
- { "disc", SLEN("disc") },
- { "circle", SLEN("circle") },
- { "square", SLEN("square") },
- { "decimal", SLEN("decimal") },
- { "decimal-leading-zero", SLEN("decimal-leading-zero") },
- { "lower-roman", SLEN("lower-roman") },
- { "upper-roman", SLEN("upper-roman") },
- { "lower-greek", SLEN("lower-greek") },
- { "lower-latin", SLEN("lower-latin") },
- { "upper-latin", SLEN("upper-latin") },
- { "armenian", SLEN("armenian") },
- { "georgian", SLEN("georgian") },
- { "lower-alpha", SLEN("lower-alpha") },
- { "upper-alpha", SLEN("upper-alpha") },
- { "binary", SLEN("binary") },
- { "octal", SLEN("octal") },
- { "lower-hexadecimal", SLEN("lower-hexadecimal") },
- { "upper-hexadecimal", SLEN("upper-hexadecimal") },
- { "arabic-indic", SLEN("arabic-indic") },
- { "lower-armenian", SLEN("lower-armenian") },
- { "upper-armenian", SLEN("upper-armenian") },
- { "bengali", SLEN("bengali") },
- { "cambodian", SLEN("cambodian") },
- { "khmer", SLEN("khmer") },
- { "cjk-decimal", SLEN("cjk-decimal") },
- { "devanagari", SLEN("devanagari") },
- { "gujarati", SLEN("gujarati") },
- { "gurmukhi", SLEN("gurmukhi") },
- { "hebrew", SLEN("hebrew") },
- { "kannada", SLEN("kannada") },
- { "lao", SLEN("lao") },
- { "malayalam", SLEN("malayalam") },
- { "mongolian", SLEN("mongolian") },
- { "myanmar", SLEN("myanmar") },
- { "oriya", SLEN("oriya") },
- { "persian", SLEN("persian") },
- { "tamil", SLEN("tamil") },
- { "telugu", SLEN("telugu") },
- { "thai", SLEN("thai") },
- { "tibetan", SLEN("tibetan") },
- { "cjk-earthly-branch", SLEN("cjk-earthly-branch") },
- { "cjk-heavenly-stem", SLEN("cjk-heavenly-stem") },
- { "hiragana", SLEN("hiragana") },
- { "hiragana-iroha", SLEN("hiragana-iroha") },
- { "katakana", SLEN("katakana") },
- { "katakana-iroha", SLEN("katakana-iroha") },
- { "invert", SLEN("invert") },
- { "visible", SLEN("visible") },
- { "always", SLEN("always") },
- { "avoid", SLEN("avoid") },
- { "x-low", SLEN("x-low") },
- { "low", SLEN("low") },
- { "high", SLEN("high") },
- { "x-high", SLEN("x-high") },
- { "static", SLEN("static") },
- { "relative", SLEN("relative") },
- { "absolute", SLEN("absolute") },
- { "once", SLEN("once") },
- { "digits", SLEN("digits") },
- { "continuous", SLEN("continuous") },
- { "code", SLEN("code") },
- { "spell-out", SLEN("spell-out") },
- { "x-slow", SLEN("x-slow") },
- { "slow", SLEN("slow") },
- { "fast", SLEN("fast") },
- { "x-fast", SLEN("x-fast") },
- { "faster", SLEN("faster") },
- { "slower", SLEN("slower") },
- { "center", SLEN("center") },
- { "justify", SLEN("justify") },
- { "capitalize", SLEN("capitalize") },
- { "uppercase", SLEN("uppercase") },
- { "lowercase", SLEN("lowercase") },
- { "embed", SLEN("embed") },
- { "bidi-override", SLEN("bidi-override") },
- { "baseline", SLEN("baseline") },
- { "sub", SLEN("sub") },
- { "super", SLEN("super") },
- { "text-top", SLEN("text-top") },
- { "middle", SLEN("middle") },
- { "text-bottom", SLEN("text-bottom") },
- { "silent", SLEN("silent") },
- { "x-soft", SLEN("x-soft") },
- { "soft", SLEN("soft") },
- { "loud", SLEN("loud") },
- { "x-loud", SLEN("x-loud") },
- { "pre", SLEN("pre") },
- { "nowrap", SLEN("nowrap") },
- { "pre-wrap", SLEN("pre-wrap") },
- { "pre-line", SLEN("pre-line") },
- { "leftwards", SLEN("leftwards") },
- { "rightwards", SLEN("rightwards") },
- { "left-side", SLEN("left-side") },
- { "far-left", SLEN("far-left") },
- { "center-left", SLEN("center-left") },
- { "center-right", SLEN("center-right") },
- { "far-right", SLEN("far-right") },
- { "right-side", SLEN("right-side") },
- { "behind", SLEN("behind") },
- { "rect", SLEN("rect") },
- { "open-quote", SLEN("open-quote") },
- { "close-quote", SLEN("close-quote") },
- { "no-open-quote", SLEN("no-open-quote") },
- { "no-close-quote", SLEN("no-close-quote") },
- { "attr", SLEN("attr") },
- { "counter", SLEN("counter") },
- { "counters", SLEN("counters") },
- { "crosshair", SLEN("crosshair") },
- { "default", SLEN("default") },
- { "pointer", SLEN("pointer") },
- { "move", SLEN("move") },
- { "e-resize", SLEN("e-resize") },
- { "ne-resize", SLEN("ne-resize") },
- { "nw-resize", SLEN("nw-resize") },
- { "n-resize", SLEN("n-resize") },
- { "se-resize", SLEN("se-resize") },
- { "sw-resize", SLEN("sw-resize") },
- { "s-resize", SLEN("s-resize") },
- { "w-resize", SLEN("w-resize") },
- { "text", SLEN("text") },
- { "wait", SLEN("wait") },
- { "help", SLEN("help") },
- { "progress", SLEN("progress") },
- { "serif", SLEN("serif") },
- { "sans-serif", SLEN("sans-serif") },
- { "cursive", SLEN("cursive") },
- { "fantasy", SLEN("fantasy") },
- { "monospace", SLEN("monospace") },
- { "male", SLEN("male") },
- { "female", SLEN("female") },
- { "child", SLEN("child") },
- { "mix", SLEN("mix") },
- { "underline", SLEN("underline") },
- { "overline", SLEN("overline") },
- { "line-through", SLEN("line-through") },
- { "blink", SLEN("blink") },
- { "rgb", SLEN("rgb") },
- { "rgba", SLEN("rgba") },
- { "hsl", SLEN("hsl") },
- { "hsla", SLEN("hsla") },
- { "-libcss-left", SLEN("-libcss-left") },
- { "-libcss-center", SLEN("-libcss-center") },
- { "-libcss-right", SLEN("-libcss-right") },
- { "currentColor", SLEN("currentColor") },
- { "odd", SLEN("odd") },
- { "even", SLEN("even") },
- { "src", SLEN("src") },
- { "local", SLEN("local") },
- { "initial", SLEN("initial") },
- { "format", SLEN("format") },
- { "woff", SLEN("woff") },
- { "truetype", SLEN("truetype") },
- { "opentype", SLEN("opentype") },
- { "embedded-opentype", SLEN("embedded-opentype") },
- { "svg", SLEN("svg") },
- { "column", SLEN("column") },
- { "avoid-page", SLEN("avoid_page") },
- { "avoid-column", SLEN("avoid-column") },
- { "balance", SLEN("balance") },
- { "horizontal-tb", SLEN("horizontal-tb") },
- { "vertical-rl", SLEN("vertical-rl") },
- { "vertical-lr", SLEN("vertical-lr") },
- { "content-box", SLEN("content-box") },
- { "border-box", SLEN("border-box") },
- { "stretch", SLEN("stretch") },
- { "inline-flex", SLEN("inline-flex") },
- { "flex-start", SLEN("flex-start") },
- { "flex-end", SLEN("flex-end") },
- { "space-between", SLEN("space-between") },
- { "space-around", SLEN("space-around") },
- { "space-evenly", SLEN("space-evenly") },
- { "row", SLEN("row") },
- { "row-reverse", SLEN("row-reverse") },
- { "column-reverse", SLEN("column-reverse") },
- { "wrap", SLEN("wrap") },
- { "wrap-reverse", SLEN("wrap-reverse") },
- { "and", SLEN("and") },
- { "or", SLEN("or") },
- { "only", SLEN("only") },
- { "infinite", SLEN("infinite") },
+ SMAP("inherit"),
+ SMAP("important"),
+ SMAP("none"),
+ SMAP("both"),
+ SMAP("fixed"),
+ SMAP("scroll"),
+ SMAP("transparent"),
+ SMAP("no-repeat"),
+ SMAP("repeat-x"),
+ SMAP("repeat-y"),
+ SMAP("repeat"),
+ SMAP("hidden"),
+ SMAP("dotted"),
+ SMAP("dashed"),
+ SMAP("solid"),
+ SMAP("double"),
+ SMAP("groove"),
+ SMAP("ridge"),
+ SMAP("inset"),
+ SMAP("outset"),
+ SMAP("thin"),
+ SMAP("medium"),
+ SMAP("thick"),
+ SMAP("collapse"),
+ SMAP("separate"),
+ SMAP("auto"),
+ SMAP("ltr"),
+ SMAP("rtl"),
+ SMAP("inline"),
+ SMAP("block"),
+ SMAP("list-item"),
+ SMAP("run-in"),
+ SMAP("inline-block"),
+ SMAP("table"),
+ SMAP("inline-table"),
+ SMAP("table-row-group"),
+ SMAP("table-header-group"),
+ SMAP("table-footer-group"),
+ SMAP("table-row"),
+ SMAP("table-column-group"),
+ SMAP("table-column"),
+ SMAP("table-cell"),
+ SMAP("table-caption"),
+ SMAP("below"),
+ SMAP("level"),
+ SMAP("above"),
+ SMAP("higher"),
+ SMAP("lower"),
+ SMAP("show"),
+ SMAP("hide"),
+ SMAP("xx-small"),
+ SMAP("x-small"),
+ SMAP("small"),
+ SMAP("large"),
+ SMAP("x-large"),
+ SMAP("xx-large"),
+ SMAP("larger"),
+ SMAP("smaller"),
+ SMAP("normal"),
+ SMAP("italic"),
+ SMAP("oblique"),
+ SMAP("small-caps"),
+ SMAP("bold"),
+ SMAP("bolder"),
+ SMAP("lighter"),
+ SMAP("inside"),
+ SMAP("outside"),
+ SMAP("disc"),
+ SMAP("circle"),
+ SMAP("square"),
+ SMAP("decimal"),
+ SMAP("decimal-leading-zero"),
+ SMAP("lower-roman"),
+ SMAP("upper-roman"),
+ SMAP("lower-greek"),
+ SMAP("lower-latin"),
+ SMAP("upper-latin"),
+ SMAP("armenian"),
+ SMAP("georgian"),
+ SMAP("lower-alpha"),
+ SMAP("upper-alpha"),
+ SMAP("binary"),
+ SMAP("octal"),
+ SMAP("lower-hexadecimal"),
+ SMAP("upper-hexadecimal"),
+ SMAP("arabic-indic"),
+ SMAP("lower-armenian"),
+ SMAP("upper-armenian"),
+ SMAP("bengali"),
+ SMAP("cambodian"),
+ SMAP("khmer"),
+ SMAP("cjk-decimal"),
+ SMAP("devanagari"),
+ SMAP("gujarati"),
+ SMAP("gurmukhi"),
+ SMAP("hebrew"),
+ SMAP("kannada"),
+ SMAP("lao"),
+ SMAP("malayalam"),
+ SMAP("mongolian"),
+ SMAP("myanmar"),
+ SMAP("oriya"),
+ SMAP("persian"),
+ SMAP("tamil"),
+ SMAP("telugu"),
+ SMAP("thai"),
+ SMAP("tibetan"),
+ SMAP("cjk-earthly-branch"),
+ SMAP("cjk-heavenly-stem"),
+ SMAP("hiragana"),
+ SMAP("hiragana-iroha"),
+ SMAP("katakana"),
+ SMAP("katakana-iroha"),
+ SMAP("invert"),
+ SMAP("visible"),
+ SMAP("always"),
+ SMAP("avoid"),
+ SMAP("x-low"),
+ SMAP("low"),
+ SMAP("high"),
+ SMAP("x-high"),
+ SMAP("static"),
+ SMAP("relative"),
+ SMAP("absolute"),
+ SMAP("once"),
+ SMAP("digits"),
+ SMAP("continuous"),
+ SMAP("code"),
+ SMAP("spell-out"),
+ SMAP("x-slow"),
+ SMAP("slow"),
+ SMAP("fast"),
+ SMAP("x-fast"),
+ SMAP("faster"),
+ SMAP("slower"),
+ SMAP("center"),
+ SMAP("justify"),
+ SMAP("capitalize"),
+ SMAP("uppercase"),
+ SMAP("lowercase"),
+ SMAP("embed"),
+ SMAP("bidi-override"),
+ SMAP("baseline"),
+ SMAP("sub"),
+ SMAP("super"),
+ SMAP("text-top"),
+ SMAP("middle"),
+ SMAP("text-bottom"),
+ SMAP("silent"),
+ SMAP("x-soft"),
+ SMAP("soft"),
+ SMAP("loud"),
+ SMAP("x-loud"),
+ SMAP("pre"),
+ SMAP("nowrap"),
+ SMAP("pre-wrap"),
+ SMAP("pre-line"),
+ SMAP("leftwards"),
+ SMAP("rightwards"),
+ SMAP("left-side"),
+ SMAP("far-left"),
+ SMAP("center-left"),
+ SMAP("center-right"),
+ SMAP("far-right"),
+ SMAP("right-side"),
+ SMAP("behind"),
+ SMAP("rect"),
+ SMAP("open-quote"),
+ SMAP("close-quote"),
+ SMAP("no-open-quote"),
+ SMAP("no-close-quote"),
+ SMAP("attr"),
+ SMAP("counter"),
+ SMAP("counters"),
+ SMAP("crosshair"),
+ SMAP("default"),
+ SMAP("pointer"),
+ SMAP("move"),
+ SMAP("e-resize"),
+ SMAP("ne-resize"),
+ SMAP("nw-resize"),
+ SMAP("n-resize"),
+ SMAP("se-resize"),
+ SMAP("sw-resize"),
+ SMAP("s-resize"),
+ SMAP("w-resize"),
+ SMAP("text"),
+ SMAP("wait"),
+ SMAP("help"),
+ SMAP("progress"),
+ SMAP("serif"),
+ SMAP("sans-serif"),
+ SMAP("cursive"),
+ SMAP("fantasy"),
+ SMAP("monospace"),
+ SMAP("male"),
+ SMAP("female"),
+ SMAP("child"),
+ SMAP("mix"),
+ SMAP("underline"),
+ SMAP("overline"),
+ SMAP("line-through"),
+ SMAP("blink"),
+ SMAP("rgb"),
+ SMAP("rgba"),
+ SMAP("hsl"),
+ SMAP("hsla"),
+ SMAP("-libcss-left"),
+ SMAP("-libcss-center"),
+ SMAP("-libcss-right"),
+ SMAP("currentColor"),
+ SMAP("odd"),
+ SMAP("even"),
+ SMAP("src"),
+ SMAP("local"),
+ SMAP("initial"),
+ SMAP("format"),
+ SMAP("woff"),
+ SMAP("truetype"),
+ SMAP("opentype"),
+ SMAP("embedded-opentype"),
+ SMAP("svg"),
+ SMAP("column"),
+ SMAP("avoid-page"),
+ SMAP("avoid-column"),
+ SMAP("balance"),
+ SMAP("horizontal-tb"),
+ SMAP("vertical-rl"),
+ SMAP("vertical-lr"),
+ SMAP("content-box"),
+ SMAP("border-box"),
+ SMAP("stretch"),
+ SMAP("inline-flex"),
+ SMAP("flex-start"),
+ SMAP("flex-end"),
+ SMAP("space-between"),
+ SMAP("space-around"),
+ SMAP("space-evenly"),
+ SMAP("row"),
+ SMAP("row-reverse"),
+ SMAP("column-reverse"),
+ SMAP("wrap"),
+ SMAP("wrap-reverse"),
+ SMAP("and"),
+ SMAP("or"),
+ SMAP("only"),
+ SMAP("infinite"),
- { "aliceblue", SLEN("aliceblue") },
- { "antiquewhite", SLEN("antiquewhite") },
- { "aqua", SLEN("aqua") },
- { "aquamarine", SLEN("aquamarine") },
- { "azure", SLEN("azure") },
- { "beige", SLEN("beige") },
- { "bisque", SLEN("bisque") },
- { "black", SLEN("black") },
- { "blanchedalmond", SLEN("blanchedalmond") },
- { "blue", SLEN("blue") },
- { "blueviolet", SLEN("blueviolet") },
- { "brown", SLEN("brown") },
- { "burlywood", SLEN("burlywood") },
- { "cadetblue", SLEN("cadetblue") },
- { "chartreuse", SLEN("chartreuse") },
- { "chocolate", SLEN("chocolate") },
- { "coral", SLEN("coral") },
- { "cornflowerblue", SLEN("cornflowerblue") },
- { "cornsilk", SLEN("cornsilk") },
- { "crimson", SLEN("crimson") },
- { "cyan", SLEN("cyan") },
- { "darkblue", SLEN("darkblue") },
- { "darkcyan", SLEN("darkcyan") },
- { "darkgoldenrod", SLEN("darkgoldenrod") },
- { "darkgray", SLEN("darkgray") },
- { "darkgreen", SLEN("darkgreen") },
- { "darkgrey", SLEN("darkgrey") },
- { "darkkhaki", SLEN("darkkhaki") },
- { "darkmagenta", SLEN("darkmagenta") },
- { "darkolivegreen", SLEN("darkolivegreen") },
- { "darkorange", SLEN("darkorange") },
- { "darkorchid", SLEN("darkorchid") },
- { "darkred", SLEN("darkred") },
- { "darksalmon", SLEN("darksalmon") },
- { "darkseagreen", SLEN("darkseagreen") },
- { "darkslateblue", SLEN("darkslateblue") },
- { "darkslategray", SLEN("darkslategray") },
- { "darkslategrey", SLEN("darkslategrey") },
- { "darkturquoise", SLEN("darkturquoise") },
- { "darkviolet", SLEN("darkviolet") },
- { "deeppink", SLEN("deeppink") },
- { "deepskyblue", SLEN("deepskyblue") },
- { "dimgray", SLEN("dimgray") },
- { "dimgrey", SLEN("dimgrey") },
- { "dodgerblue", SLEN("dodgerblue") },
- { "feldspar", SLEN("feldspar") },
- { "firebrick", SLEN("firebrick") },
- { "floralwhite", SLEN("floralwhite") },
- { "forestgreen", SLEN("forestgreen") },
- { "fuchsia", SLEN("fuchsia") },
- { "gainsboro", SLEN("gainsboro") },
- { "ghostwhite", SLEN("ghostwhite") },
- { "gold", SLEN("gold") },
- { "goldenrod", SLEN("goldenrod") },
- { "gray", SLEN("gray") },
- { "green", SLEN("green") },
- { "greenyellow", SLEN("greenyellow") },
- { "grey", SLEN("grey") },
- { "honeydew", SLEN("honeydew") },
- { "hotpink", SLEN("hotpink") },
- { "indianred", SLEN("indianred") },
- { "indigo", SLEN("indigo") },
- { "ivory", SLEN("ivory") },
- { "khaki", SLEN("khaki") },
- { "lavender", SLEN("lavender") },
- { "lavenderblush", SLEN("lavenderblush") },
- { "lawngreen", SLEN("lawngreen") },
- { "lemonchiffon", SLEN("lemonchiffon") },
- { "lightblue", SLEN("lightblue") },
- { "lightcoral", SLEN("lightcoral") },
- { "lightcyan", SLEN("lightcyan") },
- { "lightgoldenrodyellow", SLEN("lightgoldenrodyellow") },
- { "lightgray", SLEN("lightgray") },
- { "lightgreen", SLEN("lightgreen") },
- { "lightgrey", SLEN("lightgrey") },
- { "lightpink", SLEN("lightpink") },
- { "lightsalmon", SLEN("lightsalmon") },
- { "lightseagreen", SLEN("lightseagreen") },
- { "lightskyblue", SLEN("lightskyblue") },
- { "lightslateblue", SLEN("lightslateblue") },
- { "lightslategray", SLEN("lightslategray") },
- { "lightslategrey", SLEN("lightslategrey") },
- { "lightsteelblue", SLEN("lightsteelblue") },
- { "lightyellow", SLEN("lightyellow") },
- { "lime", SLEN("lime") },
- { "limegreen", SLEN("limegreen") },
- { "linen", SLEN("linen") },
- { "magenta", SLEN("magenta") },
- { "maroon", SLEN("maroon") },
- { "mediumaquamarine", SLEN("mediumaquamarine") },
- { "mediumblue", SLEN("mediumblue") },
- { "mediumorchid", SLEN("mediumorchid") },
- { "mediumpurple", SLEN("mediumpurple") },
- { "mediumseagreen", SLEN("mediumseagreen") },
- { "mediumslateblue", SLEN("mediumslateblue") },
- { "mediumspringgreen", SLEN("mediumspringgreen") },
- { "mediumturquoise", SLEN("mediumturquoise") },
- { "mediumvioletred", SLEN("mediumvioletred") },
- { "midnightblue", SLEN("midnightblue") },
- { "mintcream", SLEN("mintcream") },
- { "mistyrose", SLEN("mistyrose") },
- { "moccasin", SLEN("moccasin") },
- { "navajowhite", SLEN("navajowhite") },
- { "navy", SLEN("navy") },
- { "oldlace", SLEN("oldlace") },
- { "olive", SLEN("olive") },
- { "olivedrab", SLEN("olivedrab") },
- { "orange", SLEN("orange") },
- { "orangered", SLEN("orangered") },
- { "orchid", SLEN("orchid") },
- { "palegoldenrod", SLEN("palegoldenrod") },
- { "palegreen", SLEN("palegreen") },
- { "paleturquoise", SLEN("paleturquoise") },
- { "palevioletred", SLEN("palevioletred") },
- { "papayawhip", SLEN("papayawhip") },
- { "peachpuff", SLEN("peachpuff") },
- { "peru", SLEN("peru") },
- { "pink", SLEN("pink") },
- { "plum", SLEN("plum") },
- { "powderblue", SLEN("powderblue") },
- { "purple", SLEN("purple") },
- { "red", SLEN("red") },
- { "rosybrown", SLEN("rosybrown") },
- { "royalblue", SLEN("royalblue") },
- { "saddlebrown", SLEN("saddlebrown") },
- { "salmon", SLEN("salmon") },
- { "sandybrown", SLEN("sandybrown") },
- { "seagreen", SLEN("seagreen") },
- { "seashell", SLEN("seashell") },
- { "sienna", SLEN("sienna") },
- { "silver", SLEN("silver") },
- { "skyblue", SLEN("skyblue") },
- { "slateblue", SLEN("slateblue") },
- { "slategray", SLEN("slategray") },
- { "slategrey", SLEN("slategrey") },
- { "snow", SLEN("snow") },
- { "springgreen", SLEN("springgreen") },
- { "steelblue", SLEN("steelblue") },
- { "tan", SLEN("tan") },
- { "teal", SLEN("teal") },
- { "thistle", SLEN("thistle") },
- { "tomato", SLEN("tomato") },
- { "turquoise", SLEN("turquoise") },
- { "violet", SLEN("violet") },
- { "violetred", SLEN("violetred") },
- { "wheat", SLEN("wheat") },
- { "white", SLEN("white") },
- { "whitesmoke", SLEN("whitesmoke") },
- { "yellow", SLEN("yellow") },
- { "yellowgreen", SLEN("yellowgreen") }
+ SMAP("aliceblue"),
+ SMAP("antiquewhite"),
+ SMAP("aqua"),
+ SMAP("aquamarine"),
+ SMAP("azure"),
+ SMAP("beige"),
+ SMAP("bisque"),
+ SMAP("black"),
+ SMAP("blanchedalmond"),
+ SMAP("blue"),
+ SMAP("blueviolet"),
+ SMAP("brown"),
+ SMAP("burlywood"),
+ SMAP("cadetblue"),
+ SMAP("chartreuse"),
+ SMAP("chocolate"),
+ SMAP("coral"),
+ SMAP("cornflowerblue"),
+ SMAP("cornsilk"),
+ SMAP("crimson"),
+ SMAP("cyan"),
+ SMAP("darkblue"),
+ SMAP("darkcyan"),
+ SMAP("darkgoldenrod"),
+ SMAP("darkgray"),
+ SMAP("darkgreen"),
+ SMAP("darkgrey"),
+ SMAP("darkkhaki"),
+ SMAP("darkmagenta"),
+ SMAP("darkolivegreen"),
+ SMAP("darkorange"),
+ SMAP("darkorchid"),
+ SMAP("darkred"),
+ SMAP("darksalmon"),
+ SMAP("darkseagreen"),
+ SMAP("darkslateblue"),
+ SMAP("darkslategray"),
+ SMAP("darkslategrey"),
+ SMAP("darkturquoise"),
+ SMAP("darkviolet"),
+ SMAP("deeppink"),
+ SMAP("deepskyblue"),
+ SMAP("dimgray"),
+ SMAP("dimgrey"),
+ SMAP("dodgerblue"),
+ SMAP("feldspar"),
+ SMAP("firebrick"),
+ SMAP("floralwhite"),
+ SMAP("forestgreen"),
+ SMAP("fuchsia"),
+ SMAP("gainsboro"),
+ SMAP("ghostwhite"),
+ SMAP("gold"),
+ SMAP("goldenrod"),
+ SMAP("gray"),
+ SMAP("green"),
+ SMAP("greenyellow"),
+ SMAP("grey"),
+ SMAP("honeydew"),
+ SMAP("hotpink"),
+ SMAP("indianred"),
+ SMAP("indigo"),
+ SMAP("ivory"),
+ SMAP("khaki"),
+ SMAP("lavender"),
+ SMAP("lavenderblush"),
+ SMAP("lawngreen"),
+ SMAP("lemonchiffon"),
+ SMAP("lightblue"),
+ SMAP("lightcoral"),
+ SMAP("lightcyan"),
+ SMAP("lightgoldenrodyellow"),
+ SMAP("lightgray"),
+ SMAP("lightgreen"),
+ SMAP("lightgrey"),
+ SMAP("lightpink"),
+ SMAP("lightsalmon"),
+ SMAP("lightseagreen"),
+ SMAP("lightskyblue"),
+ SMAP("lightslateblue"),
+ SMAP("lightslategray"),
+ SMAP("lightslategrey"),
+ SMAP("lightsteelblue"),
+ SMAP("lightyellow"),
+ SMAP("lime"),
+ SMAP("limegreen"),
+ SMAP("linen"),
+ SMAP("magenta"),
+ SMAP("maroon"),
+ SMAP("mediumaquamarine"),
+ SMAP("mediumblue"),
+ SMAP("mediumorchid"),
+ SMAP("mediumpurple"),
+ SMAP("mediumseagreen"),
+ SMAP("mediumslateblue"),
+ SMAP("mediumspringgreen"),
+ SMAP("mediumturquoise"),
+ SMAP("mediumvioletred"),
+ SMAP("midnightblue"),
+ SMAP("mintcream"),
+ SMAP("mistyrose"),
+ SMAP("moccasin"),
+ SMAP("navajowhite"),
+ SMAP("navy"),
+ SMAP("oldlace"),
+ SMAP("olive"),
+ SMAP("olivedrab"),
+ SMAP("orange"),
+ SMAP("orangered"),
+ SMAP("orchid"),
+ SMAP("palegoldenrod"),
+ SMAP("palegreen"),
+ SMAP("paleturquoise"),
+ SMAP("palevioletred"),
+ SMAP("papayawhip"),
+ SMAP("peachpuff"),
+ SMAP("peru"),
+ SMAP("pink"),
+ SMAP("plum"),
+ SMAP("powderblue"),
+ SMAP("purple"),
+ SMAP("red"),
+ SMAP("rosybrown"),
+ SMAP("royalblue"),
+ SMAP("saddlebrown"),
+ SMAP("salmon"),
+ SMAP("sandybrown"),
+ SMAP("seagreen"),
+ SMAP("seashell"),
+ SMAP("sienna"),
+ SMAP("silver"),
+ SMAP("skyblue"),
+ SMAP("slateblue"),
+ SMAP("slategray"),
+ SMAP("slategrey"),
+ SMAP("snow"),
+ SMAP("springgreen"),
+ SMAP("steelblue"),
+ SMAP("tan"),
+ SMAP("teal"),
+ SMAP("thistle"),
+ SMAP("tomato"),
+ SMAP("turquoise"),
+ SMAP("violet"),
+ SMAP("violetred"),
+ SMAP("wheat"),
+ SMAP("white"),
+ SMAP("whitesmoke"),
+ SMAP("yellow"),
+ SMAP("yellowgreen")
};
-----------------------------------------------------------------------
Summary of changes:
src/parse/propstrings.c | 1192 ++++++++++++++++++++++++-----------------------
1 file changed, 598 insertions(+), 594 deletions(-)
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 5528645..a2d9175 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -10,6 +10,10 @@
#include <assert.h>
+/** build string map entry with a string constant */
+#define SMAP(s) { s, (sizeof((s)) - 1) /* -1 for '\0' */ }
+
+
typedef struct stringmap_entry {
const char *data;
size_t len;
@@ -24,608 +28,608 @@ static css__propstrings_ctx css__propstrings;
/* Must be synchronised with enum in propstrings.h */
const stringmap_entry stringmap[LAST_KNOWN] = {
- { "*", SLEN("*") },
+ SMAP("*"),
- { ":", SLEN(":") },
- { ",", SLEN(",") },
- { ";", SLEN(";") },
- { "{", SLEN("{") },
- { "}", SLEN("}") },
- { "0", SLEN("0") },
+ SMAP(":"),
+ SMAP(","),
+ SMAP(";"),
+ SMAP("{"),
+ SMAP("}"),
+ SMAP("0"),
- { "charset", SLEN("charset") },
- { "import", SLEN("import") },
- { "media", SLEN("media") },
- { "namespace", SLEN("namespace") },
- { "font-face", SLEN("font-face") },
- { "page", SLEN("page") },
+ SMAP("charset"),
+ SMAP("import"),
+ SMAP("media"),
+ SMAP("namespace"),
+ SMAP("font-face"),
+ SMAP("page"),
- { "aural", SLEN("aural") },
- { "braille", SLEN("braille") },
- { "embossed", SLEN("embossed") },
- { "handheld", SLEN("handheld") },
- { "print", SLEN("print") },
- { "projection", SLEN("projection") },
- { "screen", SLEN("screen") },
- { "speech", SLEN("speech") },
- { "tty", SLEN("tty") },
- { "tv", SLEN("tv") },
- { "all", SLEN("all") },
+ SMAP("aural"),
+ SMAP("braille"),
+ SMAP("embossed"),
+ SMAP("handheld"),
+ SMAP("print"),
+ SMAP("projection"),
+ SMAP("screen"),
+ SMAP("speech"),
+ SMAP("tty"),
+ SMAP("tv"),
+ SMAP("all"),
- { "first-child", SLEN("first-child") },
- { "link", SLEN("link") },
- { "visited", SLEN("visited") },
- { "hover", SLEN("hover") },
- { "active", SLEN("active") },
- { "focus", SLEN("focus") },
- { "lang", SLEN("lang") },
- { "first", SLEN("first") },
- { "root", SLEN("root") },
- { "nth-child", SLEN("nth-child") },
- { "nth-last-child", SLEN("nth-last-child") },
- { "nth-of-type", SLEN("nth-of-type") },
- { "nth-last-of-type", SLEN("nth-last-of-type") },
- { "last-child", SLEN("last-child") },
- { "first-of-type", SLEN("first-of-type") },
- { "last-of-type", SLEN("last-of-type") },
- { "only-child", SLEN("only-child") },
- { "only-of-type", SLEN("only-of-type") },
- { "empty", SLEN("empty") },
- { "target", SLEN("target") },
- { "enabled", SLEN("enabled") },
- { "disabled", SLEN("disabled") },
- { "checked", SLEN("checked") },
- { "not", SLEN("not") },
+ SMAP("first-child"),
+ SMAP("link"),
+ SMAP("visited"),
+ SMAP("hover"),
+ SMAP("active"),
+ SMAP("focus"),
+ SMAP("lang"),
+ SMAP("first"),
+ SMAP("root"),
+ SMAP("nth-child"),
+ SMAP("nth-last-child"),
+ SMAP("nth-of-type"),
+ SMAP("nth-last-of-type"),
+ SMAP("last-child"),
+ SMAP("first-of-type"),
+ SMAP("last-of-type"),
+ SMAP("only-child"),
+ SMAP("only-of-type"),
+ SMAP("empty"),
+ SMAP("target"),
+ SMAP("enabled"),
+ SMAP("disabled"),
+ SMAP("checked"),
+ SMAP("not"),
- { "first-line", SLEN("first-line") },
- { "first-letter", SLEN("first-letter") },
- { "before", SLEN("before") },
- { "after", SLEN("after") },
+ SMAP("first-line"),
+ SMAP("first-letter"),
+ SMAP("before"),
+ SMAP("after"),
- { "align-content", SLEN("align-content") },
- { "align-items", SLEN("align-items") },
- { "align-self", SLEN("align-self") },
- { "azimuth", SLEN("azimuth") },
- { "background", SLEN("background") },
- { "background-attachment", SLEN("background-attachment") },
- { "background-color", SLEN("background-color") },
- { "background-image", SLEN("background-image") },
- { "background-position", SLEN("background-position") },
- { "background-repeat", SLEN("background-repeat") },
- { "border", SLEN("border") },
- { "border-bottom", SLEN("border-bottom") },
- { "border-bottom-color", SLEN("border-bottom-color") },
- { "border-bottom-style", SLEN("border-bottom-style") },
- { "border-bottom-width", SLEN("border-bottom-width") },
- { "border-collapse", SLEN("border-collapse") },
- { "border-color", SLEN("border-color") },
- { "border-left", SLEN("border-left") },
- { "border-left-color", SLEN("border-left-color") },
- { "border-left-style", SLEN("border-left-style") },
- { "border-left-width", SLEN("border-left-width") },
- { "border-right", SLEN("border-right") },
- { "border-right-color", SLEN("border-right-color") },
- { "border-right-style", SLEN("border-right-style") },
- { "border-right-width", SLEN("border-right-width") },
- { "border-spacing", SLEN("border-spacing") },
- { "border-style", SLEN("border-style") },
- { "border-top", SLEN("border-top") },
- { "border-top-color", SLEN("border-top-color") },
- { "border-top-style", SLEN("border-top-style") },
- { "border-top-width", SLEN("border-top-width") },
- { "border-width", SLEN("border-width") },
- { "bottom", SLEN("bottom") },
- { "box-sizing", SLEN("box-sizing") },
- { "break-after", SLEN("break-after") },
- { "break-before", SLEN("break-before") },
- { "break-inside", SLEN("break-inside") },
- { "caption-side", SLEN("caption-side") },
- { "clear", SLEN("clear") },
- { "clip", SLEN("clip") },
- { "color", SLEN("color") },
- { "columns", SLEN("columns") },
- { "column-count", SLEN("column-count") },
- { "column-fill", SLEN("column-fill") },
- { "column-gap", SLEN("column-gap") },
- { "column-rule", SLEN("column-rule") },
- { "column-rule-color", SLEN("column-rule-color") },
- { "column-rule-style", SLEN("column-rule-style") },
- { "column-rule-width", SLEN("column-rule_width") },
- { "column-span", SLEN("column-span") },
- { "column-width", SLEN("column-width") },
- { "content", SLEN("content") },
- { "counter-increment", SLEN("counter-increment") },
- { "counter-reset", SLEN("counter-reset") },
- { "cue", SLEN("cue") },
- { "cue-after", SLEN("cue-after") },
- { "cue-before", SLEN("cue-before") },
- { "cursor", SLEN("cursor") },
- { "direction", SLEN("direction") },
- { "display", SLEN("display") },
- { "elevation", SLEN("elevation") },
- { "empty-cells", SLEN("empty-cells") },
- { "flex", SLEN("flex") },
- { "flex-basis", SLEN("flex-basis") },
- { "flex-direction", SLEN("flex-direction") },
- { "flex-flow", SLEN("flex-flow") },
- { "flex-grow", SLEN("flex-grow") },
- { "flex-shrink", SLEN("flex-shrink") },
- { "flex-wrap", SLEN("flex-wrap") },
- { "float", SLEN("float") },
- { "font", SLEN("font") },
- { "font-family", SLEN("font-family") },
- { "font-size", SLEN("font-size") },
- { "font-style", SLEN("font-style") },
- { "font-variant", SLEN("font-variant") },
- { "font-weight", SLEN("font-weight") },
- { "height", SLEN("height") },
- { "justify-content", SLEN("justify-content") },
- { "left", SLEN("left") },
- { "letter-spacing", SLEN("letter-spacing") },
- { "line-height", SLEN("line-height") },
- { "list-style", SLEN("list-style") },
- { "list-style-image", SLEN("list-style-image") },
- { "list-style-position", SLEN("list-style-position") },
- { "list-style-type", SLEN("list-style-type") },
- { "margin", SLEN("margin") },
- { "margin-bottom", SLEN("margin-bottom") },
- { "margin-left", SLEN("margin-left") },
- { "margin-right", SLEN("margin-right") },
- { "margin-top", SLEN("margin-top") },
- { "max-height", SLEN("max-height") },
- { "max-width", SLEN("max-width") },
- { "min-height", SLEN("min-height") },
- { "min-width", SLEN("min-width") },
- { "opacity", SLEN("opacity") },
- { "order", SLEN("order") },
- { "orphans", SLEN("orphans") },
- { "outline", SLEN("outline") },
- { "outline-color", SLEN("outline-color") },
- { "outline-style", SLEN("outline-style") },
- { "outline-width", SLEN("outline-width") },
- { "overflow", SLEN("overflow") },
- { "overflow-x", SLEN("overflow-x") },
- { "overflow-y", SLEN("overflow-y") },
- { "padding", SLEN("padding") },
- { "padding-bottom", SLEN("padding-bottom") },
- { "padding-left", SLEN("padding-left") },
- { "padding-right", SLEN("padding-right") },
- { "padding-top", SLEN("padding-top") },
- { "page-break-after", SLEN("page-break-after") },
- { "page-break-before", SLEN("page-break-before") },
- { "page-break-inside", SLEN("page-break-inside") },
- { "pause", SLEN("pause") },
- { "pause-after", SLEN("pause-after") },
- { "pause-before", SLEN("pause-before") },
- { "pitch-range", SLEN("pitch-range") },
- { "pitch", SLEN("pitch") },
- { "play-during", SLEN("play-during") },
- { "position", SLEN("position") },
- { "quotes", SLEN("quotes") },
- { "richness", SLEN("richness") },
- { "right", SLEN("right") },
- { "speak-header", SLEN("speak-header") },
- { "speak-numeral", SLEN("speak-numeral") },
- { "speak-punctuation", SLEN("speak-punctuation") },
- { "speak", SLEN("speak") },
- { "speech-rate", SLEN("speech-rate") },
- { "stress", SLEN("stress") },
- { "table-layout", SLEN("table-layout") },
- { "text-align", SLEN("text-align") },
- { "text-decoration", SLEN("text-decoration") },
- { "text-indent", SLEN("text-indent") },
- { "text-transform", SLEN("text-transform") },
- { "top", SLEN("top") },
- { "unicode-bidi", SLEN("unicode-bidi") },
- { "vertical-align", SLEN("vertical-align") },
- { "visibility", SLEN("visibility") },
- { "voice-family", SLEN("voice-family") },
- { "volume", SLEN("volume") },
- { "white-space", SLEN("white-space") },
- { "widows", SLEN("widows") },
- { "width", SLEN("width") },
- { "word-spacing", SLEN("word-spacing") },
- { "writing-mode", SLEN("writing-mode") },
- { "z-index", SLEN("z-index") },
+ SMAP("align-content"),
+ SMAP("align-items"),
+ SMAP("align-self"),
+ SMAP("azimuth"),
+ SMAP("background"),
+ SMAP("background-attachment"),
+ SMAP("background-color"),
+ SMAP("background-image"),
+ SMAP("background-position"),
+ SMAP("background-repeat"),
+ SMAP("border"),
+ SMAP("border-bottom"),
+ SMAP("border-bottom-color"),
+ SMAP("border-bottom-style"),
+ SMAP("border-bottom-width"),
+ SMAP("border-collapse"),
+ SMAP("border-color"),
+ SMAP("border-left"),
+ SMAP("border-left-color"),
+ SMAP("border-left-style"),
+ SMAP("border-left-width"),
+ SMAP("border-right"),
+ SMAP("border-right-color"),
+ SMAP("border-right-style"),
+ SMAP("border-right-width"),
+ SMAP("border-spacing"),
+ SMAP("border-style"),
+ SMAP("border-top"),
+ SMAP("border-top-color"),
+ SMAP("border-top-style"),
+ SMAP("border-top-width"),
+ SMAP("border-width"),
+ SMAP("bottom"),
+ SMAP("box-sizing"),
+ SMAP("break-after"),
+ SMAP("break-before"),
+ SMAP("break-inside"),
+ SMAP("caption-side"),
+ SMAP("clear"),
+ SMAP("clip"),
+ SMAP("color"),
+ SMAP("columns"),
+ SMAP("column-count"),
+ SMAP("column-fill"),
+ SMAP("column-gap"),
+ SMAP("column-rule"),
+ SMAP("column-rule-color"),
+ SMAP("column-rule-style"),
+ SMAP("column-rule-width"),
+ SMAP("column-span"),
+ SMAP("column-width"),
+ SMAP("content"),
+ SMAP("counter-increment"),
+ SMAP("counter-reset"),
+ SMAP("cue"),
+ SMAP("cue-after"),
+ SMAP("cue-before"),
+ SMAP("cursor"),
+ SMAP("direction"),
+ SMAP("display"),
+ SMAP("elevation"),
+ SMAP("empty-cells"),
+ SMAP("flex"),
+ SMAP("flex-basis"),
+ SMAP("flex-direction"),
+ SMAP("flex-flow"),
+ SMAP("flex-grow"),
+ SMAP("flex-shrink"),
+ SMAP("flex-wrap"),
+ SMAP("float"),
+ SMAP("font"),
+ SMAP("font-family"),
+ SMAP("font-size"),
+ SMAP("font-style"),
+ SMAP("font-variant"),
+ SMAP("font-weight"),
+ SMAP("height"),
+ SMAP("justify-content"),
+ SMAP("left"),
+ SMAP("letter-spacing"),
+ SMAP("line-height"),
+ SMAP("list-style"),
+ SMAP("list-style-image"),
+ SMAP("list-style-position"),
+ SMAP("list-style-type"),
+ SMAP("margin"),
+ SMAP("margin-bottom"),
+ SMAP("margin-left"),
+ SMAP("margin-right"),
+ SMAP("margin-top"),
+ SMAP("max-height"),
+ SMAP("max-width"),
+ SMAP("min-height"),
+ SMAP("min-width"),
+ SMAP("opacity"),
+ SMAP("order"),
+ SMAP("orphans"),
+ SMAP("outline"),
+ SMAP("outline-color"),
+ SMAP("outline-style"),
+ SMAP("outline-width"),
+ SMAP("overflow"),
+ SMAP("overflow-x"),
+ SMAP("overflow-y"),
+ SMAP("padding"),
+ SMAP("padding-bottom"),
+ SMAP("padding-left"),
+ SMAP("padding-right"),
+ SMAP("padding-top"),
+ SMAP("page-break-after"),
+ SMAP("page-break-before"),
+ SMAP("page-break-inside"),
+ SMAP("pause"),
+ SMAP("pause-after"),
+ SMAP("pause-before"),
+ SMAP("pitch-range"),
+ SMAP("pitch"),
+ SMAP("play-during"),
+ SMAP("position"),
+ SMAP("quotes"),
+ SMAP("richness"),
+ SMAP("right"),
+ SMAP("speak-header"),
+ SMAP("speak-numeral"),
+ SMAP("speak-punctuation"),
+ SMAP("speak"),
+ SMAP("speech-rate"),
+ SMAP("stress"),
+ SMAP("table-layout"),
+ SMAP("text-align"),
+ SMAP("text-decoration"),
+ SMAP("text-indent"),
+ SMAP("text-transform"),
+ SMAP("top"),
+ SMAP("unicode-bidi"),
+ SMAP("vertical-align"),
+ SMAP("visibility"),
+ SMAP("voice-family"),
+ SMAP("volume"),
+ SMAP("white-space"),
+ SMAP("widows"),
+ SMAP("width"),
+ SMAP("word-spacing"),
+ SMAP("writing-mode"),
+ SMAP("z-index"),
- { "inherit", SLEN("inherit") },
- { "important", SLEN("important") },
- { "none", SLEN("none") },
- { "both", SLEN("both") },
- { "fixed", SLEN("fixed") },
- { "scroll", SLEN("scroll") },
- { "transparent", SLEN("transparent") },
- { "no-repeat", SLEN("no-repeat") },
- { "repeat-x", SLEN("repeat-x") },
- { "repeat-y", SLEN("repeat-y") },
- { "repeat", SLEN("repeat") },
- { "hidden", SLEN("hidden") },
- { "dotted", SLEN("dotted") },
- { "dashed", SLEN("dashed") },
- { "solid", SLEN("solid") },
- { "double", SLEN("double") },
- { "groove", SLEN("groove") },
- { "ridge", SLEN("ridge") },
- { "inset", SLEN("inset") },
- { "outset", SLEN("outset") },
- { "thin", SLEN("thin") },
- { "medium", SLEN("medium") },
- { "thick", SLEN("thick") },
- { "collapse", SLEN("collapse") },
- { "separate", SLEN("separate") },
- { "auto", SLEN("auto") },
- { "ltr", SLEN("ltr") },
- { "rtl", SLEN("rtl") },
- { "inline", SLEN("inline") },
- { "block", SLEN("block") },
- { "list-item", SLEN("list-item") },
- { "run-in", SLEN("run-in") },
- { "inline-block", SLEN("inline-block") },
- { "table", SLEN("table") },
- { "inline-table", SLEN("inline-table") },
- { "table-row-group", SLEN("table-row-group") },
- { "table-header-group", SLEN("table-header-group") },
- { "table-footer-group", SLEN("table-footer-group") },
- { "table-row", SLEN("table-row") },
- { "table-column-group", SLEN("table-column-group") },
- { "table-column", SLEN("table-column") },
- { "table-cell", SLEN("table-cell") },
- { "table-caption", SLEN("table-caption") },
- { "below", SLEN("below") },
- { "level", SLEN("level") },
- { "above", SLEN("above") },
- { "higher", SLEN("higher") },
- { "lower", SLEN("lower") },
- { "show", SLEN("show") },
- { "hide", SLEN("hide") },
- { "xx-small", SLEN("xx-small") },
- { "x-small", SLEN("x-small") },
- { "small", SLEN("small") },
- { "large", SLEN("large") },
- { "x-large", SLEN("x-large") },
- { "xx-large", SLEN("xx-large") },
- { "larger", SLEN("larger") },
- { "smaller", SLEN("smaller") },
- { "normal", SLEN("normal") },
- { "italic", SLEN("italic") },
- { "oblique", SLEN("oblique") },
- { "small-caps", SLEN("small-caps") },
- { "bold", SLEN("bold") },
- { "bolder", SLEN("bolder") },
- { "lighter", SLEN("lighter") },
- { "inside", SLEN("inside") },
- { "outside", SLEN("outside") },
- { "disc", SLEN("disc") },
- { "circle", SLEN("circle") },
- { "square", SLEN("square") },
- { "decimal", SLEN("decimal") },
- { "decimal-leading-zero", SLEN("decimal-leading-zero") },
- { "lower-roman", SLEN("lower-roman") },
- { "upper-roman", SLEN("upper-roman") },
- { "lower-greek", SLEN("lower-greek") },
- { "lower-latin", SLEN("lower-latin") },
- { "upper-latin", SLEN("upper-latin") },
- { "armenian", SLEN("armenian") },
- { "georgian", SLEN("georgian") },
- { "lower-alpha", SLEN("lower-alpha") },
- { "upper-alpha", SLEN("upper-alpha") },
- { "binary", SLEN("binary") },
- { "octal", SLEN("octal") },
- { "lower-hexadecimal", SLEN("lower-hexadecimal") },
- { "upper-hexadecimal", SLEN("upper-hexadecimal") },
- { "arabic-indic", SLEN("arabic-indic") },
- { "lower-armenian", SLEN("lower-armenian") },
- { "upper-armenian", SLEN("upper-armenian") },
- { "bengali", SLEN("bengali") },
- { "cambodian", SLEN("cambodian") },
- { "khmer", SLEN("khmer") },
- { "cjk-decimal", SLEN("cjk-decimal") },
- { "devanagari", SLEN("devanagari") },
- { "gujarati", SLEN("gujarati") },
- { "gurmukhi", SLEN("gurmukhi") },
- { "hebrew", SLEN("hebrew") },
- { "kannada", SLEN("kannada") },
- { "lao", SLEN("lao") },
- { "malayalam", SLEN("malayalam") },
- { "mongolian", SLEN("mongolian") },
- { "myanmar", SLEN("myanmar") },
- { "oriya", SLEN("oriya") },
- { "persian", SLEN("persian") },
- { "tamil", SLEN("tamil") },
- { "telugu", SLEN("telugu") },
- { "thai", SLEN("thai") },
- { "tibetan", SLEN("tibetan") },
- { "cjk-earthly-branch", SLEN("cjk-earthly-branch") },
- { "cjk-heavenly-stem", SLEN("cjk-heavenly-stem") },
- { "hiragana", SLEN("hiragana") },
- { "hiragana-iroha", SLEN("hiragana-iroha") },
- { "katakana", SLEN("katakana") },
- { "katakana-iroha", SLEN("katakana-iroha") },
- { "invert", SLEN("invert") },
- { "visible", SLEN("visible") },
- { "always", SLEN("always") },
- { "avoid", SLEN("avoid") },
- { "x-low", SLEN("x-low") },
- { "low", SLEN("low") },
- { "high", SLEN("high") },
- { "x-high", SLEN("x-high") },
- { "static", SLEN("static") },
- { "relative", SLEN("relative") },
- { "absolute", SLEN("absolute") },
- { "once", SLEN("once") },
- { "digits", SLEN("digits") },
- { "continuous", SLEN("continuous") },
- { "code", SLEN("code") },
- { "spell-out", SLEN("spell-out") },
- { "x-slow", SLEN("x-slow") },
- { "slow", SLEN("slow") },
- { "fast", SLEN("fast") },
- { "x-fast", SLEN("x-fast") },
- { "faster", SLEN("faster") },
- { "slower", SLEN("slower") },
- { "center", SLEN("center") },
- { "justify", SLEN("justify") },
- { "capitalize", SLEN("capitalize") },
- { "uppercase", SLEN("uppercase") },
- { "lowercase", SLEN("lowercase") },
- { "embed", SLEN("embed") },
- { "bidi-override", SLEN("bidi-override") },
- { "baseline", SLEN("baseline") },
- { "sub", SLEN("sub") },
- { "super", SLEN("super") },
- { "text-top", SLEN("text-top") },
- { "middle", SLEN("middle") },
- { "text-bottom", SLEN("text-bottom") },
- { "silent", SLEN("silent") },
- { "x-soft", SLEN("x-soft") },
- { "soft", SLEN("soft") },
- { "loud", SLEN("loud") },
- { "x-loud", SLEN("x-loud") },
- { "pre", SLEN("pre") },
- { "nowrap", SLEN("nowrap") },
- { "pre-wrap", SLEN("pre-wrap") },
- { "pre-line", SLEN("pre-line") },
- { "leftwards", SLEN("leftwards") },
- { "rightwards", SLEN("rightwards") },
- { "left-side", SLEN("left-side") },
- { "far-left", SLEN("far-left") },
- { "center-left", SLEN("center-left") },
- { "center-right", SLEN("center-right") },
- { "far-right", SLEN("far-right") },
- { "right-side", SLEN("right-side") },
- { "behind", SLEN("behind") },
- { "rect", SLEN("rect") },
- { "open-quote", SLEN("open-quote") },
- { "close-quote", SLEN("close-quote") },
- { "no-open-quote", SLEN("no-open-quote") },
- { "no-close-quote", SLEN("no-close-quote") },
- { "attr", SLEN("attr") },
- { "counter", SLEN("counter") },
- { "counters", SLEN("counters") },
- { "crosshair", SLEN("crosshair") },
- { "default", SLEN("default") },
- { "pointer", SLEN("pointer") },
- { "move", SLEN("move") },
- { "e-resize", SLEN("e-resize") },
- { "ne-resize", SLEN("ne-resize") },
- { "nw-resize", SLEN("nw-resize") },
- { "n-resize", SLEN("n-resize") },
- { "se-resize", SLEN("se-resize") },
- { "sw-resize", SLEN("sw-resize") },
- { "s-resize", SLEN("s-resize") },
- { "w-resize", SLEN("w-resize") },
- { "text", SLEN("text") },
- { "wait", SLEN("wait") },
- { "help", SLEN("help") },
- { "progress", SLEN("progress") },
- { "serif", SLEN("serif") },
- { "sans-serif", SLEN("sans-serif") },
- { "cursive", SLEN("cursive") },
- { "fantasy", SLEN("fantasy") },
- { "monospace", SLEN("monospace") },
- { "male", SLEN("male") },
- { "female", SLEN("female") },
- { "child", SLEN("child") },
- { "mix", SLEN("mix") },
- { "underline", SLEN("underline") },
- { "overline", SLEN("overline") },
- { "line-through", SLEN("line-through") },
- { "blink", SLEN("blink") },
- { "rgb", SLEN("rgb") },
- { "rgba", SLEN("rgba") },
- { "hsl", SLEN("hsl") },
- { "hsla", SLEN("hsla") },
- { "-libcss-left", SLEN("-libcss-left") },
- { "-libcss-center", SLEN("-libcss-center") },
- { "-libcss-right", SLEN("-libcss-right") },
- { "currentColor", SLEN("currentColor") },
- { "odd", SLEN("odd") },
- { "even", SLEN("even") },
- { "src", SLEN("src") },
- { "local", SLEN("local") },
- { "initial", SLEN("initial") },
- { "format", SLEN("format") },
- { "woff", SLEN("woff") },
- { "truetype", SLEN("truetype") },
- { "opentype", SLEN("opentype") },
- { "embedded-opentype", SLEN("embedded-opentype") },
- { "svg", SLEN("svg") },
- { "column", SLEN("column") },
- { "avoid-page", SLEN("avoid_page") },
- { "avoid-column", SLEN("avoid-column") },
- { "balance", SLEN("balance") },
- { "horizontal-tb", SLEN("horizontal-tb") },
- { "vertical-rl", SLEN("vertical-rl") },
- { "vertical-lr", SLEN("vertical-lr") },
- { "content-box", SLEN("content-box") },
- { "border-box", SLEN("border-box") },
- { "stretch", SLEN("stretch") },
- { "inline-flex", SLEN("inline-flex") },
- { "flex-start", SLEN("flex-start") },
- { "flex-end", SLEN("flex-end") },
- { "space-between", SLEN("space-between") },
- { "space-around", SLEN("space-around") },
- { "space-evenly", SLEN("space-evenly") },
- { "row", SLEN("row") },
- { "row-reverse", SLEN("row-reverse") },
- { "column-reverse", SLEN("column-reverse") },
- { "wrap", SLEN("wrap") },
- { "wrap-reverse", SLEN("wrap-reverse") },
- { "and", SLEN("and") },
- { "or", SLEN("or") },
- { "only", SLEN("only") },
- { "infinite", SLEN("infinite") },
+ SMAP("inherit"),
+ SMAP("important"),
+ SMAP("none"),
+ SMAP("both"),
+ SMAP("fixed"),
+ SMAP("scroll"),
+ SMAP("transparent"),
+ SMAP("no-repeat"),
+ SMAP("repeat-x"),
+ SMAP("repeat-y"),
+ SMAP("repeat"),
+ SMAP("hidden"),
+ SMAP("dotted"),
+ SMAP("dashed"),
+ SMAP("solid"),
+ SMAP("double"),
+ SMAP("groove"),
+ SMAP("ridge"),
+ SMAP("inset"),
+ SMAP("outset"),
+ SMAP("thin"),
+ SMAP("medium"),
+ SMAP("thick"),
+ SMAP("collapse"),
+ SMAP("separate"),
+ SMAP("auto"),
+ SMAP("ltr"),
+ SMAP("rtl"),
+ SMAP("inline"),
+ SMAP("block"),
+ SMAP("list-item"),
+ SMAP("run-in"),
+ SMAP("inline-block"),
+ SMAP("table"),
+ SMAP("inline-table"),
+ SMAP("table-row-group"),
+ SMAP("table-header-group"),
+ SMAP("table-footer-group"),
+ SMAP("table-row"),
+ SMAP("table-column-group"),
+ SMAP("table-column"),
+ SMAP("table-cell"),
+ SMAP("table-caption"),
+ SMAP("below"),
+ SMAP("level"),
+ SMAP("above"),
+ SMAP("higher"),
+ SMAP("lower"),
+ SMAP("show"),
+ SMAP("hide"),
+ SMAP("xx-small"),
+ SMAP("x-small"),
+ SMAP("small"),
+ SMAP("large"),
+ SMAP("x-large"),
+ SMAP("xx-large"),
+ SMAP("larger"),
+ SMAP("smaller"),
+ SMAP("normal"),
+ SMAP("italic"),
+ SMAP("oblique"),
+ SMAP("small-caps"),
+ SMAP("bold"),
+ SMAP("bolder"),
+ SMAP("lighter"),
+ SMAP("inside"),
+ SMAP("outside"),
+ SMAP("disc"),
+ SMAP("circle"),
+ SMAP("square"),
+ SMAP("decimal"),
+ SMAP("decimal-leading-zero"),
+ SMAP("lower-roman"),
+ SMAP("upper-roman"),
+ SMAP("lower-greek"),
+ SMAP("lower-latin"),
+ SMAP("upper-latin"),
+ SMAP("armenian"),
+ SMAP("georgian"),
+ SMAP("lower-alpha"),
+ SMAP("upper-alpha"),
+ SMAP("binary"),
+ SMAP("octal"),
+ SMAP("lower-hexadecimal"),
+ SMAP("upper-hexadecimal"),
+ SMAP("arabic-indic"),
+ SMAP("lower-armenian"),
+ SMAP("upper-armenian"),
+ SMAP("bengali"),
+ SMAP("cambodian"),
+ SMAP("khmer"),
+ SMAP("cjk-decimal"),
+ SMAP("devanagari"),
+ SMAP("gujarati"),
+ SMAP("gurmukhi"),
+ SMAP("hebrew"),
+ SMAP("kannada"),
+ SMAP("lao"),
+ SMAP("malayalam"),
+ SMAP("mongolian"),
+ SMAP("myanmar"),
+ SMAP("oriya"),
+ SMAP("persian"),
+ SMAP("tamil"),
+ SMAP("telugu"),
+ SMAP("thai"),
+ SMAP("tibetan"),
+ SMAP("cjk-earthly-branch"),
+ SMAP("cjk-heavenly-stem"),
+ SMAP("hiragana"),
+ SMAP("hiragana-iroha"),
+ SMAP("katakana"),
+ SMAP("katakana-iroha"),
+ SMAP("invert"),
+ SMAP("visible"),
+ SMAP("always"),
+ SMAP("avoid"),
+ SMAP("x-low"),
+ SMAP("low"),
+ SMAP("high"),
+ SMAP("x-high"),
+ SMAP("static"),
+ SMAP("relative"),
+ SMAP("absolute"),
+ SMAP("once"),
+ SMAP("digits"),
+ SMAP("continuous"),
+ SMAP("code"),
+ SMAP("spell-out"),
+ SMAP("x-slow"),
+ SMAP("slow"),
+ SMAP("fast"),
+ SMAP("x-fast"),
+ SMAP("faster"),
+ SMAP("slower"),
+ SMAP("center"),
+ SMAP("justify"),
+ SMAP("capitalize"),
+ SMAP("uppercase"),
+ SMAP("lowercase"),
+ SMAP("embed"),
+ SMAP("bidi-override"),
+ SMAP("baseline"),
+ SMAP("sub"),
+ SMAP("super"),
+ SMAP("text-top"),
+ SMAP("middle"),
+ SMAP("text-bottom"),
+ SMAP("silent"),
+ SMAP("x-soft"),
+ SMAP("soft"),
+ SMAP("loud"),
+ SMAP("x-loud"),
+ SMAP("pre"),
+ SMAP("nowrap"),
+ SMAP("pre-wrap"),
+ SMAP("pre-line"),
+ SMAP("leftwards"),
+ SMAP("rightwards"),
+ SMAP("left-side"),
+ SMAP("far-left"),
+ SMAP("center-left"),
+ SMAP("center-right"),
+ SMAP("far-right"),
+ SMAP("right-side"),
+ SMAP("behind"),
+ SMAP("rect"),
+ SMAP("open-quote"),
+ SMAP("close-quote"),
+ SMAP("no-open-quote"),
+ SMAP("no-close-quote"),
+ SMAP("attr"),
+ SMAP("counter"),
+ SMAP("counters"),
+ SMAP("crosshair"),
+ SMAP("default"),
+ SMAP("pointer"),
+ SMAP("move"),
+ SMAP("e-resize"),
+ SMAP("ne-resize"),
+ SMAP("nw-resize"),
+ SMAP("n-resize"),
+ SMAP("se-resize"),
+ SMAP("sw-resize"),
+ SMAP("s-resize"),
+ SMAP("w-resize"),
+ SMAP("text"),
+ SMAP("wait"),
+ SMAP("help"),
+ SMAP("progress"),
+ SMAP("serif"),
+ SMAP("sans-serif"),
+ SMAP("cursive"),
+ SMAP("fantasy"),
+ SMAP("monospace"),
+ SMAP("male"),
+ SMAP("female"),
+ SMAP("child"),
+ SMAP("mix"),
+ SMAP("underline"),
+ SMAP("overline"),
+ SMAP("line-through"),
+ SMAP("blink"),
+ SMAP("rgb"),
+ SMAP("rgba"),
+ SMAP("hsl"),
+ SMAP("hsla"),
+ SMAP("-libcss-left"),
+ SMAP("-libcss-center"),
+ SMAP("-libcss-right"),
+ SMAP("currentColor"),
+ SMAP("odd"),
+ SMAP("even"),
+ SMAP("src"),
+ SMAP("local"),
+ SMAP("initial"),
+ SMAP("format"),
+ SMAP("woff"),
+ SMAP("truetype"),
+ SMAP("opentype"),
+ SMAP("embedded-opentype"),
+ SMAP("svg"),
+ SMAP("column"),
+ SMAP("avoid-page"),
+ SMAP("avoid-column"),
+ SMAP("balance"),
+ SMAP("horizontal-tb"),
+ SMAP("vertical-rl"),
+ SMAP("vertical-lr"),
+ SMAP("content-box"),
+ SMAP("border-box"),
+ SMAP("stretch"),
+ SMAP("inline-flex"),
+ SMAP("flex-start"),
+ SMAP("flex-end"),
+ SMAP("space-between"),
+ SMAP("space-around"),
+ SMAP("space-evenly"),
+ SMAP("row"),
+ SMAP("row-reverse"),
+ SMAP("column-reverse"),
+ SMAP("wrap"),
+ SMAP("wrap-reverse"),
+ SMAP("and"),
+ SMAP("or"),
+ SMAP("only"),
+ SMAP("infinite"),
- { "aliceblue", SLEN("aliceblue") },
- { "antiquewhite", SLEN("antiquewhite") },
- { "aqua", SLEN("aqua") },
- { "aquamarine", SLEN("aquamarine") },
- { "azure", SLEN("azure") },
- { "beige", SLEN("beige") },
- { "bisque", SLEN("bisque") },
- { "black", SLEN("black") },
- { "blanchedalmond", SLEN("blanchedalmond") },
- { "blue", SLEN("blue") },
- { "blueviolet", SLEN("blueviolet") },
- { "brown", SLEN("brown") },
- { "burlywood", SLEN("burlywood") },
- { "cadetblue", SLEN("cadetblue") },
- { "chartreuse", SLEN("chartreuse") },
- { "chocolate", SLEN("chocolate") },
- { "coral", SLEN("coral") },
- { "cornflowerblue", SLEN("cornflowerblue") },
- { "cornsilk", SLEN("cornsilk") },
- { "crimson", SLEN("crimson") },
- { "cyan", SLEN("cyan") },
- { "darkblue", SLEN("darkblue") },
- { "darkcyan", SLEN("darkcyan") },
- { "darkgoldenrod", SLEN("darkgoldenrod") },
- { "darkgray", SLEN("darkgray") },
- { "darkgreen", SLEN("darkgreen") },
- { "darkgrey", SLEN("darkgrey") },
- { "darkkhaki", SLEN("darkkhaki") },
- { "darkmagenta", SLEN("darkmagenta") },
- { "darkolivegreen", SLEN("darkolivegreen") },
- { "darkorange", SLEN("darkorange") },
- { "darkorchid", SLEN("darkorchid") },
- { "darkred", SLEN("darkred") },
- { "darksalmon", SLEN("darksalmon") },
- { "darkseagreen", SLEN("darkseagreen") },
- { "darkslateblue", SLEN("darkslateblue") },
- { "darkslategray", SLEN("darkslategray") },
- { "darkslategrey", SLEN("darkslategrey") },
- { "darkturquoise", SLEN("darkturquoise") },
- { "darkviolet", SLEN("darkviolet") },
- { "deeppink", SLEN("deeppink") },
- { "deepskyblue", SLEN("deepskyblue") },
- { "dimgray", SLEN("dimgray") },
- { "dimgrey", SLEN("dimgrey") },
- { "dodgerblue", SLEN("dodgerblue") },
- { "feldspar", SLEN("feldspar") },
- { "firebrick", SLEN("firebrick") },
- { "floralwhite", SLEN("floralwhite") },
- { "forestgreen", SLEN("forestgreen") },
- { "fuchsia", SLEN("fuchsia") },
- { "gainsboro", SLEN("gainsboro") },
- { "ghostwhite", SLEN("ghostwhite") },
- { "gold", SLEN("gold") },
- { "goldenrod", SLEN("goldenrod") },
- { "gray", SLEN("gray") },
- { "green", SLEN("green") },
- { "greenyellow", SLEN("greenyellow") },
- { "grey", SLEN("grey") },
- { "honeydew", SLEN("honeydew") },
- { "hotpink", SLEN("hotpink") },
- { "indianred", SLEN("indianred") },
- { "indigo", SLEN("indigo") },
- { "ivory", SLEN("ivory") },
- { "khaki", SLEN("khaki") },
- { "lavender", SLEN("lavender") },
- { "lavenderblush", SLEN("lavenderblush") },
- { "lawngreen", SLEN("lawngreen") },
- { "lemonchiffon", SLEN("lemonchiffon") },
- { "lightblue", SLEN("lightblue") },
- { "lightcoral", SLEN("lightcoral") },
- { "lightcyan", SLEN("lightcyan") },
- { "lightgoldenrodyellow", SLEN("lightgoldenrodyellow") },
- { "lightgray", SLEN("lightgray") },
- { "lightgreen", SLEN("lightgreen") },
- { "lightgrey", SLEN("lightgrey") },
- { "lightpink", SLEN("lightpink") },
- { "lightsalmon", SLEN("lightsalmon") },
- { "lightseagreen", SLEN("lightseagreen") },
- { "lightskyblue", SLEN("lightskyblue") },
- { "lightslateblue", SLEN("lightslateblue") },
- { "lightslategray", SLEN("lightslategray") },
- { "lightslategrey", SLEN("lightslategrey") },
- { "lightsteelblue", SLEN("lightsteelblue") },
- { "lightyellow", SLEN("lightyellow") },
- { "lime", SLEN("lime") },
- { "limegreen", SLEN("limegreen") },
- { "linen", SLEN("linen") },
- { "magenta", SLEN("magenta") },
- { "maroon", SLEN("maroon") },
- { "mediumaquamarine", SLEN("mediumaquamarine") },
- { "mediumblue", SLEN("mediumblue") },
- { "mediumorchid", SLEN("mediumorchid") },
- { "mediumpurple", SLEN("mediumpurple") },
- { "mediumseagreen", SLEN("mediumseagreen") },
- { "mediumslateblue", SLEN("mediumslateblue") },
- { "mediumspringgreen", SLEN("mediumspringgreen") },
- { "mediumturquoise", SLEN("mediumturquoise") },
- { "mediumvioletred", SLEN("mediumvioletred") },
- { "midnightblue", SLEN("midnightblue") },
- { "mintcream", SLEN("mintcream") },
- { "mistyrose", SLEN("mistyrose") },
- { "moccasin", SLEN("moccasin") },
- { "navajowhite", SLEN("navajowhite") },
- { "navy", SLEN("navy") },
- { "oldlace", SLEN("oldlace") },
- { "olive", SLEN("olive") },
- { "olivedrab", SLEN("olivedrab") },
- { "orange", SLEN("orange") },
- { "orangered", SLEN("orangered") },
- { "orchid", SLEN("orchid") },
- { "palegoldenrod", SLEN("palegoldenrod") },
- { "palegreen", SLEN("palegreen") },
- { "paleturquoise", SLEN("paleturquoise") },
- { "palevioletred", SLEN("palevioletred") },
- { "papayawhip", SLEN("papayawhip") },
- { "peachpuff", SLEN("peachpuff") },
- { "peru", SLEN("peru") },
- { "pink", SLEN("pink") },
- { "plum", SLEN("plum") },
- { "powderblue", SLEN("powderblue") },
- { "purple", SLEN("purple") },
- { "red", SLEN("red") },
- { "rosybrown", SLEN("rosybrown") },
- { "royalblue", SLEN("royalblue") },
- { "saddlebrown", SLEN("saddlebrown") },
- { "salmon", SLEN("salmon") },
- { "sandybrown", SLEN("sandybrown") },
- { "seagreen", SLEN("seagreen") },
- { "seashell", SLEN("seashell") },
- { "sienna", SLEN("sienna") },
- { "silver", SLEN("silver") },
- { "skyblue", SLEN("skyblue") },
- { "slateblue", SLEN("slateblue") },
- { "slategray", SLEN("slategray") },
- { "slategrey", SLEN("slategrey") },
- { "snow", SLEN("snow") },
- { "springgreen", SLEN("springgreen") },
- { "steelblue", SLEN("steelblue") },
- { "tan", SLEN("tan") },
- { "teal", SLEN("teal") },
- { "thistle", SLEN("thistle") },
- { "tomato", SLEN("tomato") },
- { "turquoise", SLEN("turquoise") },
- { "violet", SLEN("violet") },
- { "violetred", SLEN("violetred") },
- { "wheat", SLEN("wheat") },
- { "white", SLEN("white") },
- { "whitesmoke", SLEN("whitesmoke") },
- { "yellow", SLEN("yellow") },
- { "yellowgreen", SLEN("yellowgreen") }
+ SMAP("aliceblue"),
+ SMAP("antiquewhite"),
+ SMAP("aqua"),
+ SMAP("aquamarine"),
+ SMAP("azure"),
+ SMAP("beige"),
+ SMAP("bisque"),
+ SMAP("black"),
+ SMAP("blanchedalmond"),
+ SMAP("blue"),
+ SMAP("blueviolet"),
+ SMAP("brown"),
+ SMAP("burlywood"),
+ SMAP("cadetblue"),
+ SMAP("chartreuse"),
+ SMAP("chocolate"),
+ SMAP("coral"),
+ SMAP("cornflowerblue"),
+ SMAP("cornsilk"),
+ SMAP("crimson"),
+ SMAP("cyan"),
+ SMAP("darkblue"),
+ SMAP("darkcyan"),
+ SMAP("darkgoldenrod"),
+ SMAP("darkgray"),
+ SMAP("darkgreen"),
+ SMAP("darkgrey"),
+ SMAP("darkkhaki"),
+ SMAP("darkmagenta"),
+ SMAP("darkolivegreen"),
+ SMAP("darkorange"),
+ SMAP("darkorchid"),
+ SMAP("darkred"),
+ SMAP("darksalmon"),
+ SMAP("darkseagreen"),
+ SMAP("darkslateblue"),
+ SMAP("darkslategray"),
+ SMAP("darkslategrey"),
+ SMAP("darkturquoise"),
+ SMAP("darkviolet"),
+ SMAP("deeppink"),
+ SMAP("deepskyblue"),
+ SMAP("dimgray"),
+ SMAP("dimgrey"),
+ SMAP("dodgerblue"),
+ SMAP("feldspar"),
+ SMAP("firebrick"),
+ SMAP("floralwhite"),
+ SMAP("forestgreen"),
+ SMAP("fuchsia"),
+ SMAP("gainsboro"),
+ SMAP("ghostwhite"),
+ SMAP("gold"),
+ SMAP("goldenrod"),
+ SMAP("gray"),
+ SMAP("green"),
+ SMAP("greenyellow"),
+ SMAP("grey"),
+ SMAP("honeydew"),
+ SMAP("hotpink"),
+ SMAP("indianred"),
+ SMAP("indigo"),
+ SMAP("ivory"),
+ SMAP("khaki"),
+ SMAP("lavender"),
+ SMAP("lavenderblush"),
+ SMAP("lawngreen"),
+ SMAP("lemonchiffon"),
+ SMAP("lightblue"),
+ SMAP("lightcoral"),
+ SMAP("lightcyan"),
+ SMAP("lightgoldenrodyellow"),
+ SMAP("lightgray"),
+ SMAP("lightgreen"),
+ SMAP("lightgrey"),
+ SMAP("lightpink"),
+ SMAP("lightsalmon"),
+ SMAP("lightseagreen"),
+ SMAP("lightskyblue"),
+ SMAP("lightslateblue"),
+ SMAP("lightslategray"),
+ SMAP("lightslategrey"),
+ SMAP("lightsteelblue"),
+ SMAP("lightyellow"),
+ SMAP("lime"),
+ SMAP("limegreen"),
+ SMAP("linen"),
+ SMAP("magenta"),
+ SMAP("maroon"),
+ SMAP("mediumaquamarine"),
+ SMAP("mediumblue"),
+ SMAP("mediumorchid"),
+ SMAP("mediumpurple"),
+ SMAP("mediumseagreen"),
+ SMAP("mediumslateblue"),
+ SMAP("mediumspringgreen"),
+ SMAP("mediumturquoise"),
+ SMAP("mediumvioletred"),
+ SMAP("midnightblue"),
+ SMAP("mintcream"),
+ SMAP("mistyrose"),
+ SMAP("moccasin"),
+ SMAP("navajowhite"),
+ SMAP("navy"),
+ SMAP("oldlace"),
+ SMAP("olive"),
+ SMAP("olivedrab"),
+ SMAP("orange"),
+ SMAP("orangered"),
+ SMAP("orchid"),
+ SMAP("palegoldenrod"),
+ SMAP("palegreen"),
+ SMAP("paleturquoise"),
+ SMAP("palevioletred"),
+ SMAP("papayawhip"),
+ SMAP("peachpuff"),
+ SMAP("peru"),
+ SMAP("pink"),
+ SMAP("plum"),
+ SMAP("powderblue"),
+ SMAP("purple"),
+ SMAP("red"),
+ SMAP("rosybrown"),
+ SMAP("royalblue"),
+ SMAP("saddlebrown"),
+ SMAP("salmon"),
+ SMAP("sandybrown"),
+ SMAP("seagreen"),
+ SMAP("seashell"),
+ SMAP("sienna"),
+ SMAP("silver"),
+ SMAP("skyblue"),
+ SMAP("slateblue"),
+ SMAP("slategray"),
+ SMAP("slategrey"),
+ SMAP("snow"),
+ SMAP("springgreen"),
+ SMAP("steelblue"),
+ SMAP("tan"),
+ SMAP("teal"),
+ SMAP("thistle"),
+ SMAP("tomato"),
+ SMAP("turquoise"),
+ SMAP("violet"),
+ SMAP("violetred"),
+ SMAP("wheat"),
+ SMAP("white"),
+ SMAP("whitesmoke"),
+ SMAP("yellow"),
+ SMAP("yellowgreen")
};
--
Cascading Style Sheets library
1 year, 11 months
libcss: branch master updated. release/0.9.1-13-g7e7bb2c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/7e7bb2cde575d6ce2c0123...
...commit http://git.netsurf-browser.org/libcss.git/commit/7e7bb2cde575d6ce2c01231b...
...tree http://git.netsurf-browser.org/libcss.git/tree/7e7bb2cde575d6ce2c01231b77...
The branch, master has been updated
via 7e7bb2cde575d6ce2c01231b7759fe30c918b400 (commit)
from dd74dbf4b1a8d27cb49855f067f65b722d65bd42 (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=7e7bb2cde575d6ce2c01...
commit 7e7bb2cde575d6ce2c01231b7759fe30c918b400
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
implement the remaining css 3.1 simple predefined counter styles
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 6f8a51c..a5569d0 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -620,8 +620,25 @@ enum css_list_style_type_e {
CSS_LIST_STYLE_TYPE_CJK_DECIMAL = 0x1a,
CSS_LIST_STYLE_TYPE_DEVANAGARI = 0x1b,
CSS_LIST_STYLE_TYPE_GUJARATI = 0x1c,
- CSS_LIST_STYLE_TYPE_GURMUKHI = 0x1d
-
+ CSS_LIST_STYLE_TYPE_GURMUKHI = 0x1d,
+ CSS_LIST_STYLE_TYPE_HEBREW = 0x1e,
+ CSS_LIST_STYLE_TYPE_KANNADA = 0x1f,
+ CSS_LIST_STYLE_TYPE_LAO = 0x20,
+ CSS_LIST_STYLE_TYPE_MALAYALAM = 0x21,
+ CSS_LIST_STYLE_TYPE_MONGOLIAN = 0x22,
+ CSS_LIST_STYLE_TYPE_MYANMAR = 0x23,
+ CSS_LIST_STYLE_TYPE_ORIYA = 0x24,
+ CSS_LIST_STYLE_TYPE_PERSIAN = 0x25,
+ CSS_LIST_STYLE_TYPE_TAMIL = 0x26,
+ CSS_LIST_STYLE_TYPE_TELUGU = 0x27,
+ CSS_LIST_STYLE_TYPE_THAI = 0x28,
+ CSS_LIST_STYLE_TYPE_TIBETAN = 0x29,
+ CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH = 0x2a,
+ CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM = 0x2b,
+ CSS_LIST_STYLE_TYPE_HIAGANA = 0x2c,
+ CSS_LIST_STYLE_TYPE_HIAGANA_IROHA = 0x2d,
+ CSS_LIST_STYLE_TYPE_KATAKANA = 0x2e,
+ CSS_LIST_STYLE_TYPE_KATAKANA_IROHA = 0x2f
};
enum css_margin_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index b74e990..1e561e5 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -505,7 +505,25 @@ enum op_list_style_type {
LIST_STYLE_TYPE_CJK_DECIMAL = 0x0019,
LIST_STYLE_TYPE_DEVANAGARI = 0x001a,
LIST_STYLE_TYPE_GUJARATI = 0x001b,
- LIST_STYLE_TYPE_GURMUKHI = 0x001c
+ LIST_STYLE_TYPE_GURMUKHI = 0x001c,
+ LIST_STYLE_TYPE_HEBREW = 0x001d,
+ LIST_STYLE_TYPE_KANNADA = 0x001e,
+ LIST_STYLE_TYPE_LAO = 0x001f,
+ LIST_STYLE_TYPE_MALAYALAM = 0x0020,
+ LIST_STYLE_TYPE_MONGOLIAN = 0x0021,
+ LIST_STYLE_TYPE_MYANMAR = 0x0022,
+ LIST_STYLE_TYPE_ORIYA = 0x0023,
+ LIST_STYLE_TYPE_PERSIAN = 0x0024,
+ LIST_STYLE_TYPE_TAMIL = 0x0025,
+ LIST_STYLE_TYPE_TELUGU = 0x0026,
+ LIST_STYLE_TYPE_THAI = 0x0027,
+ LIST_STYLE_TYPE_TIBETAN = 0x0028,
+ LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH = 0x0029,
+ LIST_STYLE_TYPE_CJK_HEAVENLY_STEM = 0x002a,
+ LIST_STYLE_TYPE_HIAGANA = 0x002b,
+ LIST_STYLE_TYPE_HIAGANA_IROHA = 0x002c,
+ LIST_STYLE_TYPE_KATAKANA = 0x002d,
+ LIST_STYLE_TYPE_KATAKANA_IROHA = 0x002e
};
enum op_margin {
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index a71e22d..c82c88f 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -34,7 +34,7 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
* upper-latin, armenian, georgian, lower-alpha, upper-alpha,
* none)
*/
- #define MAP_ENTRIES 29
+ #define MAP_ENTRIES 47
bool match;
int midx;
const struct {
@@ -69,7 +69,25 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
{ CJK_DECIMAL, LIST_STYLE_TYPE_CJK_DECIMAL },
{ DEVANAGARI, LIST_STYLE_TYPE_DEVANAGARI },
{ GUJARATI, LIST_STYLE_TYPE_GUJARATI },
- { GURMUKHI, LIST_STYLE_TYPE_GURMUKHI }
+ { GURMUKHI, LIST_STYLE_TYPE_GURMUKHI },
+ { HEBREW, LIST_STYLE_TYPE_HEBREW },
+ { KANNADA, LIST_STYLE_TYPE_KANNADA },
+ { LAO, LIST_STYLE_TYPE_LAO },
+ { MALAYALAM, LIST_STYLE_TYPE_MALAYALAM },
+ { MONGOLIAN, LIST_STYLE_TYPE_MONGOLIAN },
+ { MYANMAR, LIST_STYLE_TYPE_MYANMAR },
+ { ORIYA, LIST_STYLE_TYPE_ORIYA },
+ { PERSIAN, LIST_STYLE_TYPE_PERSIAN },
+ { TAMIL, LIST_STYLE_TYPE_TAMIL },
+ { TELUGU, LIST_STYLE_TYPE_TELUGU },
+ { THAI, LIST_STYLE_TYPE_THAI },
+ { TIBETAN, LIST_STYLE_TYPE_TIBETAN },
+ { CJK_EARTHLY_BRANCH, LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH },
+ { CJK_HEAVENLY_STEM, LIST_STYLE_TYPE_CJK_HEAVENLY_STEM },
+ { HIAGANA, LIST_STYLE_TYPE_HIAGANA },
+ { HIAGANA_IROHA, LIST_STYLE_TYPE_HIAGANA_IROHA },
+ { KATAKANA, LIST_STYLE_TYPE_KATAKANA },
+ { KATAKANA_IROHA, LIST_STYLE_TYPE_KATAKANA_IROHA }
};
for (midx = 0; midx < MAP_ENTRIES; midx++) {
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 302f7f8..5528645 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -323,6 +323,24 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "devanagari", SLEN("devanagari") },
{ "gujarati", SLEN("gujarati") },
{ "gurmukhi", SLEN("gurmukhi") },
+ { "hebrew", SLEN("hebrew") },
+ { "kannada", SLEN("kannada") },
+ { "lao", SLEN("lao") },
+ { "malayalam", SLEN("malayalam") },
+ { "mongolian", SLEN("mongolian") },
+ { "myanmar", SLEN("myanmar") },
+ { "oriya", SLEN("oriya") },
+ { "persian", SLEN("persian") },
+ { "tamil", SLEN("tamil") },
+ { "telugu", SLEN("telugu") },
+ { "thai", SLEN("thai") },
+ { "tibetan", SLEN("tibetan") },
+ { "cjk-earthly-branch", SLEN("cjk-earthly-branch") },
+ { "cjk-heavenly-stem", SLEN("cjk-heavenly-stem") },
+ { "hiragana", SLEN("hiragana") },
+ { "hiragana-iroha", SLEN("hiragana-iroha") },
+ { "katakana", SLEN("katakana") },
+ { "katakana-iroha", SLEN("katakana-iroha") },
{ "invert", SLEN("invert") },
{ "visible", SLEN("visible") },
{ "always", SLEN("always") },
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 65954c6..f011231 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -85,7 +85,10 @@ enum {
LOWER_LATIN, UPPER_LATIN, ARMENIAN, GEORGIAN, LOWER_ALPHA, UPPER_ALPHA,
BINARY, OCTAL, LOWER_HEXADECIMAL, UPPER_HEXADECIMAL, ARABIC_INDIC,
LOWER_ARMENIAN, UPPER_ARMENIAN, BENGALI, CAMBODIAN, KHMER, CJK_DECIMAL,
- DEVANAGARI, GUJARATI, GURMUKHI,
+ DEVANAGARI, GUJARATI, GURMUKHI, HEBREW, KANNADA, LAO, MALAYALAM,
+ MONGOLIAN, MYANMAR, ORIYA, PERSIAN, TAMIL, TELUGU, THAI, TIBETAN,
+ CJK_EARTHLY_BRANCH, CJK_HEAVENLY_STEM, HIAGANA, HIAGANA_IROHA,
+ KATAKANA, KATAKANA_IROHA,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
RELATIVE, ABSOLUTE, ONCE, DIGITS, CONTINUOUS, CODE, SPELL_OUT, X_SLOW,
SLOW, FAST, X_FAST, FASTER, SLOWER, CENTER, JUSTIFY, CAPITALIZE,
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index e61f981..8636c03 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -659,6 +659,207 @@ static const struct list_counter_style lcs_gurmukhi = {
.calc = calc_numeric_system,
};
+static const int hebrew_weights[] = {
+ 10000,
+ 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000,
+ 400, 300, 200, 100,
+ 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10,
+ 9, 8, 7, 6, 5, 4, 3, 2, 1
+};
+static const symbol_t hebrew_symbols[] = {
+ "\xD7\x99\xD7\xB3",
+ "\xD7\x98\xD7\xB3", "\xD7\x97\xD7\xB3", "\xD7\x96\xD7\xB3", "\xD7\x95\xD7\xB3", "\xD7\x94\xD7\xB3", "\xD7\x93\xD7\xB3", "\xD7\x92\xD7\xB3", "\xD7\x91\xD7\xB3", "\xD7\x90\xD7\xB3",
+ "\xD7\xAA", "\xD7\xA9", "\xD7\xA8", "\xD7\xA7",
+ "\xD7\xA6", "\xD7\xA4", "\xD7\xA2", "\xD7\xA1", "\xD7\xA0", "\xD7\x9E", "\xD7\x9C", /* 20 */"\xD7\x9B", "\xD7\x99\xD7\x98", "\xD7\x99\xD7\x97", "\xD7\x99\xD7\x96", "\xD7\x98\xD7\x96", "\xD7\x98\xD7\x95", "\xD7\x99",
+ "\xD7\x98", "\xD7\x97", "\xD7\x96", "\xD7\x95", "\xD7\x94", "\xD7\x93", "\xD7\x92", "\xD7\x91", "\xD7\x90"
+};
+static const struct list_counter_style lcs_hebrew = {
+ .name = "hebrew",
+ .range = {
+ .start = 1,
+ .end = 10999,},
+ .symbols = hebrew_symbols,
+ .weights = hebrew_weights,
+ .items = (sizeof(hebrew_symbols) / SYMBOL_SIZE),
+ .calc = calc_additive_system,
+};
+
+static const symbol_t kannada_symbols[] = {
+ "\xE0\xB3\xA6", "\xE0\xB3\xA7", "\xE0\xB3\xA8", "\xE0\xB3\xA9", "\xE0\xB3\xAA", "\xE0\xB3\xAB", "\xE0\xB3\xAC", "\xE0\xB3\xAD", "\xE0\xB3\xAE", "\xE0\xB3\xAF"
+};
+static const struct list_counter_style lcs_kannada = {
+ .name = "kannada",
+ .symbols = kannada_symbols,
+ .items = (sizeof(kannada_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t lao_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_lao = {
+ .name = "lao",
+ .symbols = lao_symbols,
+ .items = (sizeof(lao_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t malayalam_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_malayalam = {
+ .name = "malayalam",
+ .symbols = malayalam_symbols,
+ .items = (sizeof(malayalam_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t mongolian_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_mongolian = {
+ .name = "mongolian",
+ .symbols = mongolian_symbols,
+ .items = (sizeof(mongolian_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t myanmar_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_myanmar = {
+ .name = "myanmar",
+ .symbols = myanmar_symbols,
+ .items = (sizeof(myanmar_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t oriya_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_oriya = {
+ .name = "oriya",
+ .symbols = oriya_symbols,
+ .items = (sizeof(oriya_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t persian_symbols[] = {
+ "��", "��", "��", "��", "��", "��", "��", "��", "��", "��"
+};
+static const struct list_counter_style lcs_persian = {
+ .name = "persian",
+ .symbols = persian_symbols,
+ .items = (sizeof(persian_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t tamil_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_tamil = {
+ .name = "tamil",
+ .symbols = tamil_symbols,
+ .items = (sizeof(tamil_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t telugu_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_telugu = {
+ .name = "telugu",
+ .symbols = telugu_symbols,
+ .items = (sizeof(telugu_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t thai_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_thai = {
+ .name = "thai",
+ .symbols = thai_symbols,
+ .items = (sizeof(thai_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t tibetan_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_tibetan = {
+ .name = "tibetan",
+ .symbols = tibetan_symbols,
+ .items = (sizeof(tibetan_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t cjk_earthly_branch_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_cjk_earthly_branch = {
+ .name = "cjk-earthly-branch",
+ .symbols = cjk_earthly_branch_symbols,
+ .items = (sizeof(cjk_earthly_branch_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t cjk_heavenly_stem_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_cjk_heavenly_stem = {
+ .name = "cjk-heavenly-stem",
+ .symbols = cjk_heavenly_stem_symbols,
+ .items = (sizeof(cjk_heavenly_stem_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t hiragana_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_hiragana = {
+ .name = "hiragana",
+ .symbols = hiragana_symbols,
+ .items = (sizeof(hiragana_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t hiragana_iroha_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_hiragana_iroha = {
+ .name = "hiragana-iroha",
+ .symbols = hiragana_iroha_symbols,
+ .items = (sizeof(hiragana_iroha_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t katakana_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_katakana = {
+ .name = "katakana",
+ .symbols = katakana_symbols,
+ .items = (sizeof(katakana_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t katakana_iroha_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_katakana_iroha = {
+ .name = "katakana-iroha",
+ .symbols = katakana_iroha_symbols,
+ .items = (sizeof(katakana_iroha_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
/* exported interface defined in select.h */
css_error css_computed_format_list_style(
@@ -779,6 +980,60 @@ css_error css_computed_format_list_style(
cstyle = &lcs_gurmukhi;
break;
+ case CSS_LIST_STYLE_TYPE_HEBREW:
+ cstyle = &lcs_hebrew;
+ break;
+ case CSS_LIST_STYLE_TYPE_KANNADA:
+ cstyle = &lcs_kannada;
+ break;
+ case CSS_LIST_STYLE_TYPE_LAO:
+ cstyle = &lcs_lao;
+ break;
+ case CSS_LIST_STYLE_TYPE_MALAYALAM:
+ cstyle = &lcs_malayalam;
+ break;
+ case CSS_LIST_STYLE_TYPE_MONGOLIAN:
+ cstyle = &lcs_mongolian;
+ break;
+ case CSS_LIST_STYLE_TYPE_MYANMAR:
+ cstyle = &lcs_myanmar;
+ break;
+ case CSS_LIST_STYLE_TYPE_ORIYA:
+ cstyle = &lcs_oriya;
+ break;
+ case CSS_LIST_STYLE_TYPE_PERSIAN:
+ cstyle = &lcs_persian;
+ break;
+ case CSS_LIST_STYLE_TYPE_TAMIL:
+ cstyle = &lcs_tamil;
+ break;
+ case CSS_LIST_STYLE_TYPE_TELUGU:
+ cstyle = &lcs_telugu;
+ break;
+ case CSS_LIST_STYLE_TYPE_THAI:
+ cstyle = &lcs_thai;
+ break;
+ case CSS_LIST_STYLE_TYPE_TIBETAN:
+ cstyle = &lcs_tibetan;
+ break;
+ case CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH:
+ cstyle = &lcs_cjk_earthly_branch;
+ break;
+ case CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM:
+ cstyle = &lcs_cjk_heavenly_stem;
+ break;
+ case CSS_LIST_STYLE_TYPE_HIAGANA:
+ cstyle = &lcs_hiragana;
+ break;
+ case CSS_LIST_STYLE_TYPE_HIAGANA_IROHA:
+ cstyle = &lcs_hiragana_iroha;
+ break;
+ case CSS_LIST_STYLE_TYPE_KATAKANA:
+ cstyle = &lcs_katakana;
+ break;
+ case CSS_LIST_STYLE_TYPE_KATAKANA_IROHA:
+ cstyle = &lcs_katakana_iroha;
+ break;
default:
return CSS_BADPARM;
}
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index 9a6af2c..7560c3b 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -110,6 +110,60 @@ css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
case LIST_STYLE_TYPE_GURMUKHI:
value = CSS_LIST_STYLE_TYPE_GURMUKHI;
break;
+ case LIST_STYLE_TYPE_HEBREW:
+ value = CSS_LIST_STYLE_TYPE_HEBREW;
+ break;
+ case LIST_STYLE_TYPE_KANNADA:
+ value = CSS_LIST_STYLE_TYPE_KANNADA;
+ break;
+ case LIST_STYLE_TYPE_LAO:
+ value = CSS_LIST_STYLE_TYPE_LAO;
+ break;
+ case LIST_STYLE_TYPE_MALAYALAM:
+ value = CSS_LIST_STYLE_TYPE_MALAYALAM;
+ break;
+ case LIST_STYLE_TYPE_MONGOLIAN:
+ value = CSS_LIST_STYLE_TYPE_MONGOLIAN;
+ break;
+ case LIST_STYLE_TYPE_MYANMAR:
+ value = CSS_LIST_STYLE_TYPE_MYANMAR;
+ break;
+ case LIST_STYLE_TYPE_ORIYA:
+ value = CSS_LIST_STYLE_TYPE_ORIYA;
+ break;
+ case LIST_STYLE_TYPE_PERSIAN:
+ value = CSS_LIST_STYLE_TYPE_PERSIAN;
+ break;
+ case LIST_STYLE_TYPE_TAMIL:
+ value = CSS_LIST_STYLE_TYPE_TAMIL;
+ break;
+ case LIST_STYLE_TYPE_TELUGU:
+ value = CSS_LIST_STYLE_TYPE_TELUGU;
+ break;
+ case LIST_STYLE_TYPE_THAI:
+ value = CSS_LIST_STYLE_TYPE_THAI;
+ break;
+ case LIST_STYLE_TYPE_TIBETAN:
+ value = CSS_LIST_STYLE_TYPE_TIBETAN;
+ break;
+ case LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH:
+ value = CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH;
+ break;
+ case LIST_STYLE_TYPE_CJK_HEAVENLY_STEM:
+ value = CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM;
+ break;
+ case LIST_STYLE_TYPE_HIAGANA:
+ value = CSS_LIST_STYLE_TYPE_HIAGANA;
+ break;
+ case LIST_STYLE_TYPE_HIAGANA_IROHA:
+ value = CSS_LIST_STYLE_TYPE_HIAGANA_IROHA;
+ break;
+ case LIST_STYLE_TYPE_KATAKANA:
+ value = CSS_LIST_STYLE_TYPE_KATAKANA;
+ break;
+ case LIST_STYLE_TYPE_KATAKANA_IROHA:
+ value = CSS_LIST_STYLE_TYPE_KATAKANA_IROHA;
+ break;
}
}
-----------------------------------------------------------------------
Summary of changes:
include/libcss/properties.h | 21 ++-
src/bytecode/opcodes.h | 20 ++-
src/parse/properties/utils.c | 22 ++-
src/parse/propstrings.c | 18 +++
src/parse/propstrings.h | 5 +-
src/select/format_list_style.c | 255 +++++++++++++++++++++++++++++++
src/select/properties/list_style_type.c | 54 +++++++
7 files changed, 389 insertions(+), 6 deletions(-)
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 6f8a51c..a5569d0 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -620,8 +620,25 @@ enum css_list_style_type_e {
CSS_LIST_STYLE_TYPE_CJK_DECIMAL = 0x1a,
CSS_LIST_STYLE_TYPE_DEVANAGARI = 0x1b,
CSS_LIST_STYLE_TYPE_GUJARATI = 0x1c,
- CSS_LIST_STYLE_TYPE_GURMUKHI = 0x1d
-
+ CSS_LIST_STYLE_TYPE_GURMUKHI = 0x1d,
+ CSS_LIST_STYLE_TYPE_HEBREW = 0x1e,
+ CSS_LIST_STYLE_TYPE_KANNADA = 0x1f,
+ CSS_LIST_STYLE_TYPE_LAO = 0x20,
+ CSS_LIST_STYLE_TYPE_MALAYALAM = 0x21,
+ CSS_LIST_STYLE_TYPE_MONGOLIAN = 0x22,
+ CSS_LIST_STYLE_TYPE_MYANMAR = 0x23,
+ CSS_LIST_STYLE_TYPE_ORIYA = 0x24,
+ CSS_LIST_STYLE_TYPE_PERSIAN = 0x25,
+ CSS_LIST_STYLE_TYPE_TAMIL = 0x26,
+ CSS_LIST_STYLE_TYPE_TELUGU = 0x27,
+ CSS_LIST_STYLE_TYPE_THAI = 0x28,
+ CSS_LIST_STYLE_TYPE_TIBETAN = 0x29,
+ CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH = 0x2a,
+ CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM = 0x2b,
+ CSS_LIST_STYLE_TYPE_HIAGANA = 0x2c,
+ CSS_LIST_STYLE_TYPE_HIAGANA_IROHA = 0x2d,
+ CSS_LIST_STYLE_TYPE_KATAKANA = 0x2e,
+ CSS_LIST_STYLE_TYPE_KATAKANA_IROHA = 0x2f
};
enum css_margin_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index b74e990..1e561e5 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -505,7 +505,25 @@ enum op_list_style_type {
LIST_STYLE_TYPE_CJK_DECIMAL = 0x0019,
LIST_STYLE_TYPE_DEVANAGARI = 0x001a,
LIST_STYLE_TYPE_GUJARATI = 0x001b,
- LIST_STYLE_TYPE_GURMUKHI = 0x001c
+ LIST_STYLE_TYPE_GURMUKHI = 0x001c,
+ LIST_STYLE_TYPE_HEBREW = 0x001d,
+ LIST_STYLE_TYPE_KANNADA = 0x001e,
+ LIST_STYLE_TYPE_LAO = 0x001f,
+ LIST_STYLE_TYPE_MALAYALAM = 0x0020,
+ LIST_STYLE_TYPE_MONGOLIAN = 0x0021,
+ LIST_STYLE_TYPE_MYANMAR = 0x0022,
+ LIST_STYLE_TYPE_ORIYA = 0x0023,
+ LIST_STYLE_TYPE_PERSIAN = 0x0024,
+ LIST_STYLE_TYPE_TAMIL = 0x0025,
+ LIST_STYLE_TYPE_TELUGU = 0x0026,
+ LIST_STYLE_TYPE_THAI = 0x0027,
+ LIST_STYLE_TYPE_TIBETAN = 0x0028,
+ LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH = 0x0029,
+ LIST_STYLE_TYPE_CJK_HEAVENLY_STEM = 0x002a,
+ LIST_STYLE_TYPE_HIAGANA = 0x002b,
+ LIST_STYLE_TYPE_HIAGANA_IROHA = 0x002c,
+ LIST_STYLE_TYPE_KATAKANA = 0x002d,
+ LIST_STYLE_TYPE_KATAKANA_IROHA = 0x002e
};
enum op_margin {
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index a71e22d..c82c88f 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -34,7 +34,7 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
* upper-latin, armenian, georgian, lower-alpha, upper-alpha,
* none)
*/
- #define MAP_ENTRIES 29
+ #define MAP_ENTRIES 47
bool match;
int midx;
const struct {
@@ -69,7 +69,25 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide
{ CJK_DECIMAL, LIST_STYLE_TYPE_CJK_DECIMAL },
{ DEVANAGARI, LIST_STYLE_TYPE_DEVANAGARI },
{ GUJARATI, LIST_STYLE_TYPE_GUJARATI },
- { GURMUKHI, LIST_STYLE_TYPE_GURMUKHI }
+ { GURMUKHI, LIST_STYLE_TYPE_GURMUKHI },
+ { HEBREW, LIST_STYLE_TYPE_HEBREW },
+ { KANNADA, LIST_STYLE_TYPE_KANNADA },
+ { LAO, LIST_STYLE_TYPE_LAO },
+ { MALAYALAM, LIST_STYLE_TYPE_MALAYALAM },
+ { MONGOLIAN, LIST_STYLE_TYPE_MONGOLIAN },
+ { MYANMAR, LIST_STYLE_TYPE_MYANMAR },
+ { ORIYA, LIST_STYLE_TYPE_ORIYA },
+ { PERSIAN, LIST_STYLE_TYPE_PERSIAN },
+ { TAMIL, LIST_STYLE_TYPE_TAMIL },
+ { TELUGU, LIST_STYLE_TYPE_TELUGU },
+ { THAI, LIST_STYLE_TYPE_THAI },
+ { TIBETAN, LIST_STYLE_TYPE_TIBETAN },
+ { CJK_EARTHLY_BRANCH, LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH },
+ { CJK_HEAVENLY_STEM, LIST_STYLE_TYPE_CJK_HEAVENLY_STEM },
+ { HIAGANA, LIST_STYLE_TYPE_HIAGANA },
+ { HIAGANA_IROHA, LIST_STYLE_TYPE_HIAGANA_IROHA },
+ { KATAKANA, LIST_STYLE_TYPE_KATAKANA },
+ { KATAKANA_IROHA, LIST_STYLE_TYPE_KATAKANA_IROHA }
};
for (midx = 0; midx < MAP_ENTRIES; midx++) {
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 302f7f8..5528645 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -323,6 +323,24 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "devanagari", SLEN("devanagari") },
{ "gujarati", SLEN("gujarati") },
{ "gurmukhi", SLEN("gurmukhi") },
+ { "hebrew", SLEN("hebrew") },
+ { "kannada", SLEN("kannada") },
+ { "lao", SLEN("lao") },
+ { "malayalam", SLEN("malayalam") },
+ { "mongolian", SLEN("mongolian") },
+ { "myanmar", SLEN("myanmar") },
+ { "oriya", SLEN("oriya") },
+ { "persian", SLEN("persian") },
+ { "tamil", SLEN("tamil") },
+ { "telugu", SLEN("telugu") },
+ { "thai", SLEN("thai") },
+ { "tibetan", SLEN("tibetan") },
+ { "cjk-earthly-branch", SLEN("cjk-earthly-branch") },
+ { "cjk-heavenly-stem", SLEN("cjk-heavenly-stem") },
+ { "hiragana", SLEN("hiragana") },
+ { "hiragana-iroha", SLEN("hiragana-iroha") },
+ { "katakana", SLEN("katakana") },
+ { "katakana-iroha", SLEN("katakana-iroha") },
{ "invert", SLEN("invert") },
{ "visible", SLEN("visible") },
{ "always", SLEN("always") },
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 65954c6..f011231 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -85,7 +85,10 @@ enum {
LOWER_LATIN, UPPER_LATIN, ARMENIAN, GEORGIAN, LOWER_ALPHA, UPPER_ALPHA,
BINARY, OCTAL, LOWER_HEXADECIMAL, UPPER_HEXADECIMAL, ARABIC_INDIC,
LOWER_ARMENIAN, UPPER_ARMENIAN, BENGALI, CAMBODIAN, KHMER, CJK_DECIMAL,
- DEVANAGARI, GUJARATI, GURMUKHI,
+ DEVANAGARI, GUJARATI, GURMUKHI, HEBREW, KANNADA, LAO, MALAYALAM,
+ MONGOLIAN, MYANMAR, ORIYA, PERSIAN, TAMIL, TELUGU, THAI, TIBETAN,
+ CJK_EARTHLY_BRANCH, CJK_HEAVENLY_STEM, HIAGANA, HIAGANA_IROHA,
+ KATAKANA, KATAKANA_IROHA,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
RELATIVE, ABSOLUTE, ONCE, DIGITS, CONTINUOUS, CODE, SPELL_OUT, X_SLOW,
SLOW, FAST, X_FAST, FASTER, SLOWER, CENTER, JUSTIFY, CAPITALIZE,
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index e61f981..8636c03 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -659,6 +659,207 @@ static const struct list_counter_style lcs_gurmukhi = {
.calc = calc_numeric_system,
};
+static const int hebrew_weights[] = {
+ 10000,
+ 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000,
+ 400, 300, 200, 100,
+ 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10,
+ 9, 8, 7, 6, 5, 4, 3, 2, 1
+};
+static const symbol_t hebrew_symbols[] = {
+ "\xD7\x99\xD7\xB3",
+ "\xD7\x98\xD7\xB3", "\xD7\x97\xD7\xB3", "\xD7\x96\xD7\xB3", "\xD7\x95\xD7\xB3", "\xD7\x94\xD7\xB3", "\xD7\x93\xD7\xB3", "\xD7\x92\xD7\xB3", "\xD7\x91\xD7\xB3", "\xD7\x90\xD7\xB3",
+ "\xD7\xAA", "\xD7\xA9", "\xD7\xA8", "\xD7\xA7",
+ "\xD7\xA6", "\xD7\xA4", "\xD7\xA2", "\xD7\xA1", "\xD7\xA0", "\xD7\x9E", "\xD7\x9C", /* 20 */"\xD7\x9B", "\xD7\x99\xD7\x98", "\xD7\x99\xD7\x97", "\xD7\x99\xD7\x96", "\xD7\x98\xD7\x96", "\xD7\x98\xD7\x95", "\xD7\x99",
+ "\xD7\x98", "\xD7\x97", "\xD7\x96", "\xD7\x95", "\xD7\x94", "\xD7\x93", "\xD7\x92", "\xD7\x91", "\xD7\x90"
+};
+static const struct list_counter_style lcs_hebrew = {
+ .name = "hebrew",
+ .range = {
+ .start = 1,
+ .end = 10999,},
+ .symbols = hebrew_symbols,
+ .weights = hebrew_weights,
+ .items = (sizeof(hebrew_symbols) / SYMBOL_SIZE),
+ .calc = calc_additive_system,
+};
+
+static const symbol_t kannada_symbols[] = {
+ "\xE0\xB3\xA6", "\xE0\xB3\xA7", "\xE0\xB3\xA8", "\xE0\xB3\xA9", "\xE0\xB3\xAA", "\xE0\xB3\xAB", "\xE0\xB3\xAC", "\xE0\xB3\xAD", "\xE0\xB3\xAE", "\xE0\xB3\xAF"
+};
+static const struct list_counter_style lcs_kannada = {
+ .name = "kannada",
+ .symbols = kannada_symbols,
+ .items = (sizeof(kannada_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t lao_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_lao = {
+ .name = "lao",
+ .symbols = lao_symbols,
+ .items = (sizeof(lao_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t malayalam_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_malayalam = {
+ .name = "malayalam",
+ .symbols = malayalam_symbols,
+ .items = (sizeof(malayalam_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t mongolian_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_mongolian = {
+ .name = "mongolian",
+ .symbols = mongolian_symbols,
+ .items = (sizeof(mongolian_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t myanmar_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_myanmar = {
+ .name = "myanmar",
+ .symbols = myanmar_symbols,
+ .items = (sizeof(myanmar_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t oriya_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_oriya = {
+ .name = "oriya",
+ .symbols = oriya_symbols,
+ .items = (sizeof(oriya_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t persian_symbols[] = {
+ "��", "��", "��", "��", "��", "��", "��", "��", "��", "��"
+};
+static const struct list_counter_style lcs_persian = {
+ .name = "persian",
+ .symbols = persian_symbols,
+ .items = (sizeof(persian_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t tamil_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_tamil = {
+ .name = "tamil",
+ .symbols = tamil_symbols,
+ .items = (sizeof(tamil_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t telugu_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_telugu = {
+ .name = "telugu",
+ .symbols = telugu_symbols,
+ .items = (sizeof(telugu_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t thai_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_thai = {
+ .name = "thai",
+ .symbols = thai_symbols,
+ .items = (sizeof(thai_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t tibetan_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_tibetan = {
+ .name = "tibetan",
+ .symbols = tibetan_symbols,
+ .items = (sizeof(tibetan_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t cjk_earthly_branch_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_cjk_earthly_branch = {
+ .name = "cjk-earthly-branch",
+ .symbols = cjk_earthly_branch_symbols,
+ .items = (sizeof(cjk_earthly_branch_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t cjk_heavenly_stem_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_cjk_heavenly_stem = {
+ .name = "cjk-heavenly-stem",
+ .symbols = cjk_heavenly_stem_symbols,
+ .items = (sizeof(cjk_heavenly_stem_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t hiragana_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_hiragana = {
+ .name = "hiragana",
+ .symbols = hiragana_symbols,
+ .items = (sizeof(hiragana_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t hiragana_iroha_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_hiragana_iroha = {
+ .name = "hiragana-iroha",
+ .symbols = hiragana_iroha_symbols,
+ .items = (sizeof(hiragana_iroha_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t katakana_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_katakana = {
+ .name = "katakana",
+ .symbols = katakana_symbols,
+ .items = (sizeof(katakana_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
+static const symbol_t katakana_iroha_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static struct list_counter_style lcs_katakana_iroha = {
+ .name = "katakana-iroha",
+ .symbols = katakana_iroha_symbols,
+ .items = (sizeof(katakana_iroha_symbols) / SYMBOL_SIZE),
+ .postfix = "���",
+ .calc = calc_alphabet_system,
+};
+
/* exported interface defined in select.h */
css_error css_computed_format_list_style(
@@ -779,6 +980,60 @@ css_error css_computed_format_list_style(
cstyle = &lcs_gurmukhi;
break;
+ case CSS_LIST_STYLE_TYPE_HEBREW:
+ cstyle = &lcs_hebrew;
+ break;
+ case CSS_LIST_STYLE_TYPE_KANNADA:
+ cstyle = &lcs_kannada;
+ break;
+ case CSS_LIST_STYLE_TYPE_LAO:
+ cstyle = &lcs_lao;
+ break;
+ case CSS_LIST_STYLE_TYPE_MALAYALAM:
+ cstyle = &lcs_malayalam;
+ break;
+ case CSS_LIST_STYLE_TYPE_MONGOLIAN:
+ cstyle = &lcs_mongolian;
+ break;
+ case CSS_LIST_STYLE_TYPE_MYANMAR:
+ cstyle = &lcs_myanmar;
+ break;
+ case CSS_LIST_STYLE_TYPE_ORIYA:
+ cstyle = &lcs_oriya;
+ break;
+ case CSS_LIST_STYLE_TYPE_PERSIAN:
+ cstyle = &lcs_persian;
+ break;
+ case CSS_LIST_STYLE_TYPE_TAMIL:
+ cstyle = &lcs_tamil;
+ break;
+ case CSS_LIST_STYLE_TYPE_TELUGU:
+ cstyle = &lcs_telugu;
+ break;
+ case CSS_LIST_STYLE_TYPE_THAI:
+ cstyle = &lcs_thai;
+ break;
+ case CSS_LIST_STYLE_TYPE_TIBETAN:
+ cstyle = &lcs_tibetan;
+ break;
+ case CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH:
+ cstyle = &lcs_cjk_earthly_branch;
+ break;
+ case CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM:
+ cstyle = &lcs_cjk_heavenly_stem;
+ break;
+ case CSS_LIST_STYLE_TYPE_HIAGANA:
+ cstyle = &lcs_hiragana;
+ break;
+ case CSS_LIST_STYLE_TYPE_HIAGANA_IROHA:
+ cstyle = &lcs_hiragana_iroha;
+ break;
+ case CSS_LIST_STYLE_TYPE_KATAKANA:
+ cstyle = &lcs_katakana;
+ break;
+ case CSS_LIST_STYLE_TYPE_KATAKANA_IROHA:
+ cstyle = &lcs_katakana_iroha;
+ break;
default:
return CSS_BADPARM;
}
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index 9a6af2c..7560c3b 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -110,6 +110,60 @@ css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
case LIST_STYLE_TYPE_GURMUKHI:
value = CSS_LIST_STYLE_TYPE_GURMUKHI;
break;
+ case LIST_STYLE_TYPE_HEBREW:
+ value = CSS_LIST_STYLE_TYPE_HEBREW;
+ break;
+ case LIST_STYLE_TYPE_KANNADA:
+ value = CSS_LIST_STYLE_TYPE_KANNADA;
+ break;
+ case LIST_STYLE_TYPE_LAO:
+ value = CSS_LIST_STYLE_TYPE_LAO;
+ break;
+ case LIST_STYLE_TYPE_MALAYALAM:
+ value = CSS_LIST_STYLE_TYPE_MALAYALAM;
+ break;
+ case LIST_STYLE_TYPE_MONGOLIAN:
+ value = CSS_LIST_STYLE_TYPE_MONGOLIAN;
+ break;
+ case LIST_STYLE_TYPE_MYANMAR:
+ value = CSS_LIST_STYLE_TYPE_MYANMAR;
+ break;
+ case LIST_STYLE_TYPE_ORIYA:
+ value = CSS_LIST_STYLE_TYPE_ORIYA;
+ break;
+ case LIST_STYLE_TYPE_PERSIAN:
+ value = CSS_LIST_STYLE_TYPE_PERSIAN;
+ break;
+ case LIST_STYLE_TYPE_TAMIL:
+ value = CSS_LIST_STYLE_TYPE_TAMIL;
+ break;
+ case LIST_STYLE_TYPE_TELUGU:
+ value = CSS_LIST_STYLE_TYPE_TELUGU;
+ break;
+ case LIST_STYLE_TYPE_THAI:
+ value = CSS_LIST_STYLE_TYPE_THAI;
+ break;
+ case LIST_STYLE_TYPE_TIBETAN:
+ value = CSS_LIST_STYLE_TYPE_TIBETAN;
+ break;
+ case LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH:
+ value = CSS_LIST_STYLE_TYPE_CJK_EARTHLY_BRANCH;
+ break;
+ case LIST_STYLE_TYPE_CJK_HEAVENLY_STEM:
+ value = CSS_LIST_STYLE_TYPE_CJK_HEAVENLY_STEM;
+ break;
+ case LIST_STYLE_TYPE_HIAGANA:
+ value = CSS_LIST_STYLE_TYPE_HIAGANA;
+ break;
+ case LIST_STYLE_TYPE_HIAGANA_IROHA:
+ value = CSS_LIST_STYLE_TYPE_HIAGANA_IROHA;
+ break;
+ case LIST_STYLE_TYPE_KATAKANA:
+ value = CSS_LIST_STYLE_TYPE_KATAKANA;
+ break;
+ case LIST_STYLE_TYPE_KATAKANA_IROHA:
+ value = CSS_LIST_STYLE_TYPE_KATAKANA_IROHA;
+ break;
}
}
--
Cascading Style Sheets library
1 year, 11 months
libdom: branch master updated. release/0.4.1-8-g603ef81
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/603ef81d5f715a16680278...
...commit http://git.netsurf-browser.org/libdom.git/commit/603ef81d5f715a16680278af...
...tree http://git.netsurf-browser.org/libdom.git/tree/603ef81d5f715a16680278affa...
The branch, master has been updated
via 603ef81d5f715a16680278affa49f0b95b81c347 (commit)
from 720668e90e02bf408d344e8b1d83fb16638c8605 (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/libdom.git/commit/?id=603ef81d5f715a166802...
commit 603ef81d5f715a16680278affa49f0b95b81c347
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
html element: int32 attribute getter: Handle signed values.
diff --git a/src/html/html_element.c b/src/html/html_element.c
index df0fa6a..3062a23 100644
--- a/src/html/html_element.c
+++ b/src/html/html_element.c
@@ -477,7 +477,7 @@ dom_exception dom_html_element_get_int32_t_property(dom_html_element *ele,
char *s3 = _strndup(dom_string_data(s2),
dom_string_byte_length(s2));
if (s3 != NULL) {
- *value = strtoul(s3, NULL, 0);
+ *value = strtol(s3, NULL, 0);
free(s3);
} else {
err = DOM_NO_MEM_ERR;
-----------------------------------------------------------------------
Summary of changes:
src/html/html_element.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/html/html_element.c b/src/html/html_element.c
index df0fa6a..3062a23 100644
--- a/src/html/html_element.c
+++ b/src/html/html_element.c
@@ -477,7 +477,7 @@ dom_exception dom_html_element_get_int32_t_property(dom_html_element *ele,
char *s3 = _strndup(dom_string_data(s2),
dom_string_byte_length(s2));
if (s3 != NULL) {
- *value = strtoul(s3, NULL, 0);
+ *value = strtol(s3, NULL, 0);
free(s3);
} else {
err = DOM_NO_MEM_ERR;
--
Document Object Model library
1 year, 11 months
netsurf: branch tlsa/list-values created. release/3.10-111-g9783296
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/9783296c4ffd83dfdb18e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/9783296c4ffd83dfdb18e1e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/9783296c4ffd83dfdb18e1e29...
The branch, tlsa/list-values has been created
at 9783296c4ffd83dfdb18e1e293ad635f214d2fd0 (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9783296c4ffd83dfdb1...
commit 9783296c4ffd83dfdb18e1e293ad635f214d2fd0
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
layout: Add support for OL reversed attribute.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 672084a..94cdf8f 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4517,6 +4517,98 @@ layout__get_ol_start(dom_node *ol_node, dom_long *start_out)
/**
+ * Helper to get reversed attribute value from a OL node.
+ *
+ * \param[in] ol_node DOM node for the OL element;
+ * \return true if node has reversed, otherwise false.
+ */
+static bool
+layout__get_ol_reversed(dom_node *ol_node)
+{
+ dom_exception exc;
+ bool has_reversed;
+
+ exc = dom_element_has_attribute(ol_node,
+ corestring_dom_reversed,
+ &has_reversed);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ return has_reversed;
+}
+
+
+/**
+ * Get the number of list items for a list owner.
+ *
+ * \param[in] list_owner DOM node to count list items for.
+ * \param[in] count_out Returns list item count on success.
+ * \return true on success, otherwise false.
+ */
+static bool
+layout__get_list_item_count(
+ dom_node *list_owner, int *count_out)
+{
+ dom_html_element_type tag_type;
+ dom_exception exc;
+ dom_node *child;
+ int count;
+
+ if (list_owner == NULL) {
+ return false;
+ }
+
+ exc = dom_html_element_get_tag_type(list_owner, &tag_type);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ if (tag_type != DOM_HTML_ELEMENT_TYPE_OL &&
+ tag_type != DOM_HTML_ELEMENT_TYPE_UL) {
+ return false;
+ }
+
+ exc = dom_node_get_first_child(list_owner, &child);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ count = 0;
+ while (child != NULL) {
+ dom_node *temp_node;
+
+ if (layout__check_element_type(child,
+ DOM_HTML_ELEMENT_TYPE_LI)) {
+ struct box *child_box;
+ if (dom_node_get_user_data(child,
+ corestring_dom___ns_key_box_node_data,
+ &child_box) != DOM_NO_ERR) {
+ dom_node_unref(child);
+ return false;
+ }
+
+ if (child_box != NULL &&
+ child_box->list_marker != NULL) {
+ count++;
+ }
+ }
+
+ exc = dom_node_get_next_sibling(child, &temp_node);
+ dom_node_unref(child);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ child = temp_node;
+ }
+
+ *count_out = count;
+ return true;
+}
+
+
+/**
* Handle list item counting, if this is a list owner box.
*
* \param[in] box Box to do list item counting for.
@@ -4547,7 +4639,16 @@ layout__ordered_list_count(
next = 1;
if (tag_type == DOM_HTML_ELEMENT_TYPE_OL) {
- layout__get_ol_start(box->node, &next);
+ bool have_start = layout__get_ol_start(box->node, &next);
+ bool have_reversed = layout__get_ol_reversed(box->node);
+
+ if (have_reversed) {
+ step = -1;
+ }
+
+ if (!have_start && have_reversed) {
+ layout__get_list_item_count(box->node, &next);
+ }
}
exc = dom_node_get_first_child(box->node, &child);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=32d9de461e4cb9c287d...
commit 32d9de461e4cb9c287dbafb0745ac64358a0b561
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
util: corestring: Add DOM "reversed" string.
diff --git a/utils/corestringlist.h b/utils/corestringlist.h
index b287cde..b253b3b 100644
--- a/utils/corestringlist.h
+++ b/utils/corestringlist.h
@@ -295,6 +295,7 @@ CORESTRING_DOM_STRING(rect);
CORESTRING_DOM_STRING(rel);
CORESTRING_DOM_STRING(reset);
CORESTRING_DOM_STRING(resize);
+CORESTRING_DOM_STRING(reversed);
CORESTRING_DOM_STRING(rows);
CORESTRING_DOM_STRING(rowspan);
CORESTRING_DOM_STRING(scroll);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=496b1eca087490346a2...
commit 496b1eca087490346a29c6c062c53a21e679ddd5
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
layout: list handling: Scope reduce some variables in the recursive call.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 6d7d70f..672084a 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4674,14 +4674,13 @@ static void
layout_lists(const html_content *content, struct box *box)
{
struct box *child;
- struct box *marker;
- plot_font_style_t fstyle;
layout__ordered_list_count(box);
for (child = box->children; child; child = child->next) {
if (child->list_marker) {
- marker = child->list_marker;
+ struct box *marker = child->list_marker;
+
if (layout__list_item_is_numerical(child)) {
if (marker->text == NULL) {
layout__set_numerical_marker_text(
@@ -4700,6 +4699,7 @@ layout_lists(const html_content *content, struct box *box)
marker->height) / 2;
} else if (marker->text) {
if (marker->width == UNKNOWN_WIDTH) {
+ plot_font_style_t fstyle;
font_plot_style_from_css(
&content->len_ctx,
marker->style,
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d29f6d6c1e8433f718b...
commit d29f6d6c1e8433f718b6de3d31626cd6f06c352f
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
html: layout: Change list value step to variable.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 8f84cf4..6d7d70f 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4528,6 +4528,7 @@ layout__ordered_list_count(
dom_html_element_type tag_type;
dom_exception exc;
dom_node *child;
+ int step = 1;
int next;
if (box->node == NULL) {
@@ -4578,7 +4579,7 @@ layout__ordered_list_count(
} else {
marker->list_value = next;
}
- next++;
+ next += step;
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e18bb8fde15d860f198...
commit e18bb8fde15d860f198b9555ddac123273ea2e30
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
html: Add support for OL start attribute.
Note: Added new box member because rows was unsigned, and it was
naughty to use something meant for tables.
Note: Now numbers <= 0 can be generated, but LibCSS needs updated
to support that.
diff --git a/content/handlers/html/box.h b/content/handlers/html/box.h
index a193d3c..1059556 100644
--- a/content/handlers/html/box.h
+++ b/content/handlers/html/box.h
@@ -405,6 +405,11 @@ struct box {
struct column *col;
/**
+ * List item value.
+ */
+ int list_value;
+
+ /**
* List marker box if this is a list-item, or NULL.
*/
struct box *list_marker;
diff --git a/content/handlers/html/box_manipulate.c b/content/handlers/html/box_manipulate.c
index d23091b..8073a7f 100644
--- a/content/handlers/html/box_manipulate.c
+++ b/content/handlers/html/box_manipulate.c
@@ -143,6 +143,7 @@ box_create(css_select_results *styles,
box->float_container = NULL;
box->next_float = NULL;
box->cached_place_below_level = 0;
+ box->list_value = 1;
box->list_marker = NULL;
box->col = NULL;
box->gadget = NULL;
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index b46b8a5..8f84cf4 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4481,6 +4481,42 @@ layout__get_li_value(dom_node *li_node, dom_long *value_out)
/**
+ * Helper to get start attribute value from a OL node.
+ *
+ * \param[in] ol_node DOM node for the OL element;
+ * \param[out] start_out Returns the value on success.
+ * \return true if node has value, otherwise false.
+ */
+static bool
+layout__get_ol_start(dom_node *ol_node, dom_long *start_out)
+{
+ dom_exception exc;
+ dom_long start;
+ bool has_start;
+
+ /** \todo
+ * see layout__get_li_value().
+ */
+ exc = dom_element_has_attribute(ol_node,
+ corestring_dom_start,
+ &has_start);
+ if (exc != DOM_NO_ERR || has_start == false) {
+ return false;
+ }
+
+ exc = dom_html_olist_element_get_start(
+ (dom_html_olist_element *)ol_node,
+ &start);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ *start_out = start;
+ return true;
+}
+
+
+/**
* Handle list item counting, if this is a list owner box.
*
* \param[in] box Box to do list item counting for.
@@ -4492,8 +4528,7 @@ layout__ordered_list_count(
dom_html_element_type tag_type;
dom_exception exc;
dom_node *child;
- unsigned count;
- unsigned next;
+ int next;
if (box->node == NULL) {
return;
@@ -4509,13 +4544,16 @@ layout__ordered_list_count(
return;
}
+ next = 1;
+ if (tag_type == DOM_HTML_ELEMENT_TYPE_OL) {
+ layout__get_ol_start(box->node, &next);
+ }
+
exc = dom_node_get_first_child(box->node, &child);
if (exc != DOM_NO_ERR) {
return;
}
- count = 1;
- next = 1;
while (child != NULL) {
dom_node *temp_node;
@@ -4533,14 +4571,14 @@ layout__ordered_list_count(
if (child_box != NULL &&
child_box->list_marker != NULL) {
dom_long value;
+ struct box *marker = child_box->list_marker;
if (layout__get_li_value(child, &value)) {
- child_box->list_marker->rows = value;
- next = value + 1;
+ marker->list_value = value;
+ next = marker->list_value;
} else {
- child_box->list_marker->rows = next;
- next++;
+ marker->list_value = next;
}
- count++;
+ next++;
}
}
@@ -4552,8 +4590,6 @@ layout__ordered_list_count(
child = temp_node;
}
-
- box->rows = count;
}
/**
@@ -4585,7 +4621,7 @@ layout__set_numerical_marker_text(
return;
}
- css_res = css_computed_format_list_style(box->style, marker->rows,
+ css_res = css_computed_format_list_style(box->style, marker->list_value,
marker->text, LIST_MARKER_SIZE, &counter_len);
if (css_res == CSS_OK) {
if (counter_len > LIST_MARKER_SIZE) {
@@ -4599,7 +4635,7 @@ layout__set_numerical_marker_text(
return;
}
css_computed_format_list_style(box->style,
- marker->rows, marker->text,
+ marker->list_value, marker->text,
counter_len, &counter_len);
}
marker->length = counter_len;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4c941254c8cfd1cf0e6...
commit 4c941254c8cfd1cf0e6f005d39ed0cc8f8ff077c
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
util: corestring: Add DOM "start" string.
diff --git a/utils/corestringlist.h b/utils/corestringlist.h
index d6be3c4..b287cde 100644
--- a/utils/corestringlist.h
+++ b/utils/corestringlist.h
@@ -309,6 +309,7 @@ CORESTRING_DOM_STRING(size);
CORESTRING_DOM_STRING(sizes);
CORESTRING_DOM_STRING(src);
CORESTRING_DOM_STRING(stalled);
+CORESTRING_DOM_STRING(start);
CORESTRING_DOM_STRING(storage);
CORESTRING_DOM_STRING(style);
CORESTRING_DOM_STRING(submit);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=64680a8edbebcfbcb5f...
commit 64680a8edbebcfbcb5f2f2ddcce9a998aeef19f3
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
layout: Add support for list item value attribute.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 2f222b9..b46b8a5 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4439,6 +4439,48 @@ layout__check_element_type(
/**
+ * Helper to get attribute value from a LI node.
+ *
+ * \param[in] li_node DOM node for the LI element;
+ * \param[out] value_out Returns the value on success.
+ * \return true if node has value, otherwise false.
+ */
+static bool
+layout__get_li_value(dom_node *li_node, dom_long *value_out)
+{
+ dom_exception exc;
+ dom_long value;
+ bool has_value;
+
+ /** \todo
+ * dom_html_li_element_get_value() is rubbish and we can't tell
+ * a lack of value attribute or invalid value from a perfectly
+ * valid '-1'.
+ *
+ * This helps for the common case of no value. However we should
+ * fix libdom to have some kind of sane interface to get numerical
+ * attributes.
+ */
+ exc = dom_element_has_attribute(li_node,
+ corestring_dom_value,
+ &has_value);
+ if (exc != DOM_NO_ERR || has_value == false) {
+ return false;
+ }
+
+ exc = dom_html_li_element_get_value(
+ (dom_html_li_element *)li_node,
+ &value);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ *value_out = value;
+ return true;
+}
+
+
+/**
* Handle list item counting, if this is a list owner box.
*
* \param[in] box Box to do list item counting for.
@@ -4451,6 +4493,7 @@ layout__ordered_list_count(
dom_exception exc;
dom_node *child;
unsigned count;
+ unsigned next;
if (box->node == NULL) {
return;
@@ -4472,6 +4515,7 @@ layout__ordered_list_count(
}
count = 1;
+ next = 1;
while (child != NULL) {
dom_node *temp_node;
@@ -4488,7 +4532,14 @@ layout__ordered_list_count(
if (child_box != NULL &&
child_box->list_marker != NULL) {
- child_box->list_marker->rows = count;
+ dom_long value;
+ if (layout__get_li_value(child, &value)) {
+ child_box->list_marker->rows = value;
+ next = value + 1;
+ } else {
+ child_box->list_marker->rows = next;
+ next++;
+ }
count++;
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=41a0c21812ed1fb59bf...
commit 41a0c21812ed1fb59bf75cbe26a8b8c5e19e71a0
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
html: Do list item counting at layout time.
diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c
index a133578..7bfc35e 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -350,61 +350,6 @@ box_construct_generate(dom_node *n,
/**
- * compute the index for a list marker
- *
- * calculates a one based index of a list item
- */
-static unsigned int compute_list_marker_index(struct box *last)
-{
- /* Drill down into last child of parent
- * to find the list marker (if any)
- *
- * Floated list boxes end up as:
- *
- * parent
- * BOX_INLINE_CONTAINER
- * BOX_FLOAT_{LEFT,RIGHT}
- * BOX_BLOCK <-- list box
- * ...
- */
- while ((last != NULL) && (last->list_marker == NULL)) {
- struct box *last_inner = last;
-
- while (last_inner != NULL) {
- if (last_inner->list_marker != NULL) {
- break;
- }
- if (last_inner->type == BOX_INLINE_CONTAINER ||
- last_inner->type == BOX_FLOAT_LEFT ||
- last_inner->type == BOX_FLOAT_RIGHT) {
- last_inner = last_inner->last;
- } else {
- last_inner = NULL;
- }
- }
- if (last_inner != NULL) {
- last = last_inner;
- } else {
- last = last->prev;
- }
- }
-
- if ((last == NULL) || (last->list_marker == NULL)) {
- return 1;
- }
-
- return last->list_marker->rows + 1;
-}
-
-/**
- * initial length of a list marker buffer
- *
- * enough for 9,999,999,999,999,999,999 in decimal
- * or five characters for 4byte utf8
- */
-#define LIST_MARKER_SIZE 20
-
-/**
* Construct a list marker box
*
* \param box Box to attach marker to
@@ -422,8 +367,6 @@ box_construct_marker(struct box *box,
lwc_string *image_uri;
struct box *marker;
enum css_list_style_type_e list_style_type;
- size_t counter_len;
- css_error css_res;
marker = box_create(NULL, box->style, false, NULL, NULL, title,
NULL, ctx->bctx);
@@ -454,51 +397,13 @@ box_construct_marker(struct box *box,
marker->length = 3;
break;
+ default:
+ /* Numerical list counters get handled in layout. */
+ /* Fall through. */
case CSS_LIST_STYLE_TYPE_NONE:
marker->text = NULL;
marker->length = 0;
break;
-
- default:
- marker->rows = compute_list_marker_index(parent->last);
-
- marker->text = talloc_array(ctx->bctx, char, LIST_MARKER_SIZE);
- if (marker->text == NULL) {
- return false;
- }
-
- css_res = css_computed_format_list_style(box->style,
- marker->rows,
- marker->text,
- LIST_MARKER_SIZE,
- &counter_len);
- if (css_res == CSS_OK) {
- if (counter_len > LIST_MARKER_SIZE) {
- /*
- * use computed size as marker did not fit
- * in default allocation
- */
- marker->text = talloc_realloc(ctx->bctx,
- marker->text,
- char,
- counter_len);
- if (marker->text == NULL) {
- return false;
- }
- css_computed_format_list_style(box->style,
- marker->rows,
- marker->text,
- counter_len,
- &counter_len);
- }
- marker->length = counter_len;
- } else {
- /* failed to format marker so use none type */
- marker->text = NULL;
- marker->length = 0;
- }
- break;
-
}
if (css_computed_list_style_image(box->style, &image_uri) == CSS_LIST_STYLE_IMAGE_URI &&
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 8303d7b..2f222b9 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4505,6 +4505,79 @@ layout__ordered_list_count(
box->rows = count;
}
+/**
+ * Set up the marker text for a numerical list item.
+ *
+ * \param[in] content The HTML content.
+ * \param[in] box The list item's main box.
+ */
+static void
+layout__set_numerical_marker_text(
+ const html_content *content,
+ struct box *box)
+{
+ struct box *marker = box->list_marker;
+ size_t counter_len;
+ css_error css_res;
+ enum {
+ /**
+ * initial length of a list marker buffer
+ *
+ * enough for 9,999,999,999,999,999,999 in decimal
+ * or five characters for 4-byte UTF-8.
+ */
+ LIST_MARKER_SIZE = 20,
+ };
+
+ marker->text = talloc_array(content->bctx, char, LIST_MARKER_SIZE);
+ if (marker->text == NULL) {
+ return;
+ }
+
+ css_res = css_computed_format_list_style(box->style, marker->rows,
+ marker->text, LIST_MARKER_SIZE, &counter_len);
+ if (css_res == CSS_OK) {
+ if (counter_len > LIST_MARKER_SIZE) {
+ /* Use computed size as marker did not fit in
+ * default allocation. */
+ marker->text = talloc_realloc(content->bctx,
+ marker->text,
+ char,
+ counter_len);
+ if (marker->text == NULL) {
+ return;
+ }
+ css_computed_format_list_style(box->style,
+ marker->rows, marker->text,
+ counter_len, &counter_len);
+ }
+ marker->length = counter_len;
+ }
+}
+
+/**
+ * Find out if box's style represents a numerical list style type.
+ *
+ * \param[in] b Box with style to test.
+ * \return true if box has numerical list style type, false otherwise.
+ */
+static bool
+layout__list_item_is_numerical(
+ const struct box *b)
+{
+ enum css_list_style_type_e t = css_computed_list_style_type(b->style);
+
+ switch (t) {
+ case CSS_LIST_STYLE_TYPE_DISC: /* Fall through. */
+ case CSS_LIST_STYLE_TYPE_CIRCLE: /* Fall through. */
+ case CSS_LIST_STYLE_TYPE_SQUARE: /* Fall through. */
+ case CSS_LIST_STYLE_TYPE_NONE:
+ return false;
+
+ default:
+ return true;
+ }
+}
/**
* Layout list markers.
@@ -4521,6 +4594,12 @@ layout_lists(const html_content *content, struct box *box)
for (child = box->children; child; child = child->next) {
if (child->list_marker) {
marker = child->list_marker;
+ if (layout__list_item_is_numerical(child)) {
+ if (marker->text == NULL) {
+ layout__set_numerical_marker_text(
+ content, child);
+ }
+ }
if (marker->object) {
marker->width =
content_get_width(marker->object);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9434fe1ff08cb9e009e...
commit 9434fe1ff08cb9e009efa9cd434177d91948d12e
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
layout: Pass content into list layout function.
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index ce3fe18..8303d7b 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4510,9 +4510,7 @@ layout__ordered_list_count(
* Layout list markers.
*/
static void
-layout_lists(struct box *box,
- const struct gui_layout_table *font_func,
- const nscss_len_ctx *len_ctx)
+layout_lists(const html_content *content, struct box *box)
{
struct box *child;
struct box *marker;
@@ -4529,14 +4527,17 @@ layout_lists(struct box *box,
marker->x = -marker->width;
marker->height =
content_get_height(marker->object);
- marker->y = (line_height(len_ctx,
+ marker->y = (line_height(
+ &content->len_ctx,
marker->style) -
marker->height) / 2;
} else if (marker->text) {
if (marker->width == UNKNOWN_WIDTH) {
- font_plot_style_from_css(len_ctx,
- marker->style, &fstyle);
- font_func->width(&fstyle,
+ font_plot_style_from_css(
+ &content->len_ctx,
+ marker->style,
+ &fstyle);
+ content->font_func->width(&fstyle,
marker->text,
marker->length,
&marker->width);
@@ -4544,7 +4545,8 @@ layout_lists(struct box *box,
}
marker->x = -marker->width;
marker->y = 0;
- marker->height = line_height(len_ctx,
+ marker->height = line_height(
+ &content->len_ctx,
marker->style);
} else {
marker->x = 0;
@@ -4555,7 +4557,7 @@ layout_lists(struct box *box,
/* Gap between marker and content */
marker->x -= 4;
}
- layout_lists(child, font_func, len_ctx);
+ layout_lists(content, child);
}
}
@@ -5533,7 +5535,7 @@ bool layout_document(html_content *content, int width, int height)
doc->children->margin[BOTTOM]);
}
- layout_lists(doc, font_func, &content->len_ctx);
+ layout_lists(content, doc);
layout_position_absolute(doc, doc, 0, 0, content);
layout_position_relative(&content->len_ctx, doc, doc, 0, 0);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=839fb8570a4fb8a31a7...
commit 839fb8570a4fb8a31a76605b4614e7384d60f039
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
layout: Add counting for list items to layout.
diff --git a/content/handlers/html/box.h b/content/handlers/html/box.h
index d0df735..a193d3c 100644
--- a/content/handlers/html/box.h
+++ b/content/handlers/html/box.h
@@ -404,7 +404,6 @@ struct box {
*/
struct column *col;
-
/**
* List marker box if this is a list-item, or NULL.
*/
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index ddf1d16..ce3fe18 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -47,6 +47,7 @@
#include "utils/talloc.h"
#include "utils/utils.h"
#include "utils/nsoption.h"
+#include "utils/corestrings.h"
#include "utils/nsurl.h"
#include "netsurf/inttypes.h"
#include "netsurf/content.h"
@@ -4412,6 +4413,100 @@ layout_block_context(struct box *block,
/**
+ * Check a node's tag type.
+ *
+ * Assumes node is an HTML element.
+ *
+ * \param[in] node Node to ckeck tag type of.
+ * \param[in] type Tag type to test for.
+ * \return true if if node has given type, false otherwise.
+ */
+static inline bool
+layout__check_element_type(
+ const dom_node *node,
+ dom_html_element_type type)
+{
+ dom_html_element_type node_type;
+ dom_exception exc;
+
+ exc = dom_html_element_get_tag_type(node, &node_type);
+ if (exc != DOM_NO_ERR) {
+ return false;
+ }
+
+ return node_type == type;
+}
+
+
+/**
+ * Handle list item counting, if this is a list owner box.
+ *
+ * \param[in] box Box to do list item counting for.
+ */
+static void
+layout__ordered_list_count(
+ struct box *box)
+{
+ dom_html_element_type tag_type;
+ dom_exception exc;
+ dom_node *child;
+ unsigned count;
+
+ if (box->node == NULL) {
+ return;
+ }
+
+ exc = dom_html_element_get_tag_type(box->node, &tag_type);
+ if (exc != DOM_NO_ERR) {
+ return;
+ }
+
+ if (tag_type != DOM_HTML_ELEMENT_TYPE_OL &&
+ tag_type != DOM_HTML_ELEMENT_TYPE_UL) {
+ return;
+ }
+
+ exc = dom_node_get_first_child(box->node, &child);
+ if (exc != DOM_NO_ERR) {
+ return;
+ }
+
+ count = 1;
+ while (child != NULL) {
+ dom_node *temp_node;
+
+ if (layout__check_element_type(child,
+ DOM_HTML_ELEMENT_TYPE_LI)) {
+ struct box *child_box;
+
+ if (dom_node_get_user_data(child,
+ corestring_dom___ns_key_box_node_data,
+ &child_box) != DOM_NO_ERR) {
+ dom_node_unref(child);
+ return;
+ }
+
+ if (child_box != NULL &&
+ child_box->list_marker != NULL) {
+ child_box->list_marker->rows = count;
+ count++;
+ }
+ }
+
+ exc = dom_node_get_next_sibling(child, &temp_node);
+ dom_node_unref(child);
+ if (exc != DOM_NO_ERR) {
+ return;
+ }
+
+ child = temp_node;
+ }
+
+ box->rows = count;
+}
+
+
+/**
* Layout list markers.
*/
static void
@@ -4423,6 +4518,8 @@ layout_lists(struct box *box,
struct box *marker;
plot_font_style_t fstyle;
+ layout__ordered_list_count(box);
+
for (child = box->children; child; child = child->next) {
if (child->list_marker) {
marker = child->list_marker;
-----------------------------------------------------------------------
--
NetSurf Browser
1 year, 11 months
libcss: branch master updated. release/0.9.1-12-gdd74dbf
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libcss.git/shortlog/dd74dbf4b1a8d27cb49855...
...commit http://git.netsurf-browser.org/libcss.git/commit/dd74dbf4b1a8d27cb49855f0...
...tree http://git.netsurf-browser.org/libcss.git/tree/dd74dbf4b1a8d27cb49855f067...
The branch, master has been updated
via dd74dbf4b1a8d27cb49855f067f65b722d65bd42 (commit)
via 3ccff93d3a494b9303a1cc55c4075ef0c59eaf4f (commit)
from 35f499b333d1f97c47ac5581143ce9806d1c3536 (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=dd74dbf4b1a8d27cb498...
commit dd74dbf4b1a8d27cb49855f067f65b722d65bd42
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
implement the firt half of the css 3.1 simple predefined counter styles
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 577bed0..6f8a51c 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -606,7 +606,22 @@ enum css_list_style_type_e {
CSS_LIST_STYLE_TYPE_GEORGIAN = 0xc,
CSS_LIST_STYLE_TYPE_LOWER_ALPHA = 0xd,
CSS_LIST_STYLE_TYPE_UPPER_ALPHA = 0xe,
- CSS_LIST_STYLE_TYPE_NONE = 0xf
+ CSS_LIST_STYLE_TYPE_NONE = 0xf,
+ CSS_LIST_STYLE_TYPE_BINARY = 0x10,
+ CSS_LIST_STYLE_TYPE_OCTAL = 0x11,
+ CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL = 0x12,
+ CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL = 0x13,
+ CSS_LIST_STYLE_TYPE_ARABIC_INDIC = 0x14,
+ CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN = 0x15,
+ CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN = 0x16,
+ CSS_LIST_STYLE_TYPE_BENGALI = 0x17,
+ CSS_LIST_STYLE_TYPE_CAMBODIAN = 0x18,
+ CSS_LIST_STYLE_TYPE_KHMER = 0x19,
+ CSS_LIST_STYLE_TYPE_CJK_DECIMAL = 0x1a,
+ CSS_LIST_STYLE_TYPE_DEVANAGARI = 0x1b,
+ CSS_LIST_STYLE_TYPE_GUJARATI = 0x1c,
+ CSS_LIST_STYLE_TYPE_GURMUKHI = 0x1d
+
};
enum css_margin_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 82bf75f..b74e990 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -491,7 +491,21 @@ enum op_list_style_type {
LIST_STYLE_TYPE_GEORGIAN = 0x000b,
LIST_STYLE_TYPE_LOWER_ALPHA = 0x000c,
LIST_STYLE_TYPE_UPPER_ALPHA = 0x000d,
- LIST_STYLE_TYPE_NONE = 0x000e
+ LIST_STYLE_TYPE_NONE = 0x000e,
+ LIST_STYLE_TYPE_BINARY = 0x000f,
+ LIST_STYLE_TYPE_OCTAL = 0x0010,
+ LIST_STYLE_TYPE_LOWER_HEXADECIMAL = 0x0011,
+ LIST_STYLE_TYPE_UPPER_HEXADECIMAL = 0x0012,
+ LIST_STYLE_TYPE_ARABIC_INDIC = 0x0013,
+ LIST_STYLE_TYPE_LOWER_ARMENIAN = 0x0014,
+ LIST_STYLE_TYPE_UPPER_ARMENIAN = 0x0015,
+ LIST_STYLE_TYPE_BENGALI = 0x0016,
+ LIST_STYLE_TYPE_CAMBODIAN = 0x0017,
+ LIST_STYLE_TYPE_KHMER = 0x0018,
+ LIST_STYLE_TYPE_CJK_DECIMAL = 0x0019,
+ LIST_STYLE_TYPE_DEVANAGARI = 0x001a,
+ LIST_STYLE_TYPE_GUJARATI = 0x001b,
+ LIST_STYLE_TYPE_GURMUKHI = 0x001c
};
enum op_margin {
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index 0e49853..a71e22d 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -29,77 +29,60 @@
css_error css__parse_list_style_type_value(css_language *c, const css_token *ident,
uint16_t *value)
{
- bool match;
-
/* IDENT (disc, circle, square, decimal, decimal-leading-zero,
* lower-roman, upper-roman, lower-greek, lower-latin,
* upper-latin, armenian, georgian, lower-alpha, upper-alpha,
* none)
*/
- if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[DISC],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_DISC;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[CIRCLE],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_CIRCLE;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[SQUARE],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_SQUARE;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[DECIMAL],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_DECIMAL;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[DECIMAL_LEADING_ZERO],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_ROMAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_ROMAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[UPPER_ROMAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_UPPER_ROMAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_GREEK],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_GREEK;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_LATIN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_LATIN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[UPPER_LATIN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_UPPER_LATIN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[ARMENIAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_ARMENIAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[GEORGIAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_GEORGIAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_ALPHA],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_ALPHA;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[UPPER_ALPHA],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_UPPER_ALPHA;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[NONE],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_NONE;
- } else
- return CSS_INVALID;
+ #define MAP_ENTRIES 29
+ bool match;
+ int midx;
+ const struct {
+ int stringid;
+ int value;
+ } mapping[MAP_ENTRIES] = {
+ { DISC, LIST_STYLE_TYPE_DISC },
+ { CIRCLE, LIST_STYLE_TYPE_CIRCLE },
+ { SQUARE, LIST_STYLE_TYPE_SQUARE },
+ { DECIMAL, LIST_STYLE_TYPE_DECIMAL },
+ { DECIMAL_LEADING_ZERO, LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO },
+ { LOWER_ROMAN, LIST_STYLE_TYPE_LOWER_ROMAN },
+ { UPPER_ROMAN, LIST_STYLE_TYPE_UPPER_ROMAN },
+ { LOWER_GREEK, LIST_STYLE_TYPE_LOWER_GREEK },
+ { LOWER_LATIN, LIST_STYLE_TYPE_LOWER_LATIN },
+ { UPPER_LATIN, LIST_STYLE_TYPE_UPPER_LATIN },
+ { ARMENIAN, LIST_STYLE_TYPE_ARMENIAN },
+ { GEORGIAN, LIST_STYLE_TYPE_GEORGIAN },
+ { LOWER_ALPHA, LIST_STYLE_TYPE_LOWER_ALPHA },
+ { UPPER_ALPHA, LIST_STYLE_TYPE_UPPER_ALPHA },
+ { NONE, LIST_STYLE_TYPE_NONE },
+ { BINARY, LIST_STYLE_TYPE_BINARY },
+ { OCTAL, LIST_STYLE_TYPE_OCTAL},
+ { LOWER_HEXADECIMAL, LIST_STYLE_TYPE_LOWER_HEXADECIMAL },
+ { UPPER_HEXADECIMAL, LIST_STYLE_TYPE_UPPER_HEXADECIMAL },
+ { ARABIC_INDIC, LIST_STYLE_TYPE_ARABIC_INDIC },
+ { LOWER_ARMENIAN, LIST_STYLE_TYPE_LOWER_ARMENIAN },
+ { UPPER_ARMENIAN, LIST_STYLE_TYPE_UPPER_ARMENIAN },
+ { BENGALI, LIST_STYLE_TYPE_BENGALI },
+ { CAMBODIAN, LIST_STYLE_TYPE_CAMBODIAN },
+ { KHMER, LIST_STYLE_TYPE_KHMER },
+ { CJK_DECIMAL, LIST_STYLE_TYPE_CJK_DECIMAL },
+ { DEVANAGARI, LIST_STYLE_TYPE_DEVANAGARI },
+ { GUJARATI, LIST_STYLE_TYPE_GUJARATI },
+ { GURMUKHI, LIST_STYLE_TYPE_GURMUKHI }
+ };
- return CSS_OK;
+ for (midx = 0; midx < MAP_ENTRIES; midx++) {
+ if ((lwc_string_caseless_isequal(
+ ident->idata,
+ c->strings[mapping[midx].stringid],
+ &match) == lwc_error_ok && match)) {
+ *value = mapping[midx].value;
+ return CSS_OK;
+ }
+ }
+
+ return CSS_INVALID;
}
@@ -1117,7 +1100,7 @@ css_error css__ident_list_or_string_to_string(css_language *c,
token = parserutils_vector_iterate(vector, ctx);
*result = lwc_string_ref(token->idata);
return CSS_OK;
- } else if(token->type == CSS_TOKEN_IDENT) {
+ } else if(token->type == CSS_TOKEN_IDENT) {
return css__ident_list_to_string(c, vector, ctx, reserved,
result);
}
@@ -1333,4 +1316,3 @@ cleanup:
return error;
}
-
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 3c9401b..302f7f8 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -309,6 +309,20 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "georgian", SLEN("georgian") },
{ "lower-alpha", SLEN("lower-alpha") },
{ "upper-alpha", SLEN("upper-alpha") },
+ { "binary", SLEN("binary") },
+ { "octal", SLEN("octal") },
+ { "lower-hexadecimal", SLEN("lower-hexadecimal") },
+ { "upper-hexadecimal", SLEN("upper-hexadecimal") },
+ { "arabic-indic", SLEN("arabic-indic") },
+ { "lower-armenian", SLEN("lower-armenian") },
+ { "upper-armenian", SLEN("upper-armenian") },
+ { "bengali", SLEN("bengali") },
+ { "cambodian", SLEN("cambodian") },
+ { "khmer", SLEN("khmer") },
+ { "cjk-decimal", SLEN("cjk-decimal") },
+ { "devanagari", SLEN("devanagari") },
+ { "gujarati", SLEN("gujarati") },
+ { "gurmukhi", SLEN("gurmukhi") },
{ "invert", SLEN("invert") },
{ "visible", SLEN("visible") },
{ "always", SLEN("always") },
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 24b681b..65954c6 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -83,6 +83,9 @@ enum {
LIGHTER, INSIDE, OUTSIDE, DISC, CIRCLE, SQUARE, DECIMAL,
DECIMAL_LEADING_ZERO, LOWER_ROMAN, UPPER_ROMAN, LOWER_GREEK,
LOWER_LATIN, UPPER_LATIN, ARMENIAN, GEORGIAN, LOWER_ALPHA, UPPER_ALPHA,
+ BINARY, OCTAL, LOWER_HEXADECIMAL, UPPER_HEXADECIMAL, ARABIC_INDIC,
+ LOWER_ARMENIAN, UPPER_ARMENIAN, BENGALI, CAMBODIAN, KHMER, CJK_DECIMAL,
+ DEVANAGARI, GUJARATI, GURMUKHI,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
RELATIVE, ABSOLUTE, ONCE, DIGITS, CONTINUOUS, CODE, SPELL_OUT, X_SLOW,
SLOW, FAST, X_FAST, FASTER, SLOWER, CENTER, JUSTIFY, CAPITALIZE,
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 4a2fee5..e61f981 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -385,7 +385,7 @@ static const struct list_counter_style lcs_georgian = {
};
-static const symbol_t armenian_symbols[] = {
+static const symbol_t upper_armenian_symbols[] = {
"��", "��", "��", "��", "��", "��", "��", "��", "��",
"��", "��", "��", "��", "��", "��", "��", "��", "��",
"��", "��", "��", "��", "��", "��", "��", "��", "��",
@@ -397,14 +397,32 @@ static const int armenian_weights[] = {
90, 80, 70, 60, 50, 40, 30, 20, 10,
9, 8, 7, 6, 5, 4, 3, 2, 1
};
-static const struct list_counter_style lcs_armenian = {
- .name = "armenian",
+static const struct list_counter_style lcs_upper_armenian = {
+ .name = "upper-armenian",
.range = {
.start = 1,
.end = 9999,},
- .symbols = armenian_symbols,
+ .symbols = upper_armenian_symbols,
.weights = armenian_weights,
- .items = (sizeof(armenian_symbols) / SYMBOL_SIZE),
+ .items = (sizeof(upper_armenian_symbols) / SYMBOL_SIZE),
+ .calc = calc_additive_system,
+};
+
+
+static const symbol_t lower_armenian_symbols[] = {
+ "��", "��", "��", "��", "��", "��", "��", "��", "��",
+ "��", "��", "��", "��", "��", "��", "��", "��", "��",
+ "��", "��", "��", "��", "��", "��", "��", "��", "��",
+ "��", "��", "��", "��", "��", "��", "��", "��", "��"
+};
+static const struct list_counter_style lcs_lower_armenian = {
+ .name = "lower-armenian",
+ .range = {
+ .start = 1,
+ .end = 9999,},
+ .symbols = lower_armenian_symbols,
+ .weights = armenian_weights,
+ .items = (sizeof(lower_armenian_symbols) / SYMBOL_SIZE),
.calc = calc_additive_system,
};
@@ -529,18 +547,117 @@ static const struct list_counter_style lcs_square = {
.calc = calc_cyclic_system,
};
-#if 0
-static const symbol_t lower_hexidecimal_symbols[] = {
+static const symbol_t binary_symbols[] = { "0", "1" };
+static const struct list_counter_style lcs_binary = {
+ .name = "binary",
+ .symbols = binary_symbols,
+ .items = (sizeof(binary_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t octal_symbols[] = {
+ "0", "1", "2", "3", "4", "5", "6", "7"
+};
+static const struct list_counter_style lcs_octal = {
+ .name = "octal",
+ .symbols = octal_symbols,
+ .items = (sizeof(octal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+
+static const symbol_t lower_hexadecimal_symbols[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"a", "b", "c", "d", "e", "f"
};
-static const struct list_counter_style lcs_lower_hexidecimal = {
- .name = "lower-hexidecimal",
- .symbols = lower_hexidecimal_symbols,
- .items = (sizeof(lower_hexidecimal_symbols) / SYMBOL_SIZE),
+static const struct list_counter_style lcs_lower_hexadecimal = {
+ .name = "lower-hexadecimal",
+ .symbols = lower_hexadecimal_symbols,
+ .items = (sizeof(lower_hexadecimal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t upper_hexadecimal_symbols[] = {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
+ "a", "b", "c", "d", "e", "f"
+};
+static const struct list_counter_style lcs_upper_hexadecimal = {
+ .name = "upper-hexadecimal",
+ .symbols = upper_hexadecimal_symbols,
+ .items = (sizeof(upper_hexadecimal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t arabic_indic_symbols[] = {
+ "\xd9\xa0", "\xd9\xa1", "\xd9\xa2", "\xd9\xa3", "\xd9\xa4", "\xd9\xa5", "\xd9\xa6", "\xd9\xa7", "\xd9\xa8", "\xd9\xa9"
+};
+static const struct list_counter_style lcs_arabic_indic = {
+ .name = "arabic-indic",
+ .symbols = arabic_indic_symbols,
+ .items = (sizeof(arabic_indic_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t bengali_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_bengali = {
+ .name = "bengali",
+ .symbols = bengali_symbols,
+ .items = (sizeof(bengali_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t cambodian_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_cambodian = {
+ .name = "cambodian",
+ .symbols = cambodian_symbols,
+ .items = (sizeof(cambodian_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t cjk_decimal_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_cjk_decimal = {
+ .name = "cjk-decimal",
+ .symbols = cjk_decimal_symbols,
+ .postfix = "���",
+ .items = (sizeof(cjk_decimal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t devanagari_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_devanagari = {
+ .name = "devanagari",
+ .symbols = devanagari_symbols,
+ .items = (sizeof(devanagari_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t gujarati_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_gujarati = {
+ .name = "gujarati",
+ .symbols = gujarati_symbols,
+ .items = (sizeof(gujarati_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t gurmukhi_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_gurmukhi = {
+ .name = "gurmukhi",
+ .symbols = gurmukhi_symbols,
+ .items = (sizeof(gurmukhi_symbols) / SYMBOL_SIZE),
.calc = calc_numeric_system,
};
-#endif
/* exported interface defined in select.h */
@@ -558,6 +675,22 @@ css_error css_computed_format_list_style(
const struct list_counter_style *cstyle;
switch (type) {
+ case CSS_LIST_STYLE_TYPE_DISC:
+ cstyle = &lcs_disc;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_CIRCLE:
+ cstyle = &lcs_circle;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_SQUARE:
+ cstyle = &lcs_square;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_DECIMAL:
+ cstyle = &lcs_decimal;
+ break;
+
case CSS_LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO:
cstyle = &lcs_decimal_leading_zero;
break;
@@ -570,6 +703,10 @@ css_error css_computed_format_list_style(
cstyle = &lcs_upper_roman;
break;
+ case CSS_LIST_STYLE_TYPE_LOWER_GREEK:
+ cstyle = &lcs_lower_greek;
+ break;
+
case CSS_LIST_STYLE_TYPE_LOWER_ALPHA:
case CSS_LIST_STYLE_TYPE_LOWER_LATIN:
cstyle = &lcs_lower_alpha;
@@ -580,38 +717,70 @@ css_error css_computed_format_list_style(
cstyle = &lcs_upper_alpha;
break;
- case CSS_LIST_STYLE_TYPE_LOWER_GREEK:
- cstyle = &lcs_lower_greek;
- break;
-
+ case CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN:
case CSS_LIST_STYLE_TYPE_ARMENIAN:
- cstyle = &lcs_armenian;
+ cstyle = &lcs_upper_armenian;
break;
case CSS_LIST_STYLE_TYPE_GEORGIAN:
cstyle = &lcs_georgian;
break;
- case CSS_LIST_STYLE_TYPE_DISC:
- cstyle = &lcs_disc;
+ case CSS_LIST_STYLE_TYPE_NONE:
+ *format_length = 0;
+ return CSS_OK;
+
+ case CSS_LIST_STYLE_TYPE_BINARY:
+ cstyle = &lcs_binary;
break;
- case CSS_LIST_STYLE_TYPE_CIRCLE:
- cstyle = &lcs_circle;
+ case CSS_LIST_STYLE_TYPE_OCTAL:
+ cstyle = &lcs_octal;
break;
- case CSS_LIST_STYLE_TYPE_SQUARE:
- cstyle = &lcs_square;
+ case CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL:
+ cstyle = &lcs_lower_hexadecimal;
break;
- case CSS_LIST_STYLE_TYPE_NONE:
- *format_length = 0;
- return CSS_OK;
+ case CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL:
+ cstyle = &lcs_upper_hexadecimal;
+ break;
- case CSS_LIST_STYLE_TYPE_DECIMAL:
- default:
- cstyle = &lcs_decimal;
+ case CSS_LIST_STYLE_TYPE_ARABIC_INDIC:
+ cstyle = &lcs_arabic_indic;
break;
+
+ case CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN:
+ cstyle = &lcs_lower_armenian;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_BENGALI:
+ cstyle = &lcs_bengali;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_CAMBODIAN:
+ case CSS_LIST_STYLE_TYPE_KHMER:
+ cstyle = &lcs_cambodian;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_CJK_DECIMAL:
+ cstyle = &lcs_cjk_decimal;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_DEVANAGARI:
+ cstyle = &lcs_devanagari;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_GUJARATI:
+ cstyle = &lcs_gujarati;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_GURMUKHI:
+ cstyle = &lcs_gurmukhi;
+ break;
+
+ default:
+ return CSS_BADPARM;
}
alen = cstyle->calc(aval, sizeof(aval), value, cstyle);
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index b1e5db6..9a6af2c 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -68,6 +68,48 @@ css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
case LIST_STYLE_TYPE_NONE:
value = CSS_LIST_STYLE_TYPE_NONE;
break;
+ case LIST_STYLE_TYPE_BINARY:
+ value = CSS_LIST_STYLE_TYPE_BINARY;
+ break;
+ case LIST_STYLE_TYPE_OCTAL:
+ value = CSS_LIST_STYLE_TYPE_OCTAL;
+ break;
+ case LIST_STYLE_TYPE_LOWER_HEXADECIMAL:
+ value = CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL;
+ break;
+ case LIST_STYLE_TYPE_UPPER_HEXADECIMAL:
+ value = CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL;
+ break;
+ case LIST_STYLE_TYPE_ARABIC_INDIC:
+ value = CSS_LIST_STYLE_TYPE_ARABIC_INDIC;
+ break;
+ case LIST_STYLE_TYPE_LOWER_ARMENIAN:
+ value = CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN;
+ break;
+ case LIST_STYLE_TYPE_UPPER_ARMENIAN:
+ value = CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN;
+ break;
+ case LIST_STYLE_TYPE_BENGALI:
+ value = CSS_LIST_STYLE_TYPE_BENGALI;
+ break;
+ case LIST_STYLE_TYPE_CAMBODIAN:
+ value = CSS_LIST_STYLE_TYPE_CAMBODIAN;
+ break;
+ case LIST_STYLE_TYPE_KHMER:
+ value = CSS_LIST_STYLE_TYPE_KHMER;
+ break;
+ case LIST_STYLE_TYPE_CJK_DECIMAL:
+ value = CSS_LIST_STYLE_TYPE_CJK_DECIMAL;
+ break;
+ case LIST_STYLE_TYPE_DEVANAGARI:
+ value = CSS_LIST_STYLE_TYPE_DEVANAGARI;
+ break;
+ case LIST_STYLE_TYPE_GUJARATI:
+ value = CSS_LIST_STYLE_TYPE_GUJARATI;
+ break;
+ case LIST_STYLE_TYPE_GURMUKHI:
+ value = CSS_LIST_STYLE_TYPE_GURMUKHI;
+ break;
}
}
@@ -102,4 +144,3 @@ css_error css__compose_list_style_type(const css_computed_style *parent,
return set_list_style_type(result, type);
}
-
commitdiff http://git.netsurf-browser.org/libcss.git/commit/?id=3ccff93d3a494b9303a1...
commit 3ccff93d3a494b9303a1cc55c4075ef0c59eaf4f
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Use two more bits, six total, for the list style property
Adding the two bits that were previously reserved (Must Be Zero) for
use in the list style property gives space for sixty four styles
instead of sixteen.
diff --git a/docs/Bytecode b/docs/Bytecode
index 880ccbd..d691923 100644
--- a/docs/Bytecode
+++ b/docs/Bytecode
@@ -342,11 +342,9 @@ Opcodes
bits 0-6: 0000000 => string,
0000001 => uri,
0000010 => counter,
- bits 12-13: MBZ
- bits 8-11 : list-style-type
+ bits 8-13 : list-style-type
0000011 => counters,
- bits 12-13: MBZ
- bits 8-11 : list-style-type
+ bits 8-13 : list-style-type
0000100 => attr,
other => rffe.
bit 7 clear => keywords:
@@ -646,22 +644,24 @@ Opcodes
2f - list-style-type
<value> (14bits) :
- 0 => disc,
- 1 => circle,
- 2 => square,
- 3 => decimal,
- 4 => decimal-leading-zero,
- 5 => lower-roman,
- 6 => upper-roman,
- 7 => lower-greek,
- 8 => lower-latin,
- 9 => upper-latin,
- a => armenian,
- b => georgian,
- c => lower-alpha,
- d => upper-alpha,
- e => none,
- other => Reserved for future expansion.
+ bits 6-13: MBZ
+ bits 0-5 :
+ 0 => disc,
+ 1 => circle,
+ 2 => square,
+ 3 => decimal,
+ 4 => decimal-leading-zero,
+ 5 => lower-roman,
+ 6 => upper-roman,
+ 7 => lower-greek,
+ 8 => lower-latin,
+ 9 => upper-latin,
+ a => armenian,
+ b => georgian,
+ c => lower-alpha,
+ d => upper-alpha,
+ e => none,
+ other => Reserved for future expansion.
30 - margin-top
31 - margin-right
diff --git a/src/select/autogenerated_computed.h b/src/select/autogenerated_computed.h
index 4d21fad..7765f35 100644
--- a/src/select/autogenerated_computed.h
+++ b/src/select/autogenerated_computed.h
@@ -69,7 +69,7 @@ struct css_computed_style_i {
* line_height 2 + 5 4
* list_style_image 1 sizeof(ptr)
* list_style_position 2
- * list_style_type 4
+ * list_style_type 6
* margin_bottom 2 + 5 4
* margin_left 2 + 5 4
* margin_right 2 + 5 4
@@ -140,66 +140,66 @@ struct css_computed_style_i {
* quotes 1 sizeof(ptr)
*
* --- --- ---
- * 460 bits 228 + 8sizeof(ptr) bytes
+ * 462 bits 228 + 8sizeof(ptr) bytes
* ===================
* 286 + 8sizeof(ptr) bytes
*
* Bit allocations:
*
- * 0 ccccccccoooooooobbbbbbbbrrrrrrrr
- * column_rule_width; outline_width; border_left_width; border_bottom_width
+ * 0 bbbbbbbboooooooorrrrrrrrdddddddd
+ * border_left_width; border_top_width; border_bottom_width; border_right_width
*
- * 1 vvvvvvvvvbbbbbbbboooooooolllllll
- * vertical_align; border_top_width; border_right_width; letter_spacing
+ * 1 vvvvvvvvvooooooooccccccccmmmmmmm
+ * vertical_align; outline_width; column_rule_width; margin_top
*
* 2 ccccccccccccccccccccccccccpppppp
- * clip; padding_top
+ * clip; padding_left
*
- * 3 mmmmmmmaaaaaaarrrrrrrttttttddddd
- * max_width; margin_bottom; margin_left; text_indent; display
+ * 3 mmmmmmmrrrrrrrwwwwwwwttttttddddd
+ * max_height; right; width; text_indent; display
*
- * 4 wwwwwwwfffffffcccccccllllllloooo
- * word_spacing; flex_basis; column_gap; left; font_weight
+ * 4 fffffffmmmmmmmcccccccllllllltttt
+ * flex_basis; min_height; column_gap; left; text_align
*
- * 5 wwwwwwwhhhhhhhlllllllcccccccoooo
- * width; height; line_height; column_width; outline_style
+ * 5 cccccccmmmmmmmlllllllwwwwwwwbbbb
+ * column_width; margin_bottom; line_height; word_spacing; break_inside
*
- * 6 tttttttmmmmmmmiiiiiiiaaaaaaabbbb
- * top; max_height; min_width; margin_right; border_top_style
+ * 6 hhhhhhhlllllllmmmmmmmaaaaaaabbbb
+ * height; letter_spacing; min_width; margin_right; border_bottom_style
*
- * 7 rrrrrrrbbbbbbbmmmmmmmaaaaaaacccc
- * right; bottom; min_height; margin_top; column_rule_style
+ * 7 tttttttmmmmmmmbbbbbbbaaaaaaaoooo
+ * top; margin_left; bottom; max_width; border_top_style
*
- * 8 ppppppaaaaaaddddddtttttcccccbbbb
- * padding_left; padding_right; padding_bottom; text_decoration; cursor;
- * border_right_style
+ * 8 llllllppppppaaaaaaddddddtttttggg
+ * list_style_type; padding_top; padding_right; padding_bottom;
+ * text_decoration; page_break_after
*
- * 9 aaafffpppllliiiooovvvttteeeggguu
- * align_items; font_family; page_break_before; align_self; align_content;
- * overflow_x; overflow_y; text_transform; flex_direction; page_break_after;
- * unicode_bidi
+ * 9 cccccbbbbooooffffrrrruuuullllnnn
+ * cursor; break_before; border_left_style; font_weight; break_after;
+ * outline_style; column_rule_style; font_family
*
- * 10 jjjpppcccwwwbbddeeffooaallggkkrr
- * justify_content; position; clear; white_space; box_sizing; direction;
- * empty_cells; flex_wrap; column_rule_color; background_attachment;
- * column_span; page_break_inside; background_color; border_left_color
+ * 10 aaallliiipppbbccttoouuzzffeerrmm
+ * align_content; align_items; align_self; position; border_bottom_color;
+ * column_rule_color; table_layout; box_sizing; column_span; z_index;
+ * flex_wrap; empty_cells; border_left_color; column_count
*
- * 11 ffbbooccnnllwwrrvvuummddaattzzee
- * font_style; border_bottom_color; border_top_color; caption_side;
- * font_variant; column_count; writing_mode; border_collapse; visibility;
- * outline_color; column_fill; border_right_color; float; table_layout;
- * z_index; content
+ * 11 ffoobbppaannccrrddeeuulliittUUvv
+ * float; font_variant; background_attachment; page_break_inside;
+ * background_color; font_style; content; border_top_color; border_collapse;
+ * border_right_color; outline_color; column_fill; list_style_position;
+ * caption_side; unicode_bidi; visibility
*
- * 12 bbbbbbbbbbbaaaaaaaaaaafffffffffc
- * border_spacing; background_position; font_size; color
+ * 12 bbbbbbbbbbbaaaaaaaaaaafffffffffl
+ * border_spacing; background_position; font_size; flex_grow
*
- * 13 bbbbrrrrllllttttooooddddeeeeaaai
- * break_after; break_before; list_style_type; text_align; border_left_style;
- * border_bottom_style; break_inside; background_repeat; list_style_image
+ * 13 bbbboooaaawwwvvvtttcccpppjjjfffr
+ * border_right_style; overflow_y; background_repeat; white_space; overflow_x;
+ * text_transform; clear; page_break_before; justify_content; flex_direction;
+ * order
*
- * 14 llcbqopwfrue....................
- * list_style_position; counter_increment; background_image; quotes; order;
- * opacity; widows; flex_grow; orphans; counter_reset; flex_shrink
+ * 14 wwddlicobfqupr..................
+ * writing_mode; direction; list_style_image; widows; counter_reset; orphans;
+ * background_image; flex_shrink; quotes; counter_increment; opacity; color
*/
uint32_t bits[15];
diff --git a/src/select/autogenerated_propget.h b/src/select/autogenerated_propget.h
index f1b6092..39ce62a 100644
--- a/src/select/autogenerated_propget.h
+++ b/src/select/autogenerated_propget.h
@@ -6,9 +6,9 @@
*/
-#define ALIGN_CONTENT_INDEX 9
-#define ALIGN_CONTENT_SHIFT 17
-#define ALIGN_CONTENT_MASK 0xe0000
+#define ALIGN_CONTENT_INDEX 10
+#define ALIGN_CONTENT_SHIFT 29
+#define ALIGN_CONTENT_MASK 0xe0000000
static inline uint8_t get_align_content(const css_computed_style *style)
{
uint32_t bits = style->i.bits[ALIGN_CONTENT_INDEX];
@@ -23,9 +23,9 @@ static inline uint8_t get_align_content(const css_computed_style *style)
#undef ALIGN_CONTENT_SHIFT
#undef ALIGN_CONTENT_MASK
-#define ALIGN_ITEMS_INDEX 9
-#define ALIGN_ITEMS_SHIFT 29
-#define ALIGN_ITEMS_MASK 0xe0000000
+#define ALIGN_ITEMS_INDEX 10
+#define ALIGN_ITEMS_SHIFT 26
+#define ALIGN_ITEMS_MASK 0x1c000000
static inline uint8_t get_align_items(const css_computed_style *style)
{
uint32_t bits = style->i.bits[ALIGN_ITEMS_INDEX];
@@ -40,9 +40,9 @@ static inline uint8_t get_align_items(const css_computed_style *style)
#undef ALIGN_ITEMS_SHIFT
#undef ALIGN_ITEMS_MASK
-#define ALIGN_SELF_INDEX 9
-#define ALIGN_SELF_SHIFT 20
-#define ALIGN_SELF_MASK 0x700000
+#define ALIGN_SELF_INDEX 10
+#define ALIGN_SELF_SHIFT 23
+#define ALIGN_SELF_MASK 0x3800000
static inline uint8_t get_align_self(const css_computed_style *style)
{
uint32_t bits = style->i.bits[ALIGN_SELF_INDEX];
@@ -57,9 +57,9 @@ static inline uint8_t get_align_self(const css_computed_style *style)
#undef ALIGN_SELF_SHIFT
#undef ALIGN_SELF_MASK
-#define BACKGROUND_ATTACHMENT_INDEX 10
-#define BACKGROUND_ATTACHMENT_SHIFT 8
-#define BACKGROUND_ATTACHMENT_MASK 0x300
+#define BACKGROUND_ATTACHMENT_INDEX 11
+#define BACKGROUND_ATTACHMENT_SHIFT 26
+#define BACKGROUND_ATTACHMENT_MASK 0xc000000
static inline uint8_t get_background_attachment(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BACKGROUND_ATTACHMENT_INDEX];
@@ -74,9 +74,9 @@ static inline uint8_t get_background_attachment(const css_computed_style *style)
#undef BACKGROUND_ATTACHMENT_SHIFT
#undef BACKGROUND_ATTACHMENT_MASK
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 2
-#define BACKGROUND_COLOR_MASK 0xc
+#define BACKGROUND_COLOR_INDEX 11
+#define BACKGROUND_COLOR_SHIFT 22
+#define BACKGROUND_COLOR_MASK 0xc00000
static inline uint8_t get_background_color(const css_computed_style *style,
css_color *color)
{
@@ -94,8 +94,8 @@ static inline uint8_t get_background_color(const css_computed_style *style,
#undef BACKGROUND_COLOR_MASK
#define BACKGROUND_IMAGE_INDEX 14
-#define BACKGROUND_IMAGE_SHIFT 28
-#define BACKGROUND_IMAGE_MASK 0x10000000
+#define BACKGROUND_IMAGE_SHIFT 23
+#define BACKGROUND_IMAGE_MASK 0x800000
static inline uint8_t get_background_image(const css_computed_style *style,
lwc_string **string)
{
@@ -138,8 +138,8 @@ static inline uint8_t get_background_position(const css_computed_style *style,
#undef BACKGROUND_POSITION_MASK
#define BACKGROUND_REPEAT_INDEX 13
-#define BACKGROUND_REPEAT_SHIFT 1
-#define BACKGROUND_REPEAT_MASK 0xe
+#define BACKGROUND_REPEAT_SHIFT 22
+#define BACKGROUND_REPEAT_MASK 0x1c00000
static inline uint8_t get_background_repeat(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BACKGROUND_REPEAT_INDEX];
@@ -154,9 +154,9 @@ static inline uint8_t get_background_repeat(const css_computed_style *style)
#undef BACKGROUND_REPEAT_SHIFT
#undef BACKGROUND_REPEAT_MASK
-#define BORDER_BOTTOM_COLOR_INDEX 11
-#define BORDER_BOTTOM_COLOR_SHIFT 28
-#define BORDER_BOTTOM_COLOR_MASK 0x30000000
+#define BORDER_BOTTOM_COLOR_INDEX 10
+#define BORDER_BOTTOM_COLOR_SHIFT 18
+#define BORDER_BOTTOM_COLOR_MASK 0xc0000
static inline uint8_t get_border_bottom_color(const css_computed_style *style,
css_color *color)
{
@@ -173,9 +173,9 @@ static inline uint8_t get_border_bottom_color(const css_computed_style *style,
#undef BORDER_BOTTOM_COLOR_SHIFT
#undef BORDER_BOTTOM_COLOR_MASK
-#define BORDER_BOTTOM_STYLE_INDEX 13
-#define BORDER_BOTTOM_STYLE_SHIFT 8
-#define BORDER_BOTTOM_STYLE_MASK 0xf00
+#define BORDER_BOTTOM_STYLE_INDEX 6
+#define BORDER_BOTTOM_STYLE_SHIFT 0
+#define BORDER_BOTTOM_STYLE_MASK 0xf
static inline uint8_t get_border_bottom_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
@@ -191,8 +191,8 @@ static inline uint8_t get_border_bottom_style(const css_computed_style *style)
#undef BORDER_BOTTOM_STYLE_MASK
#define BORDER_BOTTOM_WIDTH_INDEX 0
-#define BORDER_BOTTOM_WIDTH_SHIFT 0
-#define BORDER_BOTTOM_WIDTH_MASK 0xff
+#define BORDER_BOTTOM_WIDTH_SHIFT 8
+#define BORDER_BOTTOM_WIDTH_MASK 0xff00
static inline uint8_t get_border_bottom_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -213,8 +213,8 @@ static inline uint8_t get_border_bottom_width(const css_computed_style *style,
#undef BORDER_BOTTOM_WIDTH_MASK
#define BORDER_COLLAPSE_INDEX 11
-#define BORDER_COLLAPSE_SHIFT 16
-#define BORDER_COLLAPSE_MASK 0x30000
+#define BORDER_COLLAPSE_SHIFT 14
+#define BORDER_COLLAPSE_MASK 0xc000
static inline uint8_t get_border_collapse(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_COLLAPSE_INDEX];
@@ -230,8 +230,8 @@ static inline uint8_t get_border_collapse(const css_computed_style *style)
#undef BORDER_COLLAPSE_MASK
#define BORDER_LEFT_COLOR_INDEX 10
-#define BORDER_LEFT_COLOR_SHIFT 0
-#define BORDER_LEFT_COLOR_MASK 0x3
+#define BORDER_LEFT_COLOR_SHIFT 2
+#define BORDER_LEFT_COLOR_MASK 0xc
static inline uint8_t get_border_left_color(const css_computed_style *style,
css_color *color)
{
@@ -248,9 +248,9 @@ static inline uint8_t get_border_left_color(const css_computed_style *style,
#undef BORDER_LEFT_COLOR_SHIFT
#undef BORDER_LEFT_COLOR_MASK
-#define BORDER_LEFT_STYLE_INDEX 13
-#define BORDER_LEFT_STYLE_SHIFT 12
-#define BORDER_LEFT_STYLE_MASK 0xf000
+#define BORDER_LEFT_STYLE_INDEX 9
+#define BORDER_LEFT_STYLE_SHIFT 19
+#define BORDER_LEFT_STYLE_MASK 0x780000
static inline uint8_t get_border_left_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_LEFT_STYLE_INDEX];
@@ -266,8 +266,8 @@ static inline uint8_t get_border_left_style(const css_computed_style *style)
#undef BORDER_LEFT_STYLE_MASK
#define BORDER_LEFT_WIDTH_INDEX 0
-#define BORDER_LEFT_WIDTH_SHIFT 8
-#define BORDER_LEFT_WIDTH_MASK 0xff00
+#define BORDER_LEFT_WIDTH_SHIFT 24
+#define BORDER_LEFT_WIDTH_MASK 0xff000000
static inline uint8_t get_border_left_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -288,8 +288,8 @@ static inline uint8_t get_border_left_width(const css_computed_style *style,
#undef BORDER_LEFT_WIDTH_MASK
#define BORDER_RIGHT_COLOR_INDEX 11
-#define BORDER_RIGHT_COLOR_SHIFT 8
-#define BORDER_RIGHT_COLOR_MASK 0x300
+#define BORDER_RIGHT_COLOR_SHIFT 12
+#define BORDER_RIGHT_COLOR_MASK 0x3000
static inline uint8_t get_border_right_color(const css_computed_style *style,
css_color *color)
{
@@ -306,9 +306,9 @@ static inline uint8_t get_border_right_color(const css_computed_style *style,
#undef BORDER_RIGHT_COLOR_SHIFT
#undef BORDER_RIGHT_COLOR_MASK
-#define BORDER_RIGHT_STYLE_INDEX 8
-#define BORDER_RIGHT_STYLE_SHIFT 0
-#define BORDER_RIGHT_STYLE_MASK 0xf
+#define BORDER_RIGHT_STYLE_INDEX 13
+#define BORDER_RIGHT_STYLE_SHIFT 28
+#define BORDER_RIGHT_STYLE_MASK 0xf0000000
static inline uint8_t get_border_right_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_RIGHT_STYLE_INDEX];
@@ -323,9 +323,9 @@ static inline uint8_t get_border_right_style(const css_computed_style *style)
#undef BORDER_RIGHT_STYLE_SHIFT
#undef BORDER_RIGHT_STYLE_MASK
-#define BORDER_RIGHT_WIDTH_INDEX 1
-#define BORDER_RIGHT_WIDTH_SHIFT 7
-#define BORDER_RIGHT_WIDTH_MASK 0x7f80
+#define BORDER_RIGHT_WIDTH_INDEX 0
+#define BORDER_RIGHT_WIDTH_SHIFT 0
+#define BORDER_RIGHT_WIDTH_MASK 0xff
static inline uint8_t get_border_right_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -371,8 +371,8 @@ static inline uint8_t get_border_spacing(const css_computed_style *style,
#undef BORDER_SPACING_MASK
#define BORDER_TOP_COLOR_INDEX 11
-#define BORDER_TOP_COLOR_SHIFT 26
-#define BORDER_TOP_COLOR_MASK 0xc000000
+#define BORDER_TOP_COLOR_SHIFT 16
+#define BORDER_TOP_COLOR_MASK 0x30000
static inline uint8_t get_border_top_color(const css_computed_style *style,
css_color *color)
{
@@ -389,7 +389,7 @@ static inline uint8_t get_border_top_color(const css_computed_style *style,
#undef BORDER_TOP_COLOR_SHIFT
#undef BORDER_TOP_COLOR_MASK
-#define BORDER_TOP_STYLE_INDEX 6
+#define BORDER_TOP_STYLE_INDEX 7
#define BORDER_TOP_STYLE_SHIFT 0
#define BORDER_TOP_STYLE_MASK 0xf
static inline uint8_t get_border_top_style(const css_computed_style *style)
@@ -406,9 +406,9 @@ static inline uint8_t get_border_top_style(const css_computed_style *style)
#undef BORDER_TOP_STYLE_SHIFT
#undef BORDER_TOP_STYLE_MASK
-#define BORDER_TOP_WIDTH_INDEX 1
-#define BORDER_TOP_WIDTH_SHIFT 15
-#define BORDER_TOP_WIDTH_MASK 0x7f8000
+#define BORDER_TOP_WIDTH_INDEX 0
+#define BORDER_TOP_WIDTH_SHIFT 16
+#define BORDER_TOP_WIDTH_MASK 0xff0000
static inline uint8_t get_border_top_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -429,8 +429,8 @@ static inline uint8_t get_border_top_width(const css_computed_style *style,
#undef BORDER_TOP_WIDTH_MASK
#define BOTTOM_INDEX 7
-#define BOTTOM_SHIFT 18
-#define BOTTOM_MASK 0x1fc0000
+#define BOTTOM_SHIFT 11
+#define BOTTOM_MASK 0x3f800
static inline uint8_t get_bottom(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
@@ -462,8 +462,8 @@ static inline uint8_t get_bottom_bits(
#undef BOTTOM_MASK
#define BOX_SIZING_INDEX 10
-#define BOX_SIZING_SHIFT 18
-#define BOX_SIZING_MASK 0xc0000
+#define BOX_SIZING_SHIFT 12
+#define BOX_SIZING_MASK 0x3000
static inline uint8_t get_box_sizing(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BOX_SIZING_INDEX];
@@ -478,9 +478,9 @@ static inline uint8_t get_box_sizing(const css_computed_style *style)
#undef BOX_SIZING_SHIFT
#undef BOX_SIZING_MASK
-#define BREAK_AFTER_INDEX 13
-#define BREAK_AFTER_SHIFT 28
-#define BREAK_AFTER_MASK 0xf0000000
+#define BREAK_AFTER_INDEX 9
+#define BREAK_AFTER_SHIFT 11
+#define BREAK_AFTER_MASK 0x7800
static inline uint8_t get_break_after(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BREAK_AFTER_INDEX];
@@ -495,9 +495,9 @@ static inline uint8_t get_break_after(const css_computed_style *style)
#undef BREAK_AFTER_SHIFT
#undef BREAK_AFTER_MASK
-#define BREAK_BEFORE_INDEX 13
-#define BREAK_BEFORE_SHIFT 24
-#define BREAK_BEFORE_MASK 0xf000000
+#define BREAK_BEFORE_INDEX 9
+#define BREAK_BEFORE_SHIFT 23
+#define BREAK_BEFORE_MASK 0x7800000
static inline uint8_t get_break_before(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BREAK_BEFORE_INDEX];
@@ -512,9 +512,9 @@ static inline uint8_t get_break_before(const css_computed_style *style)
#undef BREAK_BEFORE_SHIFT
#undef BREAK_BEFORE_MASK
-#define BREAK_INSIDE_INDEX 13
-#define BREAK_INSIDE_SHIFT 4
-#define BREAK_INSIDE_MASK 0xf0
+#define BREAK_INSIDE_INDEX 5
+#define BREAK_INSIDE_SHIFT 0
+#define BREAK_INSIDE_MASK 0xf
static inline uint8_t get_break_inside(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BREAK_INSIDE_INDEX];
@@ -530,8 +530,8 @@ static inline uint8_t get_break_inside(const css_computed_style *style)
#undef BREAK_INSIDE_MASK
#define CAPTION_SIDE_INDEX 11
-#define CAPTION_SIDE_SHIFT 24
-#define CAPTION_SIDE_MASK 0x3000000
+#define CAPTION_SIDE_SHIFT 4
+#define CAPTION_SIDE_MASK 0x30
static inline uint8_t get_caption_side(const css_computed_style *style)
{
uint32_t bits = style->i.bits[CAPTION_SIDE_INDEX];
@@ -546,9 +546,9 @@ static inline uint8_t get_caption_side(const css_computed_style *style)
#undef CAPTION_SIDE_SHIFT
#undef CAPTION_SIDE_MASK
-#define CLEAR_INDEX 10
-#define CLEAR_SHIFT 23
-#define CLEAR_MASK 0x3800000
+#define CLEAR_INDEX 13
+#define CLEAR_SHIFT 10
+#define CLEAR_MASK 0x1c00
static inline uint8_t get_clear(const css_computed_style *style)
{
uint32_t bits = style->i.bits[CLEAR_INDEX];
@@ -605,9 +605,9 @@ static inline uint8_t get_clip(
#undef CLIP_SHIFT
#undef CLIP_MASK
-#define COLOR_INDEX 12
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
+#define COLOR_INDEX 14
+#define COLOR_SHIFT 18
+#define COLOR_MASK 0x40000
static inline uint8_t get_color(const css_computed_style *style, css_color
*color)
{
@@ -624,9 +624,9 @@ static inline uint8_t get_color(const css_computed_style *style, css_color
#undef COLOR_SHIFT
#undef COLOR_MASK
-#define COLUMN_COUNT_INDEX 11
-#define COLUMN_COUNT_SHIFT 20
-#define COLUMN_COUNT_MASK 0x300000
+#define COLUMN_COUNT_INDEX 10
+#define COLUMN_COUNT_SHIFT 0
+#define COLUMN_COUNT_MASK 0x3
static inline uint8_t get_column_count(const css_computed_style *style, int32_t
*integer)
{
@@ -644,8 +644,8 @@ static inline uint8_t get_column_count(const css_computed_style *style, int32_t
#undef COLUMN_COUNT_MASK
#define COLUMN_FILL_INDEX 11
-#define COLUMN_FILL_SHIFT 10
-#define COLUMN_FILL_MASK 0xc00
+#define COLUMN_FILL_SHIFT 8
+#define COLUMN_FILL_MASK 0x300
static inline uint8_t get_column_fill(const css_computed_style *style)
{
uint32_t bits = style->i.bits[COLUMN_FILL_INDEX];
@@ -683,8 +683,8 @@ static inline uint8_t get_column_gap(const css_computed_style *style, css_fixed
#undef COLUMN_GAP_MASK
#define COLUMN_RULE_COLOR_INDEX 10
-#define COLUMN_RULE_COLOR_SHIFT 10
-#define COLUMN_RULE_COLOR_MASK 0xc00
+#define COLUMN_RULE_COLOR_SHIFT 16
+#define COLUMN_RULE_COLOR_MASK 0x30000
static inline uint8_t get_column_rule_color(const css_computed_style *style,
css_color *color)
{
@@ -701,9 +701,9 @@ static inline uint8_t get_column_rule_color(const css_computed_style *style,
#undef COLUMN_RULE_COLOR_SHIFT
#undef COLUMN_RULE_COLOR_MASK
-#define COLUMN_RULE_STYLE_INDEX 7
-#define COLUMN_RULE_STYLE_SHIFT 0
-#define COLUMN_RULE_STYLE_MASK 0xf
+#define COLUMN_RULE_STYLE_INDEX 9
+#define COLUMN_RULE_STYLE_SHIFT 3
+#define COLUMN_RULE_STYLE_MASK 0x78
static inline uint8_t get_column_rule_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[COLUMN_RULE_STYLE_INDEX];
@@ -718,9 +718,9 @@ static inline uint8_t get_column_rule_style(const css_computed_style *style)
#undef COLUMN_RULE_STYLE_SHIFT
#undef COLUMN_RULE_STYLE_MASK
-#define COLUMN_RULE_WIDTH_INDEX 0
-#define COLUMN_RULE_WIDTH_SHIFT 24
-#define COLUMN_RULE_WIDTH_MASK 0xff000000
+#define COLUMN_RULE_WIDTH_INDEX 1
+#define COLUMN_RULE_WIDTH_SHIFT 7
+#define COLUMN_RULE_WIDTH_MASK 0x7f80
static inline uint8_t get_column_rule_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -741,8 +741,8 @@ static inline uint8_t get_column_rule_width(const css_computed_style *style,
#undef COLUMN_RULE_WIDTH_MASK
#define COLUMN_SPAN_INDEX 10
-#define COLUMN_SPAN_SHIFT 6
-#define COLUMN_SPAN_MASK 0xc0
+#define COLUMN_SPAN_SHIFT 10
+#define COLUMN_SPAN_MASK 0xc00
static inline uint8_t get_column_span(const css_computed_style *style)
{
uint32_t bits = style->i.bits[COLUMN_SPAN_INDEX];
@@ -758,8 +758,8 @@ static inline uint8_t get_column_span(const css_computed_style *style)
#undef COLUMN_SPAN_MASK
#define COLUMN_WIDTH_INDEX 5
-#define COLUMN_WIDTH_SHIFT 4
-#define COLUMN_WIDTH_MASK 0x7f0
+#define COLUMN_WIDTH_SHIFT 25
+#define COLUMN_WIDTH_MASK 0xfe000000
static inline uint8_t get_column_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -780,8 +780,8 @@ static inline uint8_t get_column_width(const css_computed_style *style,
#undef COLUMN_WIDTH_MASK
#define CONTENT_INDEX 11
-#define CONTENT_SHIFT 0
-#define CONTENT_MASK 0x3
+#define CONTENT_SHIFT 18
+#define CONTENT_MASK 0xc0000
static inline uint8_t get_content(const css_computed_style *style, const
css_computed_content_item **content_item)
{
@@ -801,8 +801,8 @@ static inline uint8_t get_content(const css_computed_style *style, const
#undef CONTENT_MASK
#define COUNTER_INCREMENT_INDEX 14
-#define COUNTER_INCREMENT_SHIFT 29
-#define COUNTER_INCREMENT_MASK 0x20000000
+#define COUNTER_INCREMENT_SHIFT 20
+#define COUNTER_INCREMENT_MASK 0x100000
static inline uint8_t get_counter_increment(const css_computed_style *style,
const css_computed_counter **counter_arr)
{
@@ -820,8 +820,8 @@ static inline uint8_t get_counter_increment(const css_computed_style *style,
#undef COUNTER_INCREMENT_MASK
#define COUNTER_RESET_INDEX 14
-#define COUNTER_RESET_SHIFT 21
-#define COUNTER_RESET_MASK 0x200000
+#define COUNTER_RESET_SHIFT 25
+#define COUNTER_RESET_MASK 0x2000000
static inline uint8_t get_counter_reset(const css_computed_style *style, const
css_computed_counter **counter_arr)
{
@@ -838,9 +838,9 @@ static inline uint8_t get_counter_reset(const css_computed_style *style, const
#undef COUNTER_RESET_SHIFT
#undef COUNTER_RESET_MASK
-#define CURSOR_INDEX 8
-#define CURSOR_SHIFT 4
-#define CURSOR_MASK 0x1f0
+#define CURSOR_INDEX 9
+#define CURSOR_SHIFT 27
+#define CURSOR_MASK 0xf8000000
static inline uint8_t get_cursor(const css_computed_style *style, lwc_string
***string_arr)
{
@@ -857,9 +857,9 @@ static inline uint8_t get_cursor(const css_computed_style *style, lwc_string
#undef CURSOR_SHIFT
#undef CURSOR_MASK
-#define DIRECTION_INDEX 10
-#define DIRECTION_SHIFT 16
-#define DIRECTION_MASK 0x30000
+#define DIRECTION_INDEX 14
+#define DIRECTION_SHIFT 28
+#define DIRECTION_MASK 0x30000000
static inline uint8_t get_direction(const css_computed_style *style)
{
uint32_t bits = style->i.bits[DIRECTION_INDEX];
@@ -892,8 +892,8 @@ static inline uint8_t get_display(const css_computed_style *style)
#undef DISPLAY_MASK
#define EMPTY_CELLS_INDEX 10
-#define EMPTY_CELLS_SHIFT 14
-#define EMPTY_CELLS_MASK 0xc000
+#define EMPTY_CELLS_SHIFT 4
+#define EMPTY_CELLS_MASK 0x30
static inline uint8_t get_empty_cells(const css_computed_style *style)
{
uint32_t bits = style->i.bits[EMPTY_CELLS_INDEX];
@@ -909,8 +909,8 @@ static inline uint8_t get_empty_cells(const css_computed_style *style)
#undef EMPTY_CELLS_MASK
#define FLEX_BASIS_INDEX 4
-#define FLEX_BASIS_SHIFT 18
-#define FLEX_BASIS_MASK 0x1fc0000
+#define FLEX_BASIS_SHIFT 25
+#define FLEX_BASIS_MASK 0xfe000000
static inline uint8_t get_flex_basis(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -930,9 +930,9 @@ static inline uint8_t get_flex_basis(const css_computed_style *style, css_fixed
#undef FLEX_BASIS_SHIFT
#undef FLEX_BASIS_MASK
-#define FLEX_DIRECTION_INDEX 9
-#define FLEX_DIRECTION_SHIFT 5
-#define FLEX_DIRECTION_MASK 0xe0
+#define FLEX_DIRECTION_INDEX 13
+#define FLEX_DIRECTION_SHIFT 1
+#define FLEX_DIRECTION_MASK 0xe
static inline uint8_t get_flex_direction(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FLEX_DIRECTION_INDEX];
@@ -947,9 +947,9 @@ static inline uint8_t get_flex_direction(const css_computed_style *style)
#undef FLEX_DIRECTION_SHIFT
#undef FLEX_DIRECTION_MASK
-#define FLEX_GROW_INDEX 14
-#define FLEX_GROW_SHIFT 23
-#define FLEX_GROW_MASK 0x800000
+#define FLEX_GROW_INDEX 12
+#define FLEX_GROW_SHIFT 0
+#define FLEX_GROW_MASK 0x1
static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed
*fixed)
{
@@ -969,8 +969,8 @@ static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed
#undef FLEX_GROW_MASK
#define FLEX_SHRINK_INDEX 14
-#define FLEX_SHRINK_SHIFT 20
-#define FLEX_SHRINK_MASK 0x100000
+#define FLEX_SHRINK_SHIFT 22
+#define FLEX_SHRINK_MASK 0x400000
static inline uint8_t get_flex_shrink(const css_computed_style *style,
css_fixed *fixed)
{
@@ -990,8 +990,8 @@ static inline uint8_t get_flex_shrink(const css_computed_style *style,
#undef FLEX_SHRINK_MASK
#define FLEX_WRAP_INDEX 10
-#define FLEX_WRAP_SHIFT 12
-#define FLEX_WRAP_MASK 0x3000
+#define FLEX_WRAP_SHIFT 6
+#define FLEX_WRAP_MASK 0xc0
static inline uint8_t get_flex_wrap(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FLEX_WRAP_INDEX];
@@ -1007,8 +1007,8 @@ static inline uint8_t get_flex_wrap(const css_computed_style *style)
#undef FLEX_WRAP_MASK
#define FLOAT_INDEX 11
-#define FLOAT_SHIFT 6
-#define FLOAT_MASK 0xc0
+#define FLOAT_SHIFT 30
+#define FLOAT_MASK 0xc0000000
static inline uint8_t get_float(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FLOAT_INDEX];
@@ -1024,8 +1024,8 @@ static inline uint8_t get_float(const css_computed_style *style)
#undef FLOAT_MASK
#define FONT_FAMILY_INDEX 9
-#define FONT_FAMILY_SHIFT 26
-#define FONT_FAMILY_MASK 0x1c000000
+#define FONT_FAMILY_SHIFT 0
+#define FONT_FAMILY_MASK 0x7
static inline uint8_t get_font_family(const css_computed_style *style,
lwc_string ***string_arr)
{
@@ -1065,8 +1065,8 @@ static inline uint8_t get_font_size(const css_computed_style *style, css_fixed
#undef FONT_SIZE_MASK
#define FONT_STYLE_INDEX 11
-#define FONT_STYLE_SHIFT 30
-#define FONT_STYLE_MASK 0xc0000000
+#define FONT_STYLE_SHIFT 20
+#define FONT_STYLE_MASK 0x300000
static inline uint8_t get_font_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FONT_STYLE_INDEX];
@@ -1082,8 +1082,8 @@ static inline uint8_t get_font_style(const css_computed_style *style)
#undef FONT_STYLE_MASK
#define FONT_VARIANT_INDEX 11
-#define FONT_VARIANT_SHIFT 22
-#define FONT_VARIANT_MASK 0xc00000
+#define FONT_VARIANT_SHIFT 28
+#define FONT_VARIANT_MASK 0x30000000
static inline uint8_t get_font_variant(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FONT_VARIANT_INDEX];
@@ -1098,9 +1098,9 @@ static inline uint8_t get_font_variant(const css_computed_style *style)
#undef FONT_VARIANT_SHIFT
#undef FONT_VARIANT_MASK
-#define FONT_WEIGHT_INDEX 4
-#define FONT_WEIGHT_SHIFT 0
-#define FONT_WEIGHT_MASK 0xf
+#define FONT_WEIGHT_INDEX 9
+#define FONT_WEIGHT_SHIFT 15
+#define FONT_WEIGHT_MASK 0x78000
static inline uint8_t get_font_weight(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FONT_WEIGHT_INDEX];
@@ -1115,9 +1115,9 @@ static inline uint8_t get_font_weight(const css_computed_style *style)
#undef FONT_WEIGHT_SHIFT
#undef FONT_WEIGHT_MASK
-#define HEIGHT_INDEX 5
-#define HEIGHT_SHIFT 18
-#define HEIGHT_MASK 0x1fc0000
+#define HEIGHT_INDEX 6
+#define HEIGHT_SHIFT 25
+#define HEIGHT_MASK 0xfe000000
static inline uint8_t get_height(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1137,9 +1137,9 @@ static inline uint8_t get_height(const css_computed_style *style, css_fixed
#undef HEIGHT_SHIFT
#undef HEIGHT_MASK
-#define JUSTIFY_CONTENT_INDEX 10
-#define JUSTIFY_CONTENT_SHIFT 29
-#define JUSTIFY_CONTENT_MASK 0xe0000000
+#define JUSTIFY_CONTENT_INDEX 13
+#define JUSTIFY_CONTENT_SHIFT 4
+#define JUSTIFY_CONTENT_MASK 0x70
static inline uint8_t get_justify_content(const css_computed_style *style)
{
uint32_t bits = style->i.bits[JUSTIFY_CONTENT_INDEX];
@@ -1187,9 +1187,9 @@ static inline uint8_t get_left_bits(
#undef LEFT_SHIFT
#undef LEFT_MASK
-#define LETTER_SPACING_INDEX 1
-#define LETTER_SPACING_SHIFT 0
-#define LETTER_SPACING_MASK 0x7f
+#define LETTER_SPACING_INDEX 6
+#define LETTER_SPACING_SHIFT 18
+#define LETTER_SPACING_MASK 0x1fc0000
static inline uint8_t get_letter_spacing(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1236,9 +1236,9 @@ static inline uint8_t get_line_height(
#undef LINE_HEIGHT_SHIFT
#undef LINE_HEIGHT_MASK
-#define LIST_STYLE_IMAGE_INDEX 13
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
+#define LIST_STYLE_IMAGE_INDEX 14
+#define LIST_STYLE_IMAGE_SHIFT 27
+#define LIST_STYLE_IMAGE_MASK 0x8000000
static inline uint8_t get_list_style_image(const css_computed_style *style,
lwc_string **string)
{
@@ -1255,9 +1255,9 @@ static inline uint8_t get_list_style_image(const css_computed_style *style,
#undef LIST_STYLE_IMAGE_SHIFT
#undef LIST_STYLE_IMAGE_MASK
-#define LIST_STYLE_POSITION_INDEX 14
-#define LIST_STYLE_POSITION_SHIFT 30
-#define LIST_STYLE_POSITION_MASK 0xc0000000
+#define LIST_STYLE_POSITION_INDEX 11
+#define LIST_STYLE_POSITION_SHIFT 6
+#define LIST_STYLE_POSITION_MASK 0xc0
static inline uint8_t get_list_style_position(const css_computed_style *style)
{
uint32_t bits = style->i.bits[LIST_STYLE_POSITION_INDEX];
@@ -1272,24 +1272,24 @@ static inline uint8_t get_list_style_position(const css_computed_style *style)
#undef LIST_STYLE_POSITION_SHIFT
#undef LIST_STYLE_POSITION_MASK
-#define LIST_STYLE_TYPE_INDEX 13
-#define LIST_STYLE_TYPE_SHIFT 20
-#define LIST_STYLE_TYPE_MASK 0xf00000
+#define LIST_STYLE_TYPE_INDEX 8
+#define LIST_STYLE_TYPE_SHIFT 26
+#define LIST_STYLE_TYPE_MASK 0xfc000000
static inline uint8_t get_list_style_type(const css_computed_style *style)
{
uint32_t bits = style->i.bits[LIST_STYLE_TYPE_INDEX];
bits &= LIST_STYLE_TYPE_MASK;
bits >>= LIST_STYLE_TYPE_SHIFT;
- /* 4bits: tttt : type */
+ /* 6bits: tttttt : type */
- return (bits & 0xf);
+ return (bits & 0x3f);
}
#undef LIST_STYLE_TYPE_INDEX
#undef LIST_STYLE_TYPE_SHIFT
#undef LIST_STYLE_TYPE_MASK
-#define MARGIN_BOTTOM_INDEX 3
+#define MARGIN_BOTTOM_INDEX 5
#define MARGIN_BOTTOM_SHIFT 18
#define MARGIN_BOTTOM_MASK 0x1fc0000
static inline uint8_t get_margin_bottom(const css_computed_style *style,
@@ -1311,9 +1311,9 @@ static inline uint8_t get_margin_bottom(const css_computed_style *style,
#undef MARGIN_BOTTOM_SHIFT
#undef MARGIN_BOTTOM_MASK
-#define MARGIN_LEFT_INDEX 3
-#define MARGIN_LEFT_SHIFT 11
-#define MARGIN_LEFT_MASK 0x3f800
+#define MARGIN_LEFT_INDEX 7
+#define MARGIN_LEFT_SHIFT 18
+#define MARGIN_LEFT_MASK 0x1fc0000
static inline uint8_t get_margin_left(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1355,9 +1355,9 @@ static inline uint8_t get_margin_right(const css_computed_style *style,
#undef MARGIN_RIGHT_SHIFT
#undef MARGIN_RIGHT_MASK
-#define MARGIN_TOP_INDEX 7
-#define MARGIN_TOP_SHIFT 4
-#define MARGIN_TOP_MASK 0x7f0
+#define MARGIN_TOP_INDEX 1
+#define MARGIN_TOP_SHIFT 0
+#define MARGIN_TOP_MASK 0x7f
static inline uint8_t get_margin_top(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1377,9 +1377,9 @@ static inline uint8_t get_margin_top(const css_computed_style *style, css_fixed
#undef MARGIN_TOP_SHIFT
#undef MARGIN_TOP_MASK
-#define MAX_HEIGHT_INDEX 6
-#define MAX_HEIGHT_SHIFT 18
-#define MAX_HEIGHT_MASK 0x1fc0000
+#define MAX_HEIGHT_INDEX 3
+#define MAX_HEIGHT_SHIFT 25
+#define MAX_HEIGHT_MASK 0xfe000000
static inline uint8_t get_max_height(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1399,9 +1399,9 @@ static inline uint8_t get_max_height(const css_computed_style *style, css_fixed
#undef MAX_HEIGHT_SHIFT
#undef MAX_HEIGHT_MASK
-#define MAX_WIDTH_INDEX 3
-#define MAX_WIDTH_SHIFT 25
-#define MAX_WIDTH_MASK 0xfe000000
+#define MAX_WIDTH_INDEX 7
+#define MAX_WIDTH_SHIFT 4
+#define MAX_WIDTH_MASK 0x7f0
static inline uint8_t get_max_width(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1421,9 +1421,9 @@ static inline uint8_t get_max_width(const css_computed_style *style, css_fixed
#undef MAX_WIDTH_SHIFT
#undef MAX_WIDTH_MASK
-#define MIN_HEIGHT_INDEX 7
-#define MIN_HEIGHT_SHIFT 11
-#define MIN_HEIGHT_MASK 0x3f800
+#define MIN_HEIGHT_INDEX 4
+#define MIN_HEIGHT_SHIFT 18
+#define MIN_HEIGHT_MASK 0x1fc0000
static inline uint8_t get_min_height(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1466,8 +1466,8 @@ static inline uint8_t get_min_width(const css_computed_style *style, css_fixed
#undef MIN_WIDTH_MASK
#define OPACITY_INDEX 14
-#define OPACITY_SHIFT 25
-#define OPACITY_MASK 0x2000000
+#define OPACITY_SHIFT 19
+#define OPACITY_MASK 0x80000
static inline uint8_t get_opacity(const css_computed_style *style, css_fixed
*fixed)
{
@@ -1486,9 +1486,9 @@ static inline uint8_t get_opacity(const css_computed_style *style, css_fixed
#undef OPACITY_SHIFT
#undef OPACITY_MASK
-#define ORDER_INDEX 14
-#define ORDER_SHIFT 26
-#define ORDER_MASK 0x4000000
+#define ORDER_INDEX 13
+#define ORDER_SHIFT 0
+#define ORDER_MASK 0x1
static inline uint8_t get_order(const css_computed_style *style, int32_t
*integer)
{
@@ -1508,8 +1508,8 @@ static inline uint8_t get_order(const css_computed_style *style, int32_t
#undef ORDER_MASK
#define ORPHANS_INDEX 14
-#define ORPHANS_SHIFT 22
-#define ORPHANS_MASK 0x400000
+#define ORPHANS_SHIFT 24
+#define ORPHANS_MASK 0x1000000
static inline uint8_t get_orphans(const css_computed_style *style, int32_t
*integer)
{
@@ -1527,8 +1527,8 @@ static inline uint8_t get_orphans(const css_computed_style *style, int32_t
#undef ORPHANS_MASK
#define OUTLINE_COLOR_INDEX 11
-#define OUTLINE_COLOR_SHIFT 12
-#define OUTLINE_COLOR_MASK 0x3000
+#define OUTLINE_COLOR_SHIFT 10
+#define OUTLINE_COLOR_MASK 0xc00
static inline uint8_t get_outline_color(const css_computed_style *style,
css_color *color)
{
@@ -1547,9 +1547,9 @@ static inline uint8_t get_outline_color(const css_computed_style *style,
#undef OUTLINE_COLOR_SHIFT
#undef OUTLINE_COLOR_MASK
-#define OUTLINE_STYLE_INDEX 5
-#define OUTLINE_STYLE_SHIFT 0
-#define OUTLINE_STYLE_MASK 0xf
+#define OUTLINE_STYLE_INDEX 9
+#define OUTLINE_STYLE_SHIFT 7
+#define OUTLINE_STYLE_MASK 0x780
static inline uint8_t get_outline_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[OUTLINE_STYLE_INDEX];
@@ -1564,9 +1564,9 @@ static inline uint8_t get_outline_style(const css_computed_style *style)
#undef OUTLINE_STYLE_SHIFT
#undef OUTLINE_STYLE_MASK
-#define OUTLINE_WIDTH_INDEX 0
-#define OUTLINE_WIDTH_SHIFT 16
-#define OUTLINE_WIDTH_MASK 0xff0000
+#define OUTLINE_WIDTH_INDEX 1
+#define OUTLINE_WIDTH_SHIFT 15
+#define OUTLINE_WIDTH_MASK 0x7f8000
static inline uint8_t get_outline_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1586,9 +1586,9 @@ static inline uint8_t get_outline_width(const css_computed_style *style,
#undef OUTLINE_WIDTH_SHIFT
#undef OUTLINE_WIDTH_MASK
-#define OVERFLOW_X_INDEX 9
-#define OVERFLOW_X_SHIFT 14
-#define OVERFLOW_X_MASK 0x1c000
+#define OVERFLOW_X_INDEX 13
+#define OVERFLOW_X_SHIFT 16
+#define OVERFLOW_X_MASK 0x70000
static inline uint8_t get_overflow_x(const css_computed_style *style)
{
uint32_t bits = style->i.bits[OVERFLOW_X_INDEX];
@@ -1603,9 +1603,9 @@ static inline uint8_t get_overflow_x(const css_computed_style *style)
#undef OVERFLOW_X_SHIFT
#undef OVERFLOW_X_MASK
-#define OVERFLOW_Y_INDEX 9
-#define OVERFLOW_Y_SHIFT 11
-#define OVERFLOW_Y_MASK 0x3800
+#define OVERFLOW_Y_INDEX 13
+#define OVERFLOW_Y_SHIFT 25
+#define OVERFLOW_Y_MASK 0xe000000
static inline uint8_t get_overflow_y(const css_computed_style *style)
{
uint32_t bits = style->i.bits[OVERFLOW_Y_INDEX];
@@ -1621,8 +1621,8 @@ static inline uint8_t get_overflow_y(const css_computed_style *style)
#undef OVERFLOW_Y_MASK
#define PADDING_BOTTOM_INDEX 8
-#define PADDING_BOTTOM_SHIFT 14
-#define PADDING_BOTTOM_MASK 0xfc000
+#define PADDING_BOTTOM_SHIFT 8
+#define PADDING_BOTTOM_MASK 0x3f00
static inline uint8_t get_padding_bottom(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1642,9 +1642,9 @@ static inline uint8_t get_padding_bottom(const css_computed_style *style,
#undef PADDING_BOTTOM_SHIFT
#undef PADDING_BOTTOM_MASK
-#define PADDING_LEFT_INDEX 8
-#define PADDING_LEFT_SHIFT 26
-#define PADDING_LEFT_MASK 0xfc000000
+#define PADDING_LEFT_INDEX 2
+#define PADDING_LEFT_SHIFT 0
+#define PADDING_LEFT_MASK 0x3f
static inline uint8_t get_padding_left(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1665,8 +1665,8 @@ static inline uint8_t get_padding_left(const css_computed_style *style,
#undef PADDING_LEFT_MASK
#define PADDING_RIGHT_INDEX 8
-#define PADDING_RIGHT_SHIFT 20
-#define PADDING_RIGHT_MASK 0x3f00000
+#define PADDING_RIGHT_SHIFT 14
+#define PADDING_RIGHT_MASK 0xfc000
static inline uint8_t get_padding_right(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1686,9 +1686,9 @@ static inline uint8_t get_padding_right(const css_computed_style *style,
#undef PADDING_RIGHT_SHIFT
#undef PADDING_RIGHT_MASK
-#define PADDING_TOP_INDEX 2
-#define PADDING_TOP_SHIFT 0
-#define PADDING_TOP_MASK 0x3f
+#define PADDING_TOP_INDEX 8
+#define PADDING_TOP_SHIFT 20
+#define PADDING_TOP_MASK 0x3f00000
static inline uint8_t get_padding_top(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1708,9 +1708,9 @@ static inline uint8_t get_padding_top(const css_computed_style *style,
#undef PADDING_TOP_SHIFT
#undef PADDING_TOP_MASK
-#define PAGE_BREAK_AFTER_INDEX 9
-#define PAGE_BREAK_AFTER_SHIFT 2
-#define PAGE_BREAK_AFTER_MASK 0x1c
+#define PAGE_BREAK_AFTER_INDEX 8
+#define PAGE_BREAK_AFTER_SHIFT 0
+#define PAGE_BREAK_AFTER_MASK 0x7
static inline uint8_t get_page_break_after(const css_computed_style *style)
{
uint32_t bits = style->i.bits[PAGE_BREAK_AFTER_INDEX];
@@ -1725,9 +1725,9 @@ static inline uint8_t get_page_break_after(const css_computed_style *style)
#undef PAGE_BREAK_AFTER_SHIFT
#undef PAGE_BREAK_AFTER_MASK
-#define PAGE_BREAK_BEFORE_INDEX 9
-#define PAGE_BREAK_BEFORE_SHIFT 23
-#define PAGE_BREAK_BEFORE_MASK 0x3800000
+#define PAGE_BREAK_BEFORE_INDEX 13
+#define PAGE_BREAK_BEFORE_SHIFT 7
+#define PAGE_BREAK_BEFORE_MASK 0x380
static inline uint8_t get_page_break_before(const css_computed_style *style)
{
uint32_t bits = style->i.bits[PAGE_BREAK_BEFORE_INDEX];
@@ -1742,9 +1742,9 @@ static inline uint8_t get_page_break_before(const css_computed_style *style)
#undef PAGE_BREAK_BEFORE_SHIFT
#undef PAGE_BREAK_BEFORE_MASK
-#define PAGE_BREAK_INSIDE_INDEX 10
-#define PAGE_BREAK_INSIDE_SHIFT 4
-#define PAGE_BREAK_INSIDE_MASK 0x30
+#define PAGE_BREAK_INSIDE_INDEX 11
+#define PAGE_BREAK_INSIDE_SHIFT 24
+#define PAGE_BREAK_INSIDE_MASK 0x3000000
static inline uint8_t get_page_break_inside(const css_computed_style *style)
{
uint32_t bits = style->i.bits[PAGE_BREAK_INSIDE_INDEX];
@@ -1760,8 +1760,8 @@ static inline uint8_t get_page_break_inside(const css_computed_style *style)
#undef PAGE_BREAK_INSIDE_MASK
#define POSITION_INDEX 10
-#define POSITION_SHIFT 26
-#define POSITION_MASK 0x1c000000
+#define POSITION_SHIFT 20
+#define POSITION_MASK 0x700000
static inline uint8_t get_position(const css_computed_style *style)
{
uint32_t bits = style->i.bits[POSITION_INDEX];
@@ -1777,8 +1777,8 @@ static inline uint8_t get_position(const css_computed_style *style)
#undef POSITION_MASK
#define QUOTES_INDEX 14
-#define QUOTES_SHIFT 27
-#define QUOTES_MASK 0x8000000
+#define QUOTES_SHIFT 21
+#define QUOTES_MASK 0x200000
static inline uint8_t get_quotes(const css_computed_style *style, lwc_string
***string_arr)
{
@@ -1795,9 +1795,9 @@ static inline uint8_t get_quotes(const css_computed_style *style, lwc_string
#undef QUOTES_SHIFT
#undef QUOTES_MASK
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 25
-#define RIGHT_MASK 0xfe000000
+#define RIGHT_INDEX 3
+#define RIGHT_SHIFT 18
+#define RIGHT_MASK 0x1fc0000
static inline uint8_t get_right(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
@@ -1828,9 +1828,9 @@ static inline uint8_t get_right_bits(
#undef RIGHT_SHIFT
#undef RIGHT_MASK
-#define TABLE_LAYOUT_INDEX 11
-#define TABLE_LAYOUT_SHIFT 4
-#define TABLE_LAYOUT_MASK 0x30
+#define TABLE_LAYOUT_INDEX 10
+#define TABLE_LAYOUT_SHIFT 14
+#define TABLE_LAYOUT_MASK 0xc000
static inline uint8_t get_table_layout(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TABLE_LAYOUT_INDEX];
@@ -1845,9 +1845,9 @@ static inline uint8_t get_table_layout(const css_computed_style *style)
#undef TABLE_LAYOUT_SHIFT
#undef TABLE_LAYOUT_MASK
-#define TEXT_ALIGN_INDEX 13
-#define TEXT_ALIGN_SHIFT 16
-#define TEXT_ALIGN_MASK 0xf0000
+#define TEXT_ALIGN_INDEX 4
+#define TEXT_ALIGN_SHIFT 0
+#define TEXT_ALIGN_MASK 0xf
static inline uint8_t get_text_align(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TEXT_ALIGN_INDEX];
@@ -1863,8 +1863,8 @@ static inline uint8_t get_text_align(const css_computed_style *style)
#undef TEXT_ALIGN_MASK
#define TEXT_DECORATION_INDEX 8
-#define TEXT_DECORATION_SHIFT 9
-#define TEXT_DECORATION_MASK 0x3e00
+#define TEXT_DECORATION_SHIFT 3
+#define TEXT_DECORATION_MASK 0xf8
static inline uint8_t get_text_decoration(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TEXT_DECORATION_INDEX];
@@ -1901,9 +1901,9 @@ static inline uint8_t get_text_indent(const css_computed_style *style,
#undef TEXT_INDENT_SHIFT
#undef TEXT_INDENT_MASK
-#define TEXT_TRANSFORM_INDEX 9
-#define TEXT_TRANSFORM_SHIFT 8
-#define TEXT_TRANSFORM_MASK 0x700
+#define TEXT_TRANSFORM_INDEX 13
+#define TEXT_TRANSFORM_SHIFT 13
+#define TEXT_TRANSFORM_MASK 0xe000
static inline uint8_t get_text_transform(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TEXT_TRANSFORM_INDEX];
@@ -1918,7 +1918,7 @@ static inline uint8_t get_text_transform(const css_computed_style *style)
#undef TEXT_TRANSFORM_SHIFT
#undef TEXT_TRANSFORM_MASK
-#define TOP_INDEX 6
+#define TOP_INDEX 7
#define TOP_SHIFT 25
#define TOP_MASK 0xfe000000
static inline uint8_t get_top(
@@ -1951,9 +1951,9 @@ static inline uint8_t get_top_bits(
#undef TOP_SHIFT
#undef TOP_MASK
-#define UNICODE_BIDI_INDEX 9
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
+#define UNICODE_BIDI_INDEX 11
+#define UNICODE_BIDI_SHIFT 2
+#define UNICODE_BIDI_MASK 0xc
static inline uint8_t get_unicode_bidi(const css_computed_style *style)
{
uint32_t bits = style->i.bits[UNICODE_BIDI_INDEX];
@@ -1991,8 +1991,8 @@ static inline uint8_t get_vertical_align(const css_computed_style *style,
#undef VERTICAL_ALIGN_MASK
#define VISIBILITY_INDEX 11
-#define VISIBILITY_SHIFT 14
-#define VISIBILITY_MASK 0xc000
+#define VISIBILITY_SHIFT 0
+#define VISIBILITY_MASK 0x3
static inline uint8_t get_visibility(const css_computed_style *style)
{
uint32_t bits = style->i.bits[VISIBILITY_INDEX];
@@ -2007,9 +2007,9 @@ static inline uint8_t get_visibility(const css_computed_style *style)
#undef VISIBILITY_SHIFT
#undef VISIBILITY_MASK
-#define WHITE_SPACE_INDEX 10
-#define WHITE_SPACE_SHIFT 20
-#define WHITE_SPACE_MASK 0x700000
+#define WHITE_SPACE_INDEX 13
+#define WHITE_SPACE_SHIFT 19
+#define WHITE_SPACE_MASK 0x380000
static inline uint8_t get_white_space(const css_computed_style *style)
{
uint32_t bits = style->i.bits[WHITE_SPACE_INDEX];
@@ -2025,8 +2025,8 @@ static inline uint8_t get_white_space(const css_computed_style *style)
#undef WHITE_SPACE_MASK
#define WIDOWS_INDEX 14
-#define WIDOWS_SHIFT 24
-#define WIDOWS_MASK 0x1000000
+#define WIDOWS_SHIFT 26
+#define WIDOWS_MASK 0x4000000
static inline uint8_t get_widows(const css_computed_style *style, int32_t
*integer)
{
@@ -2043,9 +2043,9 @@ static inline uint8_t get_widows(const css_computed_style *style, int32_t
#undef WIDOWS_SHIFT
#undef WIDOWS_MASK
-#define WIDTH_INDEX 5
-#define WIDTH_SHIFT 25
-#define WIDTH_MASK 0xfe000000
+#define WIDTH_INDEX 3
+#define WIDTH_SHIFT 11
+#define WIDTH_MASK 0x3f800
static inline uint8_t get_width(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -2065,9 +2065,9 @@ static inline uint8_t get_width(const css_computed_style *style, css_fixed
#undef WIDTH_SHIFT
#undef WIDTH_MASK
-#define WORD_SPACING_INDEX 4
-#define WORD_SPACING_SHIFT 25
-#define WORD_SPACING_MASK 0xfe000000
+#define WORD_SPACING_INDEX 5
+#define WORD_SPACING_SHIFT 4
+#define WORD_SPACING_MASK 0x7f0
static inline uint8_t get_word_spacing(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -2087,9 +2087,9 @@ static inline uint8_t get_word_spacing(const css_computed_style *style,
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_MASK
-#define WRITING_MODE_INDEX 11
-#define WRITING_MODE_SHIFT 18
-#define WRITING_MODE_MASK 0xc0000
+#define WRITING_MODE_INDEX 14
+#define WRITING_MODE_SHIFT 30
+#define WRITING_MODE_MASK 0xc0000000
static inline uint8_t get_writing_mode(const css_computed_style *style)
{
uint32_t bits = style->i.bits[WRITING_MODE_INDEX];
@@ -2104,9 +2104,9 @@ static inline uint8_t get_writing_mode(const css_computed_style *style)
#undef WRITING_MODE_SHIFT
#undef WRITING_MODE_MASK
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 2
-#define Z_INDEX_MASK 0xc
+#define Z_INDEX_INDEX 10
+#define Z_INDEX_SHIFT 8
+#define Z_INDEX_MASK 0x300
static inline uint8_t get_z_index(const css_computed_style *style, int32_t
*integer)
{
diff --git a/src/select/autogenerated_propset.h b/src/select/autogenerated_propset.h
index 2854896..56ff7c6 100644
--- a/src/select/autogenerated_propset.h
+++ b/src/select/autogenerated_propset.h
@@ -8,9 +8,9 @@
/** Default values are 'initial value', unless the property is inherited,
* in which case it is 'inherit'. */
-#define ALIGN_CONTENT_INDEX 9
-#define ALIGN_CONTENT_SHIFT 17
-#define ALIGN_CONTENT_MASK 0xe0000
+#define ALIGN_CONTENT_INDEX 10
+#define ALIGN_CONTENT_SHIFT 29
+#define ALIGN_CONTENT_MASK 0xe0000000
static inline css_error set_align_content(css_computed_style *style, uint8_t
type)
@@ -29,9 +29,9 @@ static inline css_error set_align_content(css_computed_style *style, uint8_t
#undef ALIGN_CONTENT_SHIFT
#undef ALIGN_CONTENT_MASK
-#define ALIGN_ITEMS_INDEX 9
-#define ALIGN_ITEMS_SHIFT 29
-#define ALIGN_ITEMS_MASK 0xe0000000
+#define ALIGN_ITEMS_INDEX 10
+#define ALIGN_ITEMS_SHIFT 26
+#define ALIGN_ITEMS_MASK 0x1c000000
static inline css_error set_align_items(css_computed_style *style, uint8_t type)
{
@@ -49,9 +49,9 @@ static inline css_error set_align_items(css_computed_style *style, uint8_t type)
#undef ALIGN_ITEMS_SHIFT
#undef ALIGN_ITEMS_MASK
-#define ALIGN_SELF_INDEX 9
-#define ALIGN_SELF_SHIFT 20
-#define ALIGN_SELF_MASK 0x700000
+#define ALIGN_SELF_INDEX 10
+#define ALIGN_SELF_SHIFT 23
+#define ALIGN_SELF_MASK 0x3800000
static inline css_error set_align_self(css_computed_style *style, uint8_t type)
{
@@ -69,9 +69,9 @@ static inline css_error set_align_self(css_computed_style *style, uint8_t type)
#undef ALIGN_SELF_SHIFT
#undef ALIGN_SELF_MASK
-#define BACKGROUND_ATTACHMENT_INDEX 10
-#define BACKGROUND_ATTACHMENT_SHIFT 8
-#define BACKGROUND_ATTACHMENT_MASK 0x300
+#define BACKGROUND_ATTACHMENT_INDEX 11
+#define BACKGROUND_ATTACHMENT_SHIFT 26
+#define BACKGROUND_ATTACHMENT_MASK 0xc000000
static inline css_error set_background_attachment(css_computed_style *style,
uint8_t type)
@@ -90,9 +90,9 @@ static inline css_error set_background_attachment(css_computed_style *style,
#undef BACKGROUND_ATTACHMENT_SHIFT
#undef BACKGROUND_ATTACHMENT_MASK
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 2
-#define BACKGROUND_COLOR_MASK 0xc
+#define BACKGROUND_COLOR_INDEX 11
+#define BACKGROUND_COLOR_SHIFT 22
+#define BACKGROUND_COLOR_MASK 0xc00000
static inline css_error set_background_color(css_computed_style *style, uint8_t
type, css_color color)
@@ -114,8 +114,8 @@ static inline css_error set_background_color(css_computed_style *style, uint8_t
#undef BACKGROUND_COLOR_MASK
#define BACKGROUND_IMAGE_INDEX 14
-#define BACKGROUND_IMAGE_SHIFT 28
-#define BACKGROUND_IMAGE_MASK 0x10000000
+#define BACKGROUND_IMAGE_SHIFT 23
+#define BACKGROUND_IMAGE_MASK 0x800000
static inline css_error set_background_image(css_computed_style *style, uint8_t
type, lwc_string *string)
@@ -173,8 +173,8 @@ static inline css_error set_background_position(css_computed_style *style,
#undef BACKGROUND_POSITION_MASK
#define BACKGROUND_REPEAT_INDEX 13
-#define BACKGROUND_REPEAT_SHIFT 1
-#define BACKGROUND_REPEAT_MASK 0xe
+#define BACKGROUND_REPEAT_SHIFT 22
+#define BACKGROUND_REPEAT_MASK 0x1c00000
static inline css_error set_background_repeat(css_computed_style *style,
uint8_t type)
@@ -193,9 +193,9 @@ static inline css_error set_background_repeat(css_computed_style *style,
#undef BACKGROUND_REPEAT_SHIFT
#undef BACKGROUND_REPEAT_MASK
-#define BORDER_BOTTOM_COLOR_INDEX 11
-#define BORDER_BOTTOM_COLOR_SHIFT 28
-#define BORDER_BOTTOM_COLOR_MASK 0x30000000
+#define BORDER_BOTTOM_COLOR_INDEX 10
+#define BORDER_BOTTOM_COLOR_SHIFT 18
+#define BORDER_BOTTOM_COLOR_MASK 0xc0000
static inline css_error set_border_bottom_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -216,9 +216,9 @@ static inline css_error set_border_bottom_color(css_computed_style *style,
#undef BORDER_BOTTOM_COLOR_SHIFT
#undef BORDER_BOTTOM_COLOR_MASK
-#define BORDER_BOTTOM_STYLE_INDEX 13
-#define BORDER_BOTTOM_STYLE_SHIFT 8
-#define BORDER_BOTTOM_STYLE_MASK 0xf00
+#define BORDER_BOTTOM_STYLE_INDEX 6
+#define BORDER_BOTTOM_STYLE_SHIFT 0
+#define BORDER_BOTTOM_STYLE_MASK 0xf
static inline css_error set_border_bottom_style(css_computed_style *style,
uint8_t type)
@@ -238,8 +238,8 @@ static inline css_error set_border_bottom_style(css_computed_style *style,
#undef BORDER_BOTTOM_STYLE_MASK
#define BORDER_BOTTOM_WIDTH_INDEX 0
-#define BORDER_BOTTOM_WIDTH_SHIFT 0
-#define BORDER_BOTTOM_WIDTH_MASK 0xff
+#define BORDER_BOTTOM_WIDTH_SHIFT 8
+#define BORDER_BOTTOM_WIDTH_MASK 0xff00
static inline css_error set_border_bottom_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -261,8 +261,8 @@ static inline css_error set_border_bottom_width(css_computed_style *style,
#undef BORDER_BOTTOM_WIDTH_MASK
#define BORDER_COLLAPSE_INDEX 11
-#define BORDER_COLLAPSE_SHIFT 16
-#define BORDER_COLLAPSE_MASK 0x30000
+#define BORDER_COLLAPSE_SHIFT 14
+#define BORDER_COLLAPSE_MASK 0xc000
static inline css_error set_border_collapse(css_computed_style *style, uint8_t
type)
@@ -282,8 +282,8 @@ static inline css_error set_border_collapse(css_computed_style *style, uint8_t
#undef BORDER_COLLAPSE_MASK
#define BORDER_LEFT_COLOR_INDEX 10
-#define BORDER_LEFT_COLOR_SHIFT 0
-#define BORDER_LEFT_COLOR_MASK 0x3
+#define BORDER_LEFT_COLOR_SHIFT 2
+#define BORDER_LEFT_COLOR_MASK 0xc
static inline css_error set_border_left_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -304,9 +304,9 @@ static inline css_error set_border_left_color(css_computed_style *style,
#undef BORDER_LEFT_COLOR_SHIFT
#undef BORDER_LEFT_COLOR_MASK
-#define BORDER_LEFT_STYLE_INDEX 13
-#define BORDER_LEFT_STYLE_SHIFT 12
-#define BORDER_LEFT_STYLE_MASK 0xf000
+#define BORDER_LEFT_STYLE_INDEX 9
+#define BORDER_LEFT_STYLE_SHIFT 19
+#define BORDER_LEFT_STYLE_MASK 0x780000
static inline css_error set_border_left_style(css_computed_style *style,
uint8_t type)
@@ -326,8 +326,8 @@ static inline css_error set_border_left_style(css_computed_style *style,
#undef BORDER_LEFT_STYLE_MASK
#define BORDER_LEFT_WIDTH_INDEX 0
-#define BORDER_LEFT_WIDTH_SHIFT 8
-#define BORDER_LEFT_WIDTH_MASK 0xff00
+#define BORDER_LEFT_WIDTH_SHIFT 24
+#define BORDER_LEFT_WIDTH_MASK 0xff000000
static inline css_error set_border_left_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -349,8 +349,8 @@ static inline css_error set_border_left_width(css_computed_style *style,
#undef BORDER_LEFT_WIDTH_MASK
#define BORDER_RIGHT_COLOR_INDEX 11
-#define BORDER_RIGHT_COLOR_SHIFT 8
-#define BORDER_RIGHT_COLOR_MASK 0x300
+#define BORDER_RIGHT_COLOR_SHIFT 12
+#define BORDER_RIGHT_COLOR_MASK 0x3000
static inline css_error set_border_right_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -371,9 +371,9 @@ static inline css_error set_border_right_color(css_computed_style *style,
#undef BORDER_RIGHT_COLOR_SHIFT
#undef BORDER_RIGHT_COLOR_MASK
-#define BORDER_RIGHT_STYLE_INDEX 8
-#define BORDER_RIGHT_STYLE_SHIFT 0
-#define BORDER_RIGHT_STYLE_MASK 0xf
+#define BORDER_RIGHT_STYLE_INDEX 13
+#define BORDER_RIGHT_STYLE_SHIFT 28
+#define BORDER_RIGHT_STYLE_MASK 0xf0000000
static inline css_error set_border_right_style(css_computed_style *style,
uint8_t type)
@@ -392,9 +392,9 @@ static inline css_error set_border_right_style(css_computed_style *style,
#undef BORDER_RIGHT_STYLE_SHIFT
#undef BORDER_RIGHT_STYLE_MASK
-#define BORDER_RIGHT_WIDTH_INDEX 1
-#define BORDER_RIGHT_WIDTH_SHIFT 7
-#define BORDER_RIGHT_WIDTH_MASK 0x7f80
+#define BORDER_RIGHT_WIDTH_INDEX 0
+#define BORDER_RIGHT_WIDTH_SHIFT 0
+#define BORDER_RIGHT_WIDTH_MASK 0xff
static inline css_error set_border_right_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -442,8 +442,8 @@ static inline css_error set_border_spacing(css_computed_style *style, uint8_t
#undef BORDER_SPACING_MASK
#define BORDER_TOP_COLOR_INDEX 11
-#define BORDER_TOP_COLOR_SHIFT 26
-#define BORDER_TOP_COLOR_MASK 0xc000000
+#define BORDER_TOP_COLOR_SHIFT 16
+#define BORDER_TOP_COLOR_MASK 0x30000
static inline css_error set_border_top_color(css_computed_style *style, uint8_t
type, css_color color)
@@ -464,7 +464,7 @@ static inline css_error set_border_top_color(css_computed_style *style, uint8_t
#undef BORDER_TOP_COLOR_SHIFT
#undef BORDER_TOP_COLOR_MASK
-#define BORDER_TOP_STYLE_INDEX 6
+#define BORDER_TOP_STYLE_INDEX 7
#define BORDER_TOP_STYLE_SHIFT 0
#define BORDER_TOP_STYLE_MASK 0xf
@@ -485,9 +485,9 @@ static inline css_error set_border_top_style(css_computed_style *style, uint8_t
#undef BORDER_TOP_STYLE_SHIFT
#undef BORDER_TOP_STYLE_MASK
-#define BORDER_TOP_WIDTH_INDEX 1
-#define BORDER_TOP_WIDTH_SHIFT 15
-#define BORDER_TOP_WIDTH_MASK 0x7f8000
+#define BORDER_TOP_WIDTH_INDEX 0
+#define BORDER_TOP_WIDTH_SHIFT 16
+#define BORDER_TOP_WIDTH_MASK 0xff0000
static inline css_error set_border_top_width(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -509,8 +509,8 @@ static inline css_error set_border_top_width(css_computed_style *style, uint8_t
#undef BORDER_TOP_WIDTH_MASK
#define BOTTOM_INDEX 7
-#define BOTTOM_SHIFT 18
-#define BOTTOM_MASK 0x1fc0000
+#define BOTTOM_SHIFT 11
+#define BOTTOM_MASK 0x3f800
static inline css_error set_bottom(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -532,8 +532,8 @@ static inline css_error set_bottom(css_computed_style *style, uint8_t type,
#undef BOTTOM_MASK
#define BOX_SIZING_INDEX 10
-#define BOX_SIZING_SHIFT 18
-#define BOX_SIZING_MASK 0xc0000
+#define BOX_SIZING_SHIFT 12
+#define BOX_SIZING_MASK 0x3000
static inline css_error set_box_sizing(css_computed_style *style, uint8_t type)
{
@@ -551,9 +551,9 @@ static inline css_error set_box_sizing(css_computed_style *style, uint8_t type)
#undef BOX_SIZING_SHIFT
#undef BOX_SIZING_MASK
-#define BREAK_AFTER_INDEX 13
-#define BREAK_AFTER_SHIFT 28
-#define BREAK_AFTER_MASK 0xf0000000
+#define BREAK_AFTER_INDEX 9
+#define BREAK_AFTER_SHIFT 11
+#define BREAK_AFTER_MASK 0x7800
static inline css_error set_break_after(css_computed_style *style, uint8_t type)
{
@@ -571,9 +571,9 @@ static inline css_error set_break_after(css_computed_style *style, uint8_t type)
#undef BREAK_AFTER_SHIFT
#undef BREAK_AFTER_MASK
-#define BREAK_BEFORE_INDEX 13
-#define BREAK_BEFORE_SHIFT 24
-#define BREAK_BEFORE_MASK 0xf000000
+#define BREAK_BEFORE_INDEX 9
+#define BREAK_BEFORE_SHIFT 23
+#define BREAK_BEFORE_MASK 0x7800000
static inline css_error set_break_before(css_computed_style *style, uint8_t
type)
@@ -592,9 +592,9 @@ static inline css_error set_break_before(css_computed_style *style, uint8_t
#undef BREAK_BEFORE_SHIFT
#undef BREAK_BEFORE_MASK
-#define BREAK_INSIDE_INDEX 13
-#define BREAK_INSIDE_SHIFT 4
-#define BREAK_INSIDE_MASK 0xf0
+#define BREAK_INSIDE_INDEX 5
+#define BREAK_INSIDE_SHIFT 0
+#define BREAK_INSIDE_MASK 0xf
static inline css_error set_break_inside(css_computed_style *style, uint8_t
type)
@@ -614,8 +614,8 @@ static inline css_error set_break_inside(css_computed_style *style, uint8_t
#undef BREAK_INSIDE_MASK
#define CAPTION_SIDE_INDEX 11
-#define CAPTION_SIDE_SHIFT 24
-#define CAPTION_SIDE_MASK 0x3000000
+#define CAPTION_SIDE_SHIFT 4
+#define CAPTION_SIDE_MASK 0x30
static inline css_error set_caption_side(css_computed_style *style, uint8_t
type)
@@ -634,9 +634,9 @@ static inline css_error set_caption_side(css_computed_style *style, uint8_t
#undef CAPTION_SIDE_SHIFT
#undef CAPTION_SIDE_MASK
-#define CLEAR_INDEX 10
-#define CLEAR_SHIFT 23
-#define CLEAR_MASK 0x3800000
+#define CLEAR_INDEX 13
+#define CLEAR_SHIFT 10
+#define CLEAR_MASK 0x1c00
static inline css_error set_clear(css_computed_style *style, uint8_t type)
{
@@ -696,9 +696,9 @@ static inline css_error set_clip(
#undef CLIP_SHIFT
#undef CLIP_MASK
-#define COLOR_INDEX 12
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
+#define COLOR_INDEX 14
+#define COLOR_SHIFT 18
+#define COLOR_MASK 0x40000
static inline css_error set_color(css_computed_style *style, uint8_t type,
css_color color)
@@ -718,9 +718,9 @@ static inline css_error set_color(css_computed_style *style, uint8_t type,
#undef COLOR_SHIFT
#undef COLOR_MASK
-#define COLUMN_COUNT_INDEX 11
-#define COLUMN_COUNT_SHIFT 20
-#define COLUMN_COUNT_MASK 0x300000
+#define COLUMN_COUNT_INDEX 10
+#define COLUMN_COUNT_SHIFT 0
+#define COLUMN_COUNT_MASK 0x3
static inline css_error set_column_count(css_computed_style *style, uint8_t
type, int32_t integer)
@@ -742,8 +742,8 @@ static inline css_error set_column_count(css_computed_style *style, uint8_t
#undef COLUMN_COUNT_MASK
#define COLUMN_FILL_INDEX 11
-#define COLUMN_FILL_SHIFT 10
-#define COLUMN_FILL_MASK 0xc00
+#define COLUMN_FILL_SHIFT 8
+#define COLUMN_FILL_MASK 0x300
static inline css_error set_column_fill(css_computed_style *style, uint8_t type)
{
@@ -785,8 +785,8 @@ static inline css_error set_column_gap(css_computed_style *style, uint8_t type,
#undef COLUMN_GAP_MASK
#define COLUMN_RULE_COLOR_INDEX 10
-#define COLUMN_RULE_COLOR_SHIFT 10
-#define COLUMN_RULE_COLOR_MASK 0xc00
+#define COLUMN_RULE_COLOR_SHIFT 16
+#define COLUMN_RULE_COLOR_MASK 0x30000
static inline css_error set_column_rule_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -807,9 +807,9 @@ static inline css_error set_column_rule_color(css_computed_style *style,
#undef COLUMN_RULE_COLOR_SHIFT
#undef COLUMN_RULE_COLOR_MASK
-#define COLUMN_RULE_STYLE_INDEX 7
-#define COLUMN_RULE_STYLE_SHIFT 0
-#define COLUMN_RULE_STYLE_MASK 0xf
+#define COLUMN_RULE_STYLE_INDEX 9
+#define COLUMN_RULE_STYLE_SHIFT 3
+#define COLUMN_RULE_STYLE_MASK 0x78
static inline css_error set_column_rule_style(css_computed_style *style,
uint8_t type)
@@ -828,9 +828,9 @@ static inline css_error set_column_rule_style(css_computed_style *style,
#undef COLUMN_RULE_STYLE_SHIFT
#undef COLUMN_RULE_STYLE_MASK
-#define COLUMN_RULE_WIDTH_INDEX 0
-#define COLUMN_RULE_WIDTH_SHIFT 24
-#define COLUMN_RULE_WIDTH_MASK 0xff000000
+#define COLUMN_RULE_WIDTH_INDEX 1
+#define COLUMN_RULE_WIDTH_SHIFT 7
+#define COLUMN_RULE_WIDTH_MASK 0x7f80
static inline css_error set_column_rule_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -852,8 +852,8 @@ static inline css_error set_column_rule_width(css_computed_style *style,
#undef COLUMN_RULE_WIDTH_MASK
#define COLUMN_SPAN_INDEX 10
-#define COLUMN_SPAN_SHIFT 6
-#define COLUMN_SPAN_MASK 0xc0
+#define COLUMN_SPAN_SHIFT 10
+#define COLUMN_SPAN_MASK 0xc00
static inline css_error set_column_span(css_computed_style *style, uint8_t type)
{
@@ -872,8 +872,8 @@ static inline css_error set_column_span(css_computed_style *style, uint8_t type)
#undef COLUMN_SPAN_MASK
#define COLUMN_WIDTH_INDEX 5
-#define COLUMN_WIDTH_SHIFT 4
-#define COLUMN_WIDTH_MASK 0x7f0
+#define COLUMN_WIDTH_SHIFT 25
+#define COLUMN_WIDTH_MASK 0xfe000000
static inline css_error set_column_width(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -895,8 +895,8 @@ static inline css_error set_column_width(css_computed_style *style, uint8_t
#undef COLUMN_WIDTH_MASK
#define CONTENT_INDEX 11
-#define CONTENT_SHIFT 0
-#define CONTENT_MASK 0x3
+#define CONTENT_SHIFT 18
+#define CONTENT_MASK 0xc0000
static inline css_error set_content(
css_computed_style *style, uint8_t type,
css_computed_content_item *content)
@@ -978,8 +978,8 @@ static inline css_error set_content(
#undef CONTENT_MASK
#define COUNTER_INCREMENT_INDEX 14
-#define COUNTER_INCREMENT_SHIFT 29
-#define COUNTER_INCREMENT_MASK 0x20000000
+#define COUNTER_INCREMENT_SHIFT 20
+#define COUNTER_INCREMENT_MASK 0x100000
static inline css_error set_counter_increment(css_computed_style *style,
uint8_t type, css_computed_counter *counter_arr)
@@ -1016,8 +1016,8 @@ static inline css_error set_counter_increment(css_computed_style *style,
#undef COUNTER_INCREMENT_MASK
#define COUNTER_RESET_INDEX 14
-#define COUNTER_RESET_SHIFT 21
-#define COUNTER_RESET_MASK 0x200000
+#define COUNTER_RESET_SHIFT 25
+#define COUNTER_RESET_MASK 0x2000000
static inline css_error set_counter_reset(css_computed_style *style, uint8_t
type, css_computed_counter *counter_arr)
@@ -1053,9 +1053,9 @@ static inline css_error set_counter_reset(css_computed_style *style, uint8_t
#undef COUNTER_RESET_SHIFT
#undef COUNTER_RESET_MASK
-#define CURSOR_INDEX 8
-#define CURSOR_SHIFT 4
-#define CURSOR_MASK 0x1f0
+#define CURSOR_INDEX 9
+#define CURSOR_SHIFT 27
+#define CURSOR_MASK 0xf8000000
static inline css_error set_cursor(css_computed_style *style, uint8_t type,
lwc_string **string_arr)
@@ -1091,9 +1091,9 @@ static inline css_error set_cursor(css_computed_style *style, uint8_t type,
#undef CURSOR_SHIFT
#undef CURSOR_MASK
-#define DIRECTION_INDEX 10
-#define DIRECTION_SHIFT 16
-#define DIRECTION_MASK 0x30000
+#define DIRECTION_INDEX 14
+#define DIRECTION_SHIFT 28
+#define DIRECTION_MASK 0x30000000
static inline css_error set_direction(css_computed_style *style, uint8_t type)
{
@@ -1132,8 +1132,8 @@ static inline css_error set_display(css_computed_style *style, uint8_t type)
#undef DISPLAY_MASK
#define EMPTY_CELLS_INDEX 10
-#define EMPTY_CELLS_SHIFT 14
-#define EMPTY_CELLS_MASK 0xc000
+#define EMPTY_CELLS_SHIFT 4
+#define EMPTY_CELLS_MASK 0x30
static inline css_error set_empty_cells(css_computed_style *style, uint8_t type)
{
@@ -1152,8 +1152,8 @@ static inline css_error set_empty_cells(css_computed_style *style, uint8_t type)
#undef EMPTY_CELLS_MASK
#define FLEX_BASIS_INDEX 4
-#define FLEX_BASIS_SHIFT 18
-#define FLEX_BASIS_MASK 0x1fc0000
+#define FLEX_BASIS_SHIFT 25
+#define FLEX_BASIS_MASK 0xfe000000
static inline css_error set_flex_basis(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1174,9 +1174,9 @@ static inline css_error set_flex_basis(css_computed_style *style, uint8_t type,
#undef FLEX_BASIS_SHIFT
#undef FLEX_BASIS_MASK
-#define FLEX_DIRECTION_INDEX 9
-#define FLEX_DIRECTION_SHIFT 5
-#define FLEX_DIRECTION_MASK 0xe0
+#define FLEX_DIRECTION_INDEX 13
+#define FLEX_DIRECTION_SHIFT 1
+#define FLEX_DIRECTION_MASK 0xe
static inline css_error set_flex_direction(css_computed_style *style, uint8_t
type)
@@ -1195,9 +1195,9 @@ static inline css_error set_flex_direction(css_computed_style *style, uint8_t
#undef FLEX_DIRECTION_SHIFT
#undef FLEX_DIRECTION_MASK
-#define FLEX_GROW_INDEX 14
-#define FLEX_GROW_SHIFT 23
-#define FLEX_GROW_MASK 0x800000
+#define FLEX_GROW_INDEX 12
+#define FLEX_GROW_SHIFT 0
+#define FLEX_GROW_MASK 0x1
static inline css_error set_flex_grow(css_computed_style *style, uint8_t type,
css_fixed fixed)
@@ -1219,8 +1219,8 @@ static inline css_error set_flex_grow(css_computed_style *style, uint8_t type,
#undef FLEX_GROW_MASK
#define FLEX_SHRINK_INDEX 14
-#define FLEX_SHRINK_SHIFT 20
-#define FLEX_SHRINK_MASK 0x100000
+#define FLEX_SHRINK_SHIFT 22
+#define FLEX_SHRINK_MASK 0x400000
static inline css_error set_flex_shrink(css_computed_style *style, uint8_t
type, css_fixed fixed)
@@ -1242,8 +1242,8 @@ static inline css_error set_flex_shrink(css_computed_style *style, uint8_t
#undef FLEX_SHRINK_MASK
#define FLEX_WRAP_INDEX 10
-#define FLEX_WRAP_SHIFT 12
-#define FLEX_WRAP_MASK 0x3000
+#define FLEX_WRAP_SHIFT 6
+#define FLEX_WRAP_MASK 0xc0
static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type)
{
@@ -1262,8 +1262,8 @@ static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type)
#undef FLEX_WRAP_MASK
#define FLOAT_INDEX 11
-#define FLOAT_SHIFT 6
-#define FLOAT_MASK 0xc0
+#define FLOAT_SHIFT 30
+#define FLOAT_MASK 0xc0000000
static inline css_error set_float(css_computed_style *style, uint8_t type)
{
@@ -1281,8 +1281,8 @@ static inline css_error set_float(css_computed_style *style, uint8_t type)
#undef FLOAT_MASK
#define FONT_FAMILY_INDEX 9
-#define FONT_FAMILY_SHIFT 26
-#define FONT_FAMILY_MASK 0x1c000000
+#define FONT_FAMILY_SHIFT 0
+#define FONT_FAMILY_MASK 0x7
static inline css_error set_font_family(css_computed_style *style, uint8_t
type, lwc_string **string_arr)
@@ -1342,8 +1342,8 @@ static inline css_error set_font_size(css_computed_style *style, uint8_t type,
#undef FONT_SIZE_MASK
#define FONT_STYLE_INDEX 11
-#define FONT_STYLE_SHIFT 30
-#define FONT_STYLE_MASK 0xc0000000
+#define FONT_STYLE_SHIFT 20
+#define FONT_STYLE_MASK 0x300000
static inline css_error set_font_style(css_computed_style *style, uint8_t type)
{
@@ -1362,8 +1362,8 @@ static inline css_error set_font_style(css_computed_style *style, uint8_t type)
#undef FONT_STYLE_MASK
#define FONT_VARIANT_INDEX 11
-#define FONT_VARIANT_SHIFT 22
-#define FONT_VARIANT_MASK 0xc00000
+#define FONT_VARIANT_SHIFT 28
+#define FONT_VARIANT_MASK 0x30000000
static inline css_error set_font_variant(css_computed_style *style, uint8_t
type)
@@ -1382,9 +1382,9 @@ static inline css_error set_font_variant(css_computed_style *style, uint8_t
#undef FONT_VARIANT_SHIFT
#undef FONT_VARIANT_MASK
-#define FONT_WEIGHT_INDEX 4
-#define FONT_WEIGHT_SHIFT 0
-#define FONT_WEIGHT_MASK 0xf
+#define FONT_WEIGHT_INDEX 9
+#define FONT_WEIGHT_SHIFT 15
+#define FONT_WEIGHT_MASK 0x78000
static inline css_error set_font_weight(css_computed_style *style, uint8_t type)
{
@@ -1402,9 +1402,9 @@ static inline css_error set_font_weight(css_computed_style *style, uint8_t type)
#undef FONT_WEIGHT_SHIFT
#undef FONT_WEIGHT_MASK
-#define HEIGHT_INDEX 5
-#define HEIGHT_SHIFT 18
-#define HEIGHT_MASK 0x1fc0000
+#define HEIGHT_INDEX 6
+#define HEIGHT_SHIFT 25
+#define HEIGHT_MASK 0xfe000000
static inline css_error set_height(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1425,9 +1425,9 @@ static inline css_error set_height(css_computed_style *style, uint8_t type,
#undef HEIGHT_SHIFT
#undef HEIGHT_MASK
-#define JUSTIFY_CONTENT_INDEX 10
-#define JUSTIFY_CONTENT_SHIFT 29
-#define JUSTIFY_CONTENT_MASK 0xe0000000
+#define JUSTIFY_CONTENT_INDEX 13
+#define JUSTIFY_CONTENT_SHIFT 4
+#define JUSTIFY_CONTENT_MASK 0x70
static inline css_error set_justify_content(css_computed_style *style, uint8_t
type)
@@ -1469,9 +1469,9 @@ static inline css_error set_left(css_computed_style *style, uint8_t type,
#undef LEFT_SHIFT
#undef LEFT_MASK
-#define LETTER_SPACING_INDEX 1
-#define LETTER_SPACING_SHIFT 0
-#define LETTER_SPACING_MASK 0x7f
+#define LETTER_SPACING_INDEX 6
+#define LETTER_SPACING_SHIFT 18
+#define LETTER_SPACING_MASK 0x1fc0000
static inline css_error set_letter_spacing(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1515,9 +1515,9 @@ static inline css_error set_line_height(css_computed_style *style, uint8_t
#undef LINE_HEIGHT_SHIFT
#undef LINE_HEIGHT_MASK
-#define LIST_STYLE_IMAGE_INDEX 13
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
+#define LIST_STYLE_IMAGE_INDEX 14
+#define LIST_STYLE_IMAGE_SHIFT 27
+#define LIST_STYLE_IMAGE_MASK 0x8000000
static inline css_error set_list_style_image(css_computed_style *style, uint8_t
type, lwc_string *string)
@@ -1547,9 +1547,9 @@ static inline css_error set_list_style_image(css_computed_style *style, uint8_t
#undef LIST_STYLE_IMAGE_SHIFT
#undef LIST_STYLE_IMAGE_MASK
-#define LIST_STYLE_POSITION_INDEX 14
-#define LIST_STYLE_POSITION_SHIFT 30
-#define LIST_STYLE_POSITION_MASK 0xc0000000
+#define LIST_STYLE_POSITION_INDEX 11
+#define LIST_STYLE_POSITION_SHIFT 6
+#define LIST_STYLE_POSITION_MASK 0xc0
static inline css_error set_list_style_position(css_computed_style *style,
uint8_t type)
@@ -1568,9 +1568,9 @@ static inline css_error set_list_style_position(css_computed_style *style,
#undef LIST_STYLE_POSITION_SHIFT
#undef LIST_STYLE_POSITION_MASK
-#define LIST_STYLE_TYPE_INDEX 13
-#define LIST_STYLE_TYPE_SHIFT 20
-#define LIST_STYLE_TYPE_MASK 0xf00000
+#define LIST_STYLE_TYPE_INDEX 8
+#define LIST_STYLE_TYPE_SHIFT 26
+#define LIST_STYLE_TYPE_MASK 0xfc000000
static inline css_error set_list_style_type(css_computed_style *style, uint8_t
type)
@@ -1579,8 +1579,8 @@ static inline css_error set_list_style_type(css_computed_style *style, uint8_t
bits = &style->i.bits[LIST_STYLE_TYPE_INDEX];
- /* 4bits: tttt : type */
- *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | (((uint32_t)type & 0xf) <<
+ /* 6bits: tttttt : type */
+ *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | (((uint32_t)type & 0x3f) <<
LIST_STYLE_TYPE_SHIFT);
return CSS_OK;
@@ -1589,7 +1589,7 @@ static inline css_error set_list_style_type(css_computed_style *style, uint8_t
#undef LIST_STYLE_TYPE_SHIFT
#undef LIST_STYLE_TYPE_MASK
-#define MARGIN_BOTTOM_INDEX 3
+#define MARGIN_BOTTOM_INDEX 5
#define MARGIN_BOTTOM_SHIFT 18
#define MARGIN_BOTTOM_MASK 0x1fc0000
@@ -1612,9 +1612,9 @@ static inline css_error set_margin_bottom(css_computed_style *style, uint8_t
#undef MARGIN_BOTTOM_SHIFT
#undef MARGIN_BOTTOM_MASK
-#define MARGIN_LEFT_INDEX 3
-#define MARGIN_LEFT_SHIFT 11
-#define MARGIN_LEFT_MASK 0x3f800
+#define MARGIN_LEFT_INDEX 7
+#define MARGIN_LEFT_SHIFT 18
+#define MARGIN_LEFT_MASK 0x1fc0000
static inline css_error set_margin_left(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1658,9 +1658,9 @@ static inline css_error set_margin_right(css_computed_style *style, uint8_t
#undef MARGIN_RIGHT_SHIFT
#undef MARGIN_RIGHT_MASK
-#define MARGIN_TOP_INDEX 7
-#define MARGIN_TOP_SHIFT 4
-#define MARGIN_TOP_MASK 0x7f0
+#define MARGIN_TOP_INDEX 1
+#define MARGIN_TOP_SHIFT 0
+#define MARGIN_TOP_MASK 0x7f
static inline css_error set_margin_top(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1681,9 +1681,9 @@ static inline css_error set_margin_top(css_computed_style *style, uint8_t type,
#undef MARGIN_TOP_SHIFT
#undef MARGIN_TOP_MASK
-#define MAX_HEIGHT_INDEX 6
-#define MAX_HEIGHT_SHIFT 18
-#define MAX_HEIGHT_MASK 0x1fc0000
+#define MAX_HEIGHT_INDEX 3
+#define MAX_HEIGHT_SHIFT 25
+#define MAX_HEIGHT_MASK 0xfe000000
static inline css_error set_max_height(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1704,9 +1704,9 @@ static inline css_error set_max_height(css_computed_style *style, uint8_t type,
#undef MAX_HEIGHT_SHIFT
#undef MAX_HEIGHT_MASK
-#define MAX_WIDTH_INDEX 3
-#define MAX_WIDTH_SHIFT 25
-#define MAX_WIDTH_MASK 0xfe000000
+#define MAX_WIDTH_INDEX 7
+#define MAX_WIDTH_SHIFT 4
+#define MAX_WIDTH_MASK 0x7f0
static inline css_error set_max_width(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1727,9 +1727,9 @@ static inline css_error set_max_width(css_computed_style *style, uint8_t type,
#undef MAX_WIDTH_SHIFT
#undef MAX_WIDTH_MASK
-#define MIN_HEIGHT_INDEX 7
-#define MIN_HEIGHT_SHIFT 11
-#define MIN_HEIGHT_MASK 0x3f800
+#define MIN_HEIGHT_INDEX 4
+#define MIN_HEIGHT_SHIFT 18
+#define MIN_HEIGHT_MASK 0x1fc0000
static inline css_error set_min_height(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1774,8 +1774,8 @@ static inline css_error set_min_width(css_computed_style *style, uint8_t type,
#undef MIN_WIDTH_MASK
#define OPACITY_INDEX 14
-#define OPACITY_SHIFT 25
-#define OPACITY_MASK 0x2000000
+#define OPACITY_SHIFT 19
+#define OPACITY_MASK 0x80000
static inline css_error set_opacity(css_computed_style *style, uint8_t type,
css_fixed fixed)
@@ -1796,9 +1796,9 @@ static inline css_error set_opacity(css_computed_style *style, uint8_t type,
#undef OPACITY_SHIFT
#undef OPACITY_MASK
-#define ORDER_INDEX 14
-#define ORDER_SHIFT 26
-#define ORDER_MASK 0x4000000
+#define ORDER_INDEX 13
+#define ORDER_SHIFT 0
+#define ORDER_MASK 0x1
static inline css_error set_order(css_computed_style *style, uint8_t type,
int32_t integer)
@@ -1819,8 +1819,8 @@ static inline css_error set_order(css_computed_style *style, uint8_t type,
#undef ORDER_MASK
#define ORPHANS_INDEX 14
-#define ORPHANS_SHIFT 22
-#define ORPHANS_MASK 0x400000
+#define ORPHANS_SHIFT 24
+#define ORPHANS_MASK 0x1000000
static inline css_error set_orphans(css_computed_style *style, uint8_t type,
int32_t integer)
@@ -1842,8 +1842,8 @@ static inline css_error set_orphans(css_computed_style *style, uint8_t type,
#undef ORPHANS_MASK
#define OUTLINE_COLOR_INDEX 11
-#define OUTLINE_COLOR_SHIFT 12
-#define OUTLINE_COLOR_MASK 0x3000
+#define OUTLINE_COLOR_SHIFT 10
+#define OUTLINE_COLOR_MASK 0xc00
static inline css_error set_outline_color(css_computed_style *style, uint8_t
type, css_color color)
@@ -1864,9 +1864,9 @@ static inline css_error set_outline_color(css_computed_style *style, uint8_t
#undef OUTLINE_COLOR_SHIFT
#undef OUTLINE_COLOR_MASK
-#define OUTLINE_STYLE_INDEX 5
-#define OUTLINE_STYLE_SHIFT 0
-#define OUTLINE_STYLE_MASK 0xf
+#define OUTLINE_STYLE_INDEX 9
+#define OUTLINE_STYLE_SHIFT 7
+#define OUTLINE_STYLE_MASK 0x780
static inline css_error set_outline_style(css_computed_style *style, uint8_t
type)
@@ -1885,9 +1885,9 @@ static inline css_error set_outline_style(css_computed_style *style, uint8_t
#undef OUTLINE_STYLE_SHIFT
#undef OUTLINE_STYLE_MASK
-#define OUTLINE_WIDTH_INDEX 0
-#define OUTLINE_WIDTH_SHIFT 16
-#define OUTLINE_WIDTH_MASK 0xff0000
+#define OUTLINE_WIDTH_INDEX 1
+#define OUTLINE_WIDTH_SHIFT 15
+#define OUTLINE_WIDTH_MASK 0x7f8000
static inline css_error set_outline_width(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1908,9 +1908,9 @@ static inline css_error set_outline_width(css_computed_style *style, uint8_t
#undef OUTLINE_WIDTH_SHIFT
#undef OUTLINE_WIDTH_MASK
-#define OVERFLOW_X_INDEX 9
-#define OVERFLOW_X_SHIFT 14
-#define OVERFLOW_X_MASK 0x1c000
+#define OVERFLOW_X_INDEX 13
+#define OVERFLOW_X_SHIFT 16
+#define OVERFLOW_X_MASK 0x70000
static inline css_error set_overflow_x(css_computed_style *style, uint8_t type)
{
@@ -1928,9 +1928,9 @@ static inline css_error set_overflow_x(css_computed_style *style, uint8_t type)
#undef OVERFLOW_X_SHIFT
#undef OVERFLOW_X_MASK
-#define OVERFLOW_Y_INDEX 9
-#define OVERFLOW_Y_SHIFT 11
-#define OVERFLOW_Y_MASK 0x3800
+#define OVERFLOW_Y_INDEX 13
+#define OVERFLOW_Y_SHIFT 25
+#define OVERFLOW_Y_MASK 0xe000000
static inline css_error set_overflow_y(css_computed_style *style, uint8_t type)
{
@@ -1949,8 +1949,8 @@ static inline css_error set_overflow_y(css_computed_style *style, uint8_t type)
#undef OVERFLOW_Y_MASK
#define PADDING_BOTTOM_INDEX 8
-#define PADDING_BOTTOM_SHIFT 14
-#define PADDING_BOTTOM_MASK 0xfc000
+#define PADDING_BOTTOM_SHIFT 8
+#define PADDING_BOTTOM_MASK 0x3f00
static inline css_error set_padding_bottom(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1971,9 +1971,9 @@ static inline css_error set_padding_bottom(css_computed_style *style, uint8_t
#undef PADDING_BOTTOM_SHIFT
#undef PADDING_BOTTOM_MASK
-#define PADDING_LEFT_INDEX 8
-#define PADDING_LEFT_SHIFT 26
-#define PADDING_LEFT_MASK 0xfc000000
+#define PADDING_LEFT_INDEX 2
+#define PADDING_LEFT_SHIFT 0
+#define PADDING_LEFT_MASK 0x3f
static inline css_error set_padding_left(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1995,8 +1995,8 @@ static inline css_error set_padding_left(css_computed_style *style, uint8_t
#undef PADDING_LEFT_MASK
#define PADDING_RIGHT_INDEX 8
-#define PADDING_RIGHT_SHIFT 20
-#define PADDING_RIGHT_MASK 0x3f00000
+#define PADDING_RIGHT_SHIFT 14
+#define PADDING_RIGHT_MASK 0xfc000
static inline css_error set_padding_right(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -2017,9 +2017,9 @@ static inline css_error set_padding_right(css_computed_style *style, uint8_t
#undef PADDING_RIGHT_SHIFT
#undef PADDING_RIGHT_MASK
-#define PADDING_TOP_INDEX 2
-#define PADDING_TOP_SHIFT 0
-#define PADDING_TOP_MASK 0x3f
+#define PADDING_TOP_INDEX 8
+#define PADDING_TOP_SHIFT 20
+#define PADDING_TOP_MASK 0x3f00000
static inline css_error set_padding_top(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -2040,9 +2040,9 @@ static inline css_error set_padding_top(css_computed_style *style, uint8_t
#undef PADDING_TOP_SHIFT
#undef PADDING_TOP_MASK
-#define PAGE_BREAK_AFTER_INDEX 9
-#define PAGE_BREAK_AFTER_SHIFT 2
-#define PAGE_BREAK_AFTER_MASK 0x1c
+#define PAGE_BREAK_AFTER_INDEX 8
+#define PAGE_BREAK_AFTER_SHIFT 0
+#define PAGE_BREAK_AFTER_MASK 0x7
static inline css_error set_page_break_after(css_computed_style *style, uint8_t
type)
@@ -2061,9 +2061,9 @@ static inline css_error set_page_break_after(css_computed_style *style, uint8_t
#undef PAGE_BREAK_AFTER_SHIFT
#undef PAGE_BREAK_AFTER_MASK
-#define PAGE_BREAK_BEFORE_INDEX 9
-#define PAGE_BREAK_BEFORE_SHIFT 23
-#define PAGE_BREAK_BEFORE_MASK 0x3800000
+#define PAGE_BREAK_BEFORE_INDEX 13
+#define PAGE_BREAK_BEFORE_SHIFT 7
+#define PAGE_BREAK_BEFORE_MASK 0x380
static inline css_error set_page_break_before(css_computed_style *style,
uint8_t type)
@@ -2082,9 +2082,9 @@ static inline css_error set_page_break_before(css_computed_style *style,
#undef PAGE_BREAK_BEFORE_SHIFT
#undef PAGE_BREAK_BEFORE_MASK
-#define PAGE_BREAK_INSIDE_INDEX 10
-#define PAGE_BREAK_INSIDE_SHIFT 4
-#define PAGE_BREAK_INSIDE_MASK 0x30
+#define PAGE_BREAK_INSIDE_INDEX 11
+#define PAGE_BREAK_INSIDE_SHIFT 24
+#define PAGE_BREAK_INSIDE_MASK 0x3000000
static inline css_error set_page_break_inside(css_computed_style *style,
uint8_t type)
@@ -2104,8 +2104,8 @@ static inline css_error set_page_break_inside(css_computed_style *style,
#undef PAGE_BREAK_INSIDE_MASK
#define POSITION_INDEX 10
-#define POSITION_SHIFT 26
-#define POSITION_MASK 0x1c000000
+#define POSITION_SHIFT 20
+#define POSITION_MASK 0x700000
static inline css_error set_position(css_computed_style *style, uint8_t type)
{
@@ -2124,8 +2124,8 @@ static inline css_error set_position(css_computed_style *style, uint8_t type)
#undef POSITION_MASK
#define QUOTES_INDEX 14
-#define QUOTES_SHIFT 27
-#define QUOTES_MASK 0x8000000
+#define QUOTES_SHIFT 21
+#define QUOTES_MASK 0x200000
static inline css_error set_quotes(css_computed_style *style, uint8_t type,
lwc_string **string_arr)
@@ -2161,9 +2161,9 @@ static inline css_error set_quotes(css_computed_style *style, uint8_t type,
#undef QUOTES_SHIFT
#undef QUOTES_MASK
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 25
-#define RIGHT_MASK 0xfe000000
+#define RIGHT_INDEX 3
+#define RIGHT_SHIFT 18
+#define RIGHT_MASK 0x1fc0000
static inline css_error set_right(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -2184,9 +2184,9 @@ static inline css_error set_right(css_computed_style *style, uint8_t type,
#undef RIGHT_SHIFT
#undef RIGHT_MASK
-#define TABLE_LAYOUT_INDEX 11
-#define TABLE_LAYOUT_SHIFT 4
-#define TABLE_LAYOUT_MASK 0x30
+#define TABLE_LAYOUT_INDEX 10
+#define TABLE_LAYOUT_SHIFT 14
+#define TABLE_LAYOUT_MASK 0xc000
static inline css_error set_table_layout(css_computed_style *style, uint8_t
type)
@@ -2205,9 +2205,9 @@ static inline css_error set_table_layout(css_computed_style *style, uint8_t
#undef TABLE_LAYOUT_SHIFT
#undef TABLE_LAYOUT_MASK
-#define TEXT_ALIGN_INDEX 13
-#define TEXT_ALIGN_SHIFT 16
-#define TEXT_ALIGN_MASK 0xf0000
+#define TEXT_ALIGN_INDEX 4
+#define TEXT_ALIGN_SHIFT 0
+#define TEXT_ALIGN_MASK 0xf
static inline css_error set_text_align(css_computed_style *style, uint8_t type)
{
@@ -2226,8 +2226,8 @@ static inline css_error set_text_align(css_computed_style *style, uint8_t type)
#undef TEXT_ALIGN_MASK
#define TEXT_DECORATION_INDEX 8
-#define TEXT_DECORATION_SHIFT 9
-#define TEXT_DECORATION_MASK 0x3e00
+#define TEXT_DECORATION_SHIFT 3
+#define TEXT_DECORATION_MASK 0xf8
static inline css_error set_text_decoration(css_computed_style *style, uint8_t
type)
@@ -2269,9 +2269,9 @@ static inline css_error set_text_indent(css_computed_style *style, uint8_t
#undef TEXT_INDENT_SHIFT
#undef TEXT_INDENT_MASK
-#define TEXT_TRANSFORM_INDEX 9
-#define TEXT_TRANSFORM_SHIFT 8
-#define TEXT_TRANSFORM_MASK 0x700
+#define TEXT_TRANSFORM_INDEX 13
+#define TEXT_TRANSFORM_SHIFT 13
+#define TEXT_TRANSFORM_MASK 0xe000
static inline css_error set_text_transform(css_computed_style *style, uint8_t
type)
@@ -2290,7 +2290,7 @@ static inline css_error set_text_transform(css_computed_style *style, uint8_t
#undef TEXT_TRANSFORM_SHIFT
#undef TEXT_TRANSFORM_MASK
-#define TOP_INDEX 6
+#define TOP_INDEX 7
#define TOP_SHIFT 25
#define TOP_MASK 0xfe000000
@@ -2313,9 +2313,9 @@ static inline css_error set_top(css_computed_style *style, uint8_t type,
#undef TOP_SHIFT
#undef TOP_MASK
-#define UNICODE_BIDI_INDEX 9
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
+#define UNICODE_BIDI_INDEX 11
+#define UNICODE_BIDI_SHIFT 2
+#define UNICODE_BIDI_MASK 0xc
static inline css_error set_unicode_bidi(css_computed_style *style, uint8_t
type)
@@ -2358,8 +2358,8 @@ static inline css_error set_vertical_align(css_computed_style *style, uint8_t
#undef VERTICAL_ALIGN_MASK
#define VISIBILITY_INDEX 11
-#define VISIBILITY_SHIFT 14
-#define VISIBILITY_MASK 0xc000
+#define VISIBILITY_SHIFT 0
+#define VISIBILITY_MASK 0x3
static inline css_error set_visibility(css_computed_style *style, uint8_t type)
{
@@ -2377,9 +2377,9 @@ static inline css_error set_visibility(css_computed_style *style, uint8_t type)
#undef VISIBILITY_SHIFT
#undef VISIBILITY_MASK
-#define WHITE_SPACE_INDEX 10
-#define WHITE_SPACE_SHIFT 20
-#define WHITE_SPACE_MASK 0x700000
+#define WHITE_SPACE_INDEX 13
+#define WHITE_SPACE_SHIFT 19
+#define WHITE_SPACE_MASK 0x380000
static inline css_error set_white_space(css_computed_style *style, uint8_t type)
{
@@ -2398,8 +2398,8 @@ static inline css_error set_white_space(css_computed_style *style, uint8_t type)
#undef WHITE_SPACE_MASK
#define WIDOWS_INDEX 14
-#define WIDOWS_SHIFT 24
-#define WIDOWS_MASK 0x1000000
+#define WIDOWS_SHIFT 26
+#define WIDOWS_MASK 0x4000000
static inline css_error set_widows(css_computed_style *style, uint8_t type,
int32_t integer)
@@ -2420,9 +2420,9 @@ static inline css_error set_widows(css_computed_style *style, uint8_t type,
#undef WIDOWS_SHIFT
#undef WIDOWS_MASK
-#define WIDTH_INDEX 5
-#define WIDTH_SHIFT 25
-#define WIDTH_MASK 0xfe000000
+#define WIDTH_INDEX 3
+#define WIDTH_SHIFT 11
+#define WIDTH_MASK 0x3f800
static inline css_error set_width(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -2443,9 +2443,9 @@ static inline css_error set_width(css_computed_style *style, uint8_t type,
#undef WIDTH_SHIFT
#undef WIDTH_MASK
-#define WORD_SPACING_INDEX 4
-#define WORD_SPACING_SHIFT 25
-#define WORD_SPACING_MASK 0xfe000000
+#define WORD_SPACING_INDEX 5
+#define WORD_SPACING_SHIFT 4
+#define WORD_SPACING_MASK 0x7f0
static inline css_error set_word_spacing(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -2466,9 +2466,9 @@ static inline css_error set_word_spacing(css_computed_style *style, uint8_t
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_MASK
-#define WRITING_MODE_INDEX 11
-#define WRITING_MODE_SHIFT 18
-#define WRITING_MODE_MASK 0xc0000
+#define WRITING_MODE_INDEX 14
+#define WRITING_MODE_SHIFT 30
+#define WRITING_MODE_MASK 0xc0000000
static inline css_error set_writing_mode(css_computed_style *style, uint8_t
type)
@@ -2487,9 +2487,9 @@ static inline css_error set_writing_mode(css_computed_style *style, uint8_t
#undef WRITING_MODE_SHIFT
#undef WRITING_MODE_MASK
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 2
-#define Z_INDEX_MASK 0xc
+#define Z_INDEX_INDEX 10
+#define Z_INDEX_SHIFT 8
+#define Z_INDEX_MASK 0x300
static inline css_error set_z_index(css_computed_style *style, uint8_t type,
int32_t integer)
diff --git a/src/select/select_config.py b/src/select/select_config.py
index 8845814..fd9e765 100644
--- a/src/select/select_config.py
+++ b/src/select/select_config.py
@@ -49,7 +49,7 @@ style = {
('font_weight', 4),
('justify_content', 3),
('list_style_position', 2),
- ('list_style_type', 4),
+ ('list_style_type', 6),
('overflow_x', 3),
('overflow_y', 3),
('outline_style', 4),
-----------------------------------------------------------------------
Summary of changes:
docs/Bytecode | 40 +--
include/libcss/properties.h | 17 +-
src/bytecode/opcodes.h | 16 +-
src/parse/properties/utils.c | 116 ++++----
src/parse/propstrings.c | 14 +
src/parse/propstrings.h | 3 +
src/select/autogenerated_computed.h | 82 +++---
src/select/autogenerated_propget.h | 484 +++++++++++++++----------------
src/select/autogenerated_propset.h | 484 +++++++++++++++----------------
src/select/format_list_style.c | 227 +++++++++++++--
src/select/properties/list_style_type.c | 43 ++-
src/select/select_config.py | 2 +-
12 files changed, 883 insertions(+), 645 deletions(-)
diff --git a/docs/Bytecode b/docs/Bytecode
index 880ccbd..d691923 100644
--- a/docs/Bytecode
+++ b/docs/Bytecode
@@ -342,11 +342,9 @@ Opcodes
bits 0-6: 0000000 => string,
0000001 => uri,
0000010 => counter,
- bits 12-13: MBZ
- bits 8-11 : list-style-type
+ bits 8-13 : list-style-type
0000011 => counters,
- bits 12-13: MBZ
- bits 8-11 : list-style-type
+ bits 8-13 : list-style-type
0000100 => attr,
other => rffe.
bit 7 clear => keywords:
@@ -646,22 +644,24 @@ Opcodes
2f - list-style-type
<value> (14bits) :
- 0 => disc,
- 1 => circle,
- 2 => square,
- 3 => decimal,
- 4 => decimal-leading-zero,
- 5 => lower-roman,
- 6 => upper-roman,
- 7 => lower-greek,
- 8 => lower-latin,
- 9 => upper-latin,
- a => armenian,
- b => georgian,
- c => lower-alpha,
- d => upper-alpha,
- e => none,
- other => Reserved for future expansion.
+ bits 6-13: MBZ
+ bits 0-5 :
+ 0 => disc,
+ 1 => circle,
+ 2 => square,
+ 3 => decimal,
+ 4 => decimal-leading-zero,
+ 5 => lower-roman,
+ 6 => upper-roman,
+ 7 => lower-greek,
+ 8 => lower-latin,
+ 9 => upper-latin,
+ a => armenian,
+ b => georgian,
+ c => lower-alpha,
+ d => upper-alpha,
+ e => none,
+ other => Reserved for future expansion.
30 - margin-top
31 - margin-right
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 577bed0..6f8a51c 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -606,7 +606,22 @@ enum css_list_style_type_e {
CSS_LIST_STYLE_TYPE_GEORGIAN = 0xc,
CSS_LIST_STYLE_TYPE_LOWER_ALPHA = 0xd,
CSS_LIST_STYLE_TYPE_UPPER_ALPHA = 0xe,
- CSS_LIST_STYLE_TYPE_NONE = 0xf
+ CSS_LIST_STYLE_TYPE_NONE = 0xf,
+ CSS_LIST_STYLE_TYPE_BINARY = 0x10,
+ CSS_LIST_STYLE_TYPE_OCTAL = 0x11,
+ CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL = 0x12,
+ CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL = 0x13,
+ CSS_LIST_STYLE_TYPE_ARABIC_INDIC = 0x14,
+ CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN = 0x15,
+ CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN = 0x16,
+ CSS_LIST_STYLE_TYPE_BENGALI = 0x17,
+ CSS_LIST_STYLE_TYPE_CAMBODIAN = 0x18,
+ CSS_LIST_STYLE_TYPE_KHMER = 0x19,
+ CSS_LIST_STYLE_TYPE_CJK_DECIMAL = 0x1a,
+ CSS_LIST_STYLE_TYPE_DEVANAGARI = 0x1b,
+ CSS_LIST_STYLE_TYPE_GUJARATI = 0x1c,
+ CSS_LIST_STYLE_TYPE_GURMUKHI = 0x1d
+
};
enum css_margin_e {
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 82bf75f..b74e990 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -491,7 +491,21 @@ enum op_list_style_type {
LIST_STYLE_TYPE_GEORGIAN = 0x000b,
LIST_STYLE_TYPE_LOWER_ALPHA = 0x000c,
LIST_STYLE_TYPE_UPPER_ALPHA = 0x000d,
- LIST_STYLE_TYPE_NONE = 0x000e
+ LIST_STYLE_TYPE_NONE = 0x000e,
+ LIST_STYLE_TYPE_BINARY = 0x000f,
+ LIST_STYLE_TYPE_OCTAL = 0x0010,
+ LIST_STYLE_TYPE_LOWER_HEXADECIMAL = 0x0011,
+ LIST_STYLE_TYPE_UPPER_HEXADECIMAL = 0x0012,
+ LIST_STYLE_TYPE_ARABIC_INDIC = 0x0013,
+ LIST_STYLE_TYPE_LOWER_ARMENIAN = 0x0014,
+ LIST_STYLE_TYPE_UPPER_ARMENIAN = 0x0015,
+ LIST_STYLE_TYPE_BENGALI = 0x0016,
+ LIST_STYLE_TYPE_CAMBODIAN = 0x0017,
+ LIST_STYLE_TYPE_KHMER = 0x0018,
+ LIST_STYLE_TYPE_CJK_DECIMAL = 0x0019,
+ LIST_STYLE_TYPE_DEVANAGARI = 0x001a,
+ LIST_STYLE_TYPE_GUJARATI = 0x001b,
+ LIST_STYLE_TYPE_GURMUKHI = 0x001c
};
enum op_margin {
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index 0e49853..a71e22d 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -29,77 +29,60 @@
css_error css__parse_list_style_type_value(css_language *c, const css_token *ident,
uint16_t *value)
{
- bool match;
-
/* IDENT (disc, circle, square, decimal, decimal-leading-zero,
* lower-roman, upper-roman, lower-greek, lower-latin,
* upper-latin, armenian, georgian, lower-alpha, upper-alpha,
* none)
*/
- if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[DISC],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_DISC;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[CIRCLE],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_CIRCLE;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[SQUARE],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_SQUARE;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[DECIMAL],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_DECIMAL;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[DECIMAL_LEADING_ZERO],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_ROMAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_ROMAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[UPPER_ROMAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_UPPER_ROMAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_GREEK],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_GREEK;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_LATIN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_LATIN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[UPPER_LATIN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_UPPER_LATIN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[ARMENIAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_ARMENIAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[GEORGIAN],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_GEORGIAN;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[LOWER_ALPHA],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_LOWER_ALPHA;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[UPPER_ALPHA],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_UPPER_ALPHA;
- } else if ((lwc_string_caseless_isequal(
- ident->idata, c->strings[NONE],
- &match) == lwc_error_ok && match)) {
- *value = LIST_STYLE_TYPE_NONE;
- } else
- return CSS_INVALID;
+ #define MAP_ENTRIES 29
+ bool match;
+ int midx;
+ const struct {
+ int stringid;
+ int value;
+ } mapping[MAP_ENTRIES] = {
+ { DISC, LIST_STYLE_TYPE_DISC },
+ { CIRCLE, LIST_STYLE_TYPE_CIRCLE },
+ { SQUARE, LIST_STYLE_TYPE_SQUARE },
+ { DECIMAL, LIST_STYLE_TYPE_DECIMAL },
+ { DECIMAL_LEADING_ZERO, LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO },
+ { LOWER_ROMAN, LIST_STYLE_TYPE_LOWER_ROMAN },
+ { UPPER_ROMAN, LIST_STYLE_TYPE_UPPER_ROMAN },
+ { LOWER_GREEK, LIST_STYLE_TYPE_LOWER_GREEK },
+ { LOWER_LATIN, LIST_STYLE_TYPE_LOWER_LATIN },
+ { UPPER_LATIN, LIST_STYLE_TYPE_UPPER_LATIN },
+ { ARMENIAN, LIST_STYLE_TYPE_ARMENIAN },
+ { GEORGIAN, LIST_STYLE_TYPE_GEORGIAN },
+ { LOWER_ALPHA, LIST_STYLE_TYPE_LOWER_ALPHA },
+ { UPPER_ALPHA, LIST_STYLE_TYPE_UPPER_ALPHA },
+ { NONE, LIST_STYLE_TYPE_NONE },
+ { BINARY, LIST_STYLE_TYPE_BINARY },
+ { OCTAL, LIST_STYLE_TYPE_OCTAL},
+ { LOWER_HEXADECIMAL, LIST_STYLE_TYPE_LOWER_HEXADECIMAL },
+ { UPPER_HEXADECIMAL, LIST_STYLE_TYPE_UPPER_HEXADECIMAL },
+ { ARABIC_INDIC, LIST_STYLE_TYPE_ARABIC_INDIC },
+ { LOWER_ARMENIAN, LIST_STYLE_TYPE_LOWER_ARMENIAN },
+ { UPPER_ARMENIAN, LIST_STYLE_TYPE_UPPER_ARMENIAN },
+ { BENGALI, LIST_STYLE_TYPE_BENGALI },
+ { CAMBODIAN, LIST_STYLE_TYPE_CAMBODIAN },
+ { KHMER, LIST_STYLE_TYPE_KHMER },
+ { CJK_DECIMAL, LIST_STYLE_TYPE_CJK_DECIMAL },
+ { DEVANAGARI, LIST_STYLE_TYPE_DEVANAGARI },
+ { GUJARATI, LIST_STYLE_TYPE_GUJARATI },
+ { GURMUKHI, LIST_STYLE_TYPE_GURMUKHI }
+ };
- return CSS_OK;
+ for (midx = 0; midx < MAP_ENTRIES; midx++) {
+ if ((lwc_string_caseless_isequal(
+ ident->idata,
+ c->strings[mapping[midx].stringid],
+ &match) == lwc_error_ok && match)) {
+ *value = mapping[midx].value;
+ return CSS_OK;
+ }
+ }
+
+ return CSS_INVALID;
}
@@ -1117,7 +1100,7 @@ css_error css__ident_list_or_string_to_string(css_language *c,
token = parserutils_vector_iterate(vector, ctx);
*result = lwc_string_ref(token->idata);
return CSS_OK;
- } else if(token->type == CSS_TOKEN_IDENT) {
+ } else if(token->type == CSS_TOKEN_IDENT) {
return css__ident_list_to_string(c, vector, ctx, reserved,
result);
}
@@ -1333,4 +1316,3 @@ cleanup:
return error;
}
-
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index 3c9401b..302f7f8 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -309,6 +309,20 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "georgian", SLEN("georgian") },
{ "lower-alpha", SLEN("lower-alpha") },
{ "upper-alpha", SLEN("upper-alpha") },
+ { "binary", SLEN("binary") },
+ { "octal", SLEN("octal") },
+ { "lower-hexadecimal", SLEN("lower-hexadecimal") },
+ { "upper-hexadecimal", SLEN("upper-hexadecimal") },
+ { "arabic-indic", SLEN("arabic-indic") },
+ { "lower-armenian", SLEN("lower-armenian") },
+ { "upper-armenian", SLEN("upper-armenian") },
+ { "bengali", SLEN("bengali") },
+ { "cambodian", SLEN("cambodian") },
+ { "khmer", SLEN("khmer") },
+ { "cjk-decimal", SLEN("cjk-decimal") },
+ { "devanagari", SLEN("devanagari") },
+ { "gujarati", SLEN("gujarati") },
+ { "gurmukhi", SLEN("gurmukhi") },
{ "invert", SLEN("invert") },
{ "visible", SLEN("visible") },
{ "always", SLEN("always") },
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index 24b681b..65954c6 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -83,6 +83,9 @@ enum {
LIGHTER, INSIDE, OUTSIDE, DISC, CIRCLE, SQUARE, DECIMAL,
DECIMAL_LEADING_ZERO, LOWER_ROMAN, UPPER_ROMAN, LOWER_GREEK,
LOWER_LATIN, UPPER_LATIN, ARMENIAN, GEORGIAN, LOWER_ALPHA, UPPER_ALPHA,
+ BINARY, OCTAL, LOWER_HEXADECIMAL, UPPER_HEXADECIMAL, ARABIC_INDIC,
+ LOWER_ARMENIAN, UPPER_ARMENIAN, BENGALI, CAMBODIAN, KHMER, CJK_DECIMAL,
+ DEVANAGARI, GUJARATI, GURMUKHI,
INVERT, VISIBLE, ALWAYS, AVOID, X_LOW, LOW, HIGH, X_HIGH, LIBCSS_STATIC,
RELATIVE, ABSOLUTE, ONCE, DIGITS, CONTINUOUS, CODE, SPELL_OUT, X_SLOW,
SLOW, FAST, X_FAST, FASTER, SLOWER, CENTER, JUSTIFY, CAPITALIZE,
diff --git a/src/select/autogenerated_computed.h b/src/select/autogenerated_computed.h
index 4d21fad..7765f35 100644
--- a/src/select/autogenerated_computed.h
+++ b/src/select/autogenerated_computed.h
@@ -69,7 +69,7 @@ struct css_computed_style_i {
* line_height 2 + 5 4
* list_style_image 1 sizeof(ptr)
* list_style_position 2
- * list_style_type 4
+ * list_style_type 6
* margin_bottom 2 + 5 4
* margin_left 2 + 5 4
* margin_right 2 + 5 4
@@ -140,66 +140,66 @@ struct css_computed_style_i {
* quotes 1 sizeof(ptr)
*
* --- --- ---
- * 460 bits 228 + 8sizeof(ptr) bytes
+ * 462 bits 228 + 8sizeof(ptr) bytes
* ===================
* 286 + 8sizeof(ptr) bytes
*
* Bit allocations:
*
- * 0 ccccccccoooooooobbbbbbbbrrrrrrrr
- * column_rule_width; outline_width; border_left_width; border_bottom_width
+ * 0 bbbbbbbboooooooorrrrrrrrdddddddd
+ * border_left_width; border_top_width; border_bottom_width; border_right_width
*
- * 1 vvvvvvvvvbbbbbbbboooooooolllllll
- * vertical_align; border_top_width; border_right_width; letter_spacing
+ * 1 vvvvvvvvvooooooooccccccccmmmmmmm
+ * vertical_align; outline_width; column_rule_width; margin_top
*
* 2 ccccccccccccccccccccccccccpppppp
- * clip; padding_top
+ * clip; padding_left
*
- * 3 mmmmmmmaaaaaaarrrrrrrttttttddddd
- * max_width; margin_bottom; margin_left; text_indent; display
+ * 3 mmmmmmmrrrrrrrwwwwwwwttttttddddd
+ * max_height; right; width; text_indent; display
*
- * 4 wwwwwwwfffffffcccccccllllllloooo
- * word_spacing; flex_basis; column_gap; left; font_weight
+ * 4 fffffffmmmmmmmcccccccllllllltttt
+ * flex_basis; min_height; column_gap; left; text_align
*
- * 5 wwwwwwwhhhhhhhlllllllcccccccoooo
- * width; height; line_height; column_width; outline_style
+ * 5 cccccccmmmmmmmlllllllwwwwwwwbbbb
+ * column_width; margin_bottom; line_height; word_spacing; break_inside
*
- * 6 tttttttmmmmmmmiiiiiiiaaaaaaabbbb
- * top; max_height; min_width; margin_right; border_top_style
+ * 6 hhhhhhhlllllllmmmmmmmaaaaaaabbbb
+ * height; letter_spacing; min_width; margin_right; border_bottom_style
*
- * 7 rrrrrrrbbbbbbbmmmmmmmaaaaaaacccc
- * right; bottom; min_height; margin_top; column_rule_style
+ * 7 tttttttmmmmmmmbbbbbbbaaaaaaaoooo
+ * top; margin_left; bottom; max_width; border_top_style
*
- * 8 ppppppaaaaaaddddddtttttcccccbbbb
- * padding_left; padding_right; padding_bottom; text_decoration; cursor;
- * border_right_style
+ * 8 llllllppppppaaaaaaddddddtttttggg
+ * list_style_type; padding_top; padding_right; padding_bottom;
+ * text_decoration; page_break_after
*
- * 9 aaafffpppllliiiooovvvttteeeggguu
- * align_items; font_family; page_break_before; align_self; align_content;
- * overflow_x; overflow_y; text_transform; flex_direction; page_break_after;
- * unicode_bidi
+ * 9 cccccbbbbooooffffrrrruuuullllnnn
+ * cursor; break_before; border_left_style; font_weight; break_after;
+ * outline_style; column_rule_style; font_family
*
- * 10 jjjpppcccwwwbbddeeffooaallggkkrr
- * justify_content; position; clear; white_space; box_sizing; direction;
- * empty_cells; flex_wrap; column_rule_color; background_attachment;
- * column_span; page_break_inside; background_color; border_left_color
+ * 10 aaallliiipppbbccttoouuzzffeerrmm
+ * align_content; align_items; align_self; position; border_bottom_color;
+ * column_rule_color; table_layout; box_sizing; column_span; z_index;
+ * flex_wrap; empty_cells; border_left_color; column_count
*
- * 11 ffbbooccnnllwwrrvvuummddaattzzee
- * font_style; border_bottom_color; border_top_color; caption_side;
- * font_variant; column_count; writing_mode; border_collapse; visibility;
- * outline_color; column_fill; border_right_color; float; table_layout;
- * z_index; content
+ * 11 ffoobbppaannccrrddeeuulliittUUvv
+ * float; font_variant; background_attachment; page_break_inside;
+ * background_color; font_style; content; border_top_color; border_collapse;
+ * border_right_color; outline_color; column_fill; list_style_position;
+ * caption_side; unicode_bidi; visibility
*
- * 12 bbbbbbbbbbbaaaaaaaaaaafffffffffc
- * border_spacing; background_position; font_size; color
+ * 12 bbbbbbbbbbbaaaaaaaaaaafffffffffl
+ * border_spacing; background_position; font_size; flex_grow
*
- * 13 bbbbrrrrllllttttooooddddeeeeaaai
- * break_after; break_before; list_style_type; text_align; border_left_style;
- * border_bottom_style; break_inside; background_repeat; list_style_image
+ * 13 bbbboooaaawwwvvvtttcccpppjjjfffr
+ * border_right_style; overflow_y; background_repeat; white_space; overflow_x;
+ * text_transform; clear; page_break_before; justify_content; flex_direction;
+ * order
*
- * 14 llcbqopwfrue....................
- * list_style_position; counter_increment; background_image; quotes; order;
- * opacity; widows; flex_grow; orphans; counter_reset; flex_shrink
+ * 14 wwddlicobfqupr..................
+ * writing_mode; direction; list_style_image; widows; counter_reset; orphans;
+ * background_image; flex_shrink; quotes; counter_increment; opacity; color
*/
uint32_t bits[15];
diff --git a/src/select/autogenerated_propget.h b/src/select/autogenerated_propget.h
index f1b6092..39ce62a 100644
--- a/src/select/autogenerated_propget.h
+++ b/src/select/autogenerated_propget.h
@@ -6,9 +6,9 @@
*/
-#define ALIGN_CONTENT_INDEX 9
-#define ALIGN_CONTENT_SHIFT 17
-#define ALIGN_CONTENT_MASK 0xe0000
+#define ALIGN_CONTENT_INDEX 10
+#define ALIGN_CONTENT_SHIFT 29
+#define ALIGN_CONTENT_MASK 0xe0000000
static inline uint8_t get_align_content(const css_computed_style *style)
{
uint32_t bits = style->i.bits[ALIGN_CONTENT_INDEX];
@@ -23,9 +23,9 @@ static inline uint8_t get_align_content(const css_computed_style *style)
#undef ALIGN_CONTENT_SHIFT
#undef ALIGN_CONTENT_MASK
-#define ALIGN_ITEMS_INDEX 9
-#define ALIGN_ITEMS_SHIFT 29
-#define ALIGN_ITEMS_MASK 0xe0000000
+#define ALIGN_ITEMS_INDEX 10
+#define ALIGN_ITEMS_SHIFT 26
+#define ALIGN_ITEMS_MASK 0x1c000000
static inline uint8_t get_align_items(const css_computed_style *style)
{
uint32_t bits = style->i.bits[ALIGN_ITEMS_INDEX];
@@ -40,9 +40,9 @@ static inline uint8_t get_align_items(const css_computed_style *style)
#undef ALIGN_ITEMS_SHIFT
#undef ALIGN_ITEMS_MASK
-#define ALIGN_SELF_INDEX 9
-#define ALIGN_SELF_SHIFT 20
-#define ALIGN_SELF_MASK 0x700000
+#define ALIGN_SELF_INDEX 10
+#define ALIGN_SELF_SHIFT 23
+#define ALIGN_SELF_MASK 0x3800000
static inline uint8_t get_align_self(const css_computed_style *style)
{
uint32_t bits = style->i.bits[ALIGN_SELF_INDEX];
@@ -57,9 +57,9 @@ static inline uint8_t get_align_self(const css_computed_style *style)
#undef ALIGN_SELF_SHIFT
#undef ALIGN_SELF_MASK
-#define BACKGROUND_ATTACHMENT_INDEX 10
-#define BACKGROUND_ATTACHMENT_SHIFT 8
-#define BACKGROUND_ATTACHMENT_MASK 0x300
+#define BACKGROUND_ATTACHMENT_INDEX 11
+#define BACKGROUND_ATTACHMENT_SHIFT 26
+#define BACKGROUND_ATTACHMENT_MASK 0xc000000
static inline uint8_t get_background_attachment(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BACKGROUND_ATTACHMENT_INDEX];
@@ -74,9 +74,9 @@ static inline uint8_t get_background_attachment(const css_computed_style *style)
#undef BACKGROUND_ATTACHMENT_SHIFT
#undef BACKGROUND_ATTACHMENT_MASK
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 2
-#define BACKGROUND_COLOR_MASK 0xc
+#define BACKGROUND_COLOR_INDEX 11
+#define BACKGROUND_COLOR_SHIFT 22
+#define BACKGROUND_COLOR_MASK 0xc00000
static inline uint8_t get_background_color(const css_computed_style *style,
css_color *color)
{
@@ -94,8 +94,8 @@ static inline uint8_t get_background_color(const css_computed_style *style,
#undef BACKGROUND_COLOR_MASK
#define BACKGROUND_IMAGE_INDEX 14
-#define BACKGROUND_IMAGE_SHIFT 28
-#define BACKGROUND_IMAGE_MASK 0x10000000
+#define BACKGROUND_IMAGE_SHIFT 23
+#define BACKGROUND_IMAGE_MASK 0x800000
static inline uint8_t get_background_image(const css_computed_style *style,
lwc_string **string)
{
@@ -138,8 +138,8 @@ static inline uint8_t get_background_position(const css_computed_style *style,
#undef BACKGROUND_POSITION_MASK
#define BACKGROUND_REPEAT_INDEX 13
-#define BACKGROUND_REPEAT_SHIFT 1
-#define BACKGROUND_REPEAT_MASK 0xe
+#define BACKGROUND_REPEAT_SHIFT 22
+#define BACKGROUND_REPEAT_MASK 0x1c00000
static inline uint8_t get_background_repeat(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BACKGROUND_REPEAT_INDEX];
@@ -154,9 +154,9 @@ static inline uint8_t get_background_repeat(const css_computed_style *style)
#undef BACKGROUND_REPEAT_SHIFT
#undef BACKGROUND_REPEAT_MASK
-#define BORDER_BOTTOM_COLOR_INDEX 11
-#define BORDER_BOTTOM_COLOR_SHIFT 28
-#define BORDER_BOTTOM_COLOR_MASK 0x30000000
+#define BORDER_BOTTOM_COLOR_INDEX 10
+#define BORDER_BOTTOM_COLOR_SHIFT 18
+#define BORDER_BOTTOM_COLOR_MASK 0xc0000
static inline uint8_t get_border_bottom_color(const css_computed_style *style,
css_color *color)
{
@@ -173,9 +173,9 @@ static inline uint8_t get_border_bottom_color(const css_computed_style *style,
#undef BORDER_BOTTOM_COLOR_SHIFT
#undef BORDER_BOTTOM_COLOR_MASK
-#define BORDER_BOTTOM_STYLE_INDEX 13
-#define BORDER_BOTTOM_STYLE_SHIFT 8
-#define BORDER_BOTTOM_STYLE_MASK 0xf00
+#define BORDER_BOTTOM_STYLE_INDEX 6
+#define BORDER_BOTTOM_STYLE_SHIFT 0
+#define BORDER_BOTTOM_STYLE_MASK 0xf
static inline uint8_t get_border_bottom_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
@@ -191,8 +191,8 @@ static inline uint8_t get_border_bottom_style(const css_computed_style *style)
#undef BORDER_BOTTOM_STYLE_MASK
#define BORDER_BOTTOM_WIDTH_INDEX 0
-#define BORDER_BOTTOM_WIDTH_SHIFT 0
-#define BORDER_BOTTOM_WIDTH_MASK 0xff
+#define BORDER_BOTTOM_WIDTH_SHIFT 8
+#define BORDER_BOTTOM_WIDTH_MASK 0xff00
static inline uint8_t get_border_bottom_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -213,8 +213,8 @@ static inline uint8_t get_border_bottom_width(const css_computed_style *style,
#undef BORDER_BOTTOM_WIDTH_MASK
#define BORDER_COLLAPSE_INDEX 11
-#define BORDER_COLLAPSE_SHIFT 16
-#define BORDER_COLLAPSE_MASK 0x30000
+#define BORDER_COLLAPSE_SHIFT 14
+#define BORDER_COLLAPSE_MASK 0xc000
static inline uint8_t get_border_collapse(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_COLLAPSE_INDEX];
@@ -230,8 +230,8 @@ static inline uint8_t get_border_collapse(const css_computed_style *style)
#undef BORDER_COLLAPSE_MASK
#define BORDER_LEFT_COLOR_INDEX 10
-#define BORDER_LEFT_COLOR_SHIFT 0
-#define BORDER_LEFT_COLOR_MASK 0x3
+#define BORDER_LEFT_COLOR_SHIFT 2
+#define BORDER_LEFT_COLOR_MASK 0xc
static inline uint8_t get_border_left_color(const css_computed_style *style,
css_color *color)
{
@@ -248,9 +248,9 @@ static inline uint8_t get_border_left_color(const css_computed_style *style,
#undef BORDER_LEFT_COLOR_SHIFT
#undef BORDER_LEFT_COLOR_MASK
-#define BORDER_LEFT_STYLE_INDEX 13
-#define BORDER_LEFT_STYLE_SHIFT 12
-#define BORDER_LEFT_STYLE_MASK 0xf000
+#define BORDER_LEFT_STYLE_INDEX 9
+#define BORDER_LEFT_STYLE_SHIFT 19
+#define BORDER_LEFT_STYLE_MASK 0x780000
static inline uint8_t get_border_left_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_LEFT_STYLE_INDEX];
@@ -266,8 +266,8 @@ static inline uint8_t get_border_left_style(const css_computed_style *style)
#undef BORDER_LEFT_STYLE_MASK
#define BORDER_LEFT_WIDTH_INDEX 0
-#define BORDER_LEFT_WIDTH_SHIFT 8
-#define BORDER_LEFT_WIDTH_MASK 0xff00
+#define BORDER_LEFT_WIDTH_SHIFT 24
+#define BORDER_LEFT_WIDTH_MASK 0xff000000
static inline uint8_t get_border_left_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -288,8 +288,8 @@ static inline uint8_t get_border_left_width(const css_computed_style *style,
#undef BORDER_LEFT_WIDTH_MASK
#define BORDER_RIGHT_COLOR_INDEX 11
-#define BORDER_RIGHT_COLOR_SHIFT 8
-#define BORDER_RIGHT_COLOR_MASK 0x300
+#define BORDER_RIGHT_COLOR_SHIFT 12
+#define BORDER_RIGHT_COLOR_MASK 0x3000
static inline uint8_t get_border_right_color(const css_computed_style *style,
css_color *color)
{
@@ -306,9 +306,9 @@ static inline uint8_t get_border_right_color(const css_computed_style *style,
#undef BORDER_RIGHT_COLOR_SHIFT
#undef BORDER_RIGHT_COLOR_MASK
-#define BORDER_RIGHT_STYLE_INDEX 8
-#define BORDER_RIGHT_STYLE_SHIFT 0
-#define BORDER_RIGHT_STYLE_MASK 0xf
+#define BORDER_RIGHT_STYLE_INDEX 13
+#define BORDER_RIGHT_STYLE_SHIFT 28
+#define BORDER_RIGHT_STYLE_MASK 0xf0000000
static inline uint8_t get_border_right_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BORDER_RIGHT_STYLE_INDEX];
@@ -323,9 +323,9 @@ static inline uint8_t get_border_right_style(const css_computed_style *style)
#undef BORDER_RIGHT_STYLE_SHIFT
#undef BORDER_RIGHT_STYLE_MASK
-#define BORDER_RIGHT_WIDTH_INDEX 1
-#define BORDER_RIGHT_WIDTH_SHIFT 7
-#define BORDER_RIGHT_WIDTH_MASK 0x7f80
+#define BORDER_RIGHT_WIDTH_INDEX 0
+#define BORDER_RIGHT_WIDTH_SHIFT 0
+#define BORDER_RIGHT_WIDTH_MASK 0xff
static inline uint8_t get_border_right_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -371,8 +371,8 @@ static inline uint8_t get_border_spacing(const css_computed_style *style,
#undef BORDER_SPACING_MASK
#define BORDER_TOP_COLOR_INDEX 11
-#define BORDER_TOP_COLOR_SHIFT 26
-#define BORDER_TOP_COLOR_MASK 0xc000000
+#define BORDER_TOP_COLOR_SHIFT 16
+#define BORDER_TOP_COLOR_MASK 0x30000
static inline uint8_t get_border_top_color(const css_computed_style *style,
css_color *color)
{
@@ -389,7 +389,7 @@ static inline uint8_t get_border_top_color(const css_computed_style *style,
#undef BORDER_TOP_COLOR_SHIFT
#undef BORDER_TOP_COLOR_MASK
-#define BORDER_TOP_STYLE_INDEX 6
+#define BORDER_TOP_STYLE_INDEX 7
#define BORDER_TOP_STYLE_SHIFT 0
#define BORDER_TOP_STYLE_MASK 0xf
static inline uint8_t get_border_top_style(const css_computed_style *style)
@@ -406,9 +406,9 @@ static inline uint8_t get_border_top_style(const css_computed_style *style)
#undef BORDER_TOP_STYLE_SHIFT
#undef BORDER_TOP_STYLE_MASK
-#define BORDER_TOP_WIDTH_INDEX 1
-#define BORDER_TOP_WIDTH_SHIFT 15
-#define BORDER_TOP_WIDTH_MASK 0x7f8000
+#define BORDER_TOP_WIDTH_INDEX 0
+#define BORDER_TOP_WIDTH_SHIFT 16
+#define BORDER_TOP_WIDTH_MASK 0xff0000
static inline uint8_t get_border_top_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -429,8 +429,8 @@ static inline uint8_t get_border_top_width(const css_computed_style *style,
#undef BORDER_TOP_WIDTH_MASK
#define BOTTOM_INDEX 7
-#define BOTTOM_SHIFT 18
-#define BOTTOM_MASK 0x1fc0000
+#define BOTTOM_SHIFT 11
+#define BOTTOM_MASK 0x3f800
static inline uint8_t get_bottom(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
@@ -462,8 +462,8 @@ static inline uint8_t get_bottom_bits(
#undef BOTTOM_MASK
#define BOX_SIZING_INDEX 10
-#define BOX_SIZING_SHIFT 18
-#define BOX_SIZING_MASK 0xc0000
+#define BOX_SIZING_SHIFT 12
+#define BOX_SIZING_MASK 0x3000
static inline uint8_t get_box_sizing(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BOX_SIZING_INDEX];
@@ -478,9 +478,9 @@ static inline uint8_t get_box_sizing(const css_computed_style *style)
#undef BOX_SIZING_SHIFT
#undef BOX_SIZING_MASK
-#define BREAK_AFTER_INDEX 13
-#define BREAK_AFTER_SHIFT 28
-#define BREAK_AFTER_MASK 0xf0000000
+#define BREAK_AFTER_INDEX 9
+#define BREAK_AFTER_SHIFT 11
+#define BREAK_AFTER_MASK 0x7800
static inline uint8_t get_break_after(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BREAK_AFTER_INDEX];
@@ -495,9 +495,9 @@ static inline uint8_t get_break_after(const css_computed_style *style)
#undef BREAK_AFTER_SHIFT
#undef BREAK_AFTER_MASK
-#define BREAK_BEFORE_INDEX 13
-#define BREAK_BEFORE_SHIFT 24
-#define BREAK_BEFORE_MASK 0xf000000
+#define BREAK_BEFORE_INDEX 9
+#define BREAK_BEFORE_SHIFT 23
+#define BREAK_BEFORE_MASK 0x7800000
static inline uint8_t get_break_before(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BREAK_BEFORE_INDEX];
@@ -512,9 +512,9 @@ static inline uint8_t get_break_before(const css_computed_style *style)
#undef BREAK_BEFORE_SHIFT
#undef BREAK_BEFORE_MASK
-#define BREAK_INSIDE_INDEX 13
-#define BREAK_INSIDE_SHIFT 4
-#define BREAK_INSIDE_MASK 0xf0
+#define BREAK_INSIDE_INDEX 5
+#define BREAK_INSIDE_SHIFT 0
+#define BREAK_INSIDE_MASK 0xf
static inline uint8_t get_break_inside(const css_computed_style *style)
{
uint32_t bits = style->i.bits[BREAK_INSIDE_INDEX];
@@ -530,8 +530,8 @@ static inline uint8_t get_break_inside(const css_computed_style *style)
#undef BREAK_INSIDE_MASK
#define CAPTION_SIDE_INDEX 11
-#define CAPTION_SIDE_SHIFT 24
-#define CAPTION_SIDE_MASK 0x3000000
+#define CAPTION_SIDE_SHIFT 4
+#define CAPTION_SIDE_MASK 0x30
static inline uint8_t get_caption_side(const css_computed_style *style)
{
uint32_t bits = style->i.bits[CAPTION_SIDE_INDEX];
@@ -546,9 +546,9 @@ static inline uint8_t get_caption_side(const css_computed_style *style)
#undef CAPTION_SIDE_SHIFT
#undef CAPTION_SIDE_MASK
-#define CLEAR_INDEX 10
-#define CLEAR_SHIFT 23
-#define CLEAR_MASK 0x3800000
+#define CLEAR_INDEX 13
+#define CLEAR_SHIFT 10
+#define CLEAR_MASK 0x1c00
static inline uint8_t get_clear(const css_computed_style *style)
{
uint32_t bits = style->i.bits[CLEAR_INDEX];
@@ -605,9 +605,9 @@ static inline uint8_t get_clip(
#undef CLIP_SHIFT
#undef CLIP_MASK
-#define COLOR_INDEX 12
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
+#define COLOR_INDEX 14
+#define COLOR_SHIFT 18
+#define COLOR_MASK 0x40000
static inline uint8_t get_color(const css_computed_style *style, css_color
*color)
{
@@ -624,9 +624,9 @@ static inline uint8_t get_color(const css_computed_style *style, css_color
#undef COLOR_SHIFT
#undef COLOR_MASK
-#define COLUMN_COUNT_INDEX 11
-#define COLUMN_COUNT_SHIFT 20
-#define COLUMN_COUNT_MASK 0x300000
+#define COLUMN_COUNT_INDEX 10
+#define COLUMN_COUNT_SHIFT 0
+#define COLUMN_COUNT_MASK 0x3
static inline uint8_t get_column_count(const css_computed_style *style, int32_t
*integer)
{
@@ -644,8 +644,8 @@ static inline uint8_t get_column_count(const css_computed_style *style, int32_t
#undef COLUMN_COUNT_MASK
#define COLUMN_FILL_INDEX 11
-#define COLUMN_FILL_SHIFT 10
-#define COLUMN_FILL_MASK 0xc00
+#define COLUMN_FILL_SHIFT 8
+#define COLUMN_FILL_MASK 0x300
static inline uint8_t get_column_fill(const css_computed_style *style)
{
uint32_t bits = style->i.bits[COLUMN_FILL_INDEX];
@@ -683,8 +683,8 @@ static inline uint8_t get_column_gap(const css_computed_style *style, css_fixed
#undef COLUMN_GAP_MASK
#define COLUMN_RULE_COLOR_INDEX 10
-#define COLUMN_RULE_COLOR_SHIFT 10
-#define COLUMN_RULE_COLOR_MASK 0xc00
+#define COLUMN_RULE_COLOR_SHIFT 16
+#define COLUMN_RULE_COLOR_MASK 0x30000
static inline uint8_t get_column_rule_color(const css_computed_style *style,
css_color *color)
{
@@ -701,9 +701,9 @@ static inline uint8_t get_column_rule_color(const css_computed_style *style,
#undef COLUMN_RULE_COLOR_SHIFT
#undef COLUMN_RULE_COLOR_MASK
-#define COLUMN_RULE_STYLE_INDEX 7
-#define COLUMN_RULE_STYLE_SHIFT 0
-#define COLUMN_RULE_STYLE_MASK 0xf
+#define COLUMN_RULE_STYLE_INDEX 9
+#define COLUMN_RULE_STYLE_SHIFT 3
+#define COLUMN_RULE_STYLE_MASK 0x78
static inline uint8_t get_column_rule_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[COLUMN_RULE_STYLE_INDEX];
@@ -718,9 +718,9 @@ static inline uint8_t get_column_rule_style(const css_computed_style *style)
#undef COLUMN_RULE_STYLE_SHIFT
#undef COLUMN_RULE_STYLE_MASK
-#define COLUMN_RULE_WIDTH_INDEX 0
-#define COLUMN_RULE_WIDTH_SHIFT 24
-#define COLUMN_RULE_WIDTH_MASK 0xff000000
+#define COLUMN_RULE_WIDTH_INDEX 1
+#define COLUMN_RULE_WIDTH_SHIFT 7
+#define COLUMN_RULE_WIDTH_MASK 0x7f80
static inline uint8_t get_column_rule_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -741,8 +741,8 @@ static inline uint8_t get_column_rule_width(const css_computed_style *style,
#undef COLUMN_RULE_WIDTH_MASK
#define COLUMN_SPAN_INDEX 10
-#define COLUMN_SPAN_SHIFT 6
-#define COLUMN_SPAN_MASK 0xc0
+#define COLUMN_SPAN_SHIFT 10
+#define COLUMN_SPAN_MASK 0xc00
static inline uint8_t get_column_span(const css_computed_style *style)
{
uint32_t bits = style->i.bits[COLUMN_SPAN_INDEX];
@@ -758,8 +758,8 @@ static inline uint8_t get_column_span(const css_computed_style *style)
#undef COLUMN_SPAN_MASK
#define COLUMN_WIDTH_INDEX 5
-#define COLUMN_WIDTH_SHIFT 4
-#define COLUMN_WIDTH_MASK 0x7f0
+#define COLUMN_WIDTH_SHIFT 25
+#define COLUMN_WIDTH_MASK 0xfe000000
static inline uint8_t get_column_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -780,8 +780,8 @@ static inline uint8_t get_column_width(const css_computed_style *style,
#undef COLUMN_WIDTH_MASK
#define CONTENT_INDEX 11
-#define CONTENT_SHIFT 0
-#define CONTENT_MASK 0x3
+#define CONTENT_SHIFT 18
+#define CONTENT_MASK 0xc0000
static inline uint8_t get_content(const css_computed_style *style, const
css_computed_content_item **content_item)
{
@@ -801,8 +801,8 @@ static inline uint8_t get_content(const css_computed_style *style, const
#undef CONTENT_MASK
#define COUNTER_INCREMENT_INDEX 14
-#define COUNTER_INCREMENT_SHIFT 29
-#define COUNTER_INCREMENT_MASK 0x20000000
+#define COUNTER_INCREMENT_SHIFT 20
+#define COUNTER_INCREMENT_MASK 0x100000
static inline uint8_t get_counter_increment(const css_computed_style *style,
const css_computed_counter **counter_arr)
{
@@ -820,8 +820,8 @@ static inline uint8_t get_counter_increment(const css_computed_style *style,
#undef COUNTER_INCREMENT_MASK
#define COUNTER_RESET_INDEX 14
-#define COUNTER_RESET_SHIFT 21
-#define COUNTER_RESET_MASK 0x200000
+#define COUNTER_RESET_SHIFT 25
+#define COUNTER_RESET_MASK 0x2000000
static inline uint8_t get_counter_reset(const css_computed_style *style, const
css_computed_counter **counter_arr)
{
@@ -838,9 +838,9 @@ static inline uint8_t get_counter_reset(const css_computed_style *style, const
#undef COUNTER_RESET_SHIFT
#undef COUNTER_RESET_MASK
-#define CURSOR_INDEX 8
-#define CURSOR_SHIFT 4
-#define CURSOR_MASK 0x1f0
+#define CURSOR_INDEX 9
+#define CURSOR_SHIFT 27
+#define CURSOR_MASK 0xf8000000
static inline uint8_t get_cursor(const css_computed_style *style, lwc_string
***string_arr)
{
@@ -857,9 +857,9 @@ static inline uint8_t get_cursor(const css_computed_style *style, lwc_string
#undef CURSOR_SHIFT
#undef CURSOR_MASK
-#define DIRECTION_INDEX 10
-#define DIRECTION_SHIFT 16
-#define DIRECTION_MASK 0x30000
+#define DIRECTION_INDEX 14
+#define DIRECTION_SHIFT 28
+#define DIRECTION_MASK 0x30000000
static inline uint8_t get_direction(const css_computed_style *style)
{
uint32_t bits = style->i.bits[DIRECTION_INDEX];
@@ -892,8 +892,8 @@ static inline uint8_t get_display(const css_computed_style *style)
#undef DISPLAY_MASK
#define EMPTY_CELLS_INDEX 10
-#define EMPTY_CELLS_SHIFT 14
-#define EMPTY_CELLS_MASK 0xc000
+#define EMPTY_CELLS_SHIFT 4
+#define EMPTY_CELLS_MASK 0x30
static inline uint8_t get_empty_cells(const css_computed_style *style)
{
uint32_t bits = style->i.bits[EMPTY_CELLS_INDEX];
@@ -909,8 +909,8 @@ static inline uint8_t get_empty_cells(const css_computed_style *style)
#undef EMPTY_CELLS_MASK
#define FLEX_BASIS_INDEX 4
-#define FLEX_BASIS_SHIFT 18
-#define FLEX_BASIS_MASK 0x1fc0000
+#define FLEX_BASIS_SHIFT 25
+#define FLEX_BASIS_MASK 0xfe000000
static inline uint8_t get_flex_basis(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -930,9 +930,9 @@ static inline uint8_t get_flex_basis(const css_computed_style *style, css_fixed
#undef FLEX_BASIS_SHIFT
#undef FLEX_BASIS_MASK
-#define FLEX_DIRECTION_INDEX 9
-#define FLEX_DIRECTION_SHIFT 5
-#define FLEX_DIRECTION_MASK 0xe0
+#define FLEX_DIRECTION_INDEX 13
+#define FLEX_DIRECTION_SHIFT 1
+#define FLEX_DIRECTION_MASK 0xe
static inline uint8_t get_flex_direction(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FLEX_DIRECTION_INDEX];
@@ -947,9 +947,9 @@ static inline uint8_t get_flex_direction(const css_computed_style *style)
#undef FLEX_DIRECTION_SHIFT
#undef FLEX_DIRECTION_MASK
-#define FLEX_GROW_INDEX 14
-#define FLEX_GROW_SHIFT 23
-#define FLEX_GROW_MASK 0x800000
+#define FLEX_GROW_INDEX 12
+#define FLEX_GROW_SHIFT 0
+#define FLEX_GROW_MASK 0x1
static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed
*fixed)
{
@@ -969,8 +969,8 @@ static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed
#undef FLEX_GROW_MASK
#define FLEX_SHRINK_INDEX 14
-#define FLEX_SHRINK_SHIFT 20
-#define FLEX_SHRINK_MASK 0x100000
+#define FLEX_SHRINK_SHIFT 22
+#define FLEX_SHRINK_MASK 0x400000
static inline uint8_t get_flex_shrink(const css_computed_style *style,
css_fixed *fixed)
{
@@ -990,8 +990,8 @@ static inline uint8_t get_flex_shrink(const css_computed_style *style,
#undef FLEX_SHRINK_MASK
#define FLEX_WRAP_INDEX 10
-#define FLEX_WRAP_SHIFT 12
-#define FLEX_WRAP_MASK 0x3000
+#define FLEX_WRAP_SHIFT 6
+#define FLEX_WRAP_MASK 0xc0
static inline uint8_t get_flex_wrap(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FLEX_WRAP_INDEX];
@@ -1007,8 +1007,8 @@ static inline uint8_t get_flex_wrap(const css_computed_style *style)
#undef FLEX_WRAP_MASK
#define FLOAT_INDEX 11
-#define FLOAT_SHIFT 6
-#define FLOAT_MASK 0xc0
+#define FLOAT_SHIFT 30
+#define FLOAT_MASK 0xc0000000
static inline uint8_t get_float(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FLOAT_INDEX];
@@ -1024,8 +1024,8 @@ static inline uint8_t get_float(const css_computed_style *style)
#undef FLOAT_MASK
#define FONT_FAMILY_INDEX 9
-#define FONT_FAMILY_SHIFT 26
-#define FONT_FAMILY_MASK 0x1c000000
+#define FONT_FAMILY_SHIFT 0
+#define FONT_FAMILY_MASK 0x7
static inline uint8_t get_font_family(const css_computed_style *style,
lwc_string ***string_arr)
{
@@ -1065,8 +1065,8 @@ static inline uint8_t get_font_size(const css_computed_style *style, css_fixed
#undef FONT_SIZE_MASK
#define FONT_STYLE_INDEX 11
-#define FONT_STYLE_SHIFT 30
-#define FONT_STYLE_MASK 0xc0000000
+#define FONT_STYLE_SHIFT 20
+#define FONT_STYLE_MASK 0x300000
static inline uint8_t get_font_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FONT_STYLE_INDEX];
@@ -1082,8 +1082,8 @@ static inline uint8_t get_font_style(const css_computed_style *style)
#undef FONT_STYLE_MASK
#define FONT_VARIANT_INDEX 11
-#define FONT_VARIANT_SHIFT 22
-#define FONT_VARIANT_MASK 0xc00000
+#define FONT_VARIANT_SHIFT 28
+#define FONT_VARIANT_MASK 0x30000000
static inline uint8_t get_font_variant(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FONT_VARIANT_INDEX];
@@ -1098,9 +1098,9 @@ static inline uint8_t get_font_variant(const css_computed_style *style)
#undef FONT_VARIANT_SHIFT
#undef FONT_VARIANT_MASK
-#define FONT_WEIGHT_INDEX 4
-#define FONT_WEIGHT_SHIFT 0
-#define FONT_WEIGHT_MASK 0xf
+#define FONT_WEIGHT_INDEX 9
+#define FONT_WEIGHT_SHIFT 15
+#define FONT_WEIGHT_MASK 0x78000
static inline uint8_t get_font_weight(const css_computed_style *style)
{
uint32_t bits = style->i.bits[FONT_WEIGHT_INDEX];
@@ -1115,9 +1115,9 @@ static inline uint8_t get_font_weight(const css_computed_style *style)
#undef FONT_WEIGHT_SHIFT
#undef FONT_WEIGHT_MASK
-#define HEIGHT_INDEX 5
-#define HEIGHT_SHIFT 18
-#define HEIGHT_MASK 0x1fc0000
+#define HEIGHT_INDEX 6
+#define HEIGHT_SHIFT 25
+#define HEIGHT_MASK 0xfe000000
static inline uint8_t get_height(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1137,9 +1137,9 @@ static inline uint8_t get_height(const css_computed_style *style, css_fixed
#undef HEIGHT_SHIFT
#undef HEIGHT_MASK
-#define JUSTIFY_CONTENT_INDEX 10
-#define JUSTIFY_CONTENT_SHIFT 29
-#define JUSTIFY_CONTENT_MASK 0xe0000000
+#define JUSTIFY_CONTENT_INDEX 13
+#define JUSTIFY_CONTENT_SHIFT 4
+#define JUSTIFY_CONTENT_MASK 0x70
static inline uint8_t get_justify_content(const css_computed_style *style)
{
uint32_t bits = style->i.bits[JUSTIFY_CONTENT_INDEX];
@@ -1187,9 +1187,9 @@ static inline uint8_t get_left_bits(
#undef LEFT_SHIFT
#undef LEFT_MASK
-#define LETTER_SPACING_INDEX 1
-#define LETTER_SPACING_SHIFT 0
-#define LETTER_SPACING_MASK 0x7f
+#define LETTER_SPACING_INDEX 6
+#define LETTER_SPACING_SHIFT 18
+#define LETTER_SPACING_MASK 0x1fc0000
static inline uint8_t get_letter_spacing(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1236,9 +1236,9 @@ static inline uint8_t get_line_height(
#undef LINE_HEIGHT_SHIFT
#undef LINE_HEIGHT_MASK
-#define LIST_STYLE_IMAGE_INDEX 13
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
+#define LIST_STYLE_IMAGE_INDEX 14
+#define LIST_STYLE_IMAGE_SHIFT 27
+#define LIST_STYLE_IMAGE_MASK 0x8000000
static inline uint8_t get_list_style_image(const css_computed_style *style,
lwc_string **string)
{
@@ -1255,9 +1255,9 @@ static inline uint8_t get_list_style_image(const css_computed_style *style,
#undef LIST_STYLE_IMAGE_SHIFT
#undef LIST_STYLE_IMAGE_MASK
-#define LIST_STYLE_POSITION_INDEX 14
-#define LIST_STYLE_POSITION_SHIFT 30
-#define LIST_STYLE_POSITION_MASK 0xc0000000
+#define LIST_STYLE_POSITION_INDEX 11
+#define LIST_STYLE_POSITION_SHIFT 6
+#define LIST_STYLE_POSITION_MASK 0xc0
static inline uint8_t get_list_style_position(const css_computed_style *style)
{
uint32_t bits = style->i.bits[LIST_STYLE_POSITION_INDEX];
@@ -1272,24 +1272,24 @@ static inline uint8_t get_list_style_position(const css_computed_style *style)
#undef LIST_STYLE_POSITION_SHIFT
#undef LIST_STYLE_POSITION_MASK
-#define LIST_STYLE_TYPE_INDEX 13
-#define LIST_STYLE_TYPE_SHIFT 20
-#define LIST_STYLE_TYPE_MASK 0xf00000
+#define LIST_STYLE_TYPE_INDEX 8
+#define LIST_STYLE_TYPE_SHIFT 26
+#define LIST_STYLE_TYPE_MASK 0xfc000000
static inline uint8_t get_list_style_type(const css_computed_style *style)
{
uint32_t bits = style->i.bits[LIST_STYLE_TYPE_INDEX];
bits &= LIST_STYLE_TYPE_MASK;
bits >>= LIST_STYLE_TYPE_SHIFT;
- /* 4bits: tttt : type */
+ /* 6bits: tttttt : type */
- return (bits & 0xf);
+ return (bits & 0x3f);
}
#undef LIST_STYLE_TYPE_INDEX
#undef LIST_STYLE_TYPE_SHIFT
#undef LIST_STYLE_TYPE_MASK
-#define MARGIN_BOTTOM_INDEX 3
+#define MARGIN_BOTTOM_INDEX 5
#define MARGIN_BOTTOM_SHIFT 18
#define MARGIN_BOTTOM_MASK 0x1fc0000
static inline uint8_t get_margin_bottom(const css_computed_style *style,
@@ -1311,9 +1311,9 @@ static inline uint8_t get_margin_bottom(const css_computed_style *style,
#undef MARGIN_BOTTOM_SHIFT
#undef MARGIN_BOTTOM_MASK
-#define MARGIN_LEFT_INDEX 3
-#define MARGIN_LEFT_SHIFT 11
-#define MARGIN_LEFT_MASK 0x3f800
+#define MARGIN_LEFT_INDEX 7
+#define MARGIN_LEFT_SHIFT 18
+#define MARGIN_LEFT_MASK 0x1fc0000
static inline uint8_t get_margin_left(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1355,9 +1355,9 @@ static inline uint8_t get_margin_right(const css_computed_style *style,
#undef MARGIN_RIGHT_SHIFT
#undef MARGIN_RIGHT_MASK
-#define MARGIN_TOP_INDEX 7
-#define MARGIN_TOP_SHIFT 4
-#define MARGIN_TOP_MASK 0x7f0
+#define MARGIN_TOP_INDEX 1
+#define MARGIN_TOP_SHIFT 0
+#define MARGIN_TOP_MASK 0x7f
static inline uint8_t get_margin_top(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1377,9 +1377,9 @@ static inline uint8_t get_margin_top(const css_computed_style *style, css_fixed
#undef MARGIN_TOP_SHIFT
#undef MARGIN_TOP_MASK
-#define MAX_HEIGHT_INDEX 6
-#define MAX_HEIGHT_SHIFT 18
-#define MAX_HEIGHT_MASK 0x1fc0000
+#define MAX_HEIGHT_INDEX 3
+#define MAX_HEIGHT_SHIFT 25
+#define MAX_HEIGHT_MASK 0xfe000000
static inline uint8_t get_max_height(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1399,9 +1399,9 @@ static inline uint8_t get_max_height(const css_computed_style *style, css_fixed
#undef MAX_HEIGHT_SHIFT
#undef MAX_HEIGHT_MASK
-#define MAX_WIDTH_INDEX 3
-#define MAX_WIDTH_SHIFT 25
-#define MAX_WIDTH_MASK 0xfe000000
+#define MAX_WIDTH_INDEX 7
+#define MAX_WIDTH_SHIFT 4
+#define MAX_WIDTH_MASK 0x7f0
static inline uint8_t get_max_width(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1421,9 +1421,9 @@ static inline uint8_t get_max_width(const css_computed_style *style, css_fixed
#undef MAX_WIDTH_SHIFT
#undef MAX_WIDTH_MASK
-#define MIN_HEIGHT_INDEX 7
-#define MIN_HEIGHT_SHIFT 11
-#define MIN_HEIGHT_MASK 0x3f800
+#define MIN_HEIGHT_INDEX 4
+#define MIN_HEIGHT_SHIFT 18
+#define MIN_HEIGHT_MASK 0x1fc0000
static inline uint8_t get_min_height(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -1466,8 +1466,8 @@ static inline uint8_t get_min_width(const css_computed_style *style, css_fixed
#undef MIN_WIDTH_MASK
#define OPACITY_INDEX 14
-#define OPACITY_SHIFT 25
-#define OPACITY_MASK 0x2000000
+#define OPACITY_SHIFT 19
+#define OPACITY_MASK 0x80000
static inline uint8_t get_opacity(const css_computed_style *style, css_fixed
*fixed)
{
@@ -1486,9 +1486,9 @@ static inline uint8_t get_opacity(const css_computed_style *style, css_fixed
#undef OPACITY_SHIFT
#undef OPACITY_MASK
-#define ORDER_INDEX 14
-#define ORDER_SHIFT 26
-#define ORDER_MASK 0x4000000
+#define ORDER_INDEX 13
+#define ORDER_SHIFT 0
+#define ORDER_MASK 0x1
static inline uint8_t get_order(const css_computed_style *style, int32_t
*integer)
{
@@ -1508,8 +1508,8 @@ static inline uint8_t get_order(const css_computed_style *style, int32_t
#undef ORDER_MASK
#define ORPHANS_INDEX 14
-#define ORPHANS_SHIFT 22
-#define ORPHANS_MASK 0x400000
+#define ORPHANS_SHIFT 24
+#define ORPHANS_MASK 0x1000000
static inline uint8_t get_orphans(const css_computed_style *style, int32_t
*integer)
{
@@ -1527,8 +1527,8 @@ static inline uint8_t get_orphans(const css_computed_style *style, int32_t
#undef ORPHANS_MASK
#define OUTLINE_COLOR_INDEX 11
-#define OUTLINE_COLOR_SHIFT 12
-#define OUTLINE_COLOR_MASK 0x3000
+#define OUTLINE_COLOR_SHIFT 10
+#define OUTLINE_COLOR_MASK 0xc00
static inline uint8_t get_outline_color(const css_computed_style *style,
css_color *color)
{
@@ -1547,9 +1547,9 @@ static inline uint8_t get_outline_color(const css_computed_style *style,
#undef OUTLINE_COLOR_SHIFT
#undef OUTLINE_COLOR_MASK
-#define OUTLINE_STYLE_INDEX 5
-#define OUTLINE_STYLE_SHIFT 0
-#define OUTLINE_STYLE_MASK 0xf
+#define OUTLINE_STYLE_INDEX 9
+#define OUTLINE_STYLE_SHIFT 7
+#define OUTLINE_STYLE_MASK 0x780
static inline uint8_t get_outline_style(const css_computed_style *style)
{
uint32_t bits = style->i.bits[OUTLINE_STYLE_INDEX];
@@ -1564,9 +1564,9 @@ static inline uint8_t get_outline_style(const css_computed_style *style)
#undef OUTLINE_STYLE_SHIFT
#undef OUTLINE_STYLE_MASK
-#define OUTLINE_WIDTH_INDEX 0
-#define OUTLINE_WIDTH_SHIFT 16
-#define OUTLINE_WIDTH_MASK 0xff0000
+#define OUTLINE_WIDTH_INDEX 1
+#define OUTLINE_WIDTH_SHIFT 15
+#define OUTLINE_WIDTH_MASK 0x7f8000
static inline uint8_t get_outline_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1586,9 +1586,9 @@ static inline uint8_t get_outline_width(const css_computed_style *style,
#undef OUTLINE_WIDTH_SHIFT
#undef OUTLINE_WIDTH_MASK
-#define OVERFLOW_X_INDEX 9
-#define OVERFLOW_X_SHIFT 14
-#define OVERFLOW_X_MASK 0x1c000
+#define OVERFLOW_X_INDEX 13
+#define OVERFLOW_X_SHIFT 16
+#define OVERFLOW_X_MASK 0x70000
static inline uint8_t get_overflow_x(const css_computed_style *style)
{
uint32_t bits = style->i.bits[OVERFLOW_X_INDEX];
@@ -1603,9 +1603,9 @@ static inline uint8_t get_overflow_x(const css_computed_style *style)
#undef OVERFLOW_X_SHIFT
#undef OVERFLOW_X_MASK
-#define OVERFLOW_Y_INDEX 9
-#define OVERFLOW_Y_SHIFT 11
-#define OVERFLOW_Y_MASK 0x3800
+#define OVERFLOW_Y_INDEX 13
+#define OVERFLOW_Y_SHIFT 25
+#define OVERFLOW_Y_MASK 0xe000000
static inline uint8_t get_overflow_y(const css_computed_style *style)
{
uint32_t bits = style->i.bits[OVERFLOW_Y_INDEX];
@@ -1621,8 +1621,8 @@ static inline uint8_t get_overflow_y(const css_computed_style *style)
#undef OVERFLOW_Y_MASK
#define PADDING_BOTTOM_INDEX 8
-#define PADDING_BOTTOM_SHIFT 14
-#define PADDING_BOTTOM_MASK 0xfc000
+#define PADDING_BOTTOM_SHIFT 8
+#define PADDING_BOTTOM_MASK 0x3f00
static inline uint8_t get_padding_bottom(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1642,9 +1642,9 @@ static inline uint8_t get_padding_bottom(const css_computed_style *style,
#undef PADDING_BOTTOM_SHIFT
#undef PADDING_BOTTOM_MASK
-#define PADDING_LEFT_INDEX 8
-#define PADDING_LEFT_SHIFT 26
-#define PADDING_LEFT_MASK 0xfc000000
+#define PADDING_LEFT_INDEX 2
+#define PADDING_LEFT_SHIFT 0
+#define PADDING_LEFT_MASK 0x3f
static inline uint8_t get_padding_left(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1665,8 +1665,8 @@ static inline uint8_t get_padding_left(const css_computed_style *style,
#undef PADDING_LEFT_MASK
#define PADDING_RIGHT_INDEX 8
-#define PADDING_RIGHT_SHIFT 20
-#define PADDING_RIGHT_MASK 0x3f00000
+#define PADDING_RIGHT_SHIFT 14
+#define PADDING_RIGHT_MASK 0xfc000
static inline uint8_t get_padding_right(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1686,9 +1686,9 @@ static inline uint8_t get_padding_right(const css_computed_style *style,
#undef PADDING_RIGHT_SHIFT
#undef PADDING_RIGHT_MASK
-#define PADDING_TOP_INDEX 2
-#define PADDING_TOP_SHIFT 0
-#define PADDING_TOP_MASK 0x3f
+#define PADDING_TOP_INDEX 8
+#define PADDING_TOP_SHIFT 20
+#define PADDING_TOP_MASK 0x3f00000
static inline uint8_t get_padding_top(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -1708,9 +1708,9 @@ static inline uint8_t get_padding_top(const css_computed_style *style,
#undef PADDING_TOP_SHIFT
#undef PADDING_TOP_MASK
-#define PAGE_BREAK_AFTER_INDEX 9
-#define PAGE_BREAK_AFTER_SHIFT 2
-#define PAGE_BREAK_AFTER_MASK 0x1c
+#define PAGE_BREAK_AFTER_INDEX 8
+#define PAGE_BREAK_AFTER_SHIFT 0
+#define PAGE_BREAK_AFTER_MASK 0x7
static inline uint8_t get_page_break_after(const css_computed_style *style)
{
uint32_t bits = style->i.bits[PAGE_BREAK_AFTER_INDEX];
@@ -1725,9 +1725,9 @@ static inline uint8_t get_page_break_after(const css_computed_style *style)
#undef PAGE_BREAK_AFTER_SHIFT
#undef PAGE_BREAK_AFTER_MASK
-#define PAGE_BREAK_BEFORE_INDEX 9
-#define PAGE_BREAK_BEFORE_SHIFT 23
-#define PAGE_BREAK_BEFORE_MASK 0x3800000
+#define PAGE_BREAK_BEFORE_INDEX 13
+#define PAGE_BREAK_BEFORE_SHIFT 7
+#define PAGE_BREAK_BEFORE_MASK 0x380
static inline uint8_t get_page_break_before(const css_computed_style *style)
{
uint32_t bits = style->i.bits[PAGE_BREAK_BEFORE_INDEX];
@@ -1742,9 +1742,9 @@ static inline uint8_t get_page_break_before(const css_computed_style *style)
#undef PAGE_BREAK_BEFORE_SHIFT
#undef PAGE_BREAK_BEFORE_MASK
-#define PAGE_BREAK_INSIDE_INDEX 10
-#define PAGE_BREAK_INSIDE_SHIFT 4
-#define PAGE_BREAK_INSIDE_MASK 0x30
+#define PAGE_BREAK_INSIDE_INDEX 11
+#define PAGE_BREAK_INSIDE_SHIFT 24
+#define PAGE_BREAK_INSIDE_MASK 0x3000000
static inline uint8_t get_page_break_inside(const css_computed_style *style)
{
uint32_t bits = style->i.bits[PAGE_BREAK_INSIDE_INDEX];
@@ -1760,8 +1760,8 @@ static inline uint8_t get_page_break_inside(const css_computed_style *style)
#undef PAGE_BREAK_INSIDE_MASK
#define POSITION_INDEX 10
-#define POSITION_SHIFT 26
-#define POSITION_MASK 0x1c000000
+#define POSITION_SHIFT 20
+#define POSITION_MASK 0x700000
static inline uint8_t get_position(const css_computed_style *style)
{
uint32_t bits = style->i.bits[POSITION_INDEX];
@@ -1777,8 +1777,8 @@ static inline uint8_t get_position(const css_computed_style *style)
#undef POSITION_MASK
#define QUOTES_INDEX 14
-#define QUOTES_SHIFT 27
-#define QUOTES_MASK 0x8000000
+#define QUOTES_SHIFT 21
+#define QUOTES_MASK 0x200000
static inline uint8_t get_quotes(const css_computed_style *style, lwc_string
***string_arr)
{
@@ -1795,9 +1795,9 @@ static inline uint8_t get_quotes(const css_computed_style *style, lwc_string
#undef QUOTES_SHIFT
#undef QUOTES_MASK
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 25
-#define RIGHT_MASK 0xfe000000
+#define RIGHT_INDEX 3
+#define RIGHT_SHIFT 18
+#define RIGHT_MASK 0x1fc0000
static inline uint8_t get_right(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
@@ -1828,9 +1828,9 @@ static inline uint8_t get_right_bits(
#undef RIGHT_SHIFT
#undef RIGHT_MASK
-#define TABLE_LAYOUT_INDEX 11
-#define TABLE_LAYOUT_SHIFT 4
-#define TABLE_LAYOUT_MASK 0x30
+#define TABLE_LAYOUT_INDEX 10
+#define TABLE_LAYOUT_SHIFT 14
+#define TABLE_LAYOUT_MASK 0xc000
static inline uint8_t get_table_layout(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TABLE_LAYOUT_INDEX];
@@ -1845,9 +1845,9 @@ static inline uint8_t get_table_layout(const css_computed_style *style)
#undef TABLE_LAYOUT_SHIFT
#undef TABLE_LAYOUT_MASK
-#define TEXT_ALIGN_INDEX 13
-#define TEXT_ALIGN_SHIFT 16
-#define TEXT_ALIGN_MASK 0xf0000
+#define TEXT_ALIGN_INDEX 4
+#define TEXT_ALIGN_SHIFT 0
+#define TEXT_ALIGN_MASK 0xf
static inline uint8_t get_text_align(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TEXT_ALIGN_INDEX];
@@ -1863,8 +1863,8 @@ static inline uint8_t get_text_align(const css_computed_style *style)
#undef TEXT_ALIGN_MASK
#define TEXT_DECORATION_INDEX 8
-#define TEXT_DECORATION_SHIFT 9
-#define TEXT_DECORATION_MASK 0x3e00
+#define TEXT_DECORATION_SHIFT 3
+#define TEXT_DECORATION_MASK 0xf8
static inline uint8_t get_text_decoration(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TEXT_DECORATION_INDEX];
@@ -1901,9 +1901,9 @@ static inline uint8_t get_text_indent(const css_computed_style *style,
#undef TEXT_INDENT_SHIFT
#undef TEXT_INDENT_MASK
-#define TEXT_TRANSFORM_INDEX 9
-#define TEXT_TRANSFORM_SHIFT 8
-#define TEXT_TRANSFORM_MASK 0x700
+#define TEXT_TRANSFORM_INDEX 13
+#define TEXT_TRANSFORM_SHIFT 13
+#define TEXT_TRANSFORM_MASK 0xe000
static inline uint8_t get_text_transform(const css_computed_style *style)
{
uint32_t bits = style->i.bits[TEXT_TRANSFORM_INDEX];
@@ -1918,7 +1918,7 @@ static inline uint8_t get_text_transform(const css_computed_style *style)
#undef TEXT_TRANSFORM_SHIFT
#undef TEXT_TRANSFORM_MASK
-#define TOP_INDEX 6
+#define TOP_INDEX 7
#define TOP_SHIFT 25
#define TOP_MASK 0xfe000000
static inline uint8_t get_top(
@@ -1951,9 +1951,9 @@ static inline uint8_t get_top_bits(
#undef TOP_SHIFT
#undef TOP_MASK
-#define UNICODE_BIDI_INDEX 9
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
+#define UNICODE_BIDI_INDEX 11
+#define UNICODE_BIDI_SHIFT 2
+#define UNICODE_BIDI_MASK 0xc
static inline uint8_t get_unicode_bidi(const css_computed_style *style)
{
uint32_t bits = style->i.bits[UNICODE_BIDI_INDEX];
@@ -1991,8 +1991,8 @@ static inline uint8_t get_vertical_align(const css_computed_style *style,
#undef VERTICAL_ALIGN_MASK
#define VISIBILITY_INDEX 11
-#define VISIBILITY_SHIFT 14
-#define VISIBILITY_MASK 0xc000
+#define VISIBILITY_SHIFT 0
+#define VISIBILITY_MASK 0x3
static inline uint8_t get_visibility(const css_computed_style *style)
{
uint32_t bits = style->i.bits[VISIBILITY_INDEX];
@@ -2007,9 +2007,9 @@ static inline uint8_t get_visibility(const css_computed_style *style)
#undef VISIBILITY_SHIFT
#undef VISIBILITY_MASK
-#define WHITE_SPACE_INDEX 10
-#define WHITE_SPACE_SHIFT 20
-#define WHITE_SPACE_MASK 0x700000
+#define WHITE_SPACE_INDEX 13
+#define WHITE_SPACE_SHIFT 19
+#define WHITE_SPACE_MASK 0x380000
static inline uint8_t get_white_space(const css_computed_style *style)
{
uint32_t bits = style->i.bits[WHITE_SPACE_INDEX];
@@ -2025,8 +2025,8 @@ static inline uint8_t get_white_space(const css_computed_style *style)
#undef WHITE_SPACE_MASK
#define WIDOWS_INDEX 14
-#define WIDOWS_SHIFT 24
-#define WIDOWS_MASK 0x1000000
+#define WIDOWS_SHIFT 26
+#define WIDOWS_MASK 0x4000000
static inline uint8_t get_widows(const css_computed_style *style, int32_t
*integer)
{
@@ -2043,9 +2043,9 @@ static inline uint8_t get_widows(const css_computed_style *style, int32_t
#undef WIDOWS_SHIFT
#undef WIDOWS_MASK
-#define WIDTH_INDEX 5
-#define WIDTH_SHIFT 25
-#define WIDTH_MASK 0xfe000000
+#define WIDTH_INDEX 3
+#define WIDTH_SHIFT 11
+#define WIDTH_MASK 0x3f800
static inline uint8_t get_width(const css_computed_style *style, css_fixed
*length, css_unit *unit)
{
@@ -2065,9 +2065,9 @@ static inline uint8_t get_width(const css_computed_style *style, css_fixed
#undef WIDTH_SHIFT
#undef WIDTH_MASK
-#define WORD_SPACING_INDEX 4
-#define WORD_SPACING_SHIFT 25
-#define WORD_SPACING_MASK 0xfe000000
+#define WORD_SPACING_INDEX 5
+#define WORD_SPACING_SHIFT 4
+#define WORD_SPACING_MASK 0x7f0
static inline uint8_t get_word_spacing(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
@@ -2087,9 +2087,9 @@ static inline uint8_t get_word_spacing(const css_computed_style *style,
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_MASK
-#define WRITING_MODE_INDEX 11
-#define WRITING_MODE_SHIFT 18
-#define WRITING_MODE_MASK 0xc0000
+#define WRITING_MODE_INDEX 14
+#define WRITING_MODE_SHIFT 30
+#define WRITING_MODE_MASK 0xc0000000
static inline uint8_t get_writing_mode(const css_computed_style *style)
{
uint32_t bits = style->i.bits[WRITING_MODE_INDEX];
@@ -2104,9 +2104,9 @@ static inline uint8_t get_writing_mode(const css_computed_style *style)
#undef WRITING_MODE_SHIFT
#undef WRITING_MODE_MASK
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 2
-#define Z_INDEX_MASK 0xc
+#define Z_INDEX_INDEX 10
+#define Z_INDEX_SHIFT 8
+#define Z_INDEX_MASK 0x300
static inline uint8_t get_z_index(const css_computed_style *style, int32_t
*integer)
{
diff --git a/src/select/autogenerated_propset.h b/src/select/autogenerated_propset.h
index 2854896..56ff7c6 100644
--- a/src/select/autogenerated_propset.h
+++ b/src/select/autogenerated_propset.h
@@ -8,9 +8,9 @@
/** Default values are 'initial value', unless the property is inherited,
* in which case it is 'inherit'. */
-#define ALIGN_CONTENT_INDEX 9
-#define ALIGN_CONTENT_SHIFT 17
-#define ALIGN_CONTENT_MASK 0xe0000
+#define ALIGN_CONTENT_INDEX 10
+#define ALIGN_CONTENT_SHIFT 29
+#define ALIGN_CONTENT_MASK 0xe0000000
static inline css_error set_align_content(css_computed_style *style, uint8_t
type)
@@ -29,9 +29,9 @@ static inline css_error set_align_content(css_computed_style *style, uint8_t
#undef ALIGN_CONTENT_SHIFT
#undef ALIGN_CONTENT_MASK
-#define ALIGN_ITEMS_INDEX 9
-#define ALIGN_ITEMS_SHIFT 29
-#define ALIGN_ITEMS_MASK 0xe0000000
+#define ALIGN_ITEMS_INDEX 10
+#define ALIGN_ITEMS_SHIFT 26
+#define ALIGN_ITEMS_MASK 0x1c000000
static inline css_error set_align_items(css_computed_style *style, uint8_t type)
{
@@ -49,9 +49,9 @@ static inline css_error set_align_items(css_computed_style *style, uint8_t type)
#undef ALIGN_ITEMS_SHIFT
#undef ALIGN_ITEMS_MASK
-#define ALIGN_SELF_INDEX 9
-#define ALIGN_SELF_SHIFT 20
-#define ALIGN_SELF_MASK 0x700000
+#define ALIGN_SELF_INDEX 10
+#define ALIGN_SELF_SHIFT 23
+#define ALIGN_SELF_MASK 0x3800000
static inline css_error set_align_self(css_computed_style *style, uint8_t type)
{
@@ -69,9 +69,9 @@ static inline css_error set_align_self(css_computed_style *style, uint8_t type)
#undef ALIGN_SELF_SHIFT
#undef ALIGN_SELF_MASK
-#define BACKGROUND_ATTACHMENT_INDEX 10
-#define BACKGROUND_ATTACHMENT_SHIFT 8
-#define BACKGROUND_ATTACHMENT_MASK 0x300
+#define BACKGROUND_ATTACHMENT_INDEX 11
+#define BACKGROUND_ATTACHMENT_SHIFT 26
+#define BACKGROUND_ATTACHMENT_MASK 0xc000000
static inline css_error set_background_attachment(css_computed_style *style,
uint8_t type)
@@ -90,9 +90,9 @@ static inline css_error set_background_attachment(css_computed_style *style,
#undef BACKGROUND_ATTACHMENT_SHIFT
#undef BACKGROUND_ATTACHMENT_MASK
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 2
-#define BACKGROUND_COLOR_MASK 0xc
+#define BACKGROUND_COLOR_INDEX 11
+#define BACKGROUND_COLOR_SHIFT 22
+#define BACKGROUND_COLOR_MASK 0xc00000
static inline css_error set_background_color(css_computed_style *style, uint8_t
type, css_color color)
@@ -114,8 +114,8 @@ static inline css_error set_background_color(css_computed_style *style, uint8_t
#undef BACKGROUND_COLOR_MASK
#define BACKGROUND_IMAGE_INDEX 14
-#define BACKGROUND_IMAGE_SHIFT 28
-#define BACKGROUND_IMAGE_MASK 0x10000000
+#define BACKGROUND_IMAGE_SHIFT 23
+#define BACKGROUND_IMAGE_MASK 0x800000
static inline css_error set_background_image(css_computed_style *style, uint8_t
type, lwc_string *string)
@@ -173,8 +173,8 @@ static inline css_error set_background_position(css_computed_style *style,
#undef BACKGROUND_POSITION_MASK
#define BACKGROUND_REPEAT_INDEX 13
-#define BACKGROUND_REPEAT_SHIFT 1
-#define BACKGROUND_REPEAT_MASK 0xe
+#define BACKGROUND_REPEAT_SHIFT 22
+#define BACKGROUND_REPEAT_MASK 0x1c00000
static inline css_error set_background_repeat(css_computed_style *style,
uint8_t type)
@@ -193,9 +193,9 @@ static inline css_error set_background_repeat(css_computed_style *style,
#undef BACKGROUND_REPEAT_SHIFT
#undef BACKGROUND_REPEAT_MASK
-#define BORDER_BOTTOM_COLOR_INDEX 11
-#define BORDER_BOTTOM_COLOR_SHIFT 28
-#define BORDER_BOTTOM_COLOR_MASK 0x30000000
+#define BORDER_BOTTOM_COLOR_INDEX 10
+#define BORDER_BOTTOM_COLOR_SHIFT 18
+#define BORDER_BOTTOM_COLOR_MASK 0xc0000
static inline css_error set_border_bottom_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -216,9 +216,9 @@ static inline css_error set_border_bottom_color(css_computed_style *style,
#undef BORDER_BOTTOM_COLOR_SHIFT
#undef BORDER_BOTTOM_COLOR_MASK
-#define BORDER_BOTTOM_STYLE_INDEX 13
-#define BORDER_BOTTOM_STYLE_SHIFT 8
-#define BORDER_BOTTOM_STYLE_MASK 0xf00
+#define BORDER_BOTTOM_STYLE_INDEX 6
+#define BORDER_BOTTOM_STYLE_SHIFT 0
+#define BORDER_BOTTOM_STYLE_MASK 0xf
static inline css_error set_border_bottom_style(css_computed_style *style,
uint8_t type)
@@ -238,8 +238,8 @@ static inline css_error set_border_bottom_style(css_computed_style *style,
#undef BORDER_BOTTOM_STYLE_MASK
#define BORDER_BOTTOM_WIDTH_INDEX 0
-#define BORDER_BOTTOM_WIDTH_SHIFT 0
-#define BORDER_BOTTOM_WIDTH_MASK 0xff
+#define BORDER_BOTTOM_WIDTH_SHIFT 8
+#define BORDER_BOTTOM_WIDTH_MASK 0xff00
static inline css_error set_border_bottom_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -261,8 +261,8 @@ static inline css_error set_border_bottom_width(css_computed_style *style,
#undef BORDER_BOTTOM_WIDTH_MASK
#define BORDER_COLLAPSE_INDEX 11
-#define BORDER_COLLAPSE_SHIFT 16
-#define BORDER_COLLAPSE_MASK 0x30000
+#define BORDER_COLLAPSE_SHIFT 14
+#define BORDER_COLLAPSE_MASK 0xc000
static inline css_error set_border_collapse(css_computed_style *style, uint8_t
type)
@@ -282,8 +282,8 @@ static inline css_error set_border_collapse(css_computed_style *style, uint8_t
#undef BORDER_COLLAPSE_MASK
#define BORDER_LEFT_COLOR_INDEX 10
-#define BORDER_LEFT_COLOR_SHIFT 0
-#define BORDER_LEFT_COLOR_MASK 0x3
+#define BORDER_LEFT_COLOR_SHIFT 2
+#define BORDER_LEFT_COLOR_MASK 0xc
static inline css_error set_border_left_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -304,9 +304,9 @@ static inline css_error set_border_left_color(css_computed_style *style,
#undef BORDER_LEFT_COLOR_SHIFT
#undef BORDER_LEFT_COLOR_MASK
-#define BORDER_LEFT_STYLE_INDEX 13
-#define BORDER_LEFT_STYLE_SHIFT 12
-#define BORDER_LEFT_STYLE_MASK 0xf000
+#define BORDER_LEFT_STYLE_INDEX 9
+#define BORDER_LEFT_STYLE_SHIFT 19
+#define BORDER_LEFT_STYLE_MASK 0x780000
static inline css_error set_border_left_style(css_computed_style *style,
uint8_t type)
@@ -326,8 +326,8 @@ static inline css_error set_border_left_style(css_computed_style *style,
#undef BORDER_LEFT_STYLE_MASK
#define BORDER_LEFT_WIDTH_INDEX 0
-#define BORDER_LEFT_WIDTH_SHIFT 8
-#define BORDER_LEFT_WIDTH_MASK 0xff00
+#define BORDER_LEFT_WIDTH_SHIFT 24
+#define BORDER_LEFT_WIDTH_MASK 0xff000000
static inline css_error set_border_left_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -349,8 +349,8 @@ static inline css_error set_border_left_width(css_computed_style *style,
#undef BORDER_LEFT_WIDTH_MASK
#define BORDER_RIGHT_COLOR_INDEX 11
-#define BORDER_RIGHT_COLOR_SHIFT 8
-#define BORDER_RIGHT_COLOR_MASK 0x300
+#define BORDER_RIGHT_COLOR_SHIFT 12
+#define BORDER_RIGHT_COLOR_MASK 0x3000
static inline css_error set_border_right_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -371,9 +371,9 @@ static inline css_error set_border_right_color(css_computed_style *style,
#undef BORDER_RIGHT_COLOR_SHIFT
#undef BORDER_RIGHT_COLOR_MASK
-#define BORDER_RIGHT_STYLE_INDEX 8
-#define BORDER_RIGHT_STYLE_SHIFT 0
-#define BORDER_RIGHT_STYLE_MASK 0xf
+#define BORDER_RIGHT_STYLE_INDEX 13
+#define BORDER_RIGHT_STYLE_SHIFT 28
+#define BORDER_RIGHT_STYLE_MASK 0xf0000000
static inline css_error set_border_right_style(css_computed_style *style,
uint8_t type)
@@ -392,9 +392,9 @@ static inline css_error set_border_right_style(css_computed_style *style,
#undef BORDER_RIGHT_STYLE_SHIFT
#undef BORDER_RIGHT_STYLE_MASK
-#define BORDER_RIGHT_WIDTH_INDEX 1
-#define BORDER_RIGHT_WIDTH_SHIFT 7
-#define BORDER_RIGHT_WIDTH_MASK 0x7f80
+#define BORDER_RIGHT_WIDTH_INDEX 0
+#define BORDER_RIGHT_WIDTH_SHIFT 0
+#define BORDER_RIGHT_WIDTH_MASK 0xff
static inline css_error set_border_right_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -442,8 +442,8 @@ static inline css_error set_border_spacing(css_computed_style *style, uint8_t
#undef BORDER_SPACING_MASK
#define BORDER_TOP_COLOR_INDEX 11
-#define BORDER_TOP_COLOR_SHIFT 26
-#define BORDER_TOP_COLOR_MASK 0xc000000
+#define BORDER_TOP_COLOR_SHIFT 16
+#define BORDER_TOP_COLOR_MASK 0x30000
static inline css_error set_border_top_color(css_computed_style *style, uint8_t
type, css_color color)
@@ -464,7 +464,7 @@ static inline css_error set_border_top_color(css_computed_style *style, uint8_t
#undef BORDER_TOP_COLOR_SHIFT
#undef BORDER_TOP_COLOR_MASK
-#define BORDER_TOP_STYLE_INDEX 6
+#define BORDER_TOP_STYLE_INDEX 7
#define BORDER_TOP_STYLE_SHIFT 0
#define BORDER_TOP_STYLE_MASK 0xf
@@ -485,9 +485,9 @@ static inline css_error set_border_top_style(css_computed_style *style, uint8_t
#undef BORDER_TOP_STYLE_SHIFT
#undef BORDER_TOP_STYLE_MASK
-#define BORDER_TOP_WIDTH_INDEX 1
-#define BORDER_TOP_WIDTH_SHIFT 15
-#define BORDER_TOP_WIDTH_MASK 0x7f8000
+#define BORDER_TOP_WIDTH_INDEX 0
+#define BORDER_TOP_WIDTH_SHIFT 16
+#define BORDER_TOP_WIDTH_MASK 0xff0000
static inline css_error set_border_top_width(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -509,8 +509,8 @@ static inline css_error set_border_top_width(css_computed_style *style, uint8_t
#undef BORDER_TOP_WIDTH_MASK
#define BOTTOM_INDEX 7
-#define BOTTOM_SHIFT 18
-#define BOTTOM_MASK 0x1fc0000
+#define BOTTOM_SHIFT 11
+#define BOTTOM_MASK 0x3f800
static inline css_error set_bottom(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -532,8 +532,8 @@ static inline css_error set_bottom(css_computed_style *style, uint8_t type,
#undef BOTTOM_MASK
#define BOX_SIZING_INDEX 10
-#define BOX_SIZING_SHIFT 18
-#define BOX_SIZING_MASK 0xc0000
+#define BOX_SIZING_SHIFT 12
+#define BOX_SIZING_MASK 0x3000
static inline css_error set_box_sizing(css_computed_style *style, uint8_t type)
{
@@ -551,9 +551,9 @@ static inline css_error set_box_sizing(css_computed_style *style, uint8_t type)
#undef BOX_SIZING_SHIFT
#undef BOX_SIZING_MASK
-#define BREAK_AFTER_INDEX 13
-#define BREAK_AFTER_SHIFT 28
-#define BREAK_AFTER_MASK 0xf0000000
+#define BREAK_AFTER_INDEX 9
+#define BREAK_AFTER_SHIFT 11
+#define BREAK_AFTER_MASK 0x7800
static inline css_error set_break_after(css_computed_style *style, uint8_t type)
{
@@ -571,9 +571,9 @@ static inline css_error set_break_after(css_computed_style *style, uint8_t type)
#undef BREAK_AFTER_SHIFT
#undef BREAK_AFTER_MASK
-#define BREAK_BEFORE_INDEX 13
-#define BREAK_BEFORE_SHIFT 24
-#define BREAK_BEFORE_MASK 0xf000000
+#define BREAK_BEFORE_INDEX 9
+#define BREAK_BEFORE_SHIFT 23
+#define BREAK_BEFORE_MASK 0x7800000
static inline css_error set_break_before(css_computed_style *style, uint8_t
type)
@@ -592,9 +592,9 @@ static inline css_error set_break_before(css_computed_style *style, uint8_t
#undef BREAK_BEFORE_SHIFT
#undef BREAK_BEFORE_MASK
-#define BREAK_INSIDE_INDEX 13
-#define BREAK_INSIDE_SHIFT 4
-#define BREAK_INSIDE_MASK 0xf0
+#define BREAK_INSIDE_INDEX 5
+#define BREAK_INSIDE_SHIFT 0
+#define BREAK_INSIDE_MASK 0xf
static inline css_error set_break_inside(css_computed_style *style, uint8_t
type)
@@ -614,8 +614,8 @@ static inline css_error set_break_inside(css_computed_style *style, uint8_t
#undef BREAK_INSIDE_MASK
#define CAPTION_SIDE_INDEX 11
-#define CAPTION_SIDE_SHIFT 24
-#define CAPTION_SIDE_MASK 0x3000000
+#define CAPTION_SIDE_SHIFT 4
+#define CAPTION_SIDE_MASK 0x30
static inline css_error set_caption_side(css_computed_style *style, uint8_t
type)
@@ -634,9 +634,9 @@ static inline css_error set_caption_side(css_computed_style *style, uint8_t
#undef CAPTION_SIDE_SHIFT
#undef CAPTION_SIDE_MASK
-#define CLEAR_INDEX 10
-#define CLEAR_SHIFT 23
-#define CLEAR_MASK 0x3800000
+#define CLEAR_INDEX 13
+#define CLEAR_SHIFT 10
+#define CLEAR_MASK 0x1c00
static inline css_error set_clear(css_computed_style *style, uint8_t type)
{
@@ -696,9 +696,9 @@ static inline css_error set_clip(
#undef CLIP_SHIFT
#undef CLIP_MASK
-#define COLOR_INDEX 12
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
+#define COLOR_INDEX 14
+#define COLOR_SHIFT 18
+#define COLOR_MASK 0x40000
static inline css_error set_color(css_computed_style *style, uint8_t type,
css_color color)
@@ -718,9 +718,9 @@ static inline css_error set_color(css_computed_style *style, uint8_t type,
#undef COLOR_SHIFT
#undef COLOR_MASK
-#define COLUMN_COUNT_INDEX 11
-#define COLUMN_COUNT_SHIFT 20
-#define COLUMN_COUNT_MASK 0x300000
+#define COLUMN_COUNT_INDEX 10
+#define COLUMN_COUNT_SHIFT 0
+#define COLUMN_COUNT_MASK 0x3
static inline css_error set_column_count(css_computed_style *style, uint8_t
type, int32_t integer)
@@ -742,8 +742,8 @@ static inline css_error set_column_count(css_computed_style *style, uint8_t
#undef COLUMN_COUNT_MASK
#define COLUMN_FILL_INDEX 11
-#define COLUMN_FILL_SHIFT 10
-#define COLUMN_FILL_MASK 0xc00
+#define COLUMN_FILL_SHIFT 8
+#define COLUMN_FILL_MASK 0x300
static inline css_error set_column_fill(css_computed_style *style, uint8_t type)
{
@@ -785,8 +785,8 @@ static inline css_error set_column_gap(css_computed_style *style, uint8_t type,
#undef COLUMN_GAP_MASK
#define COLUMN_RULE_COLOR_INDEX 10
-#define COLUMN_RULE_COLOR_SHIFT 10
-#define COLUMN_RULE_COLOR_MASK 0xc00
+#define COLUMN_RULE_COLOR_SHIFT 16
+#define COLUMN_RULE_COLOR_MASK 0x30000
static inline css_error set_column_rule_color(css_computed_style *style,
uint8_t type, css_color color)
@@ -807,9 +807,9 @@ static inline css_error set_column_rule_color(css_computed_style *style,
#undef COLUMN_RULE_COLOR_SHIFT
#undef COLUMN_RULE_COLOR_MASK
-#define COLUMN_RULE_STYLE_INDEX 7
-#define COLUMN_RULE_STYLE_SHIFT 0
-#define COLUMN_RULE_STYLE_MASK 0xf
+#define COLUMN_RULE_STYLE_INDEX 9
+#define COLUMN_RULE_STYLE_SHIFT 3
+#define COLUMN_RULE_STYLE_MASK 0x78
static inline css_error set_column_rule_style(css_computed_style *style,
uint8_t type)
@@ -828,9 +828,9 @@ static inline css_error set_column_rule_style(css_computed_style *style,
#undef COLUMN_RULE_STYLE_SHIFT
#undef COLUMN_RULE_STYLE_MASK
-#define COLUMN_RULE_WIDTH_INDEX 0
-#define COLUMN_RULE_WIDTH_SHIFT 24
-#define COLUMN_RULE_WIDTH_MASK 0xff000000
+#define COLUMN_RULE_WIDTH_INDEX 1
+#define COLUMN_RULE_WIDTH_SHIFT 7
+#define COLUMN_RULE_WIDTH_MASK 0x7f80
static inline css_error set_column_rule_width(css_computed_style *style,
uint8_t type, css_fixed length, css_unit unit)
@@ -852,8 +852,8 @@ static inline css_error set_column_rule_width(css_computed_style *style,
#undef COLUMN_RULE_WIDTH_MASK
#define COLUMN_SPAN_INDEX 10
-#define COLUMN_SPAN_SHIFT 6
-#define COLUMN_SPAN_MASK 0xc0
+#define COLUMN_SPAN_SHIFT 10
+#define COLUMN_SPAN_MASK 0xc00
static inline css_error set_column_span(css_computed_style *style, uint8_t type)
{
@@ -872,8 +872,8 @@ static inline css_error set_column_span(css_computed_style *style, uint8_t type)
#undef COLUMN_SPAN_MASK
#define COLUMN_WIDTH_INDEX 5
-#define COLUMN_WIDTH_SHIFT 4
-#define COLUMN_WIDTH_MASK 0x7f0
+#define COLUMN_WIDTH_SHIFT 25
+#define COLUMN_WIDTH_MASK 0xfe000000
static inline css_error set_column_width(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -895,8 +895,8 @@ static inline css_error set_column_width(css_computed_style *style, uint8_t
#undef COLUMN_WIDTH_MASK
#define CONTENT_INDEX 11
-#define CONTENT_SHIFT 0
-#define CONTENT_MASK 0x3
+#define CONTENT_SHIFT 18
+#define CONTENT_MASK 0xc0000
static inline css_error set_content(
css_computed_style *style, uint8_t type,
css_computed_content_item *content)
@@ -978,8 +978,8 @@ static inline css_error set_content(
#undef CONTENT_MASK
#define COUNTER_INCREMENT_INDEX 14
-#define COUNTER_INCREMENT_SHIFT 29
-#define COUNTER_INCREMENT_MASK 0x20000000
+#define COUNTER_INCREMENT_SHIFT 20
+#define COUNTER_INCREMENT_MASK 0x100000
static inline css_error set_counter_increment(css_computed_style *style,
uint8_t type, css_computed_counter *counter_arr)
@@ -1016,8 +1016,8 @@ static inline css_error set_counter_increment(css_computed_style *style,
#undef COUNTER_INCREMENT_MASK
#define COUNTER_RESET_INDEX 14
-#define COUNTER_RESET_SHIFT 21
-#define COUNTER_RESET_MASK 0x200000
+#define COUNTER_RESET_SHIFT 25
+#define COUNTER_RESET_MASK 0x2000000
static inline css_error set_counter_reset(css_computed_style *style, uint8_t
type, css_computed_counter *counter_arr)
@@ -1053,9 +1053,9 @@ static inline css_error set_counter_reset(css_computed_style *style, uint8_t
#undef COUNTER_RESET_SHIFT
#undef COUNTER_RESET_MASK
-#define CURSOR_INDEX 8
-#define CURSOR_SHIFT 4
-#define CURSOR_MASK 0x1f0
+#define CURSOR_INDEX 9
+#define CURSOR_SHIFT 27
+#define CURSOR_MASK 0xf8000000
static inline css_error set_cursor(css_computed_style *style, uint8_t type,
lwc_string **string_arr)
@@ -1091,9 +1091,9 @@ static inline css_error set_cursor(css_computed_style *style, uint8_t type,
#undef CURSOR_SHIFT
#undef CURSOR_MASK
-#define DIRECTION_INDEX 10
-#define DIRECTION_SHIFT 16
-#define DIRECTION_MASK 0x30000
+#define DIRECTION_INDEX 14
+#define DIRECTION_SHIFT 28
+#define DIRECTION_MASK 0x30000000
static inline css_error set_direction(css_computed_style *style, uint8_t type)
{
@@ -1132,8 +1132,8 @@ static inline css_error set_display(css_computed_style *style, uint8_t type)
#undef DISPLAY_MASK
#define EMPTY_CELLS_INDEX 10
-#define EMPTY_CELLS_SHIFT 14
-#define EMPTY_CELLS_MASK 0xc000
+#define EMPTY_CELLS_SHIFT 4
+#define EMPTY_CELLS_MASK 0x30
static inline css_error set_empty_cells(css_computed_style *style, uint8_t type)
{
@@ -1152,8 +1152,8 @@ static inline css_error set_empty_cells(css_computed_style *style, uint8_t type)
#undef EMPTY_CELLS_MASK
#define FLEX_BASIS_INDEX 4
-#define FLEX_BASIS_SHIFT 18
-#define FLEX_BASIS_MASK 0x1fc0000
+#define FLEX_BASIS_SHIFT 25
+#define FLEX_BASIS_MASK 0xfe000000
static inline css_error set_flex_basis(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1174,9 +1174,9 @@ static inline css_error set_flex_basis(css_computed_style *style, uint8_t type,
#undef FLEX_BASIS_SHIFT
#undef FLEX_BASIS_MASK
-#define FLEX_DIRECTION_INDEX 9
-#define FLEX_DIRECTION_SHIFT 5
-#define FLEX_DIRECTION_MASK 0xe0
+#define FLEX_DIRECTION_INDEX 13
+#define FLEX_DIRECTION_SHIFT 1
+#define FLEX_DIRECTION_MASK 0xe
static inline css_error set_flex_direction(css_computed_style *style, uint8_t
type)
@@ -1195,9 +1195,9 @@ static inline css_error set_flex_direction(css_computed_style *style, uint8_t
#undef FLEX_DIRECTION_SHIFT
#undef FLEX_DIRECTION_MASK
-#define FLEX_GROW_INDEX 14
-#define FLEX_GROW_SHIFT 23
-#define FLEX_GROW_MASK 0x800000
+#define FLEX_GROW_INDEX 12
+#define FLEX_GROW_SHIFT 0
+#define FLEX_GROW_MASK 0x1
static inline css_error set_flex_grow(css_computed_style *style, uint8_t type,
css_fixed fixed)
@@ -1219,8 +1219,8 @@ static inline css_error set_flex_grow(css_computed_style *style, uint8_t type,
#undef FLEX_GROW_MASK
#define FLEX_SHRINK_INDEX 14
-#define FLEX_SHRINK_SHIFT 20
-#define FLEX_SHRINK_MASK 0x100000
+#define FLEX_SHRINK_SHIFT 22
+#define FLEX_SHRINK_MASK 0x400000
static inline css_error set_flex_shrink(css_computed_style *style, uint8_t
type, css_fixed fixed)
@@ -1242,8 +1242,8 @@ static inline css_error set_flex_shrink(css_computed_style *style, uint8_t
#undef FLEX_SHRINK_MASK
#define FLEX_WRAP_INDEX 10
-#define FLEX_WRAP_SHIFT 12
-#define FLEX_WRAP_MASK 0x3000
+#define FLEX_WRAP_SHIFT 6
+#define FLEX_WRAP_MASK 0xc0
static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type)
{
@@ -1262,8 +1262,8 @@ static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type)
#undef FLEX_WRAP_MASK
#define FLOAT_INDEX 11
-#define FLOAT_SHIFT 6
-#define FLOAT_MASK 0xc0
+#define FLOAT_SHIFT 30
+#define FLOAT_MASK 0xc0000000
static inline css_error set_float(css_computed_style *style, uint8_t type)
{
@@ -1281,8 +1281,8 @@ static inline css_error set_float(css_computed_style *style, uint8_t type)
#undef FLOAT_MASK
#define FONT_FAMILY_INDEX 9
-#define FONT_FAMILY_SHIFT 26
-#define FONT_FAMILY_MASK 0x1c000000
+#define FONT_FAMILY_SHIFT 0
+#define FONT_FAMILY_MASK 0x7
static inline css_error set_font_family(css_computed_style *style, uint8_t
type, lwc_string **string_arr)
@@ -1342,8 +1342,8 @@ static inline css_error set_font_size(css_computed_style *style, uint8_t type,
#undef FONT_SIZE_MASK
#define FONT_STYLE_INDEX 11
-#define FONT_STYLE_SHIFT 30
-#define FONT_STYLE_MASK 0xc0000000
+#define FONT_STYLE_SHIFT 20
+#define FONT_STYLE_MASK 0x300000
static inline css_error set_font_style(css_computed_style *style, uint8_t type)
{
@@ -1362,8 +1362,8 @@ static inline css_error set_font_style(css_computed_style *style, uint8_t type)
#undef FONT_STYLE_MASK
#define FONT_VARIANT_INDEX 11
-#define FONT_VARIANT_SHIFT 22
-#define FONT_VARIANT_MASK 0xc00000
+#define FONT_VARIANT_SHIFT 28
+#define FONT_VARIANT_MASK 0x30000000
static inline css_error set_font_variant(css_computed_style *style, uint8_t
type)
@@ -1382,9 +1382,9 @@ static inline css_error set_font_variant(css_computed_style *style, uint8_t
#undef FONT_VARIANT_SHIFT
#undef FONT_VARIANT_MASK
-#define FONT_WEIGHT_INDEX 4
-#define FONT_WEIGHT_SHIFT 0
-#define FONT_WEIGHT_MASK 0xf
+#define FONT_WEIGHT_INDEX 9
+#define FONT_WEIGHT_SHIFT 15
+#define FONT_WEIGHT_MASK 0x78000
static inline css_error set_font_weight(css_computed_style *style, uint8_t type)
{
@@ -1402,9 +1402,9 @@ static inline css_error set_font_weight(css_computed_style *style, uint8_t type)
#undef FONT_WEIGHT_SHIFT
#undef FONT_WEIGHT_MASK
-#define HEIGHT_INDEX 5
-#define HEIGHT_SHIFT 18
-#define HEIGHT_MASK 0x1fc0000
+#define HEIGHT_INDEX 6
+#define HEIGHT_SHIFT 25
+#define HEIGHT_MASK 0xfe000000
static inline css_error set_height(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1425,9 +1425,9 @@ static inline css_error set_height(css_computed_style *style, uint8_t type,
#undef HEIGHT_SHIFT
#undef HEIGHT_MASK
-#define JUSTIFY_CONTENT_INDEX 10
-#define JUSTIFY_CONTENT_SHIFT 29
-#define JUSTIFY_CONTENT_MASK 0xe0000000
+#define JUSTIFY_CONTENT_INDEX 13
+#define JUSTIFY_CONTENT_SHIFT 4
+#define JUSTIFY_CONTENT_MASK 0x70
static inline css_error set_justify_content(css_computed_style *style, uint8_t
type)
@@ -1469,9 +1469,9 @@ static inline css_error set_left(css_computed_style *style, uint8_t type,
#undef LEFT_SHIFT
#undef LEFT_MASK
-#define LETTER_SPACING_INDEX 1
-#define LETTER_SPACING_SHIFT 0
-#define LETTER_SPACING_MASK 0x7f
+#define LETTER_SPACING_INDEX 6
+#define LETTER_SPACING_SHIFT 18
+#define LETTER_SPACING_MASK 0x1fc0000
static inline css_error set_letter_spacing(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1515,9 +1515,9 @@ static inline css_error set_line_height(css_computed_style *style, uint8_t
#undef LINE_HEIGHT_SHIFT
#undef LINE_HEIGHT_MASK
-#define LIST_STYLE_IMAGE_INDEX 13
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
+#define LIST_STYLE_IMAGE_INDEX 14
+#define LIST_STYLE_IMAGE_SHIFT 27
+#define LIST_STYLE_IMAGE_MASK 0x8000000
static inline css_error set_list_style_image(css_computed_style *style, uint8_t
type, lwc_string *string)
@@ -1547,9 +1547,9 @@ static inline css_error set_list_style_image(css_computed_style *style, uint8_t
#undef LIST_STYLE_IMAGE_SHIFT
#undef LIST_STYLE_IMAGE_MASK
-#define LIST_STYLE_POSITION_INDEX 14
-#define LIST_STYLE_POSITION_SHIFT 30
-#define LIST_STYLE_POSITION_MASK 0xc0000000
+#define LIST_STYLE_POSITION_INDEX 11
+#define LIST_STYLE_POSITION_SHIFT 6
+#define LIST_STYLE_POSITION_MASK 0xc0
static inline css_error set_list_style_position(css_computed_style *style,
uint8_t type)
@@ -1568,9 +1568,9 @@ static inline css_error set_list_style_position(css_computed_style *style,
#undef LIST_STYLE_POSITION_SHIFT
#undef LIST_STYLE_POSITION_MASK
-#define LIST_STYLE_TYPE_INDEX 13
-#define LIST_STYLE_TYPE_SHIFT 20
-#define LIST_STYLE_TYPE_MASK 0xf00000
+#define LIST_STYLE_TYPE_INDEX 8
+#define LIST_STYLE_TYPE_SHIFT 26
+#define LIST_STYLE_TYPE_MASK 0xfc000000
static inline css_error set_list_style_type(css_computed_style *style, uint8_t
type)
@@ -1579,8 +1579,8 @@ static inline css_error set_list_style_type(css_computed_style *style, uint8_t
bits = &style->i.bits[LIST_STYLE_TYPE_INDEX];
- /* 4bits: tttt : type */
- *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | (((uint32_t)type & 0xf) <<
+ /* 6bits: tttttt : type */
+ *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | (((uint32_t)type & 0x3f) <<
LIST_STYLE_TYPE_SHIFT);
return CSS_OK;
@@ -1589,7 +1589,7 @@ static inline css_error set_list_style_type(css_computed_style *style, uint8_t
#undef LIST_STYLE_TYPE_SHIFT
#undef LIST_STYLE_TYPE_MASK
-#define MARGIN_BOTTOM_INDEX 3
+#define MARGIN_BOTTOM_INDEX 5
#define MARGIN_BOTTOM_SHIFT 18
#define MARGIN_BOTTOM_MASK 0x1fc0000
@@ -1612,9 +1612,9 @@ static inline css_error set_margin_bottom(css_computed_style *style, uint8_t
#undef MARGIN_BOTTOM_SHIFT
#undef MARGIN_BOTTOM_MASK
-#define MARGIN_LEFT_INDEX 3
-#define MARGIN_LEFT_SHIFT 11
-#define MARGIN_LEFT_MASK 0x3f800
+#define MARGIN_LEFT_INDEX 7
+#define MARGIN_LEFT_SHIFT 18
+#define MARGIN_LEFT_MASK 0x1fc0000
static inline css_error set_margin_left(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1658,9 +1658,9 @@ static inline css_error set_margin_right(css_computed_style *style, uint8_t
#undef MARGIN_RIGHT_SHIFT
#undef MARGIN_RIGHT_MASK
-#define MARGIN_TOP_INDEX 7
-#define MARGIN_TOP_SHIFT 4
-#define MARGIN_TOP_MASK 0x7f0
+#define MARGIN_TOP_INDEX 1
+#define MARGIN_TOP_SHIFT 0
+#define MARGIN_TOP_MASK 0x7f
static inline css_error set_margin_top(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1681,9 +1681,9 @@ static inline css_error set_margin_top(css_computed_style *style, uint8_t type,
#undef MARGIN_TOP_SHIFT
#undef MARGIN_TOP_MASK
-#define MAX_HEIGHT_INDEX 6
-#define MAX_HEIGHT_SHIFT 18
-#define MAX_HEIGHT_MASK 0x1fc0000
+#define MAX_HEIGHT_INDEX 3
+#define MAX_HEIGHT_SHIFT 25
+#define MAX_HEIGHT_MASK 0xfe000000
static inline css_error set_max_height(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1704,9 +1704,9 @@ static inline css_error set_max_height(css_computed_style *style, uint8_t type,
#undef MAX_HEIGHT_SHIFT
#undef MAX_HEIGHT_MASK
-#define MAX_WIDTH_INDEX 3
-#define MAX_WIDTH_SHIFT 25
-#define MAX_WIDTH_MASK 0xfe000000
+#define MAX_WIDTH_INDEX 7
+#define MAX_WIDTH_SHIFT 4
+#define MAX_WIDTH_MASK 0x7f0
static inline css_error set_max_width(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1727,9 +1727,9 @@ static inline css_error set_max_width(css_computed_style *style, uint8_t type,
#undef MAX_WIDTH_SHIFT
#undef MAX_WIDTH_MASK
-#define MIN_HEIGHT_INDEX 7
-#define MIN_HEIGHT_SHIFT 11
-#define MIN_HEIGHT_MASK 0x3f800
+#define MIN_HEIGHT_INDEX 4
+#define MIN_HEIGHT_SHIFT 18
+#define MIN_HEIGHT_MASK 0x1fc0000
static inline css_error set_min_height(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -1774,8 +1774,8 @@ static inline css_error set_min_width(css_computed_style *style, uint8_t type,
#undef MIN_WIDTH_MASK
#define OPACITY_INDEX 14
-#define OPACITY_SHIFT 25
-#define OPACITY_MASK 0x2000000
+#define OPACITY_SHIFT 19
+#define OPACITY_MASK 0x80000
static inline css_error set_opacity(css_computed_style *style, uint8_t type,
css_fixed fixed)
@@ -1796,9 +1796,9 @@ static inline css_error set_opacity(css_computed_style *style, uint8_t type,
#undef OPACITY_SHIFT
#undef OPACITY_MASK
-#define ORDER_INDEX 14
-#define ORDER_SHIFT 26
-#define ORDER_MASK 0x4000000
+#define ORDER_INDEX 13
+#define ORDER_SHIFT 0
+#define ORDER_MASK 0x1
static inline css_error set_order(css_computed_style *style, uint8_t type,
int32_t integer)
@@ -1819,8 +1819,8 @@ static inline css_error set_order(css_computed_style *style, uint8_t type,
#undef ORDER_MASK
#define ORPHANS_INDEX 14
-#define ORPHANS_SHIFT 22
-#define ORPHANS_MASK 0x400000
+#define ORPHANS_SHIFT 24
+#define ORPHANS_MASK 0x1000000
static inline css_error set_orphans(css_computed_style *style, uint8_t type,
int32_t integer)
@@ -1842,8 +1842,8 @@ static inline css_error set_orphans(css_computed_style *style, uint8_t type,
#undef ORPHANS_MASK
#define OUTLINE_COLOR_INDEX 11
-#define OUTLINE_COLOR_SHIFT 12
-#define OUTLINE_COLOR_MASK 0x3000
+#define OUTLINE_COLOR_SHIFT 10
+#define OUTLINE_COLOR_MASK 0xc00
static inline css_error set_outline_color(css_computed_style *style, uint8_t
type, css_color color)
@@ -1864,9 +1864,9 @@ static inline css_error set_outline_color(css_computed_style *style, uint8_t
#undef OUTLINE_COLOR_SHIFT
#undef OUTLINE_COLOR_MASK
-#define OUTLINE_STYLE_INDEX 5
-#define OUTLINE_STYLE_SHIFT 0
-#define OUTLINE_STYLE_MASK 0xf
+#define OUTLINE_STYLE_INDEX 9
+#define OUTLINE_STYLE_SHIFT 7
+#define OUTLINE_STYLE_MASK 0x780
static inline css_error set_outline_style(css_computed_style *style, uint8_t
type)
@@ -1885,9 +1885,9 @@ static inline css_error set_outline_style(css_computed_style *style, uint8_t
#undef OUTLINE_STYLE_SHIFT
#undef OUTLINE_STYLE_MASK
-#define OUTLINE_WIDTH_INDEX 0
-#define OUTLINE_WIDTH_SHIFT 16
-#define OUTLINE_WIDTH_MASK 0xff0000
+#define OUTLINE_WIDTH_INDEX 1
+#define OUTLINE_WIDTH_SHIFT 15
+#define OUTLINE_WIDTH_MASK 0x7f8000
static inline css_error set_outline_width(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1908,9 +1908,9 @@ static inline css_error set_outline_width(css_computed_style *style, uint8_t
#undef OUTLINE_WIDTH_SHIFT
#undef OUTLINE_WIDTH_MASK
-#define OVERFLOW_X_INDEX 9
-#define OVERFLOW_X_SHIFT 14
-#define OVERFLOW_X_MASK 0x1c000
+#define OVERFLOW_X_INDEX 13
+#define OVERFLOW_X_SHIFT 16
+#define OVERFLOW_X_MASK 0x70000
static inline css_error set_overflow_x(css_computed_style *style, uint8_t type)
{
@@ -1928,9 +1928,9 @@ static inline css_error set_overflow_x(css_computed_style *style, uint8_t type)
#undef OVERFLOW_X_SHIFT
#undef OVERFLOW_X_MASK
-#define OVERFLOW_Y_INDEX 9
-#define OVERFLOW_Y_SHIFT 11
-#define OVERFLOW_Y_MASK 0x3800
+#define OVERFLOW_Y_INDEX 13
+#define OVERFLOW_Y_SHIFT 25
+#define OVERFLOW_Y_MASK 0xe000000
static inline css_error set_overflow_y(css_computed_style *style, uint8_t type)
{
@@ -1949,8 +1949,8 @@ static inline css_error set_overflow_y(css_computed_style *style, uint8_t type)
#undef OVERFLOW_Y_MASK
#define PADDING_BOTTOM_INDEX 8
-#define PADDING_BOTTOM_SHIFT 14
-#define PADDING_BOTTOM_MASK 0xfc000
+#define PADDING_BOTTOM_SHIFT 8
+#define PADDING_BOTTOM_MASK 0x3f00
static inline css_error set_padding_bottom(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1971,9 +1971,9 @@ static inline css_error set_padding_bottom(css_computed_style *style, uint8_t
#undef PADDING_BOTTOM_SHIFT
#undef PADDING_BOTTOM_MASK
-#define PADDING_LEFT_INDEX 8
-#define PADDING_LEFT_SHIFT 26
-#define PADDING_LEFT_MASK 0xfc000000
+#define PADDING_LEFT_INDEX 2
+#define PADDING_LEFT_SHIFT 0
+#define PADDING_LEFT_MASK 0x3f
static inline css_error set_padding_left(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -1995,8 +1995,8 @@ static inline css_error set_padding_left(css_computed_style *style, uint8_t
#undef PADDING_LEFT_MASK
#define PADDING_RIGHT_INDEX 8
-#define PADDING_RIGHT_SHIFT 20
-#define PADDING_RIGHT_MASK 0x3f00000
+#define PADDING_RIGHT_SHIFT 14
+#define PADDING_RIGHT_MASK 0xfc000
static inline css_error set_padding_right(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -2017,9 +2017,9 @@ static inline css_error set_padding_right(css_computed_style *style, uint8_t
#undef PADDING_RIGHT_SHIFT
#undef PADDING_RIGHT_MASK
-#define PADDING_TOP_INDEX 2
-#define PADDING_TOP_SHIFT 0
-#define PADDING_TOP_MASK 0x3f
+#define PADDING_TOP_INDEX 8
+#define PADDING_TOP_SHIFT 20
+#define PADDING_TOP_MASK 0x3f00000
static inline css_error set_padding_top(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -2040,9 +2040,9 @@ static inline css_error set_padding_top(css_computed_style *style, uint8_t
#undef PADDING_TOP_SHIFT
#undef PADDING_TOP_MASK
-#define PAGE_BREAK_AFTER_INDEX 9
-#define PAGE_BREAK_AFTER_SHIFT 2
-#define PAGE_BREAK_AFTER_MASK 0x1c
+#define PAGE_BREAK_AFTER_INDEX 8
+#define PAGE_BREAK_AFTER_SHIFT 0
+#define PAGE_BREAK_AFTER_MASK 0x7
static inline css_error set_page_break_after(css_computed_style *style, uint8_t
type)
@@ -2061,9 +2061,9 @@ static inline css_error set_page_break_after(css_computed_style *style, uint8_t
#undef PAGE_BREAK_AFTER_SHIFT
#undef PAGE_BREAK_AFTER_MASK
-#define PAGE_BREAK_BEFORE_INDEX 9
-#define PAGE_BREAK_BEFORE_SHIFT 23
-#define PAGE_BREAK_BEFORE_MASK 0x3800000
+#define PAGE_BREAK_BEFORE_INDEX 13
+#define PAGE_BREAK_BEFORE_SHIFT 7
+#define PAGE_BREAK_BEFORE_MASK 0x380
static inline css_error set_page_break_before(css_computed_style *style,
uint8_t type)
@@ -2082,9 +2082,9 @@ static inline css_error set_page_break_before(css_computed_style *style,
#undef PAGE_BREAK_BEFORE_SHIFT
#undef PAGE_BREAK_BEFORE_MASK
-#define PAGE_BREAK_INSIDE_INDEX 10
-#define PAGE_BREAK_INSIDE_SHIFT 4
-#define PAGE_BREAK_INSIDE_MASK 0x30
+#define PAGE_BREAK_INSIDE_INDEX 11
+#define PAGE_BREAK_INSIDE_SHIFT 24
+#define PAGE_BREAK_INSIDE_MASK 0x3000000
static inline css_error set_page_break_inside(css_computed_style *style,
uint8_t type)
@@ -2104,8 +2104,8 @@ static inline css_error set_page_break_inside(css_computed_style *style,
#undef PAGE_BREAK_INSIDE_MASK
#define POSITION_INDEX 10
-#define POSITION_SHIFT 26
-#define POSITION_MASK 0x1c000000
+#define POSITION_SHIFT 20
+#define POSITION_MASK 0x700000
static inline css_error set_position(css_computed_style *style, uint8_t type)
{
@@ -2124,8 +2124,8 @@ static inline css_error set_position(css_computed_style *style, uint8_t type)
#undef POSITION_MASK
#define QUOTES_INDEX 14
-#define QUOTES_SHIFT 27
-#define QUOTES_MASK 0x8000000
+#define QUOTES_SHIFT 21
+#define QUOTES_MASK 0x200000
static inline css_error set_quotes(css_computed_style *style, uint8_t type,
lwc_string **string_arr)
@@ -2161,9 +2161,9 @@ static inline css_error set_quotes(css_computed_style *style, uint8_t type,
#undef QUOTES_SHIFT
#undef QUOTES_MASK
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 25
-#define RIGHT_MASK 0xfe000000
+#define RIGHT_INDEX 3
+#define RIGHT_SHIFT 18
+#define RIGHT_MASK 0x1fc0000
static inline css_error set_right(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -2184,9 +2184,9 @@ static inline css_error set_right(css_computed_style *style, uint8_t type,
#undef RIGHT_SHIFT
#undef RIGHT_MASK
-#define TABLE_LAYOUT_INDEX 11
-#define TABLE_LAYOUT_SHIFT 4
-#define TABLE_LAYOUT_MASK 0x30
+#define TABLE_LAYOUT_INDEX 10
+#define TABLE_LAYOUT_SHIFT 14
+#define TABLE_LAYOUT_MASK 0xc000
static inline css_error set_table_layout(css_computed_style *style, uint8_t
type)
@@ -2205,9 +2205,9 @@ static inline css_error set_table_layout(css_computed_style *style, uint8_t
#undef TABLE_LAYOUT_SHIFT
#undef TABLE_LAYOUT_MASK
-#define TEXT_ALIGN_INDEX 13
-#define TEXT_ALIGN_SHIFT 16
-#define TEXT_ALIGN_MASK 0xf0000
+#define TEXT_ALIGN_INDEX 4
+#define TEXT_ALIGN_SHIFT 0
+#define TEXT_ALIGN_MASK 0xf
static inline css_error set_text_align(css_computed_style *style, uint8_t type)
{
@@ -2226,8 +2226,8 @@ static inline css_error set_text_align(css_computed_style *style, uint8_t type)
#undef TEXT_ALIGN_MASK
#define TEXT_DECORATION_INDEX 8
-#define TEXT_DECORATION_SHIFT 9
-#define TEXT_DECORATION_MASK 0x3e00
+#define TEXT_DECORATION_SHIFT 3
+#define TEXT_DECORATION_MASK 0xf8
static inline css_error set_text_decoration(css_computed_style *style, uint8_t
type)
@@ -2269,9 +2269,9 @@ static inline css_error set_text_indent(css_computed_style *style, uint8_t
#undef TEXT_INDENT_SHIFT
#undef TEXT_INDENT_MASK
-#define TEXT_TRANSFORM_INDEX 9
-#define TEXT_TRANSFORM_SHIFT 8
-#define TEXT_TRANSFORM_MASK 0x700
+#define TEXT_TRANSFORM_INDEX 13
+#define TEXT_TRANSFORM_SHIFT 13
+#define TEXT_TRANSFORM_MASK 0xe000
static inline css_error set_text_transform(css_computed_style *style, uint8_t
type)
@@ -2290,7 +2290,7 @@ static inline css_error set_text_transform(css_computed_style *style, uint8_t
#undef TEXT_TRANSFORM_SHIFT
#undef TEXT_TRANSFORM_MASK
-#define TOP_INDEX 6
+#define TOP_INDEX 7
#define TOP_SHIFT 25
#define TOP_MASK 0xfe000000
@@ -2313,9 +2313,9 @@ static inline css_error set_top(css_computed_style *style, uint8_t type,
#undef TOP_SHIFT
#undef TOP_MASK
-#define UNICODE_BIDI_INDEX 9
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
+#define UNICODE_BIDI_INDEX 11
+#define UNICODE_BIDI_SHIFT 2
+#define UNICODE_BIDI_MASK 0xc
static inline css_error set_unicode_bidi(css_computed_style *style, uint8_t
type)
@@ -2358,8 +2358,8 @@ static inline css_error set_vertical_align(css_computed_style *style, uint8_t
#undef VERTICAL_ALIGN_MASK
#define VISIBILITY_INDEX 11
-#define VISIBILITY_SHIFT 14
-#define VISIBILITY_MASK 0xc000
+#define VISIBILITY_SHIFT 0
+#define VISIBILITY_MASK 0x3
static inline css_error set_visibility(css_computed_style *style, uint8_t type)
{
@@ -2377,9 +2377,9 @@ static inline css_error set_visibility(css_computed_style *style, uint8_t type)
#undef VISIBILITY_SHIFT
#undef VISIBILITY_MASK
-#define WHITE_SPACE_INDEX 10
-#define WHITE_SPACE_SHIFT 20
-#define WHITE_SPACE_MASK 0x700000
+#define WHITE_SPACE_INDEX 13
+#define WHITE_SPACE_SHIFT 19
+#define WHITE_SPACE_MASK 0x380000
static inline css_error set_white_space(css_computed_style *style, uint8_t type)
{
@@ -2398,8 +2398,8 @@ static inline css_error set_white_space(css_computed_style *style, uint8_t type)
#undef WHITE_SPACE_MASK
#define WIDOWS_INDEX 14
-#define WIDOWS_SHIFT 24
-#define WIDOWS_MASK 0x1000000
+#define WIDOWS_SHIFT 26
+#define WIDOWS_MASK 0x4000000
static inline css_error set_widows(css_computed_style *style, uint8_t type,
int32_t integer)
@@ -2420,9 +2420,9 @@ static inline css_error set_widows(css_computed_style *style, uint8_t type,
#undef WIDOWS_SHIFT
#undef WIDOWS_MASK
-#define WIDTH_INDEX 5
-#define WIDTH_SHIFT 25
-#define WIDTH_MASK 0xfe000000
+#define WIDTH_INDEX 3
+#define WIDTH_SHIFT 11
+#define WIDTH_MASK 0x3f800
static inline css_error set_width(css_computed_style *style, uint8_t type,
css_fixed length, css_unit unit)
@@ -2443,9 +2443,9 @@ static inline css_error set_width(css_computed_style *style, uint8_t type,
#undef WIDTH_SHIFT
#undef WIDTH_MASK
-#define WORD_SPACING_INDEX 4
-#define WORD_SPACING_SHIFT 25
-#define WORD_SPACING_MASK 0xfe000000
+#define WORD_SPACING_INDEX 5
+#define WORD_SPACING_SHIFT 4
+#define WORD_SPACING_MASK 0x7f0
static inline css_error set_word_spacing(css_computed_style *style, uint8_t
type, css_fixed length, css_unit unit)
@@ -2466,9 +2466,9 @@ static inline css_error set_word_spacing(css_computed_style *style, uint8_t
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_MASK
-#define WRITING_MODE_INDEX 11
-#define WRITING_MODE_SHIFT 18
-#define WRITING_MODE_MASK 0xc0000
+#define WRITING_MODE_INDEX 14
+#define WRITING_MODE_SHIFT 30
+#define WRITING_MODE_MASK 0xc0000000
static inline css_error set_writing_mode(css_computed_style *style, uint8_t
type)
@@ -2487,9 +2487,9 @@ static inline css_error set_writing_mode(css_computed_style *style, uint8_t
#undef WRITING_MODE_SHIFT
#undef WRITING_MODE_MASK
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 2
-#define Z_INDEX_MASK 0xc
+#define Z_INDEX_INDEX 10
+#define Z_INDEX_SHIFT 8
+#define Z_INDEX_MASK 0x300
static inline css_error set_z_index(css_computed_style *style, uint8_t type,
int32_t integer)
diff --git a/src/select/format_list_style.c b/src/select/format_list_style.c
index 4a2fee5..e61f981 100644
--- a/src/select/format_list_style.c
+++ b/src/select/format_list_style.c
@@ -385,7 +385,7 @@ static const struct list_counter_style lcs_georgian = {
};
-static const symbol_t armenian_symbols[] = {
+static const symbol_t upper_armenian_symbols[] = {
"��", "��", "��", "��", "��", "��", "��", "��", "��",
"��", "��", "��", "��", "��", "��", "��", "��", "��",
"��", "��", "��", "��", "��", "��", "��", "��", "��",
@@ -397,14 +397,32 @@ static const int armenian_weights[] = {
90, 80, 70, 60, 50, 40, 30, 20, 10,
9, 8, 7, 6, 5, 4, 3, 2, 1
};
-static const struct list_counter_style lcs_armenian = {
- .name = "armenian",
+static const struct list_counter_style lcs_upper_armenian = {
+ .name = "upper-armenian",
.range = {
.start = 1,
.end = 9999,},
- .symbols = armenian_symbols,
+ .symbols = upper_armenian_symbols,
.weights = armenian_weights,
- .items = (sizeof(armenian_symbols) / SYMBOL_SIZE),
+ .items = (sizeof(upper_armenian_symbols) / SYMBOL_SIZE),
+ .calc = calc_additive_system,
+};
+
+
+static const symbol_t lower_armenian_symbols[] = {
+ "��", "��", "��", "��", "��", "��", "��", "��", "��",
+ "��", "��", "��", "��", "��", "��", "��", "��", "��",
+ "��", "��", "��", "��", "��", "��", "��", "��", "��",
+ "��", "��", "��", "��", "��", "��", "��", "��", "��"
+};
+static const struct list_counter_style lcs_lower_armenian = {
+ .name = "lower-armenian",
+ .range = {
+ .start = 1,
+ .end = 9999,},
+ .symbols = lower_armenian_symbols,
+ .weights = armenian_weights,
+ .items = (sizeof(lower_armenian_symbols) / SYMBOL_SIZE),
.calc = calc_additive_system,
};
@@ -529,18 +547,117 @@ static const struct list_counter_style lcs_square = {
.calc = calc_cyclic_system,
};
-#if 0
-static const symbol_t lower_hexidecimal_symbols[] = {
+static const symbol_t binary_symbols[] = { "0", "1" };
+static const struct list_counter_style lcs_binary = {
+ .name = "binary",
+ .symbols = binary_symbols,
+ .items = (sizeof(binary_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t octal_symbols[] = {
+ "0", "1", "2", "3", "4", "5", "6", "7"
+};
+static const struct list_counter_style lcs_octal = {
+ .name = "octal",
+ .symbols = octal_symbols,
+ .items = (sizeof(octal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+
+static const symbol_t lower_hexadecimal_symbols[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"a", "b", "c", "d", "e", "f"
};
-static const struct list_counter_style lcs_lower_hexidecimal = {
- .name = "lower-hexidecimal",
- .symbols = lower_hexidecimal_symbols,
- .items = (sizeof(lower_hexidecimal_symbols) / SYMBOL_SIZE),
+static const struct list_counter_style lcs_lower_hexadecimal = {
+ .name = "lower-hexadecimal",
+ .symbols = lower_hexadecimal_symbols,
+ .items = (sizeof(lower_hexadecimal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t upper_hexadecimal_symbols[] = {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
+ "a", "b", "c", "d", "e", "f"
+};
+static const struct list_counter_style lcs_upper_hexadecimal = {
+ .name = "upper-hexadecimal",
+ .symbols = upper_hexadecimal_symbols,
+ .items = (sizeof(upper_hexadecimal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t arabic_indic_symbols[] = {
+ "\xd9\xa0", "\xd9\xa1", "\xd9\xa2", "\xd9\xa3", "\xd9\xa4", "\xd9\xa5", "\xd9\xa6", "\xd9\xa7", "\xd9\xa8", "\xd9\xa9"
+};
+static const struct list_counter_style lcs_arabic_indic = {
+ .name = "arabic-indic",
+ .symbols = arabic_indic_symbols,
+ .items = (sizeof(arabic_indic_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t bengali_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_bengali = {
+ .name = "bengali",
+ .symbols = bengali_symbols,
+ .items = (sizeof(bengali_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t cambodian_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_cambodian = {
+ .name = "cambodian",
+ .symbols = cambodian_symbols,
+ .items = (sizeof(cambodian_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t cjk_decimal_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_cjk_decimal = {
+ .name = "cjk-decimal",
+ .symbols = cjk_decimal_symbols,
+ .postfix = "���",
+ .items = (sizeof(cjk_decimal_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t devanagari_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_devanagari = {
+ .name = "devanagari",
+ .symbols = devanagari_symbols,
+ .items = (sizeof(devanagari_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t gujarati_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_gujarati = {
+ .name = "gujarati",
+ .symbols = gujarati_symbols,
+ .items = (sizeof(gujarati_symbols) / SYMBOL_SIZE),
+ .calc = calc_numeric_system,
+};
+
+static const symbol_t gurmukhi_symbols[] = {
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���"
+};
+static const struct list_counter_style lcs_gurmukhi = {
+ .name = "gurmukhi",
+ .symbols = gurmukhi_symbols,
+ .items = (sizeof(gurmukhi_symbols) / SYMBOL_SIZE),
.calc = calc_numeric_system,
};
-#endif
/* exported interface defined in select.h */
@@ -558,6 +675,22 @@ css_error css_computed_format_list_style(
const struct list_counter_style *cstyle;
switch (type) {
+ case CSS_LIST_STYLE_TYPE_DISC:
+ cstyle = &lcs_disc;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_CIRCLE:
+ cstyle = &lcs_circle;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_SQUARE:
+ cstyle = &lcs_square;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_DECIMAL:
+ cstyle = &lcs_decimal;
+ break;
+
case CSS_LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO:
cstyle = &lcs_decimal_leading_zero;
break;
@@ -570,6 +703,10 @@ css_error css_computed_format_list_style(
cstyle = &lcs_upper_roman;
break;
+ case CSS_LIST_STYLE_TYPE_LOWER_GREEK:
+ cstyle = &lcs_lower_greek;
+ break;
+
case CSS_LIST_STYLE_TYPE_LOWER_ALPHA:
case CSS_LIST_STYLE_TYPE_LOWER_LATIN:
cstyle = &lcs_lower_alpha;
@@ -580,38 +717,70 @@ css_error css_computed_format_list_style(
cstyle = &lcs_upper_alpha;
break;
- case CSS_LIST_STYLE_TYPE_LOWER_GREEK:
- cstyle = &lcs_lower_greek;
- break;
-
+ case CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN:
case CSS_LIST_STYLE_TYPE_ARMENIAN:
- cstyle = &lcs_armenian;
+ cstyle = &lcs_upper_armenian;
break;
case CSS_LIST_STYLE_TYPE_GEORGIAN:
cstyle = &lcs_georgian;
break;
- case CSS_LIST_STYLE_TYPE_DISC:
- cstyle = &lcs_disc;
+ case CSS_LIST_STYLE_TYPE_NONE:
+ *format_length = 0;
+ return CSS_OK;
+
+ case CSS_LIST_STYLE_TYPE_BINARY:
+ cstyle = &lcs_binary;
break;
- case CSS_LIST_STYLE_TYPE_CIRCLE:
- cstyle = &lcs_circle;
+ case CSS_LIST_STYLE_TYPE_OCTAL:
+ cstyle = &lcs_octal;
break;
- case CSS_LIST_STYLE_TYPE_SQUARE:
- cstyle = &lcs_square;
+ case CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL:
+ cstyle = &lcs_lower_hexadecimal;
break;
- case CSS_LIST_STYLE_TYPE_NONE:
- *format_length = 0;
- return CSS_OK;
+ case CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL:
+ cstyle = &lcs_upper_hexadecimal;
+ break;
- case CSS_LIST_STYLE_TYPE_DECIMAL:
- default:
- cstyle = &lcs_decimal;
+ case CSS_LIST_STYLE_TYPE_ARABIC_INDIC:
+ cstyle = &lcs_arabic_indic;
break;
+
+ case CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN:
+ cstyle = &lcs_lower_armenian;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_BENGALI:
+ cstyle = &lcs_bengali;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_CAMBODIAN:
+ case CSS_LIST_STYLE_TYPE_KHMER:
+ cstyle = &lcs_cambodian;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_CJK_DECIMAL:
+ cstyle = &lcs_cjk_decimal;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_DEVANAGARI:
+ cstyle = &lcs_devanagari;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_GUJARATI:
+ cstyle = &lcs_gujarati;
+ break;
+
+ case CSS_LIST_STYLE_TYPE_GURMUKHI:
+ cstyle = &lcs_gurmukhi;
+ break;
+
+ default:
+ return CSS_BADPARM;
}
alen = cstyle->calc(aval, sizeof(aval), value, cstyle);
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index b1e5db6..9a6af2c 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -68,6 +68,48 @@ css_error css__cascade_list_style_type(uint32_t opv, css_style *style,
case LIST_STYLE_TYPE_NONE:
value = CSS_LIST_STYLE_TYPE_NONE;
break;
+ case LIST_STYLE_TYPE_BINARY:
+ value = CSS_LIST_STYLE_TYPE_BINARY;
+ break;
+ case LIST_STYLE_TYPE_OCTAL:
+ value = CSS_LIST_STYLE_TYPE_OCTAL;
+ break;
+ case LIST_STYLE_TYPE_LOWER_HEXADECIMAL:
+ value = CSS_LIST_STYLE_TYPE_LOWER_HEXADECIMAL;
+ break;
+ case LIST_STYLE_TYPE_UPPER_HEXADECIMAL:
+ value = CSS_LIST_STYLE_TYPE_UPPER_HEXADECIMAL;
+ break;
+ case LIST_STYLE_TYPE_ARABIC_INDIC:
+ value = CSS_LIST_STYLE_TYPE_ARABIC_INDIC;
+ break;
+ case LIST_STYLE_TYPE_LOWER_ARMENIAN:
+ value = CSS_LIST_STYLE_TYPE_LOWER_ARMENIAN;
+ break;
+ case LIST_STYLE_TYPE_UPPER_ARMENIAN:
+ value = CSS_LIST_STYLE_TYPE_UPPER_ARMENIAN;
+ break;
+ case LIST_STYLE_TYPE_BENGALI:
+ value = CSS_LIST_STYLE_TYPE_BENGALI;
+ break;
+ case LIST_STYLE_TYPE_CAMBODIAN:
+ value = CSS_LIST_STYLE_TYPE_CAMBODIAN;
+ break;
+ case LIST_STYLE_TYPE_KHMER:
+ value = CSS_LIST_STYLE_TYPE_KHMER;
+ break;
+ case LIST_STYLE_TYPE_CJK_DECIMAL:
+ value = CSS_LIST_STYLE_TYPE_CJK_DECIMAL;
+ break;
+ case LIST_STYLE_TYPE_DEVANAGARI:
+ value = CSS_LIST_STYLE_TYPE_DEVANAGARI;
+ break;
+ case LIST_STYLE_TYPE_GUJARATI:
+ value = CSS_LIST_STYLE_TYPE_GUJARATI;
+ break;
+ case LIST_STYLE_TYPE_GURMUKHI:
+ value = CSS_LIST_STYLE_TYPE_GURMUKHI;
+ break;
}
}
@@ -102,4 +144,3 @@ css_error css__compose_list_style_type(const css_computed_style *parent,
return set_list_style_type(result, type);
}
-
diff --git a/src/select/select_config.py b/src/select/select_config.py
index 8845814..fd9e765 100644
--- a/src/select/select_config.py
+++ b/src/select/select_config.py
@@ -49,7 +49,7 @@ style = {
('font_weight', 4),
('justify_content', 3),
('list_style_position', 2),
- ('list_style_type', 4),
+ ('list_style_type', 6),
('overflow_x', 3),
('overflow_y', 3),
('outline_style', 4),
--
Cascading Style Sheets library
1 year, 11 months