1 /*
2  Copyright (C) 2016-2017 Alexander Borisov
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 
18  Author: lex.borisov@gmail.com (Alexander Borisov)
19 */
20 
21 #include "mycss/property/parser.h"
22 
mycss_property_parser_destroy_string(mycore_string_t * str,bool return_value)23 bool mycss_property_parser_destroy_string(mycore_string_t* str, bool return_value)
24 {
25     mycss_property_shared_destroy_string(str);
26     return return_value;
27 }
28 
mycss_property_parser_switcher_to_find_important(mycss_entry_t * entry,mycss_token_t * token,bool last_response)29 bool mycss_property_parser_switcher_to_find_important(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
30 {
31     entry->parser = mycss_declaration_state_colon_before_important;
32     return true;
33 }
34 
35 /////////////////////////////////////////////////////////
36 //// CSS Property
37 ////
38 /////////////////////////////////////////////////////////
mycss_property_parser_undef(mycss_entry_t * entry,mycss_token_t * token,bool last_response)39 bool mycss_property_parser_undef(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
40 {
41     return mycss_property_shared_switch_to_parse_error(entry);
42 }
43 
44 /* width height */
mycss_property_parser_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)45 bool mycss_property_parser_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
46 {
47     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
48         return true;
49 
50     mycore_string_t str = {0};
51     mycss_declaration_entry_t* declr_entry = entry->declaration->entry_last;
52 
53     if(mycss_property_shared_width(entry, token, &declr_entry->value, &declr_entry->value_type, &str)) {
54         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
55     }
56 
57     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
58 }
59 
mycss_property_parser_height(mycss_entry_t * entry,mycss_token_t * token,bool last_response)60 bool mycss_property_parser_height(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
61 {
62     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
63         return true;
64 
65     mycore_string_t str = {0};
66     mycss_declaration_entry_t* declr_entry = entry->declaration->entry_last;
67 
68     if(mycss_property_shared_height(entry, token, &declr_entry->value, &declr_entry->value_type, &str))
69         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
70 
71     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
72 }
73 
mycss_property_parser_max_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)74 bool mycss_property_parser_max_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
75 {
76     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
77         return true;
78 
79     mycore_string_t str = {0};
80     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
81 
82     if(mycss_property_shared_length_percentage(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
83         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
84 
85     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
86         return mycss_property_shared_switch_to_parse_error(entry);
87 
88     if(str.data == NULL)
89         mycss_token_data_to_string(entry, token, &str, true, false);
90 
91     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
92 
93     switch (dec_entry->value_type) {
94         case MyCSS_PROPERTY_MAX_WIDTH_NONE:
95             /* default values */
96         case MyCSS_PROPERTY_VALUE_INHERIT:
97         case MyCSS_PROPERTY_VALUE_INITIAL:
98         case MyCSS_PROPERTY_VALUE_UNSET:
99             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
100 
101         default:
102             dec_entry->value_type = MyCSS_PROPERTY_VALUE_UNDEF;
103             break;
104     }
105 
106     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
107 }
108 
mycss_property_parser_max_height(mycss_entry_t * entry,mycss_token_t * token,bool last_response)109 bool mycss_property_parser_max_height(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
110 {
111     return mycss_property_parser_max_width(entry, token, last_response);
112 }
113 
mycss_property_parser_min_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)114 bool mycss_property_parser_min_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
115 {
116     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
117         return true;
118 
119     mycore_string_t str = {0};
120     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
121 
122     if(mycss_property_shared_length_percentage(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
123        mycss_property_shared_default(entry, token, &dec_entry->value_type, &str))
124     {
125         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
126     }
127 
128     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
129 }
130 
mycss_property_parser_min_height(mycss_entry_t * entry,mycss_token_t * token,bool last_response)131 bool mycss_property_parser_min_height(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
132 {
133     return mycss_property_parser_min_width(entry, token, last_response);
134 }
135 
136 /* padding */
mycss_property_parser_padding_shared(mycss_entry_t * entry,mycss_token_t * token,mycore_string_t * str)137 mycss_declaration_entry_t * mycss_property_parser_padding_shared(mycss_entry_t* entry, mycss_token_t* token, mycore_string_t* str)
138 {
139     void *value = NULL;
140     unsigned int value_type = 0;
141 
142     if(mycss_property_shared_length_percentage(entry, token, &value, &value_type, str) ||
143        mycss_property_shared_default(entry, token, &value_type, str))
144     {
145         mycss_declaration_entry_t* decl = mycss_declaration_entry_create(entry->declaration, NULL);
146 
147         decl->value = value;
148         decl->value_type = value_type;
149 
150         return decl;
151     }
152 
153     return NULL;
154 }
155 
mycss_property_parser_padding(mycss_entry_t * entry,mycss_token_t * token,bool last_response)156 bool mycss_property_parser_padding(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
157 {
158     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
159         return true;
160 
161     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
162 
163     if(dec_entry->value == NULL)
164         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_shorthand_four_t));
165 
166     mycss_values_shorthand_four_t *value = dec_entry->value;
167 
168     if(mycss_property_shared_check_declaration_end(entry, token))
169     {
170         if(value->one == NULL)
171             return mycss_property_shared_switch_to_parse_error(entry);
172 
173         return true;
174     }
175 
176     mycore_string_t str = {0};
177 
178     if(value->one == NULL)
179     {
180         if((value->one = mycss_property_parser_padding_shared(entry, token, &str))) {
181             value->one->type = MyCSS_PROPERTY_TYPE_PADDING_TOP;
182             return mycss_property_parser_destroy_string(&str, true);
183         }
184     }
185     else if(value->two == NULL)
186     {
187         if((value->two = mycss_property_parser_padding_shared(entry, token, &str))) {
188             value->two->type = MyCSS_PROPERTY_TYPE_PADDING_RIGHT;
189             return mycss_property_parser_destroy_string(&str, true);
190         }
191     }
192     else if(value->three == NULL)
193     {
194         if((value->three = mycss_property_parser_padding_shared(entry, token, &str))) {
195             value->three->type = MyCSS_PROPERTY_TYPE_PADDING_BOTTOM;
196             return mycss_property_parser_destroy_string(&str, true);
197         }
198     }
199     else if(value->four == NULL)
200     {
201         if((value->four = mycss_property_parser_padding_shared(entry, token, &str))) {
202             value->four->type = MyCSS_PROPERTY_TYPE_PADDING_LEFT;
203             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
204         }
205     }
206 
207     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
208 }
209 
mycss_property_parser_padding_X(mycss_entry_t * entry,mycss_token_t * token,bool last_response)210 bool mycss_property_parser_padding_X(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
211 {
212     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
213         return true;
214 
215     mycore_string_t str = {0};
216     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
217 
218     if(mycss_property_shared_length_percentage(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
219        mycss_property_shared_default(entry, token, &dec_entry->value_type, &str))
220     {
221         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
222     }
223 
224     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
225 }
226 
mycss_property_parser_padding_bottom(mycss_entry_t * entry,mycss_token_t * token,bool last_response)227 bool mycss_property_parser_padding_bottom(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
228 {
229     return mycss_property_parser_padding_X(entry, token, last_response);
230 }
231 
mycss_property_parser_padding_left(mycss_entry_t * entry,mycss_token_t * token,bool last_response)232 bool mycss_property_parser_padding_left(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
233 {
234     return mycss_property_parser_padding_X(entry, token, last_response);
235 }
236 
mycss_property_parser_padding_right(mycss_entry_t * entry,mycss_token_t * token,bool last_response)237 bool mycss_property_parser_padding_right(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
238 {
239     return mycss_property_parser_padding_X(entry, token, last_response);
240 }
241 
mycss_property_parser_padding_top(mycss_entry_t * entry,mycss_token_t * token,bool last_response)242 bool mycss_property_parser_padding_top(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
243 {
244     return mycss_property_parser_padding_X(entry, token, last_response);
245 }
246 
247 /* padding logical */
mycss_property_parser_padding_block_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)248 bool mycss_property_parser_padding_block_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
249 {
250     return mycss_property_parser_padding_X(entry, token, last_response);
251 }
252 
mycss_property_parser_padding_block_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)253 bool mycss_property_parser_padding_block_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
254 {
255     return mycss_property_parser_padding_X(entry, token, last_response);
256 }
257 
mycss_property_parser_padding_inline_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)258 bool mycss_property_parser_padding_inline_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
259 {
260     return mycss_property_parser_padding_X(entry, token, last_response);
261 }
262 
mycss_property_parser_padding_inline_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)263 bool mycss_property_parser_padding_inline_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
264 {
265     return mycss_property_parser_padding_X(entry, token, last_response);
266 }
267 
268 /* margin */
mycss_property_parser_margin_shared(mycss_entry_t * entry,mycss_token_t * token,mycore_string_t * str)269 mycss_declaration_entry_t * mycss_property_parser_margin_shared(mycss_entry_t* entry, mycss_token_t* token, mycore_string_t* str)
270 {
271     void *value = NULL;
272     unsigned int value_type = 0;
273 
274     if(mycss_property_shared_length_percentage(entry, token, &value, &value_type, str) ||
275        mycss_property_shared_default(entry, token, &value_type, str) ||
276        mycss_property_shared_by_value_type(entry, token, &value_type, MyCSS_PROPERTY_MARGIN_AUTO, str))
277     {
278         mycss_declaration_entry_t* decl = mycss_declaration_entry_create(entry->declaration, NULL);
279 
280         decl->value = value;
281         decl->value_type = value_type;
282 
283         return decl;
284     }
285 
286     return NULL;
287 }
288 
mycss_property_parser_margin(mycss_entry_t * entry,mycss_token_t * token,bool last_response)289 bool mycss_property_parser_margin(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
290 {
291     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
292         return true;
293 
294     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
295 
296     if(dec_entry->value == NULL)
297         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_shorthand_four_t));
298 
299     mycss_values_shorthand_four_t *value = dec_entry->value;
300 
301     if(mycss_property_shared_check_declaration_end(entry, token))
302     {
303         if(value->one == NULL)
304             return mycss_property_shared_switch_to_parse_error(entry);
305 
306         return true;
307     }
308 
309     mycore_string_t str = {0};
310 
311     if(value->one == NULL)
312     {
313         if((value->one = mycss_property_parser_margin_shared(entry, token, &str))) {
314             value->one->type = MyCSS_PROPERTY_TYPE_MARGIN_TOP;
315             return mycss_property_parser_destroy_string(&str, true);
316         }
317     }
318     else if(value->two == NULL)
319     {
320         if((value->two = mycss_property_parser_margin_shared(entry, token, &str))) {
321             value->two->type = MyCSS_PROPERTY_TYPE_MARGIN_RIGHT;
322             return mycss_property_parser_destroy_string(&str, true);
323         }
324     }
325     else if(value->three == NULL)
326     {
327         if((value->three = mycss_property_parser_margin_shared(entry, token, &str))) {
328             value->three->type = MyCSS_PROPERTY_TYPE_MARGIN_BOTTOM;
329             return mycss_property_parser_destroy_string(&str, true);
330         }
331     }
332     else if(value->four == NULL)
333     {
334         if((value->four = mycss_property_parser_margin_shared(entry, token, &str))) {
335             value->four->type = MyCSS_PROPERTY_TYPE_MARGIN_LEFT;
336             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
337         }
338     }
339 
340     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
341 }
342 
mycss_property_parser_margin_X(mycss_entry_t * entry,mycss_token_t * token,bool last_response)343 bool mycss_property_parser_margin_X(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
344 {
345     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
346         return true;
347 
348     mycore_string_t str = {0};
349     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
350 
351     if(mycss_property_shared_length(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
352        mycss_property_shared_default(entry, token, &dec_entry->value_type, &str) ||
353        mycss_property_shared_by_value_type(entry, token, &dec_entry->value_type, MyCSS_PROPERTY_MARGIN_AUTO, &str))
354     {
355         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
356     }
357 
358     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
359 }
360 
mycss_property_parser_margin_bottom(mycss_entry_t * entry,mycss_token_t * token,bool last_response)361 bool mycss_property_parser_margin_bottom(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
362 {
363     return mycss_property_parser_margin_X(entry, token, last_response);
364 }
365 
mycss_property_parser_margin_left(mycss_entry_t * entry,mycss_token_t * token,bool last_response)366 bool mycss_property_parser_margin_left(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
367 {
368     return mycss_property_parser_margin_X(entry, token, last_response);
369 }
370 
mycss_property_parser_margin_right(mycss_entry_t * entry,mycss_token_t * token,bool last_response)371 bool mycss_property_parser_margin_right(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
372 {
373     return mycss_property_parser_margin_X(entry, token, last_response);
374 }
375 
mycss_property_parser_margin_top(mycss_entry_t * entry,mycss_token_t * token,bool last_response)376 bool mycss_property_parser_margin_top(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
377 {
378     return mycss_property_parser_margin_X(entry, token, last_response);
379 }
380 
381 /* margin logical */
mycss_property_parser_margin_block_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)382 bool mycss_property_parser_margin_block_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
383 {
384     return mycss_property_parser_margin_X(entry, token, last_response);
385 }
386 
mycss_property_parser_margin_block_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)387 bool mycss_property_parser_margin_block_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
388 {
389     return mycss_property_parser_margin_X(entry, token, last_response);
390 }
391 
mycss_property_parser_margin_inline_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)392 bool mycss_property_parser_margin_inline_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
393 {
394     return mycss_property_parser_margin_X(entry, token, last_response);
395 }
396 
mycss_property_parser_margin_inline_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)397 bool mycss_property_parser_margin_inline_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
398 {
399     return mycss_property_parser_margin_X(entry, token, last_response);
400 }
401 
402 /* display */
mycss_property_parser_display(mycss_entry_t * entry,mycss_token_t * token,bool last_response)403 bool mycss_property_parser_display(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
404 {
405     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
406         return true;
407 
408     mycore_string_t str = {0};
409 
410     if(token->type == MyCSS_TOKEN_TYPE_IDENT)
411     {
412         mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
413         mycss_token_data_to_string(entry, token, &str, true, false);
414 
415         dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
416 
417         switch (dec_entry->value_type) {
418             case MyCSS_PROPERTY_DISPLAY_BLOCK:
419             case MyCSS_PROPERTY_DISPLAY_CONTENTS:
420             case MyCSS_PROPERTY_DISPLAY_FLEX:
421             case MyCSS_PROPERTY_DISPLAY_FLOW:
422             case MyCSS_PROPERTY_DISPLAY_FLOW_ROOT:
423             case MyCSS_PROPERTY_DISPLAY_GRID:
424             case MyCSS_PROPERTY_DISPLAY_INLINE:
425             case MyCSS_PROPERTY_DISPLAY_INLINE_BLOCK:
426             case MyCSS_PROPERTY_DISPLAY_INLINE_FLEX:
427             case MyCSS_PROPERTY_DISPLAY_INLINE_GRID:
428             case MyCSS_PROPERTY_DISPLAY_INLINE_LIST_ITEM:
429             case MyCSS_PROPERTY_DISPLAY_INLINE_TABLE:
430             case MyCSS_PROPERTY_DISPLAY_LIST_ITEM:
431             case MyCSS_PROPERTY_DISPLAY_NONE:
432             case MyCSS_PROPERTY_DISPLAY_RUBY:
433             case MyCSS_PROPERTY_DISPLAY_RUBY_BASE:
434             case MyCSS_PROPERTY_DISPLAY_RUBY_BASE_CONTAINER:
435             case MyCSS_PROPERTY_DISPLAY_RUBY_TEXT:
436             case MyCSS_PROPERTY_DISPLAY_RUBY_TEXT_CONTAINER:
437             case MyCSS_PROPERTY_DISPLAY_RUN_IN:
438             case MyCSS_PROPERTY_DISPLAY_TABLE:
439             case MyCSS_PROPERTY_DISPLAY_TABLE_CAPTION:
440             case MyCSS_PROPERTY_DISPLAY_TABLE_CELL:
441             case MyCSS_PROPERTY_DISPLAY_TABLE_COLUMN:
442             case MyCSS_PROPERTY_DISPLAY_TABLE_COLUMN_GROUP:
443             case MyCSS_PROPERTY_DISPLAY_TABLE_FOOTER_GROUP:
444             case MyCSS_PROPERTY_DISPLAY_TABLE_HEADER_GROUP:
445             case MyCSS_PROPERTY_DISPLAY_TABLE_ROW:
446             case MyCSS_PROPERTY_DISPLAY_TABLE_ROW_GROUP:
447                 break;
448 
449             default:
450                 if(mycss_property_shared_default(entry, token, &dec_entry->value_type, &str) == false) {
451                     dec_entry->value_type = MyCSS_PROPERTY_TYPE_UNDEF;
452                     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
453                 }
454                 break;
455         }
456     }
457 
458     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
459 }
460 
461 /* border */
mycss_property_parser_border_width_shared(mycss_entry_t * entry,mycss_token_t * token,mycore_string_t * str)462 mycss_declaration_entry_t * mycss_property_parser_border_width_shared(mycss_entry_t* entry, mycss_token_t* token, mycore_string_t* str)
463 {
464     void *value = NULL;
465     unsigned int value_type = 0;
466 
467     if(mycss_property_shared_line_width(entry, token, &value, &value_type, str))
468     {
469         mycss_declaration_entry_t* decl = mycss_declaration_entry_create(entry->declaration, NULL);
470 
471         decl->value = value;
472         decl->value_type = value_type;
473 
474         return decl;
475     }
476 
477     return NULL;
478 }
479 
mycss_property_parser_border_color_shared(mycss_entry_t * entry,mycss_token_t * token,mycore_string_t * str,mycss_parser_token_f return_parser,unsigned int type)480 static mycss_declaration_entry_t * mycss_property_parser_border_color_shared(mycss_entry_t* entry, mycss_token_t* token,
481                                                                              mycore_string_t* str, mycss_parser_token_f return_parser,
482                                                                              unsigned int type)
483 {
484     void *value = NULL;
485     unsigned int value_type = 0;
486     bool parser_changed = false;
487 
488     if(mycss_property_shared_color(entry, token, &value, &value_type, str, &parser_changed))
489     {
490         mycss_declaration_entry_t* step_dec_entry = mycss_declaration_entry_create(entry->declaration, NULL);
491 
492         step_dec_entry->type       = type;
493         step_dec_entry->value      = value;
494         step_dec_entry->value_type = value_type;
495 
496         if(parser_changed) {
497             mycss_stack_push(entry->declaration->stack, entry->declaration->entry_last->value, return_parser);
498             entry->declaration->entry_last->value = step_dec_entry->value;
499         }
500 
501         return step_dec_entry;
502     }
503 
504     return NULL;
505 }
506 
mycss_property_parser_border_style_shared(mycss_entry_t * entry,mycss_token_t * token,mycore_string_t * str)507 mycss_declaration_entry_t * mycss_property_parser_border_style_shared(mycss_entry_t* entry, mycss_token_t* token, mycore_string_t* str)
508 {
509     unsigned int value_type = 0;
510 
511     if(mycss_property_shared_line_style(entry, token, &value_type, str))
512     {
513         mycss_declaration_entry_t* decl = mycss_declaration_entry_create(entry->declaration, NULL);
514         decl->value_type = value_type;
515 
516         return decl;
517     }
518 
519     return NULL;
520 }
521 
mycss_property_parser_border_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)522 bool mycss_property_parser_border_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
523 {
524     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
525         return true;
526 
527     if(mycss_property_shared_check_declaration_end(entry, token)) {
528         return true;
529     }
530 
531     entry->parser = mycss_property_parser_border_top;
532     return false;
533 }
534 
mycss_property_parser_border(mycss_entry_t * entry,mycss_token_t * token,bool last_response)535 bool mycss_property_parser_border(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
536 {
537     return mycss_property_parser_border_top(entry, token, last_response);
538 }
539 
mycss_property_parser_border_top(mycss_entry_t * entry,mycss_token_t * token,bool last_response)540 bool mycss_property_parser_border_top(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
541 {
542     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
543         return true;
544 
545     mycore_string_t str = {0};
546     unsigned int value_type = 0;
547     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
548 
549     if(mycss_property_shared_default(entry, token, &value_type, &str))
550     {
551         if(dec_entry->value == NULL) {
552             dec_entry->value_type = value_type;
553             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
554         }
555     }
556 
557     if(dec_entry->value == NULL)
558         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_border_t));
559 
560     mycss_declaration_entry_t* shared_declr;
561     mycss_values_border_t *border = dec_entry->value;
562 
563     if(mycss_property_shared_check_declaration_end(entry, token))
564     {
565         if(border == NULL || (border->style == NULL && border->width == NULL && border->color == NULL))
566             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
567 
568         return mycss_property_parser_destroy_string(&str, true);
569     }
570 
571     if((shared_declr = mycss_property_parser_border_width_shared(entry, token, &str))) {
572         if(border->width)
573             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
574 
575         border->width = shared_declr;
576         border->width->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_WIDTH;
577 
578         return mycss_property_parser_destroy_string(&str, true);
579     }
580 
581     if((shared_declr = mycss_property_parser_border_style_shared(entry, token, &str))) {
582         if(border->style)
583             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
584 
585         border->style = shared_declr;
586         border->style->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_STYLE;
587 
588         return mycss_property_parser_destroy_string(&str, true);
589     }
590 
591     if(border->color == NULL) {
592         if((shared_declr = mycss_property_parser_border_color_shared(entry, token, &str,
593                                                                     mycss_property_parser_border_after,
594                                                                     MyCSS_PROPERTY_TYPE_BORDER_TOP_COLOR)))
595         {
596             border->color = shared_declr;
597             return mycss_property_parser_destroy_string(&str, true);
598         }
599     }
600 
601     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
602 }
603 
mycss_property_parser_border_right(mycss_entry_t * entry,mycss_token_t * token,bool last_response)604 bool mycss_property_parser_border_right(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
605 {
606     return mycss_property_parser_border_top(entry, token, last_response);
607 }
608 
mycss_property_parser_border_bottom(mycss_entry_t * entry,mycss_token_t * token,bool last_response)609 bool mycss_property_parser_border_bottom(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
610 {
611     return mycss_property_parser_border_top(entry, token, last_response);
612 }
613 
mycss_property_parser_border_left(mycss_entry_t * entry,mycss_token_t * token,bool last_response)614 bool mycss_property_parser_border_left(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
615 {
616     return mycss_property_parser_border_top(entry, token, last_response);
617 }
618 
619 /* border logical */
mycss_property_parser_border_block_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)620 bool mycss_property_parser_border_block_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
621 {
622     return mycss_property_parser_border(entry, token, last_response);
623 }
624 
mycss_property_parser_border_block_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)625 bool mycss_property_parser_border_block_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
626 {
627     return mycss_property_parser_border(entry, token, last_response);
628 }
629 
mycss_property_parser_border_inline_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)630 bool mycss_property_parser_border_inline_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
631 {
632     return mycss_property_parser_border(entry, token, last_response);
633 }
634 
mycss_property_parser_border_inline_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)635 bool mycss_property_parser_border_inline_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
636 {
637     return mycss_property_parser_border(entry, token, last_response);
638 }
639 
640 /* border width */
mycss_property_parser_border_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)641 bool mycss_property_parser_border_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
642 {
643     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
644         return true;
645 
646     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
647 
648     if(dec_entry->value == NULL)
649         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_shorthand_four_t));
650 
651     mycss_values_shorthand_four_t *value = dec_entry->value;
652 
653     if(mycss_property_shared_check_declaration_end(entry, token))
654     {
655         if(value->one == NULL)
656             return mycss_property_shared_switch_to_parse_error(entry);
657 
658         return true;
659     }
660 
661     mycore_string_t str = {0};
662 
663     if(value->one == NULL)
664     {
665         if((value->one = mycss_property_parser_border_width_shared(entry, token, &str))) {
666             value->one->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_WIDTH;
667             return mycss_property_parser_destroy_string(&str, true);
668         }
669     }
670     else if(value->two == NULL)
671     {
672         if((value->two = mycss_property_parser_border_width_shared(entry, token, &str))) {
673             value->two->type = MyCSS_PROPERTY_TYPE_BORDER_RIGHT_WIDTH;
674             return mycss_property_parser_destroy_string(&str, true);
675         }
676     }
677     else if(value->three == NULL)
678     {
679         if((value->three = mycss_property_parser_border_width_shared(entry, token, &str))) {
680             value->three->type = MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_WIDTH;
681             return mycss_property_parser_destroy_string(&str, true);
682         }
683     }
684     else if(value->four == NULL)
685     {
686         if((value->four = mycss_property_parser_border_width_shared(entry, token, &str))) {
687             value->four->type = MyCSS_PROPERTY_TYPE_BORDER_LEFT_WIDTH;
688             return mycss_property_parser_destroy_string(&str, true);
689         }
690     }
691 
692     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
693 }
694 
mycss_property_parser_border_top_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)695 bool mycss_property_parser_border_top_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
696 {
697     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
698         return true;
699 
700     mycore_string_t str = {0};
701     mycss_declaration_entry_t* declr_entry = entry->declaration->entry_last;
702 
703     if(mycss_property_shared_line_width(entry, token, &declr_entry->value, &declr_entry->value_type, &str)) {
704         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
705     }
706 
707     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
708 }
709 
mycss_property_parser_border_right_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)710 bool mycss_property_parser_border_right_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
711 {
712     return mycss_property_parser_border_top_width(entry, token, last_response);
713 }
714 
mycss_property_parser_border_bottom_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)715 bool mycss_property_parser_border_bottom_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
716 {
717     return mycss_property_parser_border_top_width(entry, token, last_response);
718 }
719 
mycss_property_parser_border_left_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)720 bool mycss_property_parser_border_left_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
721 {
722     return mycss_property_parser_border_top_width(entry, token, last_response);
723 }
724 
725 /* border width logical */
mycss_property_parser_border_block_start_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)726 bool mycss_property_parser_border_block_start_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
727 {
728     return mycss_property_parser_border_width(entry, token, last_response);
729 }
730 
mycss_property_parser_border_block_end_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)731 bool mycss_property_parser_border_block_end_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
732 {
733     return mycss_property_parser_border_width(entry, token, last_response);
734 }
735 
mycss_property_parser_border_inline_start_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)736 bool mycss_property_parser_border_inline_start_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
737 {
738     return mycss_property_parser_border_width(entry, token, last_response);
739 }
740 
mycss_property_parser_border_inline_end_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)741 bool mycss_property_parser_border_inline_end_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
742 {
743     return mycss_property_parser_border_width(entry, token, last_response);
744 }
745 
746 /* border style */
mycss_property_parser_border_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)747 bool mycss_property_parser_border_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
748 {
749     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
750         return true;
751 
752     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
753 
754     if(dec_entry->value == NULL)
755         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_shorthand_four_t));
756 
757     mycss_values_shorthand_four_t *value = dec_entry->value;
758 
759     if(mycss_property_shared_check_declaration_end(entry, token))
760     {
761         if(value->one == NULL)
762             return mycss_property_shared_switch_to_parse_error(entry);
763 
764         return true;
765     }
766 
767     mycore_string_t str = {0};
768 
769     if(value->one == NULL)
770     {
771         if((value->one = mycss_property_parser_border_style_shared(entry, token, &str))) {
772             value->one->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_STYLE;
773             return mycss_property_parser_destroy_string(&str, true);
774         }
775     }
776     else if(value->two == NULL)
777     {
778         if((value->two = mycss_property_parser_border_style_shared(entry, token, &str))) {
779             value->two->type = MyCSS_PROPERTY_TYPE_BORDER_RIGHT_STYLE;
780             return mycss_property_parser_destroy_string(&str, true);
781         }
782     }
783     else if(value->three == NULL)
784     {
785         if((value->three = mycss_property_parser_border_style_shared(entry, token, &str))) {
786             value->three->type = MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_STYLE;
787             return mycss_property_parser_destroy_string(&str, true);
788         }
789     }
790     else if(value->four == NULL)
791     {
792         if((value->four = mycss_property_parser_border_style_shared(entry, token, &str))) {
793             value->four->type = MyCSS_PROPERTY_TYPE_BORDER_LEFT_STYLE;
794             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
795         }
796     }
797 
798     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
799 }
800 
mycss_property_parser_border_top_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)801 bool mycss_property_parser_border_top_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
802 {
803     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
804         return true;
805 
806     mycore_string_t str = {0};
807     mycss_declaration_entry_t* declr_entry = entry->declaration->entry_last;
808 
809     if(mycss_property_shared_line_style(entry, token, &declr_entry->value_type, &str)) {
810         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
811     }
812 
813     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
814 }
815 
mycss_property_parser_border_right_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)816 bool mycss_property_parser_border_right_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
817 {
818     return mycss_property_parser_border_top_style(entry, token, last_response);
819 }
820 
mycss_property_parser_border_bottom_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)821 bool mycss_property_parser_border_bottom_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
822 {
823     return mycss_property_parser_border_top_style(entry, token, last_response);
824 }
825 
mycss_property_parser_border_left_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)826 bool mycss_property_parser_border_left_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
827 {
828     return mycss_property_parser_border_top_style(entry, token, last_response);
829 }
830 
831 /* border style logical */
mycss_property_parser_border_block_start_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)832 bool mycss_property_parser_border_block_start_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
833 {
834     return mycss_property_parser_border_style(entry, token, last_response);
835 }
836 
mycss_property_parser_border_block_end_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)837 bool mycss_property_parser_border_block_end_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
838 {
839     return mycss_property_parser_border_style(entry, token, last_response);
840 }
841 
mycss_property_parser_border_inline_start_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)842 bool mycss_property_parser_border_inline_start_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
843 {
844     return mycss_property_parser_border_style(entry, token, last_response);
845 }
846 
mycss_property_parser_border_inline_end_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)847 bool mycss_property_parser_border_inline_end_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
848 {
849     return mycss_property_parser_border_style(entry, token, last_response);
850 }
851 
852 /* border radius */
mycss_property_parser_border_radius_shared(mycss_entry_t * entry,mycss_token_t * token,mycore_string_t * str,bool is_first)853 static mycss_declaration_entry_t * mycss_property_parser_border_radius_shared(mycss_entry_t* entry, mycss_token_t* token, mycore_string_t* str, bool is_first)
854 {
855     void *value = NULL;
856     unsigned int value_type = 0;
857 
858     if(mycss_property_shared_length_percentage(entry, token, &value, &value_type, str))
859     {
860         mycss_declaration_entry_t* decl = mycss_declaration_entry_create(entry->declaration, NULL);
861 
862         mycss_values_shorthand_two_type_t *short_two_type = mycss_values_create(entry, sizeof(mycss_values_shorthand_two_type_t));
863 
864         if(is_first) {
865             short_two_type->one = value;
866             short_two_type->type_one = value_type;
867         }
868         else {
869             short_two_type->two = value;
870             short_two_type->type_two = value_type;
871         }
872 
873         decl->value = short_two_type;
874         return decl;
875     }
876 
877     return NULL;
878 }
879 
mycss_property_parser_border_radius_two_shared(mycss_entry_t * entry,mycss_token_t * token,mycss_values_shorthand_two_type_t * short_two_type,mycore_string_t * str)880 static bool mycss_property_parser_border_radius_two_shared(mycss_entry_t* entry, mycss_token_t* token,
881                                                     mycss_values_shorthand_two_type_t *short_two_type, mycore_string_t* str)
882 {
883     if(mycss_property_shared_length_percentage(entry, token, &short_two_type->two, &short_two_type->type_two, str)) {
884         return true;
885     }
886 
887     return false;
888 }
889 
mycss_property_parser_border_radius_two(mycss_entry_t * entry,mycss_token_t * token,bool last_response)890 bool mycss_property_parser_border_radius_two(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
891 {
892     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
893         return true;
894 
895     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
896     mycss_values_shorthand_four_t *value = dec_entry->value;
897 
898     if(mycss_property_shared_check_declaration_end(entry, token)) {
899         return true;
900     }
901 
902     mycore_string_t str = {0};
903 
904     if(((mycss_values_shorthand_two_type_t*)(value->one->value))->two == NULL)
905     {
906         if(mycss_property_parser_border_radius_two_shared(entry, token, value->one->value, &str))
907             return mycss_property_parser_destroy_string(&str, true);
908     }
909     else if(value->two == NULL)
910     {
911         if((value->two = mycss_property_parser_border_radius_shared(entry, token, &str, false))) {
912             value->two->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_RIGHT_RADIUS;
913             return mycss_property_parser_destroy_string(&str, true);
914         }
915     }
916     else if(((mycss_values_shorthand_two_type_t*)(value->two->value))->two == NULL)
917     {
918         if(mycss_property_parser_border_radius_two_shared(entry, token, value->two->value, &str))
919             return mycss_property_parser_destroy_string(&str, true);
920     }
921     else if(value->three == NULL)
922     {
923         if((value->three = mycss_property_parser_border_radius_shared(entry, token, &str, false))) {
924             value->three->type = MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_RIGHT_RADIUS;
925             return mycss_property_parser_destroy_string(&str, true);
926         }
927     }
928     else if(((mycss_values_shorthand_two_type_t*)(value->three->value))->two == NULL)
929     {
930         if(mycss_property_parser_border_radius_two_shared(entry, token, value->three->value, &str))
931             return mycss_property_parser_destroy_string(&str, true);
932     }
933     else if(value->four == NULL)
934     {
935         if((value->four = mycss_property_parser_border_radius_shared(entry, token, &str, false))) {
936             value->four->type = MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_LEFT_RADIUS;
937             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
938         }
939     }
940     else if(((mycss_values_shorthand_two_type_t*)(value->four->value))->two == NULL)
941     {
942         if(mycss_property_parser_border_radius_two_shared(entry, token, value->four->value, &str))
943             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
944     }
945 
946     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
947 }
948 
mycss_property_parser_border_radius_wait_two(mycss_entry_t * entry,mycss_token_t * token,bool last_response)949 static bool mycss_property_parser_border_radius_wait_two(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
950 {
951     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
952         return true;
953 
954     if(mycss_property_shared_check_declaration_end(entry, token)) {
955         return true;
956     }
957 
958     if(token->type == MyCSS_TOKEN_TYPE_DELIM && *token->data == '/') {
959         entry->parser = mycss_property_parser_border_radius_two;
960         return true;
961     }
962 
963     return mycss_property_shared_switch_to_parse_error(entry);
964 }
965 
mycss_property_parser_border_radius(mycss_entry_t * entry,mycss_token_t * token,bool last_response)966 bool mycss_property_parser_border_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
967 {
968     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
969         return true;
970 
971     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
972 
973     if(dec_entry->value == NULL)
974         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_shorthand_four_t));
975 
976     mycss_values_shorthand_four_t *value = dec_entry->value;
977 
978     if(mycss_property_shared_check_declaration_end(entry, token))
979     {
980         if(value->one == NULL)
981             return mycss_property_shared_switch_to_parse_error(entry);
982 
983         return true;
984     }
985 
986     mycore_string_t str = {0};
987 
988     if(value->one == NULL)
989     {
990         if((value->one = mycss_property_parser_border_radius_shared(entry, token, &str, true))) {
991             value->one->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_LEFT_RADIUS;
992             return mycss_property_parser_destroy_string(&str, true);
993         }
994 
995         unsigned int value_type = 0;
996 
997         if(mycss_property_shared_default(entry, token, &value_type, &str)) {
998             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
999         }
1000     }
1001     else if(value->two == NULL)
1002     {
1003         if((value->two = mycss_property_parser_border_radius_shared(entry, token, &str, true))) {
1004             value->two->type = MyCSS_PROPERTY_TYPE_BORDER_TOP_RIGHT_RADIUS;
1005             return mycss_property_parser_destroy_string(&str, true);
1006         }
1007     }
1008     else if(value->three == NULL)
1009     {
1010         if((value->three = mycss_property_parser_border_radius_shared(entry, token, &str, true))) {
1011             value->three->type = MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_RIGHT_RADIUS;
1012             return mycss_property_parser_destroy_string(&str, true);
1013         }
1014     }
1015     else if(value->four == NULL)
1016     {
1017         if((value->four = mycss_property_parser_border_radius_shared(entry, token, &str, true))) {
1018             value->four->type = MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_LEFT_RADIUS;
1019 
1020             entry->parser = mycss_property_parser_border_radius_wait_two;
1021             return mycss_property_parser_destroy_string(&str, true);
1022         }
1023     }
1024 
1025     if(token->type == MyCSS_TOKEN_TYPE_DELIM && *token->data == '/') {
1026         if(value->one == NULL)
1027             return mycss_property_shared_switch_to_parse_error(entry);
1028 
1029         entry->parser = mycss_property_parser_border_radius_two;
1030         return mycss_property_parser_destroy_string(&str, true);
1031     }
1032 
1033     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1034 }
1035 
mycss_property_parser_short_two_type(mycss_entry_t * entry,mycss_token_t * token)1036 bool mycss_property_parser_short_two_type(mycss_entry_t* entry, mycss_token_t* token)
1037 {
1038     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1039         return true;
1040 
1041     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1042 
1043     if(dec_entry->value == NULL)
1044         dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_shorthand_two_type_t));
1045 
1046     mycss_values_shorthand_two_type_t *short_two_type = dec_entry->value;
1047 
1048     if(mycss_property_shared_check_declaration_end(entry, token))
1049     {
1050         if(short_two_type->one == NULL)
1051             return mycss_property_shared_switch_to_parse_error(entry);
1052 
1053         return true;
1054     }
1055 
1056     mycore_string_t str = {0};
1057 
1058     if(short_two_type->one == NULL)
1059     {
1060         if(mycss_property_shared_length_percentage(entry, token, &short_two_type->one, &short_two_type->type_one, &str) ||
1061            mycss_property_shared_default(entry, token, &short_two_type->type_one, &str))
1062         {
1063             return mycss_property_parser_destroy_string(&str, true);
1064         }
1065     }
1066     else if(short_two_type->two == NULL)
1067     {
1068         if(mycss_property_shared_length_percentage(entry, token, &short_two_type->two, &short_two_type->type_two, &str) ||
1069            mycss_property_shared_default(entry, token, &short_two_type->type_two, &str))
1070         {
1071             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1072         }
1073     }
1074 
1075     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1076 }
1077 
mycss_property_parser_border_top_right_radius(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1078 bool mycss_property_parser_border_top_right_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1079 {
1080     return mycss_property_parser_short_two_type(entry, token);
1081 }
1082 
mycss_property_parser_border_top_left_radius(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1083 bool mycss_property_parser_border_top_left_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1084 {
1085     return mycss_property_parser_border_top_right_radius(entry, token, last_response);
1086 }
1087 
mycss_property_parser_border_bottom_right_radius(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1088 bool mycss_property_parser_border_bottom_right_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1089 {
1090     return mycss_property_parser_border_top_right_radius(entry, token, last_response);
1091 }
1092 
mycss_property_parser_border_bottom_left_radius(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1093 bool mycss_property_parser_border_bottom_left_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1094 {
1095     return mycss_property_parser_border_top_right_radius(entry, token, last_response);
1096 }
1097 
1098 /* border color */
mycss_property_parser_border_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1099 bool mycss_property_parser_border_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1100 {
1101     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1102         return true;
1103 
1104     mycore_string_t str = {0};
1105 
1106     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1107     mycss_values_shorthand_four_t *value = dec_entry->value;
1108 
1109     if(value == NULL)
1110     {
1111         unsigned int value_type = 0;
1112         if(mycss_property_shared_default(entry, token, &value_type, &str))
1113         {
1114             dec_entry->value_type = value_type;
1115             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1116         }
1117 
1118         mycss_declaration_entry_t* shared_declr;
1119         dec_entry->value = value = mycss_values_create(entry, sizeof(mycss_values_shorthand_four_t));
1120 
1121         if((shared_declr = mycss_property_parser_border_color_shared(entry, token, &str, mycss_property_parser_border_color_after,
1122                                                                      MyCSS_PROPERTY_TYPE_BORDER_TOP_COLOR)))
1123         {
1124             value->one = shared_declr;
1125             return mycss_property_parser_destroy_string(&str, true);
1126         }
1127     }
1128     else if(value->two == NULL) {
1129         if((value->two = mycss_property_parser_border_color_shared(entry, token, &str, mycss_property_parser_border_color_after,
1130                                                                    MyCSS_PROPERTY_TYPE_BORDER_RIGHT_COLOR)))
1131         {
1132             return mycss_property_parser_destroy_string(&str, true);
1133         }
1134     }
1135     else if(value->three == NULL) {
1136         if((value->three = mycss_property_parser_border_color_shared(entry, token, &str, mycss_property_parser_border_color_after,
1137                                                                      MyCSS_PROPERTY_TYPE_BORDER_BOTTOM_COLOR)))
1138         {
1139             return mycss_property_parser_destroy_string(&str, true);
1140         }
1141     }
1142     else if(value->four == NULL) {
1143         if((value->four = mycss_property_parser_border_color_shared(entry, token, &str, mycss_property_parser_border_color_after,
1144                                                                     MyCSS_PROPERTY_TYPE_BORDER_LEFT_COLOR)))
1145         {
1146             return mycss_property_parser_destroy_string(&str, true);
1147         }
1148     }
1149 
1150     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1151 }
1152 
mycss_property_parser_border_color_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1153 bool mycss_property_parser_border_color_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1154 {
1155     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1156         return true;
1157 
1158     if(mycss_property_shared_check_declaration_end(entry, token)) {
1159         return true;
1160     }
1161 
1162     entry->parser = mycss_property_parser_border_color;
1163     return false;
1164 }
1165 
mycss_property_parser_border_top_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1166 bool mycss_property_parser_border_top_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1167 {
1168     return mycss_property_parser_color(entry, token, last_response);
1169 }
1170 
mycss_property_parser_border_right_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1171 bool mycss_property_parser_border_right_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1172 {
1173     return mycss_property_parser_color(entry, token, last_response);
1174 }
1175 
mycss_property_parser_border_bottom_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1176 bool mycss_property_parser_border_bottom_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1177 {
1178     return mycss_property_parser_color(entry, token, last_response);
1179 }
1180 
mycss_property_parser_border_left_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1181 bool mycss_property_parser_border_left_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1182 {
1183     return mycss_property_parser_color(entry, token, last_response);
1184 }
1185 
1186 /* border color logical */
mycss_property_parser_border_block_start_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1187 bool mycss_property_parser_border_block_start_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1188 {
1189     return mycss_property_parser_color(entry, token, last_response);
1190 }
1191 
mycss_property_parser_border_block_end_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1192 bool mycss_property_parser_border_block_end_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1193 {
1194     return mycss_property_parser_color(entry, token, last_response);
1195 }
1196 
mycss_property_parser_border_inline_start_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1197 bool mycss_property_parser_border_inline_start_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1198 {
1199     return mycss_property_parser_color(entry, token, last_response);
1200 }
1201 
mycss_property_parser_border_inline_end_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1202 bool mycss_property_parser_border_inline_end_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1203 {
1204     return mycss_property_parser_color(entry, token, last_response);
1205 }
1206 
1207 /* box sizing */
mycss_property_parser_box_sizing(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1208 bool mycss_property_parser_box_sizing(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1209 {
1210     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1211         return true;
1212 
1213     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1214         return mycss_property_shared_switch_to_parse_error(entry);
1215 
1216     mycore_string_t str = {0};
1217     mycss_token_data_to_string(entry, token, &str, true, false);
1218 
1219     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1220     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1221 
1222     switch (dec_entry->value_type) {
1223         case MyCSS_PROPERTY_BOX_SIZING_CONTENT_BOX:
1224         case MyCSS_PROPERTY_BOX_SIZING_BORDER_BOX:
1225             /* default values */
1226         case MyCSS_PROPERTY_VALUE_INHERIT:
1227         case MyCSS_PROPERTY_VALUE_INITIAL:
1228         case MyCSS_PROPERTY_VALUE_UNSET:
1229             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1230 
1231         default:
1232             break;
1233     }
1234 
1235     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1236 }
1237 
1238 /* vertical align */
mycss_property_parser_vertical_align(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1239 bool mycss_property_parser_vertical_align(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1240 {
1241     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1242         return true;
1243 
1244     mycore_string_t str = {0};
1245     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1246 
1247     if(mycss_property_shared_length_percentage(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
1248         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1249 
1250     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1251         return mycss_property_shared_switch_to_parse_error(entry);
1252 
1253     if(str.data == NULL)
1254         mycss_token_data_to_string(entry, token, &str, true, false);
1255 
1256     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1257 
1258     switch (dec_entry->value_type) {
1259         case MyCSS_PROPERTY_VERTICAL_ALIGN_BASELINE:
1260         case MyCSS_PROPERTY_VERTICAL_ALIGN_SUB:
1261         case MyCSS_PROPERTY_VERTICAL_ALIGN_SUPER:
1262         case MyCSS_PROPERTY_VERTICAL_ALIGN_TOP:
1263         case MyCSS_PROPERTY_VERTICAL_ALIGN_TEXT_TOP:
1264         case MyCSS_PROPERTY_VERTICAL_ALIGN_MIDDLE:
1265         case MyCSS_PROPERTY_VERTICAL_ALIGN_BOTTOM:
1266         case MyCSS_PROPERTY_VERTICAL_ALIGN_TEXT_BOTTOM:
1267             /* default values */
1268         case MyCSS_PROPERTY_VALUE_INHERIT:
1269         case MyCSS_PROPERTY_VALUE_INITIAL:
1270         case MyCSS_PROPERTY_VALUE_UNSET:
1271             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1272 
1273         default:
1274             break;
1275     }
1276 
1277     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1278 }
1279 
1280 /* line height */
mycss_property_parser_line_height(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1281 bool mycss_property_parser_line_height(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1282 {
1283     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1284         return true;
1285 
1286     mycore_string_t str = {0};
1287     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1288 
1289     if(mycss_property_shared_line_height(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
1290         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1291 
1292     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1293 }
1294 
1295 /* color */
mycss_property_parser_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1296 bool mycss_property_parser_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1297 {
1298     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1299         return true;
1300 
1301     mycore_string_t str = {0};
1302     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1303 
1304     bool parser_changed = false;
1305 
1306     dec_entry->value = NULL;
1307 
1308     if(mycss_property_shared_color(entry, token, &dec_entry->value, &dec_entry->value_type, &str, &parser_changed))
1309     {
1310         if(parser_changed) {
1311             mycss_stack_push(entry->declaration->stack, NULL, mycss_property_parser_color_after);
1312             return true;
1313         }
1314 
1315         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1316     }
1317 
1318     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1319 }
1320 
mycss_property_parser_color_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1321 bool mycss_property_parser_color_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1322 {
1323     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1324         return true;
1325 
1326     if(mycss_property_shared_check_declaration_end(entry, token))
1327         return true;
1328 
1329     return mycss_property_shared_switch_to_parse_error(entry);
1330 }
1331 
1332 /* position */
mycss_property_parser_position(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1333 bool mycss_property_parser_position(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1334 {
1335     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1336         return true;
1337 
1338     mycore_string_t str = {0};
1339     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1340 
1341     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1342         return mycss_property_shared_switch_to_parse_error(entry);
1343 
1344     mycss_token_data_to_string(entry, token, &str, true, false);
1345     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1346 
1347     switch (dec_entry->value_type) {
1348         case MyCSS_PROPERTY_POSITION_STATIC:
1349         case MyCSS_PROPERTY_POSITION_RELATIVE:
1350         case MyCSS_PROPERTY_POSITION_ABSOLUTE:
1351         case MyCSS_PROPERTY_POSITION_STICKY:
1352         case MyCSS_PROPERTY_POSITION_FIXED:
1353             /* default values */
1354         case MyCSS_PROPERTY_VALUE_INHERIT:
1355         case MyCSS_PROPERTY_VALUE_INITIAL:
1356         case MyCSS_PROPERTY_VALUE_UNSET:
1357             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1358 
1359         default:
1360             break;
1361     }
1362 
1363     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1364 }
1365 
1366 /* z-index */
mycss_property_parser_z_index(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1367 bool mycss_property_parser_z_index(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1368 {
1369     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1370         return true;
1371 
1372     mycore_string_t str = {0};
1373     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1374 
1375     if(mycss_property_shared_number(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
1376         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1377 
1378     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1379         return mycss_property_shared_switch_to_parse_error(entry);
1380 
1381     if(str.data == NULL)
1382         mycss_token_data_to_string(entry, token, &str, true, false);
1383 
1384     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1385 
1386     switch (dec_entry->value_type) {
1387         case MyCSS_PROPERTY_Z_INDEX_AUTO:
1388             /* default values */
1389         case MyCSS_PROPERTY_VALUE_INHERIT:
1390         case MyCSS_PROPERTY_VALUE_INITIAL:
1391         case MyCSS_PROPERTY_VALUE_UNSET:
1392             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1393 
1394         default:
1395             dec_entry->value_type = MyCSS_PROPERTY_VALUE_UNDEF;
1396             break;
1397     }
1398 
1399     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1400 }
1401 
1402 /* Cursor */
mycss_property_parser_cursor(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1403 bool mycss_property_parser_cursor(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1404 {
1405     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1406         return true;
1407 
1408     mycore_string_t str = {0};
1409     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1410 
1411     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1412         return mycss_property_shared_switch_to_parse_error(entry);
1413 
1414     mycss_token_data_to_string(entry, token, &str, true, false);
1415     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1416 
1417     switch (dec_entry->value_type) {
1418         case MyCSS_PROPERTY_CURSOR_AUTO:
1419         case MyCSS_PROPERTY_CURSOR_DEFAULT:
1420         case MyCSS_PROPERTY_CURSOR_NONE:
1421         case MyCSS_PROPERTY_CURSOR_CONTEXT_MENU:
1422         case MyCSS_PROPERTY_CURSOR_HELP:
1423         case MyCSS_PROPERTY_CURSOR_POINTER:
1424         case MyCSS_PROPERTY_CURSOR_PROGRESS:
1425         case MyCSS_PROPERTY_CURSOR_WAIT:
1426         case MyCSS_PROPERTY_CURSOR_CELL:
1427         case MyCSS_PROPERTY_CURSOR_CROSSHAIR:
1428         case MyCSS_PROPERTY_CURSOR_TEXT:
1429         case MyCSS_PROPERTY_CURSOR_VERTICAL_TEXT:
1430         case MyCSS_PROPERTY_CURSOR_ALIAS:
1431         case MyCSS_PROPERTY_CURSOR_COPY:
1432         case MyCSS_PROPERTY_CURSOR_MOVE:
1433         case MyCSS_PROPERTY_CURSOR_NO_DROP:
1434         case MyCSS_PROPERTY_CURSOR_NOT_ALLOWED:
1435         case MyCSS_PROPERTY_CURSOR_GRAB:
1436         case MyCSS_PROPERTY_CURSOR_GRABBING:
1437         case MyCSS_PROPERTY_CURSOR_E_RESIZE:
1438         case MyCSS_PROPERTY_CURSOR_N_RESIZE:
1439         case MyCSS_PROPERTY_CURSOR_NE_RESIZE:
1440         case MyCSS_PROPERTY_CURSOR_NW_RESIZE:
1441         case MyCSS_PROPERTY_CURSOR_S_RESIZE:
1442         case MyCSS_PROPERTY_CURSOR_SE_RESIZE:
1443         case MyCSS_PROPERTY_CURSOR_SW_RESIZE:
1444         case MyCSS_PROPERTY_CURSOR_W_RESIZE:
1445         case MyCSS_PROPERTY_CURSOR_EW_RESIZE:
1446         case MyCSS_PROPERTY_CURSOR_NS_RESIZE:
1447         case MyCSS_PROPERTY_CURSOR_NESW_RESIZE:
1448         case MyCSS_PROPERTY_CURSOR_NWSE_RESIZE:
1449         case MyCSS_PROPERTY_CURSOR_COL_RESIZE:
1450         case MyCSS_PROPERTY_CURSOR_ROW_RESIZE:
1451         case MyCSS_PROPERTY_CURSOR_ALL_SCROLL:
1452         case MyCSS_PROPERTY_CURSOR_ZOOM_IN:
1453         case MyCSS_PROPERTY_CURSOR_ZOOM_OUT:
1454             /* default values */
1455         case MyCSS_PROPERTY_VALUE_INHERIT:
1456         case MyCSS_PROPERTY_VALUE_INITIAL:
1457         case MyCSS_PROPERTY_VALUE_UNSET:
1458             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1459 
1460         default:
1461             break;
1462     }
1463 
1464     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1465 }
1466 
1467 /* float */
mycss_property_parser_float(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1468 bool mycss_property_parser_float(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1469 {
1470     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1471         return true;
1472 
1473     mycore_string_t str = {0};
1474     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1475 
1476     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1477         return mycss_property_shared_switch_to_parse_error(entry);
1478 
1479     mycss_token_data_to_string(entry, token, &str, true, false);
1480     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1481 
1482     switch (dec_entry->value_type) {
1483         case MyCSS_PROPERTY_FLOAT_LEFT:
1484         case MyCSS_PROPERTY_FLOAT_RIGHT:
1485         case MyCSS_PROPERTY_FLOAT_TOP:
1486         case MyCSS_PROPERTY_FLOAT_BOTTOM:
1487         case MyCSS_PROPERTY_FLOAT_START:
1488         case MyCSS_PROPERTY_FLOAT_END:
1489         case MyCSS_PROPERTY_FLOAT_NONE:
1490             /* default values */
1491         case MyCSS_PROPERTY_VALUE_INHERIT:
1492         case MyCSS_PROPERTY_VALUE_INITIAL:
1493         case MyCSS_PROPERTY_VALUE_UNSET:
1494             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1495 
1496         default:
1497             break;
1498     }
1499 
1500     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1501 }
1502 
mycss_property_parser_float_displace(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1503 bool mycss_property_parser_float_displace(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1504 {
1505     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1506         return true;
1507 
1508     mycore_string_t str = {0};
1509     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1510 
1511     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1512         return mycss_property_shared_switch_to_parse_error(entry);
1513 
1514     mycss_token_data_to_string(entry, token, &str, true, false);
1515     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1516 
1517     switch (dec_entry->value_type) {
1518         case MyCSS_PROPERTY_FLOAT_DISPLACE_LINE:
1519         case MyCSS_PROPERTY_FLOAT_DISPLACE_INDENT:
1520         case MyCSS_PROPERTY_FLOAT_DISPLACE_BLOCK:
1521         case MyCSS_PROPERTY_FLOAT_DISPLACE_BLOCK_WITHIN_PAGE:
1522             /* default values */
1523         case MyCSS_PROPERTY_VALUE_INHERIT:
1524         case MyCSS_PROPERTY_VALUE_INITIAL:
1525         case MyCSS_PROPERTY_VALUE_UNSET:
1526             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1527 
1528         default:
1529             break;
1530     }
1531 
1532     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1533 }
1534 
1535 /* top right bottom left */
mycss_property_parser_top(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1536 bool mycss_property_parser_top(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1537 {
1538     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1539         return true;
1540 
1541     mycore_string_t str = {0};
1542     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1543 
1544     if(mycss_property_shared_length_percentage(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
1545         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1546 
1547     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1548         return mycss_property_shared_switch_to_parse_error(entry);
1549 
1550     if(str.data == NULL)
1551         mycss_token_data_to_string(entry, token, &str, true, false);
1552 
1553     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1554 
1555     switch (dec_entry->value_type) {
1556         case MyCSS_PROPERTY_VALUE_AUTO:
1557             /* default values */
1558         case MyCSS_PROPERTY_VALUE_INHERIT:
1559         case MyCSS_PROPERTY_VALUE_INITIAL:
1560         case MyCSS_PROPERTY_VALUE_UNSET:
1561             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1562 
1563         default:
1564             dec_entry->value_type = MyCSS_PROPERTY_VALUE_UNDEF;
1565             break;
1566     }
1567 
1568     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1569 }
1570 
mycss_property_parser_right(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1571 bool mycss_property_parser_right(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1572 {
1573     return mycss_property_parser_top(entry, token, last_response);
1574 }
1575 
mycss_property_parser_bottom(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1576 bool mycss_property_parser_bottom(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1577 {
1578     return mycss_property_parser_top(entry, token, last_response);
1579 }
1580 
mycss_property_parser_left(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1581 bool mycss_property_parser_left(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1582 {
1583     return mycss_property_parser_top(entry, token, last_response);
1584 }
1585 
1586 /* clear */
mycss_property_parser_clear(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1587 bool mycss_property_parser_clear(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1588 {
1589     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1590         return true;
1591 
1592     mycore_string_t str = {0};
1593     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1594 
1595     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1596         return mycss_property_shared_switch_to_parse_error(entry);
1597 
1598     mycss_token_data_to_string(entry, token, &str, true, false);
1599     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1600 
1601     switch (dec_entry->value_type) {
1602         case MyCSS_PROPERTY_CLEAR_LEFT:
1603         case MyCSS_PROPERTY_CLEAR_RIGHT:
1604         case MyCSS_PROPERTY_CLEAR_BOTH:
1605         case MyCSS_PROPERTY_CLEAR_NONE:
1606             /* default values */
1607         case MyCSS_PROPERTY_VALUE_INHERIT:
1608         case MyCSS_PROPERTY_VALUE_INITIAL:
1609         case MyCSS_PROPERTY_VALUE_UNSET:
1610             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1611 
1612         default:
1613             break;
1614     }
1615 
1616     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1617 }
1618 
mycss_property_parser_clear_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1619 bool mycss_property_parser_clear_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1620 {
1621     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1622         return true;
1623 
1624     mycore_string_t str = {0};
1625     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1626 
1627     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1628         return mycss_property_shared_switch_to_parse_error(entry);
1629 
1630     mycss_token_data_to_string(entry, token, &str, true, false);
1631     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1632 
1633     switch (dec_entry->value_type) {
1634         case MyCSS_PROPERTY_CLEAR_AFTER_NONE:
1635         case MyCSS_PROPERTY_CLEAR_AFTER_LEFT:
1636         case MyCSS_PROPERTY_CLEAR_AFTER_RIGHT:
1637         case MyCSS_PROPERTY_CLEAR_AFTER_TOP:
1638         case MyCSS_PROPERTY_CLEAR_AFTER_BOTTOM:
1639         case MyCSS_PROPERTY_CLEAR_AFTER_INSIDE:
1640         case MyCSS_PROPERTY_CLEAR_AFTER_OUTSIDE:
1641         case MyCSS_PROPERTY_CLEAR_AFTER_START:
1642         case MyCSS_PROPERTY_CLEAR_AFTER_END:
1643         case MyCSS_PROPERTY_CLEAR_AFTER_BOTH:
1644         case MyCSS_PROPERTY_CLEAR_AFTER_DESCENDANTS:
1645             /* default values */
1646         case MyCSS_PROPERTY_VALUE_INHERIT:
1647         case MyCSS_PROPERTY_VALUE_INITIAL:
1648         case MyCSS_PROPERTY_VALUE_UNSET:
1649             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1650 
1651         default:
1652             break;
1653     }
1654 
1655     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1656 }
1657 
1658 /* overflow */
mycss_property_parser_overflow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1659 bool mycss_property_parser_overflow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1660 {
1661     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1662         return true;
1663 
1664     mycore_string_t str = {0};
1665     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1666 
1667     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1668         return mycss_property_shared_switch_to_parse_error(entry);
1669 
1670     mycss_token_data_to_string(entry, token, &str, true, false);
1671     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1672 
1673     switch (dec_entry->value_type) {
1674         case MyCSS_PROPERTY_OVERFLOW_VISIBLE:
1675         case MyCSS_PROPERTY_OVERFLOW_HIDDEN:
1676         case MyCSS_PROPERTY_OVERFLOW_SCROLL:
1677         case MyCSS_PROPERTY_OVERFLOW_AUTO:
1678         case MyCSS_PROPERTY_OVERFLOW_NO_DISPLAY:
1679         case MyCSS_PROPERTY_OVERFLOW_NO_CONTENT:
1680             /* default values */
1681         case MyCSS_PROPERTY_VALUE_INHERIT:
1682         case MyCSS_PROPERTY_VALUE_INITIAL:
1683         case MyCSS_PROPERTY_VALUE_UNSET:
1684             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1685 
1686         default:
1687             break;
1688     }
1689 
1690     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1691 }
1692 
mycss_property_parser_overflow_wrap(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1693 bool mycss_property_parser_overflow_wrap(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1694 {
1695     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1696         return true;
1697 
1698     mycore_string_t str = {0};
1699     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1700 
1701     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1702         return mycss_property_shared_switch_to_parse_error(entry);
1703 
1704     mycss_token_data_to_string(entry, token, &str, true, false);
1705     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1706 
1707     switch (dec_entry->value_type) {
1708         case MyCSS_PROPERTY_OVERFLOW_WRAP_NORMAL:
1709         case MyCSS_PROPERTY_OVERFLOW_WRAP_BREAK_WORD:
1710         case MyCSS_PROPERTY_OVERFLOW_WRAP_BREAK_SPACES:
1711             /* default values */
1712         case MyCSS_PROPERTY_VALUE_INHERIT:
1713         case MyCSS_PROPERTY_VALUE_INITIAL:
1714         case MyCSS_PROPERTY_VALUE_UNSET:
1715             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1716 
1717         default:
1718             break;
1719     }
1720 
1721     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1722 }
1723 
mycss_property_parser_overflow_x(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1724 bool mycss_property_parser_overflow_x(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1725 {
1726     return mycss_property_parser_overflow(entry, token, last_response);
1727 }
1728 
mycss_property_parser_overflow_y(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1729 bool mycss_property_parser_overflow_y(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1730 {
1731     return mycss_property_parser_overflow(entry, token, last_response);
1732 }
1733 
1734 /* visibility */
mycss_property_parser_visibility(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1735 bool mycss_property_parser_visibility(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1736 {
1737     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1738         return true;
1739 
1740     mycore_string_t str = {0};
1741     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1742 
1743     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1744         return mycss_property_shared_switch_to_parse_error(entry);
1745 
1746     mycss_token_data_to_string(entry, token, &str, true, false);
1747     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1748 
1749     switch (dec_entry->value_type) {
1750         case MyCSS_PROPERTY_VISIBILITY_VISIBLE:
1751         case MyCSS_PROPERTY_VISIBILITY_HIDDEN:
1752         case MyCSS_PROPERTY_VISIBILITY_COLLAPSE:
1753             /* default values */
1754         case MyCSS_PROPERTY_VALUE_INHERIT:
1755         case MyCSS_PROPERTY_VALUE_INITIAL:
1756         case MyCSS_PROPERTY_VALUE_UNSET:
1757             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1758 
1759         default:
1760             break;
1761     }
1762 
1763     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1764 }
1765 
1766 /* font */
mycss_property_parser_font_weight(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1767 bool mycss_property_parser_font_weight(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1768 {
1769     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1770         return true;
1771 
1772     mycore_string_t str = {0};
1773     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1774 
1775     if(mycss_property_shared_font_weight(entry, token, &dec_entry->value_type, &str))
1776         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1777 
1778     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1779 }
1780 
mycss_property_parser_font_size(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1781 bool mycss_property_parser_font_size(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1782 {
1783     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1784         return true;
1785 
1786     mycore_string_t str = {0};
1787     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1788 
1789     if(mycss_property_shared_font_size(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
1790         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1791 
1792     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1793 }
1794 
mycss_property_parser_font_size_adjust(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1795 bool mycss_property_parser_font_size_adjust(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1796 {
1797     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1798         return true;
1799 
1800     mycore_string_t str = {0};
1801     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1802 
1803     if(mycss_property_shared_number(entry, token, &dec_entry->value, &dec_entry->value_type, &str))
1804         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1805 
1806     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
1807         return mycss_property_shared_switch_to_parse_error(entry);
1808 
1809     if(str.data == NULL)
1810         mycss_token_data_to_string(entry, token, &str, true, false);
1811 
1812     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
1813 
1814     switch (dec_entry->value_type) {
1815         case MyCSS_PROPERTY_FONT_SIZE_ADJUST_NONE:
1816             /* default values */
1817         case MyCSS_PROPERTY_VALUE_INHERIT:
1818         case MyCSS_PROPERTY_VALUE_INITIAL:
1819         case MyCSS_PROPERTY_VALUE_UNSET:
1820             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1821 
1822         default:
1823             dec_entry->value_type = MyCSS_PROPERTY_VALUE_UNDEF;
1824             break;
1825     }
1826 
1827     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1828 }
1829 
mycss_property_parser_font_stretch(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1830 bool mycss_property_parser_font_stretch(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1831 {
1832     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1833         return true;
1834 
1835     mycore_string_t str = {0};
1836     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1837 
1838     if(mycss_property_shared_font_stretch(entry, token, &dec_entry->value_type, &str))
1839         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1840 
1841     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1842 }
1843 
mycss_property_parser_font_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1844 bool mycss_property_parser_font_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1845 {
1846     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1847         return true;
1848 
1849     mycore_string_t str = {0};
1850     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1851 
1852     if(mycss_property_shared_font_style(entry, token, &dec_entry->value_type, &str))
1853         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
1854 
1855     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1856 }
1857 
mycss_property_parser_font_family_wait_comma_or_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1858 static bool mycss_property_parser_font_family_wait_comma_or_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1859 {
1860     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE )
1861         return true;
1862 
1863     if(token->type == MyCSS_TOKEN_TYPE_COMMA) {
1864         entry->parser = mycss_property_parser_font_family;
1865         return true;
1866     }
1867 
1868     if(mycss_property_shared_check_declaration_end(entry, token))
1869         return true;
1870 
1871     return mycss_property_shared_switch_to_parse_error(entry);
1872 }
1873 
mycss_property_parser_font_family(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1874 bool mycss_property_parser_font_family(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1875 {
1876     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1877         return true;
1878 
1879     if(mycss_property_shared_check_declaration_end(entry, token))
1880         return true;
1881 
1882     mycore_string_t str = {0}; bool dont_destroy_str;
1883     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1884 
1885     if(mycss_property_shared_font_family(entry, token, &dec_entry->value, &dec_entry->value_type, &dont_destroy_str, &str)) {
1886         if(dont_destroy_str == false)
1887             mycss_property_shared_destroy_string(&str);
1888 
1889         entry->parser = mycss_property_parser_font_family_wait_comma_or_end;
1890         return true;
1891     }
1892 
1893     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1894 }
1895 
1896 /*
1897  * Font
1898  */
1899 bool mycss_property_parser_font_step_wait_family(mycss_entry_t* entry, mycss_token_t* token, bool last_response);
1900 
mycss_property_parser_font_step_wait_family_comma_or_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1901 static bool mycss_property_parser_font_step_wait_family_comma_or_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1902 {
1903     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE )
1904         return true;
1905 
1906     if(token->type == MyCSS_TOKEN_TYPE_COMMA) {
1907         entry->parser = mycss_property_parser_font_step_wait_family;
1908         return true;
1909     }
1910 
1911     if(mycss_property_shared_check_declaration_end(entry, token))
1912         return true;
1913 
1914     return mycss_property_shared_switch_to_parse_error(entry);
1915 }
1916 
mycss_property_parser_font_step_wait_family(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1917 bool mycss_property_parser_font_step_wait_family(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1918 {
1919     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1920         return true;
1921     if(mycss_property_shared_check_declaration_end(entry, token))
1922         return true;
1923 
1924     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1925 
1926     if(dec_entry->value == NULL)
1927         return mycss_property_shared_switch_to_parse_error(entry);
1928 
1929     mycore_string_t str = {0};
1930     mycss_values_font_t *font = (mycss_values_font_t*)dec_entry->value;
1931 
1932     void *value = NULL;
1933     unsigned int value_type = 0;
1934     bool dont_destroy_str;
1935 
1936     if(font->family) {
1937         value = font->family->value;
1938         value_type = font->family->value_type;
1939     }
1940 
1941     if(mycss_property_shared_font_family(entry, token, &value, &value_type, &dont_destroy_str, &str)) {
1942         if(dont_destroy_str == false)
1943             mycss_property_shared_destroy_string(&str);
1944 
1945         if(font->family == NULL) {
1946             font->family = mycss_declaration_entry_create(entry->declaration, NULL);
1947 
1948             font->family->type = MyCSS_PROPERTY_TYPE_FONT_FAMILY;
1949             font->family->value = value;
1950             font->family->value_type = value_type;
1951         }
1952 
1953         entry->parser = mycss_property_parser_font_step_wait_family_comma_or_end;
1954         return true;
1955     }
1956 
1957     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1958 }
1959 
mycss_property_parser_font_step_wait_line_height(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1960 bool mycss_property_parser_font_step_wait_line_height(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1961 {
1962     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1963         return true;
1964     if(mycss_property_shared_check_declaration_end(entry, token))
1965         return true;
1966 
1967     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
1968 
1969     if(dec_entry->value == NULL)
1970         return mycss_property_shared_switch_to_parse_error(entry);
1971 
1972     void *value = NULL;
1973     unsigned int value_type = 0;
1974 
1975     mycore_string_t str = {0};
1976     mycss_values_font_t *font = (mycss_values_font_t*)dec_entry->value;
1977 
1978     if(mycss_property_shared_line_height(entry, token, &value, &value_type, &str)) {
1979         font->line_height = mycss_declaration_entry_create(entry->declaration, NULL);
1980 
1981         font->line_height->type = MyCSS_PROPERTY_TYPE_LINE_HEIGHT;
1982         font->line_height->value = value;
1983         font->line_height->value_type = value_type;
1984 
1985         entry->parser = mycss_property_parser_font_step_wait_family;
1986         return mycss_property_parser_destroy_string(&str, true);
1987     }
1988 
1989     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
1990 }
1991 
mycss_property_parser_font_step_after_size(mycss_entry_t * entry,mycss_token_t * token,bool last_response)1992 bool mycss_property_parser_font_step_after_size(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
1993 {
1994     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
1995         return true;
1996 
1997     if(token->type == MyCSS_TOKEN_TYPE_DELIM) {
1998         if(*token->data == '/') {
1999             entry->parser = mycss_property_parser_font_step_wait_line_height;
2000             return true;
2001         }
2002 
2003         return mycss_property_shared_switch_to_parse_error(entry);
2004     }
2005 
2006     if(mycss_property_shared_check_declaration_end(entry, token))
2007         return true;
2008 
2009     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2010 
2011     if(dec_entry->value == NULL)
2012         return mycss_property_shared_switch_to_parse_error(entry);
2013 
2014     void *value = NULL;
2015     unsigned int value_type = 0;
2016     bool dont_destroy_str;
2017 
2018     mycore_string_t str = {0};
2019     mycss_values_font_t *font = (mycss_values_font_t*)dec_entry->value;
2020 
2021     if(mycss_property_shared_font_family(entry, token, &value, &value_type, &dont_destroy_str, &str)) {
2022         if(dont_destroy_str == false)
2023             mycss_property_shared_destroy_string(&str);
2024 
2025         font->family = mycss_declaration_entry_create(entry->declaration, NULL);
2026 
2027         font->family->type = MyCSS_PROPERTY_TYPE_FONT_FAMILY;
2028         font->family->value = value;
2029         font->family->value_type = value_type;
2030 
2031         entry->parser = mycss_property_parser_font_step_wait_family_comma_or_end;
2032         return true;
2033     }
2034 
2035     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2036 }
2037 
mycss_property_parser_font_step_one(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2038 bool mycss_property_parser_font_step_one(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2039 {
2040     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2041         return true;
2042 
2043     if(mycss_property_shared_check_declaration_end(entry, token))
2044         return true;
2045 
2046     mycore_string_t str = {0};
2047     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2048 
2049     if(dec_entry->value == NULL)
2050         return mycss_property_shared_switch_to_parse_error(entry);
2051 
2052     void *value = NULL;
2053     unsigned int value_type = 0;
2054 
2055     mycss_values_font_t *font = (mycss_values_font_t*)dec_entry->value;
2056 
2057     if(mycss_property_shared_font_style(entry, token, &value_type, &str))
2058     {
2059         if(font->style)
2060             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2061 
2062         font->style = mycss_declaration_entry_create(entry->declaration, NULL);
2063 
2064         font->style->type = MyCSS_PROPERTY_TYPE_FONT_STYLE;
2065         font->style->value_type = value_type;
2066 
2067         return mycss_property_parser_destroy_string(&str, true);
2068     }
2069     else if(mycss_property_shared_font_weight(entry, token, &value_type, &str)) {
2070         if(font->weight)
2071             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2072 
2073         font->weight = mycss_declaration_entry_create(entry->declaration, NULL);
2074 
2075         font->weight->type = MyCSS_PROPERTY_TYPE_FONT_WEIGHT;
2076         font->weight->value_type = value_type;
2077 
2078         return mycss_property_parser_destroy_string(&str, true);
2079     }
2080     else if(mycss_property_shared_font_stretch(entry, token, &value_type, &str)) {
2081         if(font->stretch)
2082             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2083 
2084         font->stretch = mycss_declaration_entry_create(entry->declaration, NULL);
2085 
2086         font->stretch->type = MyCSS_PROPERTY_TYPE_FONT_STRETCH;
2087         font->stretch->value_type = value_type;
2088 
2089         return mycss_property_parser_destroy_string(&str, true);
2090     }
2091 
2092     /* <‘font-size’> [ / <‘line-height’> ]? <‘font-family’>  */
2093     if(mycss_property_shared_font_size(entry, token, &value, &value_type, &str)) {
2094         font->size = mycss_declaration_entry_create(entry->declaration, NULL);
2095 
2096         font->size->type = MyCSS_PROPERTY_TYPE_FONT_SIZE;
2097         font->size->value = value;
2098         font->size->value_type = value_type;
2099 
2100         entry->parser = mycss_property_parser_font_step_after_size;
2101         return mycss_property_parser_destroy_string(&str, true);
2102     }
2103 
2104     bool dont_destroy_str;
2105 
2106     if(mycss_property_shared_font_family(entry, token, &value, &value_type, &dont_destroy_str, &str)) {
2107         if(dont_destroy_str == false)
2108             mycss_property_shared_destroy_string(&str);
2109 
2110         font->family = mycss_declaration_entry_create(entry->declaration, NULL);
2111 
2112         font->family->type = MyCSS_PROPERTY_TYPE_FONT_FAMILY;
2113         font->family->value = value;
2114         font->family->value_type = value_type;
2115 
2116         entry->parser = mycss_property_parser_font_step_wait_family_comma_or_end;
2117         return true;
2118     }
2119 
2120     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2121 }
2122 
mycss_property_parser_font(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2123 bool mycss_property_parser_font(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2124 {
2125     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2126         return true;
2127 
2128     mycore_string_t str = {0};
2129     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2130 
2131     dec_entry->value = mycss_values_create(entry, sizeof(mycss_values_font_t));
2132 
2133     if(dec_entry->value == NULL)
2134         return mycss_property_shared_switch_to_parse_error(entry);
2135 
2136     void *value = NULL;
2137     unsigned int value_type = 0;
2138 
2139     mycss_values_font_t *font = (mycss_values_font_t*)dec_entry->value;
2140 
2141     /* caption | icon | menu | message-box | small-caption | status-bar */
2142     if(mycss_property_shared_font_ends(entry, token, &value_type, &str)) {
2143         dec_entry->value_type = value_type;
2144         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2145     }
2146 
2147     /* [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’> ]? */
2148     if(mycss_property_shared_font_style(entry, token, &value_type, &str))
2149     {
2150         font->style = mycss_declaration_entry_create(entry->declaration, NULL);
2151 
2152         font->style->type = MyCSS_PROPERTY_TYPE_FONT_STYLE;
2153         font->style->value_type = value_type;
2154 
2155         entry->parser = mycss_property_parser_font_step_one;
2156         return mycss_property_parser_destroy_string(&str, true);
2157     }
2158     else if(mycss_property_shared_font_weight(entry, token, &value_type, &str)) {
2159         font->weight = mycss_declaration_entry_create(entry->declaration, NULL);
2160 
2161         font->weight->type = MyCSS_PROPERTY_TYPE_FONT_STYLE;
2162         font->weight->value_type = value_type;
2163 
2164         entry->parser = mycss_property_parser_font_step_one;
2165         return mycss_property_parser_destroy_string(&str, true);
2166     }
2167     else if(mycss_property_shared_font_stretch(entry, token, &value_type, &str)) {
2168         font->stretch = mycss_declaration_entry_create(entry->declaration, NULL);
2169 
2170         font->stretch->type = MyCSS_PROPERTY_TYPE_FONT_STYLE;
2171         font->stretch->value_type = value_type;
2172 
2173         entry->parser = mycss_property_parser_font_step_one;
2174         return mycss_property_parser_destroy_string(&str, true);
2175     }
2176 
2177     /* <‘font-size’> [ / <‘line-height’> ]? <‘font-family’>  */
2178     if(mycss_property_shared_font_size(entry, token, &value, &value_type, &str)) {
2179         font->size = mycss_declaration_entry_create(entry->declaration, NULL);
2180 
2181         font->size->type = MyCSS_PROPERTY_TYPE_FONT_STYLE;
2182         font->size->value = value;
2183         font->size->value_type = value_type;
2184 
2185         entry->parser = mycss_property_parser_font_step_after_size;
2186         return mycss_property_parser_destroy_string(&str, true);
2187     }
2188 
2189     bool dont_destroy_str;
2190 
2191     if(mycss_property_shared_font_family(entry, token, &value, &value_type, &dont_destroy_str, &str)) {
2192         if(dont_destroy_str == false)
2193             mycss_property_shared_destroy_string(&str);
2194 
2195         font->family = mycss_declaration_entry_create(entry->declaration, NULL);
2196 
2197         font->family->type = MyCSS_PROPERTY_TYPE_FONT_FAMILY;
2198         font->family->value = value;
2199         font->family->value_type = value_type;
2200 
2201         entry->parser = mycss_property_parser_font_step_wait_family_comma_or_end;
2202         return true;
2203     }
2204 
2205     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2206 }
2207 
2208 /* text align */
mycss_property_parser_text_align(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2209 bool mycss_property_parser_text_align(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2210 {
2211     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2212         return true;
2213 
2214     mycore_string_t str = {0};
2215     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2216 
2217     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2218         return mycss_property_shared_switch_to_parse_error(entry);
2219 
2220     mycss_token_data_to_string(entry, token, &str, true, false);
2221     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2222 
2223     switch (dec_entry->value_type) {
2224         case MyCSS_PROPERTY_TEXT_ALIGN_START:
2225         case MyCSS_PROPERTY_TEXT_ALIGN_END:
2226         case MyCSS_PROPERTY_TEXT_ALIGN_LEFT:
2227         case MyCSS_PROPERTY_TEXT_ALIGN_RIGHT:
2228         case MyCSS_PROPERTY_TEXT_ALIGN_CENTER:
2229         case MyCSS_PROPERTY_TEXT_ALIGN_JUSTIFY:
2230         case MyCSS_PROPERTY_TEXT_ALIGN_MATCH_PARENT:
2231         case MyCSS_PROPERTY_TEXT_ALIGN_JUSTIFY_ALL:
2232             /* default values */
2233         case MyCSS_PROPERTY_VALUE_INHERIT:
2234         case MyCSS_PROPERTY_VALUE_INITIAL:
2235         case MyCSS_PROPERTY_VALUE_UNSET:
2236             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2237 
2238         default:
2239             break;
2240     }
2241 
2242     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2243 }
2244 
mycss_property_parser_text_align_all(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2245 bool mycss_property_parser_text_align_all(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2246 {
2247     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2248         return true;
2249 
2250     mycore_string_t str = {0};
2251     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2252 
2253     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2254         return mycss_property_shared_switch_to_parse_error(entry);
2255 
2256     mycss_token_data_to_string(entry, token, &str, true, false);
2257     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2258 
2259     switch (dec_entry->value_type) {
2260         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_START:
2261         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_END:
2262         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_LEFT:
2263         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_RIGHT:
2264         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_CENTER:
2265         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_JUSTIFY:
2266         case MyCSS_PROPERTY_TEXT_ALIGN_ALL_MATCH_PARENT:
2267             /* default values */
2268         case MyCSS_PROPERTY_VALUE_INHERIT:
2269         case MyCSS_PROPERTY_VALUE_INITIAL:
2270         case MyCSS_PROPERTY_VALUE_UNSET:
2271             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2272 
2273         default:
2274             break;
2275     }
2276 
2277     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2278 }
2279 
mycss_property_parser_text_align_last(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2280 bool mycss_property_parser_text_align_last(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2281 {
2282     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2283         return true;
2284 
2285     mycore_string_t str = {0};
2286     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2287 
2288     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2289         return mycss_property_shared_switch_to_parse_error(entry);
2290 
2291     mycss_token_data_to_string(entry, token, &str, true, false);
2292     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2293 
2294     switch (dec_entry->value_type) {
2295         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_AUTO:
2296         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_START:
2297         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_END:
2298         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_LEFT:
2299         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_RIGHT:
2300         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_CENTER:
2301         case MyCSS_PROPERTY_TEXT_ALIGN_LAST_JUSTIFY:
2302             /* default values */
2303         case MyCSS_PROPERTY_VALUE_INHERIT:
2304         case MyCSS_PROPERTY_VALUE_INITIAL:
2305         case MyCSS_PROPERTY_VALUE_UNSET:
2306             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2307 
2308         default:
2309             break;
2310     }
2311 
2312     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2313 }
2314 
2315 /* text-transform */
mycss_property_parser_white_space(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2316 bool mycss_property_parser_white_space(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2317 {
2318     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2319         return true;
2320 
2321     mycore_string_t str = {0};
2322     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2323 
2324     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2325         return mycss_property_shared_switch_to_parse_error(entry);
2326 
2327     mycss_token_data_to_string(entry, token, &str, true, false);
2328     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2329 
2330     switch (dec_entry->value_type) {
2331         case MyCSS_PROPERTY_WHITE_SPACE_NORMAL:
2332         case MyCSS_PROPERTY_WHITE_SPACE_PRE:
2333         case MyCSS_PROPERTY_WHITE_SPACE_NOWRAP:
2334         case MyCSS_PROPERTY_WHITE_SPACE_PRE_WRAP:
2335         case MyCSS_PROPERTY_WHITE_SPACE_PRE_LINE:
2336             /* default values */
2337         case MyCSS_PROPERTY_VALUE_INHERIT:
2338         case MyCSS_PROPERTY_VALUE_INITIAL:
2339         case MyCSS_PROPERTY_VALUE_UNSET:
2340             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2341 
2342         default:
2343             break;
2344     }
2345 
2346     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2347 }
2348 
mycss_property_parser_text_transform(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2349 bool mycss_property_parser_text_transform(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2350 {
2351     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2352         return true;
2353 
2354     mycore_string_t str = {0};
2355     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2356 
2357     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2358         return mycss_property_shared_switch_to_parse_error(entry);
2359 
2360     mycss_token_data_to_string(entry, token, &str, true, false);
2361     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2362 
2363     switch (dec_entry->value_type) {
2364         case MyCSS_PROPERTY_TEXT_TRANSFORM_NONE:
2365         case MyCSS_PROPERTY_TEXT_TRANSFORM_CAPITALIZE:
2366         case MyCSS_PROPERTY_TEXT_TRANSFORM_UPPERCASE:
2367         case MyCSS_PROPERTY_TEXT_TRANSFORM_LOWERCASE:
2368         case MyCSS_PROPERTY_TEXT_TRANSFORM_FULL_WIDTH:
2369             /* default values */
2370         case MyCSS_PROPERTY_VALUE_INHERIT:
2371         case MyCSS_PROPERTY_VALUE_INITIAL:
2372         case MyCSS_PROPERTY_VALUE_UNSET:
2373             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2374 
2375         default:
2376             break;
2377     }
2378 
2379     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2380 }
2381 
mycss_property_parser_word_break(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2382 bool mycss_property_parser_word_break(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2383 {
2384     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2385         return true;
2386 
2387     mycore_string_t str = {0};
2388     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2389 
2390     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2391         return mycss_property_shared_switch_to_parse_error(entry);
2392 
2393     mycss_token_data_to_string(entry, token, &str, true, false);
2394     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2395 
2396     switch (dec_entry->value_type) {
2397         case MyCSS_PROPERTY_WORD_BREAK_NORMAL:
2398         case MyCSS_PROPERTY_WORD_BREAK_KEEP_ALL:
2399         case MyCSS_PROPERTY_WORD_BREAK_BREAK_ALL:
2400             /* default values */
2401         case MyCSS_PROPERTY_VALUE_INHERIT:
2402         case MyCSS_PROPERTY_VALUE_INITIAL:
2403         case MyCSS_PROPERTY_VALUE_UNSET:
2404             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2405 
2406         default:
2407             break;
2408     }
2409 
2410     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2411 }
2412 
mycss_property_parser_line_break(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2413 bool mycss_property_parser_line_break(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2414 {
2415     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2416         return true;
2417 
2418     mycore_string_t str = {0};
2419     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2420 
2421     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2422         return mycss_property_shared_switch_to_parse_error(entry);
2423 
2424     mycss_token_data_to_string(entry, token, &str, true, false);
2425     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2426 
2427     switch (dec_entry->value_type) {
2428         case MyCSS_PROPERTY_LINE_BREAK_AUTO:
2429         case MyCSS_PROPERTY_LINE_BREAK_LOOSE:
2430         case MyCSS_PROPERTY_LINE_BREAK_NORMAL:
2431         case MyCSS_PROPERTY_LINE_BREAK_STRICT:
2432             /* default values */
2433         case MyCSS_PROPERTY_VALUE_INHERIT:
2434         case MyCSS_PROPERTY_VALUE_INITIAL:
2435         case MyCSS_PROPERTY_VALUE_UNSET:
2436             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2437 
2438         default:
2439             break;
2440     }
2441 
2442     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2443 }
2444 
mycss_property_parser_tab_size(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2445 bool mycss_property_parser_tab_size(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2446 {
2447     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2448         return true;
2449 
2450     mycore_string_t str = {0};
2451     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2452 
2453     if(mycss_property_shared_number(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
2454        mycss_property_shared_length(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
2455        mycss_property_shared_default(entry, token, &dec_entry->value_type, &str))
2456     {
2457         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2458     }
2459 
2460     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2461 }
2462 
mycss_property_parser_hyphens(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2463 bool mycss_property_parser_hyphens(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2464 {
2465     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2466         return true;
2467 
2468     mycore_string_t str = {0};
2469     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2470 
2471     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2472         return mycss_property_shared_switch_to_parse_error(entry);
2473 
2474     mycss_token_data_to_string(entry, token, &str, true, false);
2475     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2476 
2477     switch (dec_entry->value_type) {
2478         case MyCSS_PROPERTY_HYPHENS_NONE:
2479         case MyCSS_PROPERTY_HYPHENS_MANUAL:
2480         case MyCSS_PROPERTY_HYPHENS_AUTO:
2481             /* default values */
2482         case MyCSS_PROPERTY_VALUE_INHERIT:
2483         case MyCSS_PROPERTY_VALUE_INITIAL:
2484         case MyCSS_PROPERTY_VALUE_UNSET:
2485             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2486 
2487         default:
2488             break;
2489     }
2490 
2491     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2492 }
2493 
mycss_property_parser_word_wrap(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2494 bool mycss_property_parser_word_wrap(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2495 {
2496     return mycss_property_parser_overflow_wrap(entry, token, last_response);
2497 }
2498 
mycss_property_parser_text_justify(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2499 bool mycss_property_parser_text_justify(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2500 {
2501     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2502         return true;
2503 
2504     mycore_string_t str = {0};
2505     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2506 
2507     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2508         return mycss_property_shared_switch_to_parse_error(entry);
2509 
2510     mycss_token_data_to_string(entry, token, &str, true, false);
2511     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2512 
2513     switch (dec_entry->value_type) {
2514         case MyCSS_PROPERTY_TEXT_JUSTIFY_AUTO:
2515         case MyCSS_PROPERTY_TEXT_JUSTIFY_NONE:
2516         case MyCSS_PROPERTY_TEXT_JUSTIFY_INTER_WORD:
2517         case MyCSS_PROPERTY_TEXT_JUSTIFY_INTER_CHARACTER:
2518             /* default values */
2519         case MyCSS_PROPERTY_VALUE_INHERIT:
2520         case MyCSS_PROPERTY_VALUE_INITIAL:
2521         case MyCSS_PROPERTY_VALUE_UNSET:
2522             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2523 
2524         default:
2525             break;
2526     }
2527 
2528     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2529 }
2530 
mycss_property_parser_word_spacing(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2531 bool mycss_property_parser_word_spacing(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2532 {
2533     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2534         return true;
2535 
2536     mycore_string_t str = {0};
2537     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2538 
2539     if(mycss_property_shared_length_percentage(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
2540        mycss_property_shared_by_value_type(entry, token, &dec_entry->value_type, MyCSS_PROPERTY_WORD_SPACING_NORMAL, &str) ||
2541        mycss_property_shared_default(entry, token, &dec_entry->value_type, &str))
2542     {
2543         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2544     }
2545 
2546     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2547 }
2548 
mycss_property_parser_letter_spacing(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2549 bool mycss_property_parser_letter_spacing(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2550 {
2551     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2552         return true;
2553 
2554     mycore_string_t str = {0};
2555     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2556 
2557     if(mycss_property_shared_length(entry, token, &dec_entry->value, &dec_entry->value_type, &str) ||
2558        mycss_property_shared_by_value_type(entry, token, &dec_entry->value_type, MyCSS_PROPERTY_LETTER_SPACING_NORMAL, &str) ||
2559        mycss_property_shared_default(entry, token, &dec_entry->value_type, &str))
2560     {
2561         return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2562     }
2563 
2564     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2565 }
2566 
mycss_property_parser_direction(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2567 bool mycss_property_parser_direction(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2568 {
2569     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2570         return true;
2571 
2572     mycore_string_t str = {0};
2573     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2574 
2575     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2576         return mycss_property_shared_switch_to_parse_error(entry);
2577 
2578     mycss_token_data_to_string(entry, token, &str, true, false);
2579     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2580 
2581     switch (dec_entry->value_type) {
2582         case MyCSS_PROPERTY_DIRECTION_LTR:
2583         case MyCSS_PROPERTY_DIRECTION_RTL:
2584             /* default values */
2585         case MyCSS_PROPERTY_VALUE_INHERIT:
2586         case MyCSS_PROPERTY_VALUE_INITIAL:
2587         case MyCSS_PROPERTY_VALUE_UNSET:
2588             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2589 
2590         default:
2591             break;
2592     }
2593 
2594     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2595 }
2596 
mycss_property_parser_unicode_bidi(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2597 bool mycss_property_parser_unicode_bidi(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2598 {
2599     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2600         return true;
2601 
2602     mycore_string_t str = {0};
2603     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2604 
2605     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2606         return mycss_property_shared_switch_to_parse_error(entry);
2607 
2608     mycss_token_data_to_string(entry, token, &str, true, false);
2609     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2610 
2611     switch (dec_entry->value_type) {
2612         case MyCSS_PROPERTY_UNICODE_BIDI_NORMAL:
2613         case MyCSS_PROPERTY_UNICODE_BIDI_EMBED:
2614         case MyCSS_PROPERTY_UNICODE_BIDI_ISOLATE:
2615         case MyCSS_PROPERTY_UNICODE_BIDI_BIDI_OVERRIDE:
2616         case MyCSS_PROPERTY_UNICODE_BIDI_ISOLATE_OVERRIDE:
2617         case MyCSS_PROPERTY_UNICODE_BIDI_PLAINTEXT:
2618             /* default values */
2619         case MyCSS_PROPERTY_VALUE_INHERIT:
2620         case MyCSS_PROPERTY_VALUE_INITIAL:
2621         case MyCSS_PROPERTY_VALUE_UNSET:
2622             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2623 
2624         default:
2625             break;
2626     }
2627 
2628     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2629 }
2630 
mycss_property_parser_writing_mode(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2631 bool mycss_property_parser_writing_mode(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2632 {
2633     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2634         return true;
2635 
2636     mycore_string_t str = {0};
2637     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2638 
2639     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2640         return mycss_property_shared_switch_to_parse_error(entry);
2641 
2642     mycss_token_data_to_string(entry, token, &str, true, false);
2643     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2644 
2645     switch (dec_entry->value_type) {
2646         case MyCSS_PROPERTY_WRITING_MODE_HORIZONTAL_TB:
2647         case MyCSS_PROPERTY_WRITING_MODE_VERTICAL_LR:
2648         case MyCSS_PROPERTY_WRITING_MODE_VERTICAL_RL:
2649         case MyCSS_PROPERTY_WRITING_MODE_SIDEWAYS_LR:
2650         case MyCSS_PROPERTY_WRITING_MODE_SIDEWAYS_RL:
2651             /* default values */
2652         case MyCSS_PROPERTY_VALUE_INHERIT:
2653         case MyCSS_PROPERTY_VALUE_INITIAL:
2654         case MyCSS_PROPERTY_VALUE_UNSET:
2655             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2656 
2657         default:
2658             break;
2659     }
2660 
2661     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2662 }
2663 
mycss_property_parser_text_orientation(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2664 bool mycss_property_parser_text_orientation(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2665 {
2666     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2667         return true;
2668 
2669     mycore_string_t str = {0};
2670     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2671 
2672     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2673         return mycss_property_shared_switch_to_parse_error(entry);
2674 
2675     mycss_token_data_to_string(entry, token, &str, true, false);
2676     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2677 
2678     switch (dec_entry->value_type) {
2679         case MyCSS_PROPERTY_TEXT_ORIENTATION_MIXED:
2680         case MyCSS_PROPERTY_TEXT_ORIENTATION_UPRIGHT:
2681         case MyCSS_PROPERTY_TEXT_ORIENTATION_SIDEWAYS:
2682             /* default values */
2683         case MyCSS_PROPERTY_VALUE_INHERIT:
2684         case MyCSS_PROPERTY_VALUE_INITIAL:
2685         case MyCSS_PROPERTY_VALUE_UNSET:
2686             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2687 
2688         default:
2689             break;
2690     }
2691 
2692     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2693 }
2694 
mycss_property_parser_glyph_orientation_vertical(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2695 bool mycss_property_parser_glyph_orientation_vertical(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2696 {
2697     if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
2698         return true;
2699 
2700     mycore_string_t str = {0};
2701     mycss_declaration_entry_t* dec_entry = entry->declaration->entry_last;
2702 
2703     if(token->type != MyCSS_TOKEN_TYPE_IDENT)
2704         return mycss_property_shared_switch_to_parse_error(entry);
2705 
2706     mycss_token_data_to_string(entry, token, &str, true, false);
2707     dec_entry->value_type = mycss_property_value_type_by_name(str.data, str.length);
2708 
2709     switch (dec_entry->value_type) {
2710         case MyCSS_PROPERTY_GLYPH_ORIENTATION_VERTICAL_AUTO:
2711         case MyCSS_PROPERTY_GLYPH_ORIENTATION_VERTICAL_0DEG:
2712         case MyCSS_PROPERTY_GLYPH_ORIENTATION_VERTICAL_90DEG:
2713         case MyCSS_PROPERTY_GLYPH_ORIENTATION_VERTICAL_0:
2714         case MyCSS_PROPERTY_GLYPH_ORIENTATION_VERTICAL_90:
2715             /* default values */
2716         case MyCSS_PROPERTY_VALUE_INHERIT:
2717         case MyCSS_PROPERTY_VALUE_INITIAL:
2718         case MyCSS_PROPERTY_VALUE_UNSET:
2719             return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_find_important(entry));
2720 
2721         default:
2722             break;
2723     }
2724 
2725     return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
2726 }
2727 
2728 /* not yet */
mycss_property_parser_align_content(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2729 bool mycss_property_parser_align_content(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2730 {
2731     return mycss_property_shared_switch_to_parse_error(entry);
2732 }
2733 
mycss_property_parser_align_items(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2734 bool mycss_property_parser_align_items(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2735 {
2736     return mycss_property_shared_switch_to_parse_error(entry);
2737 }
2738 
mycss_property_parser_align_self(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2739 bool mycss_property_parser_align_self(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2740 {
2741     return mycss_property_shared_switch_to_parse_error(entry);
2742 }
2743 
mycss_property_parser_animation(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2744 bool mycss_property_parser_animation(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2745 {
2746     return mycss_property_shared_switch_to_parse_error(entry);
2747 }
2748 
mycss_property_parser_animation_delay(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2749 bool mycss_property_parser_animation_delay(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2750 {
2751     return mycss_property_shared_switch_to_parse_error(entry);
2752 }
2753 
mycss_property_parser_animation_direction(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2754 bool mycss_property_parser_animation_direction(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2755 {
2756     return mycss_property_shared_switch_to_parse_error(entry);
2757 }
2758 
mycss_property_parser_animation_duration(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2759 bool mycss_property_parser_animation_duration(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2760 {
2761     return mycss_property_shared_switch_to_parse_error(entry);
2762 }
2763 
mycss_property_parser_animation_fill_mode(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2764 bool mycss_property_parser_animation_fill_mode(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2765 {
2766     return mycss_property_shared_switch_to_parse_error(entry);
2767 }
2768 
mycss_property_parser_animation_iteration_count(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2769 bool mycss_property_parser_animation_iteration_count(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2770 {
2771     return mycss_property_shared_switch_to_parse_error(entry);
2772 }
2773 
mycss_property_parser_animation_name(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2774 bool mycss_property_parser_animation_name(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2775 {
2776     return mycss_property_shared_switch_to_parse_error(entry);
2777 }
2778 
mycss_property_parser_animation_play_state(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2779 bool mycss_property_parser_animation_play_state(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2780 {
2781     return mycss_property_shared_switch_to_parse_error(entry);
2782 }
2783 
mycss_property_parser_animation_timing_function(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2784 bool mycss_property_parser_animation_timing_function(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2785 {
2786     return mycss_property_shared_switch_to_parse_error(entry);
2787 }
2788 
mycss_property_parser_appearance(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2789 bool mycss_property_parser_appearance(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2790 {
2791     return mycss_property_shared_switch_to_parse_error(entry);
2792 }
2793 
mycss_property_parser_backface_visibility(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2794 bool mycss_property_parser_backface_visibility(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2795 {
2796     return mycss_property_shared_switch_to_parse_error(entry);
2797 }
2798 
mycss_property_parser_bookmark_label(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2799 bool mycss_property_parser_bookmark_label(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2800 {
2801     return mycss_property_shared_switch_to_parse_error(entry);
2802 }
2803 
mycss_property_parser_bookmark_level(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2804 bool mycss_property_parser_bookmark_level(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2805 {
2806     return mycss_property_shared_switch_to_parse_error(entry);
2807 }
2808 
mycss_property_parser_bookmark_state(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2809 bool mycss_property_parser_bookmark_state(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2810 {
2811     return mycss_property_shared_switch_to_parse_error(entry);
2812 }
2813 
mycss_property_parser_border_collapse(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2814 bool mycss_property_parser_border_collapse(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2815 {
2816     return mycss_property_shared_switch_to_parse_error(entry);
2817 }
2818 
mycss_property_parser_border_image(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2819 bool mycss_property_parser_border_image(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2820 {
2821     return mycss_property_shared_switch_to_parse_error(entry);
2822 }
2823 
mycss_property_parser_border_image_outset(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2824 bool mycss_property_parser_border_image_outset(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2825 {
2826     return mycss_property_shared_switch_to_parse_error(entry);
2827 }
2828 
mycss_property_parser_border_image_repeat(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2829 bool mycss_property_parser_border_image_repeat(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2830 {
2831     return mycss_property_shared_switch_to_parse_error(entry);
2832 }
2833 
mycss_property_parser_border_image_slice(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2834 bool mycss_property_parser_border_image_slice(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2835 {
2836     return mycss_property_shared_switch_to_parse_error(entry);
2837 }
2838 
mycss_property_parser_border_image_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2839 bool mycss_property_parser_border_image_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2840 {
2841     return mycss_property_shared_switch_to_parse_error(entry);
2842 }
2843 
mycss_property_parser_border_spacing(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2844 bool mycss_property_parser_border_spacing(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2845 {
2846     return mycss_property_parser_short_two_type(entry, token);
2847 }
2848 
mycss_property_parser_box_decoration_break(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2849 bool mycss_property_parser_box_decoration_break(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2850 {
2851     return mycss_property_shared_switch_to_parse_error(entry);
2852 }
2853 
mycss_property_parser_box_shadow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2854 bool mycss_property_parser_box_shadow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2855 {
2856     return mycss_property_shared_switch_to_parse_error(entry);
2857 }
2858 
mycss_property_parser_box_suppress(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2859 bool mycss_property_parser_box_suppress(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2860 {
2861     return mycss_property_shared_switch_to_parse_error(entry);
2862 }
2863 
mycss_property_parser_break_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2864 bool mycss_property_parser_break_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2865 {
2866     return mycss_property_shared_switch_to_parse_error(entry);
2867 }
2868 
mycss_property_parser_break_before(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2869 bool mycss_property_parser_break_before(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2870 {
2871     return mycss_property_shared_switch_to_parse_error(entry);
2872 }
2873 
mycss_property_parser_break_inside(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2874 bool mycss_property_parser_break_inside(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2875 {
2876     return mycss_property_shared_switch_to_parse_error(entry);
2877 }
2878 
mycss_property_parser_caption_side(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2879 bool mycss_property_parser_caption_side(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2880 {
2881     return mycss_property_shared_switch_to_parse_error(entry);
2882 }
2883 
mycss_property_parser_caret(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2884 bool mycss_property_parser_caret(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2885 {
2886     return mycss_property_shared_switch_to_parse_error(entry);
2887 }
2888 
mycss_property_parser_caret_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2889 bool mycss_property_parser_caret_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2890 {
2891     return mycss_property_shared_switch_to_parse_error(entry);
2892 }
2893 
mycss_property_parser_caret_shape(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2894 bool mycss_property_parser_caret_shape(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2895 {
2896     return mycss_property_shared_switch_to_parse_error(entry);
2897 }
2898 
mycss_property_parser_color_adjust(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2899 bool mycss_property_parser_color_adjust(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2900 {
2901     return mycss_property_shared_switch_to_parse_error(entry);
2902 }
2903 
mycss_property_parser_color_interpolation(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2904 bool mycss_property_parser_color_interpolation(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2905 {
2906     return mycss_property_shared_switch_to_parse_error(entry);
2907 }
2908 
mycss_property_parser_color_interpolation_filters(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2909 bool mycss_property_parser_color_interpolation_filters(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2910 {
2911     return mycss_property_shared_switch_to_parse_error(entry);
2912 }
2913 
mycss_property_parser_color_rendering(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2914 bool mycss_property_parser_color_rendering(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2915 {
2916     return mycss_property_shared_switch_to_parse_error(entry);
2917 }
2918 
mycss_property_parser_column_count(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2919 bool mycss_property_parser_column_count(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2920 {
2921     return mycss_property_shared_switch_to_parse_error(entry);
2922 }
2923 
mycss_property_parser_column_fill(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2924 bool mycss_property_parser_column_fill(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2925 {
2926     return mycss_property_shared_switch_to_parse_error(entry);
2927 }
2928 
mycss_property_parser_column_gap(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2929 bool mycss_property_parser_column_gap(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2930 {
2931     return mycss_property_shared_switch_to_parse_error(entry);
2932 }
2933 
mycss_property_parser_column_rule(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2934 bool mycss_property_parser_column_rule(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2935 {
2936     return mycss_property_shared_switch_to_parse_error(entry);
2937 }
2938 
mycss_property_parser_column_rule_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2939 bool mycss_property_parser_column_rule_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2940 {
2941     return mycss_property_shared_switch_to_parse_error(entry);
2942 }
2943 
mycss_property_parser_column_rule_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2944 bool mycss_property_parser_column_rule_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2945 {
2946     return mycss_property_shared_switch_to_parse_error(entry);
2947 }
2948 
mycss_property_parser_column_rule_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2949 bool mycss_property_parser_column_rule_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2950 {
2951     return mycss_property_shared_switch_to_parse_error(entry);
2952 }
2953 
mycss_property_parser_column_span(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2954 bool mycss_property_parser_column_span(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2955 {
2956     return mycss_property_shared_switch_to_parse_error(entry);
2957 }
2958 
mycss_property_parser_column_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2959 bool mycss_property_parser_column_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2960 {
2961     return mycss_property_shared_switch_to_parse_error(entry);
2962 }
2963 
mycss_property_parser_columns(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2964 bool mycss_property_parser_columns(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2965 {
2966     return mycss_property_shared_switch_to_parse_error(entry);
2967 }
2968 
mycss_property_parser_contain(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2969 bool mycss_property_parser_contain(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2970 {
2971     return mycss_property_shared_switch_to_parse_error(entry);
2972 }
2973 
mycss_property_parser_content(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2974 bool mycss_property_parser_content(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2975 {
2976     return mycss_property_shared_switch_to_parse_error(entry);
2977 }
2978 
mycss_property_parser_continue(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2979 bool mycss_property_parser_continue(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2980 {
2981     return mycss_property_shared_switch_to_parse_error(entry);
2982 }
2983 
mycss_property_parser_counter_increment(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2984 bool mycss_property_parser_counter_increment(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2985 {
2986     return mycss_property_shared_switch_to_parse_error(entry);
2987 }
2988 
mycss_property_parser_cue(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2989 bool mycss_property_parser_cue(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2990 {
2991     return mycss_property_shared_switch_to_parse_error(entry);
2992 }
2993 
mycss_property_parser_cue_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2994 bool mycss_property_parser_cue_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
2995 {
2996     return mycss_property_shared_switch_to_parse_error(entry);
2997 }
2998 
mycss_property_parser_cue_before(mycss_entry_t * entry,mycss_token_t * token,bool last_response)2999 bool mycss_property_parser_cue_before(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3000 {
3001     return mycss_property_shared_switch_to_parse_error(entry);
3002 }
3003 
mycss_property_parser_empty_cells(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3004 bool mycss_property_parser_empty_cells(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3005 {
3006     return mycss_property_shared_switch_to_parse_error(entry);
3007 }
3008 
mycss_property_parser_fill(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3009 bool mycss_property_parser_fill(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3010 {
3011     return mycss_property_shared_switch_to_parse_error(entry);
3012 }
3013 
mycss_property_parser_fill_opacity(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3014 bool mycss_property_parser_fill_opacity(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3015 {
3016     return mycss_property_shared_switch_to_parse_error(entry);
3017 }
3018 
mycss_property_parser_fill_rule(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3019 bool mycss_property_parser_fill_rule(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3020 {
3021     return mycss_property_shared_switch_to_parse_error(entry);
3022 }
3023 
mycss_property_parser_flex(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3024 bool mycss_property_parser_flex(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3025 {
3026     return mycss_property_shared_switch_to_parse_error(entry);
3027 }
3028 
mycss_property_parser_flex_basis(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3029 bool mycss_property_parser_flex_basis(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3030 {
3031     return mycss_property_shared_switch_to_parse_error(entry);
3032 }
3033 
mycss_property_parser_flex_direction(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3034 bool mycss_property_parser_flex_direction(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3035 {
3036     return mycss_property_shared_switch_to_parse_error(entry);
3037 }
3038 
mycss_property_parser_flex_flow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3039 bool mycss_property_parser_flex_flow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3040 {
3041     return mycss_property_shared_switch_to_parse_error(entry);
3042 }
3043 
mycss_property_parser_flex_grow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3044 bool mycss_property_parser_flex_grow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3045 {
3046     return mycss_property_shared_switch_to_parse_error(entry);
3047 }
3048 
mycss_property_parser_flex_shrink(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3049 bool mycss_property_parser_flex_shrink(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3050 {
3051     return mycss_property_shared_switch_to_parse_error(entry);
3052 }
3053 
mycss_property_parser_flex_wrap(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3054 bool mycss_property_parser_flex_wrap(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3055 {
3056     return mycss_property_shared_switch_to_parse_error(entry);
3057 }
3058 
mycss_property_parser_font_feature_settings(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3059 bool mycss_property_parser_font_feature_settings(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3060 {
3061     return mycss_property_shared_switch_to_parse_error(entry);
3062 }
3063 
mycss_property_parser_font_kerning(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3064 bool mycss_property_parser_font_kerning(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3065 {
3066     return mycss_property_shared_switch_to_parse_error(entry);
3067 }
3068 
mycss_property_parser_font_language_override(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3069 bool mycss_property_parser_font_language_override(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3070 {
3071     return mycss_property_shared_switch_to_parse_error(entry);
3072 }
3073 
mycss_property_parser_font_synthesis(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3074 bool mycss_property_parser_font_synthesis(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3075 {
3076     return mycss_property_shared_switch_to_parse_error(entry);
3077 }
3078 
mycss_property_parser_font_variant(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3079 bool mycss_property_parser_font_variant(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3080 {
3081     return mycss_property_shared_switch_to_parse_error(entry);
3082 }
3083 
mycss_property_parser_font_variant_alternates(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3084 bool mycss_property_parser_font_variant_alternates(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3085 {
3086     return mycss_property_shared_switch_to_parse_error(entry);
3087 }
3088 
mycss_property_parser_font_variant_caps(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3089 bool mycss_property_parser_font_variant_caps(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3090 {
3091     return mycss_property_shared_switch_to_parse_error(entry);
3092 }
3093 
mycss_property_parser_font_variant_east_asian(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3094 bool mycss_property_parser_font_variant_east_asian(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3095 {
3096     return mycss_property_shared_switch_to_parse_error(entry);
3097 }
3098 
mycss_property_parser_font_variant_ligatures(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3099 bool mycss_property_parser_font_variant_ligatures(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3100 {
3101     return mycss_property_shared_switch_to_parse_error(entry);
3102 }
3103 
mycss_property_parser_font_variant_numeric(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3104 bool mycss_property_parser_font_variant_numeric(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3105 {
3106     return mycss_property_shared_switch_to_parse_error(entry);
3107 }
3108 
mycss_property_parser_font_variant_position(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3109 bool mycss_property_parser_font_variant_position(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3110 {
3111     return mycss_property_shared_switch_to_parse_error(entry);
3112 }
3113 
mycss_property_parser_hanging_punctuation(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3114 bool mycss_property_parser_hanging_punctuation(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3115 {
3116     return mycss_property_shared_switch_to_parse_error(entry);
3117 }
3118 
mycss_property_parser_image_rendering(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3119 bool mycss_property_parser_image_rendering(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3120 {
3121     return mycss_property_shared_switch_to_parse_error(entry);
3122 }
3123 
mycss_property_parser_indent_edge_reset(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3124 bool mycss_property_parser_indent_edge_reset(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3125 {
3126     return mycss_property_shared_switch_to_parse_error(entry);
3127 }
3128 
mycss_property_parser_inline_size_step(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3129 bool mycss_property_parser_inline_size_step(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3130 {
3131     return mycss_property_shared_switch_to_parse_error(entry);
3132 }
3133 
mycss_property_parser_justify_content(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3134 bool mycss_property_parser_justify_content(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3135 {
3136     return mycss_property_shared_switch_to_parse_error(entry);
3137 }
3138 
mycss_property_parser_line_height_step(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3139 bool mycss_property_parser_line_height_step(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3140 {
3141     return mycss_property_shared_switch_to_parse_error(entry);
3142 }
3143 
mycss_property_parser_list_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3144 bool mycss_property_parser_list_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3145 {
3146     return mycss_property_shared_switch_to_parse_error(entry);
3147 }
3148 
mycss_property_parser_list_style_image(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3149 bool mycss_property_parser_list_style_image(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3150 {
3151     return mycss_property_shared_switch_to_parse_error(entry);
3152 }
3153 
mycss_property_parser_list_style_position(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3154 bool mycss_property_parser_list_style_position(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3155 {
3156     return mycss_property_shared_switch_to_parse_error(entry);
3157 }
3158 
mycss_property_parser_list_style_type(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3159 bool mycss_property_parser_list_style_type(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3160 {
3161     return mycss_property_shared_switch_to_parse_error(entry);
3162 }
3163 
mycss_property_parser_marker(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3164 bool mycss_property_parser_marker(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3165 {
3166     return mycss_property_shared_switch_to_parse_error(entry);
3167 }
3168 
mycss_property_parser_marker_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3169 bool mycss_property_parser_marker_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3170 {
3171     return mycss_property_shared_switch_to_parse_error(entry);
3172 }
3173 
mycss_property_parser_marker_mid(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3174 bool mycss_property_parser_marker_mid(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3175 {
3176     return mycss_property_shared_switch_to_parse_error(entry);
3177 }
3178 
mycss_property_parser_marker_side(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3179 bool mycss_property_parser_marker_side(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3180 {
3181     return mycss_property_shared_switch_to_parse_error(entry);
3182 }
3183 
mycss_property_parser_marker_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3184 bool mycss_property_parser_marker_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3185 {
3186     return mycss_property_shared_switch_to_parse_error(entry);
3187 }
3188 
mycss_property_parser_max_lines(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3189 bool mycss_property_parser_max_lines(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3190 {
3191     return mycss_property_shared_switch_to_parse_error(entry);
3192 }
3193 
mycss_property_parser_nav_down(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3194 bool mycss_property_parser_nav_down(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3195 {
3196     return mycss_property_shared_switch_to_parse_error(entry);
3197 }
3198 
mycss_property_parser_nav_left(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3199 bool mycss_property_parser_nav_left(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3200 {
3201     return mycss_property_shared_switch_to_parse_error(entry);
3202 }
3203 
mycss_property_parser_nav_right(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3204 bool mycss_property_parser_nav_right(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3205 {
3206     return mycss_property_shared_switch_to_parse_error(entry);
3207 }
3208 
mycss_property_parser_nav_up(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3209 bool mycss_property_parser_nav_up(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3210 {
3211     return mycss_property_shared_switch_to_parse_error(entry);
3212 }
3213 
mycss_property_parser_offset_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3214 bool mycss_property_parser_offset_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3215 {
3216     return mycss_property_shared_switch_to_parse_error(entry);
3217 }
3218 
mycss_property_parser_offset_before(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3219 bool mycss_property_parser_offset_before(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3220 {
3221     return mycss_property_shared_switch_to_parse_error(entry);
3222 }
3223 
mycss_property_parser_offset_end(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3224 bool mycss_property_parser_offset_end(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3225 {
3226     return mycss_property_shared_switch_to_parse_error(entry);
3227 }
3228 
mycss_property_parser_offset_start(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3229 bool mycss_property_parser_offset_start(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3230 {
3231     return mycss_property_shared_switch_to_parse_error(entry);
3232 }
3233 
mycss_property_parser_opacity(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3234 bool mycss_property_parser_opacity(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3235 {
3236     return mycss_property_shared_switch_to_parse_error(entry);
3237 }
3238 
mycss_property_parser_order(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3239 bool mycss_property_parser_order(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3240 {
3241     return mycss_property_shared_switch_to_parse_error(entry);
3242 }
3243 
mycss_property_parser_orphans(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3244 bool mycss_property_parser_orphans(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3245 {
3246     return mycss_property_shared_switch_to_parse_error(entry);
3247 }
3248 
mycss_property_parser_outline(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3249 bool mycss_property_parser_outline(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3250 {
3251     return mycss_property_shared_switch_to_parse_error(entry);
3252 }
3253 
mycss_property_parser_outline_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3254 bool mycss_property_parser_outline_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3255 {
3256     return mycss_property_shared_switch_to_parse_error(entry);
3257 }
3258 
mycss_property_parser_outline_offset(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3259 bool mycss_property_parser_outline_offset(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3260 {
3261     return mycss_property_shared_switch_to_parse_error(entry);
3262 }
3263 
mycss_property_parser_outline_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3264 bool mycss_property_parser_outline_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3265 {
3266     return mycss_property_shared_switch_to_parse_error(entry);
3267 }
3268 
mycss_property_parser_outline_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3269 bool mycss_property_parser_outline_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3270 {
3271     return mycss_property_shared_switch_to_parse_error(entry);
3272 }
3273 
mycss_property_parser_pause(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3274 bool mycss_property_parser_pause(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3275 {
3276     return mycss_property_shared_switch_to_parse_error(entry);
3277 }
3278 
mycss_property_parser_pause_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3279 bool mycss_property_parser_pause_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3280 {
3281     return mycss_property_shared_switch_to_parse_error(entry);
3282 }
3283 
mycss_property_parser_pause_before(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3284 bool mycss_property_parser_pause_before(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3285 {
3286     return mycss_property_shared_switch_to_parse_error(entry);
3287 }
3288 
mycss_property_parser_perspective(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3289 bool mycss_property_parser_perspective(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3290 {
3291     return mycss_property_shared_switch_to_parse_error(entry);
3292 }
3293 
mycss_property_parser_perspective_origin(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3294 bool mycss_property_parser_perspective_origin(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3295 {
3296     return mycss_property_shared_switch_to_parse_error(entry);
3297 }
3298 
mycss_property_parser_presentation_level(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3299 bool mycss_property_parser_presentation_level(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3300 {
3301     return mycss_property_shared_switch_to_parse_error(entry);
3302 }
3303 
mycss_property_parser_quotes(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3304 bool mycss_property_parser_quotes(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3305 {
3306     return mycss_property_shared_switch_to_parse_error(entry);
3307 }
3308 
mycss_property_parser_region_fragment(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3309 bool mycss_property_parser_region_fragment(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3310 {
3311     return mycss_property_shared_switch_to_parse_error(entry);
3312 }
3313 
mycss_property_parser_resize(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3314 bool mycss_property_parser_resize(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3315 {
3316     return mycss_property_shared_switch_to_parse_error(entry);
3317 }
3318 
mycss_property_parser_rest(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3319 bool mycss_property_parser_rest(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3320 {
3321     return mycss_property_shared_switch_to_parse_error(entry);
3322 }
3323 
mycss_property_parser_rest_after(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3324 bool mycss_property_parser_rest_after(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3325 {
3326     return mycss_property_shared_switch_to_parse_error(entry);
3327 }
3328 
mycss_property_parser_rest_before(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3329 bool mycss_property_parser_rest_before(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3330 {
3331     return mycss_property_shared_switch_to_parse_error(entry);
3332 }
3333 
mycss_property_parser_ruby_align(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3334 bool mycss_property_parser_ruby_align(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3335 {
3336     return mycss_property_shared_switch_to_parse_error(entry);
3337 }
3338 
mycss_property_parser_ruby_merge(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3339 bool mycss_property_parser_ruby_merge(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3340 {
3341     return mycss_property_shared_switch_to_parse_error(entry);
3342 }
3343 
mycss_property_parser_ruby_position(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3344 bool mycss_property_parser_ruby_position(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3345 {
3346     return mycss_property_shared_switch_to_parse_error(entry);
3347 }
3348 
mycss_property_parser_scroll_padding(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3349 bool mycss_property_parser_scroll_padding(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3350 {
3351     return mycss_property_shared_switch_to_parse_error(entry);
3352 }
3353 
mycss_property_parser_scroll_snap_align(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3354 bool mycss_property_parser_scroll_snap_align(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3355 {
3356     return mycss_property_shared_switch_to_parse_error(entry);
3357 }
3358 
mycss_property_parser_scroll_snap_margin(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3359 bool mycss_property_parser_scroll_snap_margin(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3360 {
3361     return mycss_property_shared_switch_to_parse_error(entry);
3362 }
3363 
mycss_property_parser_scroll_snap_stop(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3364 bool mycss_property_parser_scroll_snap_stop(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3365 {
3366     return mycss_property_shared_switch_to_parse_error(entry);
3367 }
3368 
mycss_property_parser_scroll_snap_type(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3369 bool mycss_property_parser_scroll_snap_type(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3370 {
3371     return mycss_property_shared_switch_to_parse_error(entry);
3372 }
3373 
mycss_property_parser_shape_image_threshold(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3374 bool mycss_property_parser_shape_image_threshold(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3375 {
3376     return mycss_property_shared_switch_to_parse_error(entry);
3377 }
3378 
mycss_property_parser_shape_margin(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3379 bool mycss_property_parser_shape_margin(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3380 {
3381     return mycss_property_shared_switch_to_parse_error(entry);
3382 }
3383 
mycss_property_parser_shape_outside(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3384 bool mycss_property_parser_shape_outside(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3385 {
3386     return mycss_property_shared_switch_to_parse_error(entry);
3387 }
3388 
mycss_property_parser_shape_rendering(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3389 bool mycss_property_parser_shape_rendering(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3390 {
3391     return mycss_property_shared_switch_to_parse_error(entry);
3392 }
3393 
mycss_property_parser_speak(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3394 bool mycss_property_parser_speak(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3395 {
3396     return mycss_property_shared_switch_to_parse_error(entry);
3397 }
3398 
mycss_property_parser_speak_as(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3399 bool mycss_property_parser_speak_as(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3400 {
3401     return mycss_property_shared_switch_to_parse_error(entry);
3402 }
3403 
mycss_property_parser_string_set(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3404 bool mycss_property_parser_string_set(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3405 {
3406     return mycss_property_shared_switch_to_parse_error(entry);
3407 }
3408 
mycss_property_parser_stroke(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3409 bool mycss_property_parser_stroke(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3410 {
3411     return mycss_property_shared_switch_to_parse_error(entry);
3412 }
3413 
mycss_property_parser_stroke_dasharray(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3414 bool mycss_property_parser_stroke_dasharray(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3415 {
3416     return mycss_property_shared_switch_to_parse_error(entry);
3417 }
3418 
mycss_property_parser_stroke_dashoffset(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3419 bool mycss_property_parser_stroke_dashoffset(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3420 {
3421     return mycss_property_shared_switch_to_parse_error(entry);
3422 }
3423 
mycss_property_parser_stroke_linecap(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3424 bool mycss_property_parser_stroke_linecap(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3425 {
3426     return mycss_property_shared_switch_to_parse_error(entry);
3427 }
3428 
mycss_property_parser_stroke_linejoin(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3429 bool mycss_property_parser_stroke_linejoin(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3430 {
3431     return mycss_property_shared_switch_to_parse_error(entry);
3432 }
3433 
mycss_property_parser_stroke_miterlimit(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3434 bool mycss_property_parser_stroke_miterlimit(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3435 {
3436     return mycss_property_shared_switch_to_parse_error(entry);
3437 }
3438 
mycss_property_parser_stroke_opacity(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3439 bool mycss_property_parser_stroke_opacity(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3440 {
3441     return mycss_property_shared_switch_to_parse_error(entry);
3442 }
3443 
mycss_property_parser_stroke_width(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3444 bool mycss_property_parser_stroke_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3445 {
3446     return mycss_property_shared_switch_to_parse_error(entry);
3447 }
3448 
mycss_property_parser_table_layout(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3449 bool mycss_property_parser_table_layout(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3450 {
3451     return mycss_property_shared_switch_to_parse_error(entry);
3452 }
3453 
mycss_property_parser_text_combine_upright(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3454 bool mycss_property_parser_text_combine_upright(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3455 {
3456     return mycss_property_shared_switch_to_parse_error(entry);
3457 }
3458 
mycss_property_parser_text_emphasis(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3459 bool mycss_property_parser_text_emphasis(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3460 {
3461     return mycss_property_shared_switch_to_parse_error(entry);
3462 }
3463 
mycss_property_parser_text_emphasis_color(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3464 bool mycss_property_parser_text_emphasis_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3465 {
3466     return mycss_property_shared_switch_to_parse_error(entry);
3467 }
3468 
mycss_property_parser_text_emphasis_position(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3469 bool mycss_property_parser_text_emphasis_position(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3470 {
3471     return mycss_property_shared_switch_to_parse_error(entry);
3472 }
3473 
mycss_property_parser_text_emphasis_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3474 bool mycss_property_parser_text_emphasis_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3475 {
3476     return mycss_property_shared_switch_to_parse_error(entry);
3477 }
3478 
mycss_property_parser_text_indent(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3479 bool mycss_property_parser_text_indent(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3480 {
3481     return mycss_property_shared_switch_to_parse_error(entry);
3482 }
3483 
mycss_property_parser_text_overflow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3484 bool mycss_property_parser_text_overflow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3485 {
3486     return mycss_property_shared_switch_to_parse_error(entry);
3487 }
3488 
mycss_property_parser_text_rendering(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3489 bool mycss_property_parser_text_rendering(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3490 {
3491     return mycss_property_shared_switch_to_parse_error(entry);
3492 }
3493 
mycss_property_parser_text_shadow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3494 bool mycss_property_parser_text_shadow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3495 {
3496     return mycss_property_shared_switch_to_parse_error(entry);
3497 }
3498 
mycss_property_parser_text_size_adjust(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3499 bool mycss_property_parser_text_size_adjust(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3500 {
3501     return mycss_property_shared_switch_to_parse_error(entry);
3502 }
3503 
mycss_property_parser_text_underline_position(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3504 bool mycss_property_parser_text_underline_position(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3505 {
3506     return mycss_property_shared_switch_to_parse_error(entry);
3507 }
3508 
mycss_property_parser_touch_action(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3509 bool mycss_property_parser_touch_action(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3510 {
3511     return mycss_property_shared_switch_to_parse_error(entry);
3512 }
3513 
mycss_property_parser_transform(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3514 bool mycss_property_parser_transform(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3515 {
3516     return mycss_property_shared_switch_to_parse_error(entry);
3517 }
3518 
mycss_property_parser_transform_box(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3519 bool mycss_property_parser_transform_box(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3520 {
3521     return mycss_property_shared_switch_to_parse_error(entry);
3522 }
3523 
mycss_property_parser_transform_origin(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3524 bool mycss_property_parser_transform_origin(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3525 {
3526     return mycss_property_shared_switch_to_parse_error(entry);
3527 }
3528 
mycss_property_parser_transform_style(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3529 bool mycss_property_parser_transform_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3530 {
3531     return mycss_property_shared_switch_to_parse_error(entry);
3532 }
3533 
mycss_property_parser_transition(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3534 bool mycss_property_parser_transition(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3535 {
3536     return mycss_property_shared_switch_to_parse_error(entry);
3537 }
3538 
mycss_property_parser_transition_delay(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3539 bool mycss_property_parser_transition_delay(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3540 {
3541     return mycss_property_shared_switch_to_parse_error(entry);
3542 }
3543 
mycss_property_parser_transition_duration(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3544 bool mycss_property_parser_transition_duration(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3545 {
3546     return mycss_property_shared_switch_to_parse_error(entry);
3547 }
3548 
mycss_property_parser_transition_property(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3549 bool mycss_property_parser_transition_property(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3550 {
3551     return mycss_property_shared_switch_to_parse_error(entry);
3552 }
3553 
mycss_property_parser_transition_timing_function(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3554 bool mycss_property_parser_transition_timing_function(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3555 {
3556     return mycss_property_shared_switch_to_parse_error(entry);
3557 }
3558 
mycss_property_parser_user_select(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3559 bool mycss_property_parser_user_select(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3560 {
3561     return mycss_property_shared_switch_to_parse_error(entry);
3562 }
3563 
mycss_property_parser_voice_balance(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3564 bool mycss_property_parser_voice_balance(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3565 {
3566     return mycss_property_shared_switch_to_parse_error(entry);
3567 }
3568 
mycss_property_parser_voice_duration(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3569 bool mycss_property_parser_voice_duration(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3570 {
3571     return mycss_property_shared_switch_to_parse_error(entry);
3572 }
3573 
mycss_property_parser_voice_family(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3574 bool mycss_property_parser_voice_family(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3575 {
3576     return mycss_property_shared_switch_to_parse_error(entry);
3577 }
3578 
mycss_property_parser_voice_pitch(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3579 bool mycss_property_parser_voice_pitch(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3580 {
3581     return mycss_property_shared_switch_to_parse_error(entry);
3582 }
3583 
mycss_property_parser_voice_range(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3584 bool mycss_property_parser_voice_range(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3585 {
3586     return mycss_property_shared_switch_to_parse_error(entry);
3587 }
3588 
mycss_property_parser_voice_rate(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3589 bool mycss_property_parser_voice_rate(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3590 {
3591     return mycss_property_shared_switch_to_parse_error(entry);
3592 }
3593 
mycss_property_parser_voice_stress(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3594 bool mycss_property_parser_voice_stress(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3595 {
3596     return mycss_property_shared_switch_to_parse_error(entry);
3597 }
3598 
mycss_property_parser_voice_volume(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3599 bool mycss_property_parser_voice_volume(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3600 {
3601     return mycss_property_shared_switch_to_parse_error(entry);
3602 }
3603 
mycss_property_parser_widows(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3604 bool mycss_property_parser_widows(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3605 {
3606     return mycss_property_shared_switch_to_parse_error(entry);
3607 }
3608 
mycss_property_parser_will_change(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3609 bool mycss_property_parser_will_change(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3610 {
3611     return mycss_property_shared_switch_to_parse_error(entry);
3612 }
3613 
mycss_property_parser_wrap_flow(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3614 bool mycss_property_parser_wrap_flow(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3615 {
3616     return mycss_property_shared_switch_to_parse_error(entry);
3617 }
3618 
mycss_property_parser_wrap_through(mycss_entry_t * entry,mycss_token_t * token,bool last_response)3619 bool mycss_property_parser_wrap_through(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
3620 {
3621     return mycss_property_shared_switch_to_parse_error(entry);
3622 }
3623 
3624 
3625