Carry mona patch forward
[netsurf-overlay.git] / dev-libs / libcss / files / libcss-9999-add-mona-family.patch
blob606d53c3d71f7594d810020d0af6b5de4a05b37f
1 diff --git a/include/libcss/properties.h b/include/libcss/properties.h
2 index 577bed0..3e181ab 100644
3 --- a/include/libcss/properties.h
4 +++ b/include/libcss/properties.h
5 @@ -495,7 +495,8 @@ enum css_font_family_e {
6 CSS_FONT_FAMILY_SANS_SERIF = 0x2,
7 CSS_FONT_FAMILY_CURSIVE = 0x3,
8 CSS_FONT_FAMILY_FANTASY = 0x4,
9 - CSS_FONT_FAMILY_MONOSPACE = 0x5
10 + CSS_FONT_FAMILY_MONOSPACE = 0x5,
11 + CSS_FONT_FAMILY_MONA = 0x6
14 enum css_font_size_e {
15 diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
16 index 82bf75f..cc0c3bd 100644
17 --- a/src/bytecode/opcodes.h
18 +++ b/src/bytecode/opcodes.h
19 @@ -392,7 +392,8 @@ enum op_font_family {
20 FONT_FAMILY_SANS_SERIF = 0x0002,
21 FONT_FAMILY_CURSIVE = 0x0003,
22 FONT_FAMILY_FANTASY = 0x0004,
23 - FONT_FAMILY_MONOSPACE = 0x0005
24 + FONT_FAMILY_MONOSPACE = 0x0005,
25 + FONT_FAMILY_MONA = 0x0006
28 enum op_font_size {
29 diff --git a/src/parse/font_face.c b/src/parse/font_face.c
30 index f17d50e..60a821d 100644
31 --- a/src/parse/font_face.c
32 +++ b/src/parse/font_face.c
33 @@ -31,6 +31,8 @@ static bool font_rule_font_family_reserved(css_language *c,
34 &match) == lwc_error_ok && match) ||
35 (lwc_string_caseless_isequal(ident->idata,
36 c->strings[MONOSPACE], &match) == lwc_error_ok &&
37 + (lwc_string_caseless_isequal(ident->idata, c->strings[MONA],
38 + &match) == lwc_error_ok && match) ||
39 match) ||
40 (lwc_string_caseless_isequal(ident->idata, c->strings[INHERIT],
41 &match) == lwc_error_ok && match) ||
42 diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c
43 index 9903f75..7c0b68b 100644
44 --- a/src/parse/properties/font.c
45 +++ b/src/parse/properties/font.c
46 @@ -146,6 +146,8 @@ static css_error parse_system_font(css_language *c,
47 error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_CURSIVE);
48 else if ((lwc_string_caseless_isequal(system_font->family, c->strings[FANTASY], &match) == lwc_error_ok && match))
49 error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_FANTASY);
50 + else if ((lwc_string_caseless_isequal(system_font->family, c->strings[MONA], &match) == lwc_error_ok && match))
51 + error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_MONA);
52 else if ((lwc_string_caseless_isequal(system_font->family, c->strings[MONOSPACE], &match) == lwc_error_ok && match))
53 error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_MONOSPACE);
54 else {
55 diff --git a/src/parse/properties/font_family.c b/src/parse/properties/font_family.c
56 index 23c080b..2555f71 100644
57 --- a/src/parse/properties/font_family.c
58 +++ b/src/parse/properties/font_family.c
59 @@ -36,6 +36,9 @@ static bool font_family_reserved(css_language *c, const css_token *ident)
60 (lwc_string_caseless_isequal(
61 ident->idata, c->strings[FANTASY],
62 &match) == lwc_error_ok && match) ||
63 + (lwc_string_caseless_isequal(
64 + ident->idata, c->strings[MONA],
65 + &match) == lwc_error_ok && match) ||
66 (lwc_string_caseless_isequal(
67 ident->idata, c->strings[MONOSPACE],
68 &match) == lwc_error_ok && match);
69 @@ -71,6 +74,10 @@ static css_code_t font_family_value(css_language *c, const css_token *token, boo
70 token->idata, c->strings[FANTASY],
71 &match) == lwc_error_ok && match))
72 value = FONT_FAMILY_FANTASY;
73 + else if ((lwc_string_caseless_isequal(
74 + token->idata, c->strings[MONA],
75 + &match) == lwc_error_ok && match))
76 + value = MONA;
77 else if ((lwc_string_caseless_isequal(
78 token->idata, c->strings[MONOSPACE],
79 &match) == lwc_error_ok && match))
80 diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
81 index bfd2965..10bf940 100644
82 --- a/src/parse/propstrings.c
83 +++ b/src/parse/propstrings.c
84 @@ -390,6 +390,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
85 { "sans-serif", SLEN("sans-serif") },
86 { "cursive", SLEN("cursive") },
87 { "fantasy", SLEN("fantasy") },
88 + { "mona", SLEN("mona") },
89 { "monospace", SLEN("monospace") },
90 { "male", SLEN("male") },
91 { "female", SLEN("female") },
92 diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
93 index 67eaa5f..8a5a253 100644
94 --- a/src/parse/propstrings.h
95 +++ b/src/parse/propstrings.h
96 @@ -94,7 +94,7 @@ enum {
97 COUNTER, COUNTERS, CROSSHAIR, DEFAULT, POINTER, MOVE, E_RESIZE,
98 NE_RESIZE, NW_RESIZE, N_RESIZE, SE_RESIZE, SW_RESIZE, S_RESIZE,
99 W_RESIZE, LIBCSS_TEXT, WAIT, HELP, PROGRESS, SERIF, SANS_SERIF, CURSIVE,
100 - FANTASY, MONOSPACE, MALE, FEMALE, CHILD, MIX, UNDERLINE, OVERLINE,
101 + MONA, FANTASY, MONOSPACE, MALE, FEMALE, CHILD, MIX, UNDERLINE, OVERLINE,
102 LINE_THROUGH, BLINK, RGB, RGBA, HSL, HSLA, LIBCSS_LEFT, LIBCSS_CENTER,
103 LIBCSS_RIGHT, CURRENTCOLOR, ODD, EVEN, SRC, LOCAL, INITIAL,
104 FORMAT, WOFF, TRUETYPE, OPENTYPE, EMBEDDED_OPENTYPE, SVG, COLUMN,
105 diff --git a/src/select/properties/font_family.c b/src/select/properties/font_family.c
106 index f853fcc..9f2cf4c 100644
107 --- a/src/select/properties/font_family.c
108 +++ b/src/select/properties/font_family.c
109 @@ -52,6 +52,10 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style,
110 if (value == CSS_FONT_FAMILY_INHERIT)
111 value = CSS_FONT_FAMILY_FANTASY;
112 break;
113 + case FONT_FAMILY_MONA:
114 + if (value == CSS_FONT_FAMILY_INHERIT)
115 + value = CSS_FONT_FAMILY_MONA;
116 + break;
117 case FONT_FAMILY_MONOSPACE:
118 if (value == CSS_FONT_FAMILY_INHERIT)
119 value = CSS_FONT_FAMILY_MONOSPACE;