diff --git a/include/mycss/selectors/function_parser.h b/include/mycss/selectors/function_parser.h index 63c48f2..0fac6e2 100644 --- a/include/mycss/selectors/function_parser.h +++ b/include/mycss/selectors/function_parser.h @@ -22,9 +22,7 @@ #define MyHTML_MyCSS_SELECTORS_FUNCTION_PARSER_H #pragma once -// FRANK -// #define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 57 -#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 59 +#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 57 #ifdef __cplusplus extern "C" { diff --git a/include/mycss/selectors/function_resource.h b/include/mycss/selectors/function_resource.h index 14ebfb1..08aff1d 100644 --- a/include/mycss/selectors/function_resource.h +++ b/include/mycss/selectors/function_resource.h @@ -22,11 +22,9 @@ #define MyHTML_MyCSS_SELECTORS_FUNCTION_RESOURCE_H #pragma once -// FRANK -// #define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 58 -#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 59 +#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 57 -static const mycss_selectots_function_begin_entry_t mycss_selectors_function_begin_map_index[] = +static const mycss_selectots_function_begin_entry_t mycss_selectors_function_begin_map_index[] = { {NULL, 0, NULL, 0, 0}, {"dir", 3, mycss_selectors_function_begin_dir, 0, 1}, @@ -80,12 +78,11 @@ static const mycss_selectots_function_begin_entry_t mycss_selectors_function_beg {"nth-child", 9, mycss_selectors_function_begin_nth_child, 0, 49}, {NULL, 0, NULL, 0, 0}, {NULL, 0, NULL, 0, 0}, - {NULL, 0, NULL, 0, 0}, + {"contains", 8, mycss_selectors_function_begin_contains, 0, 52}, {NULL, 0, NULL, 0, 0}, {NULL, 0, NULL, 0, 0}, {NULL, 0, NULL, 0, 0}, {"drop", 4, mycss_selectors_function_begin_drop, 0, 56}, - {"contains", 8, mycss_selectors_function_begin_contains, 0, 57}, {NULL, 0, NULL, 0, 0}, }; diff --git a/include/mycss/selectors/value_resource.h b/include/mycss/selectors/value_resource.h index 69958b1..32d0061 100644 --- a/include/mycss/selectors/value_resource.h +++ b/include/mycss/selectors/value_resource.h @@ -39,6 +39,7 @@ static const mycss_selectors_value_destroy_f mycss_selectors_value_destroy_map[M static const mycss_selectors_value_function_destroy_f mycss_selectors_value_function_destroy_map[MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_LAST_ENTRY] = { mycss_selectors_value_pseudo_class_function_undef_destroy, mycss_selectors_value_pseudo_class_function_undef_destroy, + mycss_selectors_value_pseudo_class_function_contains_destroy, mycss_selectors_value_pseudo_class_function_current_destroy, mycss_selectors_value_pseudo_class_function_dir_destroy, mycss_selectors_value_pseudo_class_function_drop_destroy, @@ -52,7 +53,6 @@ static const mycss_selectors_value_function_destroy_f mycss_selectors_value_func mycss_selectors_value_pseudo_class_function_nth_last_column_destroy, mycss_selectors_value_pseudo_class_function_nth_last_of_type_destroy, mycss_selectors_value_pseudo_class_function_nth_of_type_destroy, - mycss_selectors_value_pseudo_class_function_contains_destroy, }; #endif /* MyHTML_MyCSS_SELECTORS_VALUE_RESOURCE_H */ diff --git a/lib/libmodest-0.0.6.so b/lib/libmodest-0.0.6.so new file mode 100755 index 0000000..797a223 Binary files /dev/null and b/lib/libmodest-0.0.6.so differ diff --git a/lib/libmodest-0.0.so b/lib/libmodest-0.0.so new file mode 120000 index 0000000..0ef27eb --- /dev/null +++ b/lib/libmodest-0.0.so @@ -0,0 +1 @@ +libmodest-0.0.6.so \ No newline at end of file diff --git a/lib/libmodest-0.so b/lib/libmodest-0.so new file mode 120000 index 0000000..0ef27eb --- /dev/null +++ b/lib/libmodest-0.so @@ -0,0 +1 @@ +libmodest-0.0.6.so \ No newline at end of file diff --git a/lib/libmodest.so b/lib/libmodest.so new file mode 120000 index 0000000..0ef27eb --- /dev/null +++ b/lib/libmodest.so @@ -0,0 +1 @@ +libmodest-0.0.6.so \ No newline at end of file diff --git a/lib/libmodest_static.a b/lib/libmodest_static.a new file mode 100644 index 0000000..2170a91 Binary files /dev/null and b/lib/libmodest_static.a differ diff --git a/source/mycss/selectors/function_parser.h b/source/mycss/selectors/function_parser.h index e15cb4e..1dac131 100644 --- a/source/mycss/selectors/function_parser.h +++ b/source/mycss/selectors/function_parser.h @@ -22,9 +22,7 @@ #define MyHTML_MyCSS_SELECTORS_FUNCTION_PARSER_H #pragma once -// FRANK -// #define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 58 -#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 59 +#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 57 #ifdef __cplusplus extern "C" { diff --git a/source/mycss/selectors/function_resource.h b/source/mycss/selectors/function_resource.h index 14ebfb1..08aff1d 100644 --- a/source/mycss/selectors/function_resource.h +++ b/source/mycss/selectors/function_resource.h @@ -22,11 +22,9 @@ #define MyHTML_MyCSS_SELECTORS_FUNCTION_RESOURCE_H #pragma once -// FRANK -// #define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 58 -#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 59 +#define MyCSS_SELECTORS_FUNCTION_NAME_STATIC_SIZE 57 -static const mycss_selectots_function_begin_entry_t mycss_selectors_function_begin_map_index[] = +static const mycss_selectots_function_begin_entry_t mycss_selectors_function_begin_map_index[] = { {NULL, 0, NULL, 0, 0}, {"dir", 3, mycss_selectors_function_begin_dir, 0, 1}, @@ -80,12 +78,11 @@ static const mycss_selectots_function_begin_entry_t mycss_selectors_function_beg {"nth-child", 9, mycss_selectors_function_begin_nth_child, 0, 49}, {NULL, 0, NULL, 0, 0}, {NULL, 0, NULL, 0, 0}, - {NULL, 0, NULL, 0, 0}, + {"contains", 8, mycss_selectors_function_begin_contains, 0, 52}, {NULL, 0, NULL, 0, 0}, {NULL, 0, NULL, 0, 0}, {NULL, 0, NULL, 0, 0}, {"drop", 4, mycss_selectors_function_begin_drop, 0, 56}, - {"contains", 8, mycss_selectors_function_begin_contains, 0, 57}, {NULL, 0, NULL, 0, 0}, }; diff --git a/source/mycss/selectors/value.c b/source/mycss/selectors/value.c index 34e8583..ad655ab 100644 --- a/source/mycss/selectors/value.c +++ b/source/mycss/selectors/value.c @@ -371,4 +371,16 @@ void * mycss_selectors_value_pseudo_class_function_nth_of_type_destroy(mycss_ent return value; } +void * mycss_selectors_value_pseudo_class_function_contains_destroy(mycss_entry_t* entry, void* value, bool self_destroy) +{ + if(value == NULL) + return NULL; + + if(self_destroy) { + mchar_async_free(entry->mchar, entry->mchar_value_node_id, value); + return NULL; + } + + return value; +} diff --git a/source/mycss/selectors/value_resource.h b/source/mycss/selectors/value_resource.h index c2e0eb2..2324af1 100644 --- a/source/mycss/selectors/value_resource.h +++ b/source/mycss/selectors/value_resource.h @@ -39,6 +39,7 @@ static const mycss_selectors_value_destroy_f mycss_selectors_value_destroy_map[M static const mycss_selectors_value_function_destroy_f mycss_selectors_value_function_destroy_map[MyCSS_SELECTORS_SUB_TYPE_PSEUDO_CLASS_FUNCTION_LAST_ENTRY] = { mycss_selectors_value_pseudo_class_function_undef_destroy, mycss_selectors_value_pseudo_class_function_undef_destroy, + mycss_selectors_value_pseudo_class_function_contains_destroy, mycss_selectors_value_pseudo_class_function_current_destroy, mycss_selectors_value_pseudo_class_function_dir_destroy, mycss_selectors_value_pseudo_class_function_drop_destroy, diff --git a/test/mycore/utils/avl_tree b/test/mycore/utils/avl_tree new file mode 100755 index 0000000..90eaf2b Binary files /dev/null and b/test/mycore/utils/avl_tree differ diff --git a/test/mycss/declaration b/test/mycss/declaration new file mode 100755 index 0000000..c9a23fd Binary files /dev/null and b/test/mycss/declaration differ diff --git a/test/myencoding/encoding_detect_meta b/test/myencoding/encoding_detect_meta new file mode 100755 index 0000000..b95c436 Binary files /dev/null and b/test/myencoding/encoding_detect_meta differ diff --git a/test/myhtml/commoncrawl b/test/myhtml/commoncrawl new file mode 100755 index 0000000..da3d55b Binary files /dev/null and b/test/myhtml/commoncrawl differ diff --git a/test/myhtml/pseudo_class_contains b/test/myhtml/pseudo_class_contains new file mode 100755 index 0000000..4d1cbc0 Binary files /dev/null and b/test/myhtml/pseudo_class_contains differ diff --git a/test/myurl/url b/test/myurl/url new file mode 100755 index 0000000..54f5f31 Binary files /dev/null and b/test/myurl/url differ diff --git a/test_suite/mycore/utils/avl_tree b/test_suite/mycore/utils/avl_tree new file mode 100755 index 0000000..90eaf2b Binary files /dev/null and b/test_suite/mycore/utils/avl_tree differ diff --git a/test_suite/mycss/declaration b/test_suite/mycss/declaration new file mode 100755 index 0000000..c9a23fd Binary files /dev/null and b/test_suite/mycss/declaration differ diff --git a/test_suite/myencoding/encoding_detect_meta b/test_suite/myencoding/encoding_detect_meta new file mode 100755 index 0000000..b95c436 Binary files /dev/null and b/test_suite/myencoding/encoding_detect_meta differ diff --git a/test_suite/myhtml/commoncrawl b/test_suite/myhtml/commoncrawl new file mode 100755 index 0000000..da3d55b Binary files /dev/null and b/test_suite/myhtml/commoncrawl differ diff --git a/test_suite/myhtml/pseudo_class_contains b/test_suite/myhtml/pseudo_class_contains new file mode 100755 index 0000000..4d1cbc0 Binary files /dev/null and b/test_suite/myhtml/pseudo_class_contains differ diff --git a/test_suite/myurl/url b/test_suite/myurl/url new file mode 100755 index 0000000..54f5f31 Binary files /dev/null and b/test_suite/myurl/url differ diff --git a/utils/MyCSS/functions.pl b/utils/MyCSS/functions.pl index 62d6c8d..b4660d3 100755 --- a/utils/MyCSS/functions.pl +++ b/utils/MyCSS/functions.pl @@ -13,7 +13,6 @@ my $func_map = { not => "", matches => "", has => "", - contains => "", dir => "", lang => "", current => "", @@ -23,7 +22,8 @@ my $func_map = { 'nth-of-type' => "", 'nth-last-of-type' => "", 'nth-column' => "", - 'nth-last-column' => "" + 'nth-last-column' => "", + 'contains' => "" }; my $INDEX_OF_NAMES = print_functions();