2 * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_chtml10.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_cookie.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
25 #include "chxj_str_util.h"
26 #include "chxj_header_inf.h"
27 #include "chxj_conv_z2h.h"
29 #define GET_CHTML10(X) ((chtml10_t *)(X))
32 #define W_L(X) do { chtml10->out = BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, (X)); } while(0)
33 #define W_V(X) do { chtml10->out = (X) ? BUFFERED_WRITE_VALUE(chtml10->out, &doc->buf, (X)) \
34 : BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, ""); } while(0)
37 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml10->conf); W_V(nlcode); } while (0)
39 #define CHTML10_PUSH_ONLY(tagname) \
44 char *attr_style = NULL; \
45 chtml10 = GET_CHTML10(pdoc); \
47 for (attr = qs_get_attr(doc,node); \
49 attr = qs_get_next_attr(doc,attr)) { \
50 char *nm = qs_get_attr_name(doc,attr); \
51 char *val = qs_get_attr_value(doc,attr); \
52 if (val && STRCASEEQ('s','S',"style", nm)) { \
57 if (IS_CSS_ON(chtml10->entryp)) { \
58 s_chtml10_push_and_get_now_style(pdoc, node, attr_style); \
60 return chtml10->out; \
64 static char *s_chtml10_start_html_tag (void *pdoc, Node *node);
65 static char *s_chtml10_end_html_tag (void *pdoc, Node *node);
66 static char *s_chtml10_start_meta_tag (void *pdoc, Node *node);
67 static char *s_chtml10_end_meta_tag (void *pdoc, Node *node);
68 static char *s_chtml10_start_textarea_tag (void *pdoc, Node *node);
69 static char *s_chtml10_end_textarea_tag (void *pdoc, Node *node);
70 static char *s_chtml10_start_p_tag (void *pdoc, Node *node);
71 static char *s_chtml10_end_p_tag (void *pdoc, Node *node);
72 static char *s_chtml10_start_pre_tag (void *pdoc, Node *node);
73 static char *s_chtml10_end_pre_tag (void *pdoc, Node *node);
74 static char *s_chtml10_start_ul_tag (void *pdoc, Node *node);
75 static char *s_chtml10_end_ul_tag (void *pdoc, Node *node);
76 static char *s_chtml10_start_li_tag (void *pdoc, Node *node);
77 static char *s_chtml10_end_li_tag (void *pdoc, Node *node);
78 static char *s_chtml10_start_ol_tag (void *pdoc, Node *node);
79 static char *s_chtml10_end_ol_tag (void *pdoc, Node *node);
80 static char *s_chtml10_start_h1_tag (void *pdoc, Node *node);
81 static char *s_chtml10_end_h1_tag (void *pdoc, Node *node);
82 static char *s_chtml10_start_h2_tag (void *pdoc, Node *node);
83 static char *s_chtml10_end_h2_tag (void *pdoc, Node *node);
84 static char *s_chtml10_start_h3_tag (void *pdoc, Node *node);
85 static char *s_chtml10_end_h3_tag (void *pdoc, Node *node);
86 static char *s_chtml10_start_h4_tag (void *pdoc, Node *node);
87 static char *s_chtml10_end_h4_tag (void *pdoc, Node *node);
88 static char *s_chtml10_start_h5_tag (void *pdoc, Node *node);
89 static char *s_chtml10_end_h5_tag (void *pdoc, Node *node);
90 static char *s_chtml10_start_h6_tag (void *pdoc, Node *node);
91 static char *s_chtml10_end_h6_tag (void *pdoc, Node *node);
92 static char *s_chtml10_start_head_tag (void *pdoc, Node *node);
93 static char *s_chtml10_end_head_tag (void *pdoc, Node *node);
94 static char *s_chtml10_start_title_tag (void *pdoc, Node *node);
95 static char *s_chtml10_end_title_tag (void *pdoc, Node *node);
96 static char *s_chtml10_start_base_tag (void *pdoc, Node *node);
97 static char *s_chtml10_end_base_tag (void *pdoc, Node *node);
98 static char *s_chtml10_start_body_tag (void *pdoc, Node *node);
99 static char *s_chtml10_end_body_tag (void *pdoc, Node *node);
100 static char *s_chtml10_start_a_tag (void *pdoc, Node *node);
101 static char *s_chtml10_end_a_tag (void *pdoc, Node *node);
102 static char *s_chtml10_start_br_tag (void *pdoc, Node *node);
103 static char *s_chtml10_end_br_tag (void *pdoc, Node *node);
104 static char *s_chtml10_start_tr_tag (void *pdoc, Node *node);
105 static char *s_chtml10_end_tr_tag (void *pdoc, Node *node);
106 static char *s_chtml10_start_input_tag (void *pdoc, Node *node);
107 static char *s_chtml10_end_input_tag (void *pdoc, Node *node);
108 static char *s_chtml10_start_form_tag (void *pdoc, Node *node);
109 static char *s_chtml10_end_form_tag (void *pdoc, Node *node);
110 static char *s_chtml10_start_center_tag (void *pdoc, Node *node);
111 static char *s_chtml10_end_center_tag (void *pdoc, Node *node);
112 static char *s_chtml10_start_hr_tag (void *pdoc, Node *node);
113 static char *s_chtml10_end_hr_tag (void *pdoc, Node *node);
114 static char *s_chtml10_start_img_tag (void *pdoc, Node *node);
115 static char *s_chtml10_end_img_tag (void *pdoc, Node *node);
116 static char *s_chtml10_start_select_tag (void *pdoc, Node *node);
117 static char *s_chtml10_end_select_tag (void *pdoc, Node *node);
118 static char *s_chtml10_start_option_tag (void *pdoc, Node *node);
119 static char *s_chtml10_end_option_tag (void *pdoc, Node *node);
120 static char *s_chtml10_start_div_tag (void *pdoc, Node *node);
121 static char *s_chtml10_end_div_tag (void *pdoc, Node *node);
122 static char *s_chtml10_start_blockquote_tag (void *pdoc, Node *node);
123 static char *s_chtml10_end_blockquote_tag (void *pdoc, Node *node);
124 static char *s_chtml10_start_dir_tag (void *pdoc, Node *node);
125 static char *s_chtml10_end_dir_tag (void *pdoc, Node *node);
126 static char *s_chtml10_start_dl_tag (void *pdoc, Node *node);
127 static char *s_chtml10_end_dl_tag (void *pdoc, Node *node);
128 static char *s_chtml10_start_dt_tag (void *pdoc, Node *node);
129 static char *s_chtml10_end_dt_tag (void *pdoc, Node *node);
130 static char *s_chtml10_start_dd_tag (void *pdoc, Node *node);
131 static char *s_chtml10_end_dd_tag (void *pdoc, Node *node);
132 static char *s_chtml10_start_menu_tag (void *pdoc, Node *node);
133 static char *s_chtml10_end_menu_tag (void *pdoc, Node *node);
134 static char *s_chtml10_start_plaintext_tag (void *pdoc, Node *node);
135 static char *s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node);
136 static char *s_chtml10_end_plaintext_tag (void *pdoc, Node *node);
137 static char *s_chtml10_link_tag (void *pdoc, Node *node);
138 static char *s_chtml10_style_tag (void *pdoc, Node *node);
139 static char *s_chtml10_newline_mark (void *pdoc, Node *node);
140 static char *s_chtml10_start_span_tag (void *pdoc, Node *node);
141 static char *s_chtml10_end_span_tag (void *pdoc, Node *node);
143 static void s_init_chtml10(chtml10_t *chtml, Doc *doc, request_rec *r, device_table *spec);
145 static int s_chtml10_search_emoji(chtml10_t *chtml, char *txt, char **rslt);
146 static char *s_chtml10_chxjif_tag (void *pdoc, Node *node);
147 static char *s_chtml10_text (void *pdoc, Node *node);
148 static css_prop_list_t *s_chtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
149 static css_prop_list_t *s_chtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
153 tag_handler chtml10_handler[] = {
156 s_chtml10_start_html_tag,
157 s_chtml10_end_html_tag,
161 s_chtml10_start_meta_tag,
162 s_chtml10_end_meta_tag,
166 s_chtml10_start_textarea_tag,
167 s_chtml10_end_textarea_tag,
171 s_chtml10_start_p_tag,
176 s_chtml10_start_pre_tag,
177 s_chtml10_end_pre_tag,
181 s_chtml10_start_ul_tag,
182 s_chtml10_end_ul_tag,
186 s_chtml10_start_li_tag,
187 s_chtml10_end_li_tag,
191 s_chtml10_start_ol_tag,
192 s_chtml10_end_ol_tag,
196 s_chtml10_start_h1_tag,
197 s_chtml10_end_h1_tag,
201 s_chtml10_start_h2_tag,
202 s_chtml10_end_h2_tag,
206 s_chtml10_start_h3_tag,
207 s_chtml10_end_h3_tag,
211 s_chtml10_start_h4_tag,
212 s_chtml10_end_h4_tag,
216 s_chtml10_start_h5_tag,
217 s_chtml10_end_h5_tag,
221 s_chtml10_start_h6_tag,
222 s_chtml10_end_h6_tag,
226 s_chtml10_start_head_tag,
227 s_chtml10_end_head_tag,
231 s_chtml10_start_title_tag,
232 s_chtml10_end_title_tag,
236 s_chtml10_start_base_tag,
237 s_chtml10_end_base_tag,
241 s_chtml10_start_body_tag,
242 s_chtml10_end_body_tag,
246 s_chtml10_start_a_tag,
251 s_chtml10_start_br_tag,
252 s_chtml10_end_br_tag,
261 s_chtml10_start_tr_tag,
262 s_chtml10_end_tr_tag,
281 s_chtml10_start_form_tag,
282 s_chtml10_end_form_tag,
286 s_chtml10_start_input_tag,
287 s_chtml10_end_input_tag,
291 s_chtml10_start_center_tag,
292 s_chtml10_end_center_tag,
296 s_chtml10_start_hr_tag,
297 s_chtml10_end_hr_tag,
301 s_chtml10_start_img_tag,
302 s_chtml10_end_img_tag,
306 s_chtml10_start_select_tag,
307 s_chtml10_end_select_tag,
311 s_chtml10_start_option_tag,
312 s_chtml10_end_option_tag,
316 s_chtml10_start_div_tag,
317 s_chtml10_end_div_tag,
321 s_chtml10_chxjif_tag,
341 s_chtml10_start_span_tag,
342 s_chtml10_end_span_tag,
366 s_chtml10_start_dt_tag,
367 s_chtml10_end_dt_tag,
381 s_chtml10_start_blockquote_tag,
382 s_chtml10_end_blockquote_tag,
386 s_chtml10_start_dir_tag,
387 s_chtml10_end_dir_tag,
391 s_chtml10_start_dl_tag,
392 s_chtml10_end_dl_tag,
396 s_chtml10_start_dd_tag,
397 s_chtml10_end_dd_tag,
401 s_chtml10_start_menu_tag,
402 s_chtml10_end_menu_tag,
406 s_chtml10_start_plaintext_tag,
407 s_chtml10_end_plaintext_tag,
426 s_chtml10_newline_mark,
433 * converts from CHTML5.0 to CHTML1.0.
435 * @param r [i] Requet_rec is appointed.
436 * @param spec [i] The result of the device specification processing which
437 * was done in advance is appointed.
438 * @param src [i] The character string before the converting is appointed.
439 * @return The character string after the converting is returned.
442 chxj_convert_chtml10(
448 chxjconvrule_entry *entryp,
461 DBG(r, "start chxj_convert_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
463 /*--------------------------------------------------------------------------*/
465 /*--------------------------------------------------------------------------*/
467 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
469 DBG(r,"i found qrcode xml");
472 DBG(r,"not found qrcode xml");
474 /*--------------------------------------------------------------------------*/
475 /* The CHTML structure is initialized. */
476 /*--------------------------------------------------------------------------*/
477 s_init_chtml10(&chtml10, &doc, r, spec);
478 chtml10.entryp = entryp;
479 chtml10.cookie = cookie;
481 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
483 /*--------------------------------------------------------------------------*/
484 /* The character string of the input is analyzed. */
485 /*--------------------------------------------------------------------------*/
486 qs_init_malloc(&doc);
487 qs_init_root_node(&doc);
489 if (IS_CSS_ON(chtml10.entryp)) {
490 /* current property list */
491 chtml10.css_prop_stack = chxj_new_prop_list_stack(&doc);
494 ss = apr_pcalloc(r->pool, srclen + 1);
495 memset(ss, 0, srclen + 1);
496 memcpy(ss, src, srclen);
499 chxj_dump_out("[src] CHTML -> CHTML1.0", ss, srclen);
502 qs_parse_string(&doc,ss, strlen(ss));
504 chxj_buffered_write_init(r->pool, &doc.buf);
505 /*--------------------------------------------------------------------------*/
506 /* It converts it from CHTML to CHTML. */
507 /*--------------------------------------------------------------------------*/
508 chxj_node_convert(spec,r,(void *)&chtml10, &doc, qs_get_root(&doc), 0);
509 chtml10.out = chxj_buffered_write_flush(chtml10.out, &doc.buf);
510 dst = apr_pstrdup(r->pool, chtml10.out);
511 chxj_buffered_write_terminate(&doc.buf);
513 qs_all_free(&doc,QX_LOGMARK);
516 return apr_pstrdup(r->pool,ss);
519 if (strlen(dst) == 0) {
520 dst = apr_psprintf(r->pool, "\n");
522 *dstlen = strlen(dst);
525 chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
528 DBG(r, "end chxj_convert_chtml10() cookie_id=[%s] time=[%" APR_TIME_T_FMT "]", (cookie) ? cookie->cookie_id : "", apr_time_now() - t);
535 * The CHTML structure is initialized.
537 * @param chtml10 [i/o] The pointer to the HDML structure that wants to be
538 * initialized is specified.
539 * @param doc [i] The Doc structure that should be set to the initialized
540 * HDML structure is specified.
541 * @param r [i] To use POOL, the pointer to request_rec is specified.
542 * @param spec [i] The pointer to the device_table
551 memset(doc, 0, sizeof(Doc));
552 memset(chtml10, 0, sizeof(chtml10_t));
556 chtml10->spec = spec;
557 chtml10->out = qs_alloc_zero_byte_string(r->pool);
558 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
559 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
560 chtml10->style = NULL;
565 * Corresponding EMOJI to a current character-code is retrieved.
566 * The substitution character string is stored in the rslt pointer if agreeing.
568 * @param chtml10 [i] The pointer to the CHTML structure is specified.
569 * @param txt [i] The character string to want to examine whether it is
570 * EMOJI is specified.
571 * @param rslt [o] The pointer to the pointer that stores the result is
573 * @return When corresponding EMOJI exists, it returns it excluding 0.
576 s_chtml10_search_emoji(chtml10_t *chtml10, char *txt, char **rslt)
583 spec = chtml10->spec;
589 DBG(r,"spec is NULL");
592 for (ee = chtml10->conf->emoji;
597 DBG(r,"emoji->imode is NULL");
601 if (ee->imode->string
603 && strlen(ee->imode->string) > 0
604 && *ee->imode->string == *txt
605 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
606 *rslt = apr_palloc(r->pool, 3);
607 (*rslt)[0] = ee->imode->hex1byte & 0xff;
608 (*rslt)[1] = ee->imode->hex2byte & 0xff;
610 return strlen(ee->imode->string);
617 chxj_chtml10_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
628 chtml10 = &__chtml10;
631 DBG(r, "REQ[%X] start chxj_chtml10_emoji_only_converter()", (unsigned int)(apr_size_t)r);
632 memset(doc, 0, sizeof(Doc));
633 memset(chtml10, 0, sizeof(chtml10_t));
637 chtml10->spec = spec;
638 chtml10->out = qs_alloc_zero_byte_string(r->pool);
639 chtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
640 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
642 apr_pool_create(&pool, r->pool);
644 chxj_buffered_write_init(pool, &doc->buf);
646 for (ii=0; ii<len; ii++) {
650 rtn = s_chtml10_search_emoji(chtml10, (char *)&src[ii], &out);
657 if (is_sjis_kanji(src[ii])) {
658 two_byte[0] = src[ii+0];
659 two_byte[1] = src[ii+1];
665 one_byte[0] = src[ii+0];
671 chtml10->out = chxj_buffered_write_flush(chtml10->out, &doc->buf);
673 DBG(r, "REQ[%X] end chxj_chtml10_emoji_only_converter()", (unsigned int)(apr_size_t)r);
679 * It is a handler who processes the HTML tag.
681 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
682 * destination is specified.
683 * @param node [i] The HTML tag node is specified.
684 * @return The conversion result is returned.
687 s_chtml10_start_html_tag(void *pdoc, Node *UNUSED(node))
693 chtml10 = GET_CHTML10(pdoc);
697 /*--------------------------------------------------------------------------*/
699 /*--------------------------------------------------------------------------*/
706 * It is a handler who processes the HTML tag.
708 * @param pdoc [i/o] The pointer to the CHTML structure at the output
709 * destination is specified.
710 * @param node [i] The HTML tag node is specified.
711 * @return The conversion result is returned.
714 s_chtml10_end_html_tag(void *pdoc, Node *UNUSED(child))
721 chtml10 = GET_CHTML10(pdoc);
725 if (IS_CSS_ON(chtml10->entryp)) {
726 chxj_css_pop_prop_list(chtml10->css_prop_stack);
735 * It is a handler who processes the META tag.
737 * @param pdoc [i/o] The pointer to the CHTML structure at the output
738 * destination is specified.
739 * @param node [i] The META tag node is specified.
740 * @return The conversion result is returned.
743 s_chtml10_start_meta_tag(void *pdoc, Node *UNUSED(node))
745 chtml10_t *chtml10 = GET_CHTML10(pdoc);
754 * It is a handler who processes the META tag.
756 * @param pdoc [i/o] The pointer to the CHTML structure at the output
757 * destination is specified.
758 * @param node [i] The META tag node is specified.
759 * @return The conversion result is returned.
762 s_chtml10_end_meta_tag(void *pdoc, Node *UNUSED(child))
764 chtml10_t *chtml10 = GET_CHTML10(pdoc);
771 * It is a handler who processes the HEAD tag.
773 * @param pdoc [i/o] The pointer to the CHTML structure at the output
774 * destination is specified.
775 * @param node [i] The HEAD tag node is specified.
776 * @return The conversion result is returned.
779 s_chtml10_start_head_tag(void *pdoc, Node *UNUSED(node))
785 chtml10 = GET_CHTML10(pdoc);
796 * It is a handler who processes the HEAD tag.
798 * @param pdoc [i/o] The pointer to the CHTML structure at the output
799 * destination is specified.
800 * @param node [i] The HEAD tag node is specified.
801 * @return The conversion result is returned.
804 s_chtml10_end_head_tag(void *pdoc, Node *UNUSED(child))
810 chtml10 = GET_CHTML10(pdoc);
821 * It is a handler who processes the OL tag.
823 * @param pdoc [i/o] The pointer to the CHTML structure at the output
824 * destination is specified.
825 * @param node [i] The OL tag node is specified.
826 * @return The conversion result is returned.
829 s_chtml10_start_ol_tag(void *pdoc, Node *node)
835 char *attr_style = NULL;
837 chtml10 = GET_CHTML10(pdoc);
841 for (attr = qs_get_attr(doc,node);
843 attr = qs_get_next_attr(doc,attr)) {
844 char *nm = qs_get_attr_name(doc,attr);
845 char *val = qs_get_attr_value(doc,attr);
846 if (val && STRCASEEQ('s','S',"style", nm)) {
851 if (IS_CSS_ON(chtml10->entryp)) {
852 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
862 * It is a handler who processes the OL tag.
864 * @param pdoc [i/o] The pointer to the CHTML structure at the output
865 * destination is specified.
866 * @param node [i] The OL tag node is specified.
867 * @return The conversion result is returned.
870 s_chtml10_end_ol_tag(void *pdoc, Node *UNUSED(child))
876 chtml10 = GET_CHTML10(pdoc);
881 if (IS_CSS_ON(chtml10->entryp)) {
882 chxj_css_pop_prop_list(chtml10->css_prop_stack);
890 * It is a handler who processes the UL tag.
892 * @param pdoc [i/o] The pointer to the CHTML structure at the output
893 * destination is specified.
894 * @param node [i] The UL tag node is specified.
895 * @return The conversion result is returned.
898 s_chtml10_start_ul_tag(void *pdoc, Node *node)
904 char *attr_style = NULL;
906 chtml10 = GET_CHTML10(pdoc);
911 for (attr = qs_get_attr(doc,node);
913 attr = qs_get_next_attr(doc,attr)) {
914 char *nm = qs_get_attr_name(doc,attr);
915 char *val = qs_get_attr_value(doc,attr);
916 if (val && STRCASEEQ('s','S',"style", nm)) {
921 if (IS_CSS_ON(chtml10->entryp)) {
922 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
932 * It is a handler who processes the UL tag.
934 * @param pdoc [i/o] The pointer to the CHTML structure at the output
935 * destination is specified.
936 * @param node [i] The UL tag node is specified.
937 * @return The conversion result is returned.
940 s_chtml10_end_ul_tag(void *pdoc, Node *UNUSED(child))
946 chtml10 = GET_CHTML10(pdoc);
951 if (IS_CSS_ON(chtml10->entryp)) {
952 chxj_css_pop_prop_list(chtml10->css_prop_stack);
960 * It is a handler who processes the LI tag.
962 * @param pdoc [i/o] The pointer to the CHTML structure at the output
963 * destination is specified.
964 * @param node [i] The LI tag node is specified.
965 * @return The conversion result is returned.
968 s_chtml10_start_li_tag(void *pdoc, Node *node)
974 char *attr_style = NULL;
976 chtml10 = GET_CHTML10(pdoc);
980 for (attr = qs_get_attr(doc,node);
982 attr = qs_get_next_attr(doc,attr)) {
983 char *nm = qs_get_attr_name(doc,attr);
984 char *val = qs_get_attr_value(doc,attr);
985 if (val && STRCASEEQ('s','S',"style", nm)) {
990 if (IS_CSS_ON(chtml10->entryp)) {
991 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1000 * It is a handler who processes the LI tag.
1002 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1003 * destination is specified.
1004 * @param node [i] The LI tag node is specified.
1005 * @return The conversion result is returned.
1008 s_chtml10_end_li_tag(void *pdoc, Node *UNUSED(child))
1010 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1011 if (IS_CSS_ON(chtml10->entryp)) {
1012 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1014 return chtml10->out;
1019 * It is a handler who processes the H1 tag.
1021 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1022 * destination is specified.
1023 * @param node [i] The H1 tag node is specified.
1024 * @return The conversion result is returned.
1027 s_chtml10_start_h1_tag(void *pdoc, Node *node)
1033 char *attr_style = NULL;
1034 char *attr_align = NULL;
1036 chtml10 = GET_CHTML10(pdoc);
1040 for (attr = qs_get_attr(doc,node);
1042 attr = qs_get_next_attr(doc,attr)) {
1043 char *name = qs_get_attr_name(doc,attr);
1044 char *value = qs_get_attr_value(doc,attr);
1045 if (STRCASEEQ('a','A',"align", name)) {
1046 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1050 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1054 if (IS_CSS_ON(chtml10->entryp)) {
1055 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1057 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1058 css_property_t *cur;
1059 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1060 if (STRCASEEQ('l','L',"left", cur->value)) {
1061 attr_align = apr_pstrdup(doc->pool, "left");
1063 else if (STRCASEEQ('c','C',"center",cur->value)) {
1064 attr_align = apr_pstrdup(doc->pool, "center");
1066 else if (STRCASEEQ('r','R',"right",cur->value)) {
1067 attr_align = apr_pstrdup(doc->pool, "right");
1080 return chtml10->out;
1085 * It is a handler who processes the H1 tag.
1087 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1088 * destination is specified.
1089 * @param node [i] The H1 tag node is specified.
1090 * @return The conversion result is returned.
1093 s_chtml10_end_h1_tag(void *pdoc, Node *UNUSED(child))
1099 chtml10 = GET_CHTML10(pdoc);
1104 if (IS_CSS_ON(chtml10->entryp)) {
1105 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1108 return chtml10->out;
1113 * It is a handler who processes the H2 tag.
1115 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1116 * destination is specified.
1117 * @param node [i] The H2 tag node is specified.
1118 * @return The conversion result is returned.
1121 s_chtml10_start_h2_tag(void *pdoc, Node *node)
1126 char *attr_style = NULL;
1127 char *attr_align = NULL;
1129 chtml10 = GET_CHTML10(pdoc);
1132 for (attr = qs_get_attr(doc,node);
1134 attr = qs_get_next_attr(doc,attr)) {
1135 char *name = qs_get_attr_name(doc,attr);
1136 char *value = qs_get_attr_value(doc,attr);
1137 if (STRCASEEQ('a','A',"align", name)) {
1138 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1142 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1146 if (IS_CSS_ON(chtml10->entryp)) {
1147 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1149 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1150 css_property_t *cur;
1151 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1152 if (STRCASEEQ('l','L',"left", cur->value)) {
1153 attr_align = apr_pstrdup(doc->pool, "left");
1155 else if (STRCASEEQ('c','C',"center",cur->value)) {
1156 attr_align = apr_pstrdup(doc->pool, "center");
1158 else if (STRCASEEQ('r','R',"right",cur->value)) {
1159 attr_align = apr_pstrdup(doc->pool, "right");
1172 return chtml10->out;
1177 * It is a handler who processes the H2 tag.
1179 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1180 * destination is specified.
1181 * @param node [i] The H2 tag node is specified.
1182 * @return The conversion result is returned.
1185 s_chtml10_end_h2_tag(void *pdoc, Node *UNUSED(child))
1191 chtml10 = GET_CHTML10(pdoc);
1196 if (IS_CSS_ON(chtml10->entryp)) {
1197 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1200 return chtml10->out;
1205 * It is a handler who processes the H3 tag.
1207 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1208 * destination is specified.
1209 * @param node [i] The H3 tag node is specified.
1210 * @return The conversion result is returned.
1213 s_chtml10_start_h3_tag(void *pdoc, Node *node)
1218 char *attr_style = NULL;
1219 char *attr_align = NULL;
1221 chtml10 = GET_CHTML10(pdoc);
1224 for (attr = qs_get_attr(doc,node);
1226 attr = qs_get_next_attr(doc,attr)) {
1227 char *name = qs_get_attr_name(doc,attr);
1228 char *value = qs_get_attr_value(doc,attr);
1229 if (STRCASEEQ('a','A',"align", name)) {
1230 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1234 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1238 if (IS_CSS_ON(chtml10->entryp)) {
1239 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1241 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1242 css_property_t *cur;
1243 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1244 if (STRCASEEQ('l','L',"left", cur->value)) {
1245 attr_align = apr_pstrdup(doc->pool, "left");
1247 else if (STRCASEEQ('c','C',"center",cur->value)) {
1248 attr_align = apr_pstrdup(doc->pool, "center");
1250 else if (STRCASEEQ('r','R',"right",cur->value)) {
1251 attr_align = apr_pstrdup(doc->pool, "right");
1264 return chtml10->out;
1269 * It is a handler who processes the H3 tag.
1271 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1272 * destination is specified.
1273 * @param node [i] The H3 tag node is specified.
1274 * @return The conversion result is returned.
1277 s_chtml10_end_h3_tag(void *pdoc, Node *UNUSED(child))
1283 chtml10 = GET_CHTML10(pdoc);
1288 if (IS_CSS_ON(chtml10->entryp)) {
1289 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1292 return chtml10->out;
1297 * It is a handler who processes the H4 tag.
1299 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1300 * destination is specified.
1301 * @param node [i] The H4 tag node is specified.
1302 * @return The conversion result is returned.
1305 s_chtml10_start_h4_tag(void *pdoc, Node *node)
1310 char *attr_style = NULL;
1311 char *attr_align = NULL;
1313 chtml10 = GET_CHTML10(pdoc);
1316 for (attr = qs_get_attr(doc,node);
1318 attr = qs_get_next_attr(doc,attr)) {
1319 char *name = qs_get_attr_name(doc,attr);
1320 char *value = qs_get_attr_value(doc,attr);
1321 if (STRCASEEQ('a','A',"align", name)) {
1322 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1326 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1330 if (IS_CSS_ON(chtml10->entryp)) {
1331 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1333 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1334 css_property_t *cur;
1335 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1336 if (STRCASEEQ('l','L',"left", cur->value)) {
1337 attr_align = apr_pstrdup(doc->pool, "left");
1339 else if (STRCASEEQ('c','C',"center",cur->value)) {
1340 attr_align = apr_pstrdup(doc->pool, "center");
1342 else if (STRCASEEQ('r','R',"right",cur->value)) {
1343 attr_align = apr_pstrdup(doc->pool, "right");
1356 return chtml10->out;
1361 * It is a handler who processes the H4 tag.
1363 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1364 * destination is specified.
1365 * @param node [i] The H4 tag node is specified.
1366 * @return The conversion result is returned.
1369 s_chtml10_end_h4_tag(void *pdoc, Node *UNUSED(child))
1374 chtml10 = GET_CHTML10(pdoc);
1378 if (IS_CSS_ON(chtml10->entryp)) {
1379 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1382 return chtml10->out;
1387 * It is a handler who processes the H5 tag.
1389 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1390 * destination is specified.
1391 * @param node [i] The H5 tag node is specified.
1392 * @return The conversion result is returned.
1395 s_chtml10_start_h5_tag(void *pdoc, Node *node)
1400 char *attr_style = NULL;
1401 char *attr_align = NULL;
1403 chtml10 = GET_CHTML10(pdoc);
1406 for (attr = qs_get_attr(doc,node);
1408 attr = qs_get_next_attr(doc,attr)) {
1409 char *name = qs_get_attr_name(doc,attr);
1410 char *value = qs_get_attr_value(doc,attr);
1411 if (STRCASEEQ('a','A',"align", name)) {
1412 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1416 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1420 if (IS_CSS_ON(chtml10->entryp)) {
1421 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1423 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1424 css_property_t *cur;
1425 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1426 if (STRCASEEQ('l','L',"left", cur->value)) {
1427 attr_align = apr_pstrdup(doc->pool, "left");
1429 else if (STRCASEEQ('c','C',"center",cur->value)) {
1430 attr_align = apr_pstrdup(doc->pool, "center");
1432 else if (STRCASEEQ('r','R',"right",cur->value)) {
1433 attr_align = apr_pstrdup(doc->pool, "right");
1446 return chtml10->out;
1451 * It is a handler who processes the H5 tag.
1453 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1454 * destination is specified.
1455 * @param node [i] The H5 tag node is specified.
1456 * @return The conversion result is returned.
1459 s_chtml10_end_h5_tag(void *pdoc, Node *UNUSED(child))
1464 chtml10 = GET_CHTML10(pdoc);
1468 if (IS_CSS_ON(chtml10->entryp)) {
1469 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1472 return chtml10->out;
1477 * It is a handler who processes the H6 tag.
1479 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1480 * destination is specified.
1481 * @param node [i] The H6 tag node is specified.
1482 * @return The conversion result is returned.
1485 s_chtml10_start_h6_tag(void *pdoc, Node *node)
1490 char *attr_style = NULL;
1491 char *attr_align = NULL;
1493 chtml10 = GET_CHTML10(pdoc);
1496 for (attr = qs_get_attr(doc,node);
1498 attr = qs_get_next_attr(doc,attr)) {
1499 char *name = qs_get_attr_name(doc,attr);
1500 char *value = qs_get_attr_value(doc,attr);
1501 if (STRCASEEQ('a','A',"align", name)) {
1502 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1506 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1510 if (IS_CSS_ON(chtml10->entryp)) {
1511 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1513 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
1514 css_property_t *cur;
1515 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
1516 if (STRCASEEQ('l','L',"left", cur->value)) {
1517 attr_align = apr_pstrdup(doc->pool, "left");
1519 else if (STRCASEEQ('c','C',"center",cur->value)) {
1520 attr_align = apr_pstrdup(doc->pool, "center");
1522 else if (STRCASEEQ('r','R',"right",cur->value)) {
1523 attr_align = apr_pstrdup(doc->pool, "right");
1536 return chtml10->out;
1541 * It is a handler who processes the H6 tag.
1543 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1544 * destination is specified.
1545 * @param node [i] The H6 tag node is specified.
1546 * @return The conversion result is returned.
1549 s_chtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
1554 chtml10 = GET_CHTML10(pdoc);
1558 if (IS_CSS_ON(chtml10->entryp)) {
1559 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1562 return chtml10->out;
1567 * It is a handler who processes the TITLE tag.
1569 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1570 * destination is specified.
1571 * @param node [i] The TITLE tag node is specified.
1572 * @return The conversion result is returned.
1575 s_chtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
1580 chtml10 = GET_CHTML10(pdoc);
1585 return chtml10->out;
1590 * It is a handler who processes the TITLE tag.
1592 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1593 * destination is specified.
1594 * @param node [i] The TITLE tag node is specified.
1595 * @return The conversion result is returned.
1598 s_chtml10_end_title_tag(void *pdoc, Node *UNUSED(child))
1603 chtml10 = GET_CHTML10(pdoc);
1608 return chtml10->out;
1613 * It is a handler who processes the BASE tag.
1615 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1616 * destination is specified.
1617 * @param node [i] The BASE tag node is specified.
1618 * @return The conversion result is returned.
1621 s_chtml10_start_base_tag(void *pdoc, Node *node)
1627 chtml10 = GET_CHTML10(pdoc);
1631 /*--------------------------------------------------------------------------*/
1632 /* Get Attributes */
1633 /*--------------------------------------------------------------------------*/
1634 for (attr = qs_get_attr(doc,node);
1636 attr = qs_get_next_attr(doc,attr)) {
1637 char *name = qs_get_attr_name(doc,attr);
1638 char *value = qs_get_attr_value(doc,attr);
1639 if (STRCASEEQ('h','H',"href", name)) {
1648 return chtml10->out;
1653 * It is a handler who processes the BASE tag.
1655 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1656 * destination is specified.
1657 * @param node [i] The BASE tag node is specified.
1658 * @return The conversion result is returned.
1661 s_chtml10_end_base_tag(void *pdoc, Node *UNUSED(child))
1663 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1665 return chtml10->out;
1670 * It is a handler who processes the BODY tag.
1672 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1673 * destination is specified.
1674 * @param node [i] The BODY tag node is specified.
1675 * @return The conversion result is returned.
1678 s_chtml10_start_body_tag(void *pdoc, Node *node)
1683 char *attr_style = NULL;
1685 chtml10 = GET_CHTML10(pdoc);
1688 /*--------------------------------------------------------------------------*/
1689 /* Get Attributes */
1690 /*--------------------------------------------------------------------------*/
1691 for (attr = qs_get_attr(doc,node);
1693 attr = qs_get_next_attr(doc,attr)) {
1694 char *name = qs_get_attr_name(doc,attr);
1695 char *value = qs_get_attr_value(doc,attr);
1699 if (strcasecmp(name, "alink") == 0) {
1700 /*----------------------------------------------------------------------*/
1702 /*----------------------------------------------------------------------*/
1709 if (strcasecmp(name, "bgcolor") == 0) {
1710 /*----------------------------------------------------------------------*/
1712 /*----------------------------------------------------------------------*/
1719 if (strcasecmp(name, "text") == 0) {
1720 /*----------------------------------------------------------------------*/
1722 /*----------------------------------------------------------------------*/
1729 if (strcasecmp(name, "link") == 0) {
1730 /*----------------------------------------------------------------------*/
1732 /*----------------------------------------------------------------------*/
1739 if (strcasecmp(name, "vlink") == 0) {
1740 /*----------------------------------------------------------------------*/
1742 /*----------------------------------------------------------------------*/
1749 if (strcasecmp("style", name) == 0 && value && *value) {
1759 if (IS_CSS_ON(chtml10->entryp)) {
1760 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1765 return chtml10->out;
1770 * It is a handler who processes the BODY tag.
1772 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1773 * destination is specified.
1774 * @param node [i] The BODY tag node is specified.
1775 * @return The conversion result is returned.
1778 s_chtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
1783 chtml10 = GET_CHTML10(pdoc);
1787 if (IS_CSS_ON(chtml10->entryp)) {
1788 chxj_css_pop_prop_list(chtml10->css_prop_stack);
1791 return chtml10->out;
1796 * It is a handler who processes the A tag.
1798 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1799 * destination is specified.
1800 * @param node [i] The A tag node is specified.
1801 * @return The conversion result is returned.
1804 s_chtml10_start_a_tag(void *pdoc, Node *node)
1810 char *attr_style = NULL;
1812 chtml10 = GET_CHTML10(pdoc);
1818 /*--------------------------------------------------------------------------*/
1819 /* Get Attributes */
1820 /*--------------------------------------------------------------------------*/
1821 for (attr = qs_get_attr(doc,node);
1823 attr = qs_get_next_attr(doc,attr)) {
1824 char *name = qs_get_attr_name(doc,attr);
1825 char *value = qs_get_attr_value(doc,attr);
1829 if (strcasecmp(name, "name") == 0) {
1830 /*--------------------------------------------------------------------*/
1832 /*--------------------------------------------------------------------*/
1841 if (strcasecmp(name, "href") == 0) {
1842 /*--------------------------------------------------------------------*/
1844 /*--------------------------------------------------------------------*/
1845 value = chxj_encoding_parameter(r, value, 0);
1846 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1847 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1857 if (strcasecmp(name, "accesskey") == 0) {
1858 /*--------------------------------------------------------------------*/
1860 /*--------------------------------------------------------------------*/
1861 W_L(" accesskey=\"");
1869 if (strcasecmp(name, "cti") == 0) {
1870 /*--------------------------------------------------------------------*/
1872 /*--------------------------------------------------------------------*/
1879 if (strcasecmp(name, "utn") == 0) {
1880 /*--------------------------------------------------------------------*/
1882 /*--------------------------------------------------------------------*/
1889 if (strcasecmp(name, "telbook") == 0) {
1890 /*--------------------------------------------------------------------*/
1892 /*--------------------------------------------------------------------*/
1899 if (strcasecmp(name, "kana") == 0) {
1900 /*--------------------------------------------------------------------*/
1902 /*--------------------------------------------------------------------*/
1909 if (strcasecmp(name, "email") == 0) {
1910 /*--------------------------------------------------------------------*/
1912 /*--------------------------------------------------------------------*/
1919 if (strcasecmp(name, "ista") == 0) {
1920 /*--------------------------------------------------------------------*/
1922 /*--------------------------------------------------------------------*/
1926 if (strcasecmp(name, "ilet") == 0) {
1927 /*--------------------------------------------------------------------*/
1929 /*--------------------------------------------------------------------*/
1933 if (strcasecmp(name, "iswf") == 0) {
1934 /*--------------------------------------------------------------------*/
1936 /*--------------------------------------------------------------------*/
1940 if (strcasecmp(name, "irst") == 0) {
1941 /*--------------------------------------------------------------------*/
1943 /*--------------------------------------------------------------------*/
1947 if (strcasecmp(name, "ijam") == 0) {
1948 /*--------------------------------------------------------------------*/
1950 /*--------------------------------------------------------------------*/
1957 if (strcasecmp(name, "style") == 0 && value && *value) {
1969 if (IS_CSS_ON(chtml10->entryp)) {
1970 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
1972 return chtml10->out;
1977 * It is a handler who processes the A tag.
1979 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1980 * destination is specified.
1981 * @param node [i] The A tag node is specified.
1982 * @return The conversion result is returned.
1985 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1991 chtml10 = GET_CHTML10(pdoc);
1997 if (IS_CSS_ON(chtml10->entryp)) {
1998 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2001 return chtml10->out;
2006 * It is a handler who processes the BR tag.
2008 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2009 * destination is specified.
2010 * @param node [i] The BR tag node is specified.
2011 * @return The conversion result is returned.
2014 s_chtml10_start_br_tag(void *pdoc, Node *node)
2021 chtml10 = GET_CHTML10(pdoc);
2027 /*--------------------------------------------------------------------------*/
2028 /* Get Attributes */
2029 /*--------------------------------------------------------------------------*/
2030 for (attr = qs_get_attr(doc,node);
2032 attr = qs_get_next_attr(doc,attr)) {
2033 char *name = qs_get_attr_name(doc,attr);
2034 char *value = qs_get_attr_value(doc,attr);
2035 if (STRCASEEQ('c','C',"clear",name)) {
2036 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
2045 return chtml10->out;
2050 * It is a handler who processes the BR tag.
2052 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2053 * destination is specified.
2054 * @param node [i] The BR tag node is specified.
2055 * @return The conversion result is returned.
2058 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
2060 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2062 return chtml10->out;
2067 * It is a handler who processes the TR tag.
2069 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2070 * destination is specified.
2071 * @param node [i] The TR tag node is specified.
2072 * @return The conversion result is returned.
2075 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
2077 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2079 return chtml10->out;
2084 * It is a handler who processes the TR tag.
2086 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2087 * destination is specified.
2088 * @param node [i] The TR tag node is specified.
2089 * @return The conversion result is returned.
2092 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
2098 chtml10 = GET_CHTML10(pdoc);
2104 return chtml10->out;
2109 * It is a handler who processes the FORM tag.
2111 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2112 * destination is specified.
2113 * @param node [i] The FORM tag node is specified.
2114 * @return The conversion result is returned.
2117 s_chtml10_start_form_tag(void *pdoc, Node *node)
2123 char *attr_style = NULL;
2124 char *attr_action = NULL;
2125 char *attr_method = NULL;
2126 char *new_hidden_tag = NULL;
2128 chtml10 = GET_CHTML10(pdoc);
2132 /*--------------------------------------------------------------------------*/
2133 /* Get Attributes */
2134 /*--------------------------------------------------------------------------*/
2135 for (attr = qs_get_attr(doc,node);
2137 attr = qs_get_next_attr(doc,attr)) {
2138 char *name = qs_get_attr_name(doc,attr);
2139 char *value = qs_get_attr_value(doc,attr);
2143 if (strcasecmp(name, "action") == 0) {
2144 /*--------------------------------------------------------------------*/
2146 /*--------------------------------------------------------------------*/
2147 attr_action = chxj_encoding_parameter(r, value, 0);
2148 attr_action = chxj_add_cookie_parameter(r, attr_action, chtml10->cookie);
2154 if (strcasecmp(name, "method") == 0) {
2155 /*--------------------------------------------------------------------*/
2157 /*--------------------------------------------------------------------*/
2158 attr_method = value;
2164 if (strcasecmp(name, "utn") == 0) {
2165 /*--------------------------------------------------------------------*/
2167 /*--------------------------------------------------------------------*/
2174 if (strcasecmp(name, "style") == 0 && value && *value) {
2183 if (IS_CSS_ON(chtml10->entryp)) {
2184 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2186 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
2191 char *new_query_string = NULL;
2192 q = strchr(attr_action, '?');
2194 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, chtml10->entryp);
2195 if (new_hidden_tag || new_query_string) {
2201 if (new_query_string) {
2203 W_V(new_query_string);
2213 if (new_hidden_tag) {
2214 W_V(new_hidden_tag);
2217 return chtml10->out;
2222 * It is a handler who processes the FORM tag.
2224 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2225 * destination is specified.
2226 * @param node [i] The FORM tag node is specified.
2227 * @return The conversion result is returned.
2230 s_chtml10_end_form_tag(void *pdoc, Node *UNUSED(child))
2236 chtml10 = GET_CHTML10(pdoc);
2241 if (IS_CSS_ON(chtml10->entryp)) {
2242 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2245 return chtml10->out;
2250 * It is a handler who processes the INPUT tag.
2252 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2253 * destination is specified.
2254 * @param node [i] The INPUT tag node is specified.
2255 * @return The conversion result is returned.
2258 s_chtml10_start_input_tag(void *pdoc, Node *node)
2272 chtml10 = GET_CHTML10(pdoc);
2287 /*--------------------------------------------------------------------------*/
2288 /* Get Attributes */
2289 /*--------------------------------------------------------------------------*/
2291 type = qs_get_type_attr(doc, node, doc->buf.pool);
2292 name = qs_get_name_attr(doc, node, doc->buf.pool);
2293 value = qs_get_value_attr(doc,node,doc->buf.pool);
2294 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
2295 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
2296 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
2297 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
2298 size = qs_get_size_attr(doc, node, doc->buf.pool);
2301 type = qs_trim_string(doc->buf.pool, type);
2302 if (type && (STRCASEEQ('t','T',"text", type) ||
2303 STRCASEEQ('p','P',"password",type) ||
2304 STRCASEEQ('c','C',"checkbox",type) ||
2305 STRCASEEQ('r','R',"radio", type) ||
2306 STRCASEEQ('h','H',"hidden", type) ||
2307 STRCASEEQ('s','S',"submit", type) ||
2308 STRCASEEQ('r','R',"reset", type))) {
2315 if (size && *size != 0) {
2321 if (name && *name != 0) {
2327 if (value && *value != 0) {
2328 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
2329 apr_size_t value_len = strlen(value);
2330 value = chxj_conv_z2h(r, value, &value_len, chtml10->entryp);
2334 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2338 if (accesskey && *accesskey != 0) {
2339 W_L(" accesskey=\"");
2345 /*------------------------------------------------------------------------*/
2347 /*------------------------------------------------------------------------*/
2350 /*--------------------------------------------------------------------------*/
2351 /* The figure is default for the password. */
2352 /*--------------------------------------------------------------------------*/
2353 if (max_length && *max_length != 0) {
2354 W_L(" maxlength=\"");
2364 return chtml10->out;
2369 * It is a handler who processes the INPUT tag.
2371 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2372 * destination is specified.
2373 * @param node [i] The INPUT tag node is specified.
2374 * @return The conversion result is returned.
2377 s_chtml10_end_input_tag(void *pdoc, Node *UNUSED(child))
2379 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2381 return chtml10->out;
2386 * It is a handler who processes the CENTER tag.
2388 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2389 * destination is specified.
2390 * @param node [i] The CENTER tag node is specified.
2391 * @return The conversion result is returned.
2394 s_chtml10_start_center_tag(void *pdoc, Node *node)
2400 char *attr_style = NULL;
2402 chtml10 = GET_CHTML10(pdoc);
2406 for (attr = qs_get_attr(doc,node);
2408 attr = qs_get_next_attr(doc,attr)) {
2409 char *name = qs_get_attr_name(doc,attr);
2410 char *value = qs_get_attr_value(doc,attr);
2411 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2417 if (IS_CSS_ON(chtml10->entryp)) {
2418 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2421 return chtml10->out;
2426 * It is a handler who processes the CENTER tag.
2428 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2429 * destination is specified.
2430 * @param node [i] The CENTER tag node is specified.
2431 * @return The conversion result is returned.
2434 s_chtml10_end_center_tag(void *pdoc, Node *UNUSED(child))
2440 chtml10 = GET_CHTML10(pdoc);
2445 if (IS_CSS_ON(chtml10->entryp)) {
2446 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2449 return chtml10->out;
2454 * It is a handler who processes the HR tag.
2456 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2457 * destination is specified.
2458 * @param node [i] The HR tag node is specified.
2459 * @return The conversion result is returned.
2462 s_chtml10_start_hr_tag(void *pdoc, Node *node)
2468 char *attr_align = NULL;
2469 char *attr_size = NULL;
2470 char *attr_width = NULL;
2471 char *attr_noshade = NULL;
2472 char *attr_style = NULL;
2474 chtml10 = GET_CHTML10(pdoc);
2478 for (attr = qs_get_attr(doc,node);
2480 attr = qs_get_next_attr(doc,attr)) {
2481 char *name = qs_get_attr_name (doc,attr);
2482 char *value = qs_get_attr_value(doc,attr);
2486 if (strcasecmp(name, "align") == 0) {
2487 /*--------------------------------------------------------------------*/
2489 /*--------------------------------------------------------------------*/
2490 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2498 if (strcasecmp(name, "size") == 0) {
2499 /*--------------------------------------------------------------------*/
2501 /*--------------------------------------------------------------------*/
2502 if (value && *value) {
2506 else if (strcasecmp(name, "style") == 0) {
2507 if (value && *value) {
2515 if (strcasecmp(name, "width") == 0) {
2516 /*--------------------------------------------------------------------*/
2518 /*--------------------------------------------------------------------*/
2519 if (value && *value) {
2527 if (strcasecmp(name, "noshade") == 0) {
2528 /*--------------------------------------------------------------------*/
2530 /*--------------------------------------------------------------------*/
2531 attr_noshade = apr_pstrdup(doc->pool, "noshade");
2537 if (strcasecmp(name, "color") == 0) {
2538 /*--------------------------------------------------------------------*/
2540 /*--------------------------------------------------------------------*/
2549 if (IS_CSS_ON(chtml10->entryp)) {
2550 css_prop_list_t *style = s_chtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2552 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
2553 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2554 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2555 css_property_t *cur;
2556 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
2557 if (STRCASEEQ('s','S',"solid",cur->value)) {
2558 attr_noshade = "noshade";
2561 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2562 char *tmp = apr_pstrdup(doc->pool, cur->value);
2563 char *tmpp = strstr(tmp, "px");
2566 attr_size = apr_pstrdup(doc->pool, tmp);
2569 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2570 char *tmp = apr_pstrdup(doc->pool, cur->value);
2571 char *tmpp = strstr(tmp, "px");
2574 attr_width = apr_pstrdup(doc->pool, tmp);
2577 tmpp = strstr(tmp, "%");
2579 attr_width = apr_pstrdup(doc->pool, tmp);
2605 return chtml10->out;
2610 * It is a handler who processes the HR tag.
2612 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2613 * destination is specified.
2614 * @param node [i] The HR tag node is specified.
2615 * @return The conversion result is returned.
2618 s_chtml10_end_hr_tag(void *pdoc, Node *UNUSED(child))
2620 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2622 return chtml10->out;
2627 * It is a handler who processes the IMG tag.
2629 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2630 * destination is specified.
2631 * @param node [i] The IMG tag node is specified.
2632 * @return The conversion result is returned.
2635 s_chtml10_start_img_tag(void *pdoc, Node *node)
2641 char *attr_src = NULL;
2642 char *attr_align = NULL;
2643 char *attr_style = NULL;
2644 char *attr_alt = NULL;
2645 char *attr_width = NULL;
2646 char *attr_height = NULL;
2647 char *attr_hspace = NULL;
2648 char *attr_vspace = NULL;
2649 #ifndef IMG_NOT_CONVERT_FILENAME
2653 chtml10 = GET_CHTML10(pdoc);
2654 #ifndef IMG_NOT_CONVERT_FILENAME
2655 spec = chtml10->spec;
2660 /*--------------------------------------------------------------------------*/
2661 /* Get Attributes */
2662 /*--------------------------------------------------------------------------*/
2663 for (attr = qs_get_attr(doc,node);
2665 attr = qs_get_next_attr(doc,attr)) {
2666 char *name = qs_get_attr_name (doc,attr);
2667 char *value = qs_get_attr_value(doc,attr);
2671 if (strcasecmp(name, "src") == 0) {
2672 /*--------------------------------------------------------------------*/
2674 /*--------------------------------------------------------------------*/
2675 #ifdef IMG_NOT_CONVERT_FILENAME
2676 value = chxj_encoding_parameter(r, value, 0);
2677 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2678 value = chxj_add_cookie_no_update_parameter(r, value);
2681 value = chxj_img_conv(r, spec, value);
2682 value = chxj_encoding_parameter(r, value, 0);
2683 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2684 value = chxj_add_cookie_no_update_parameter(r, value);
2688 else if (strcasecmp(name,"style") == 0 && value && *value) {
2695 if (strcasecmp(name, "align" ) == 0) {
2696 /*--------------------------------------------------------------------*/
2698 /*--------------------------------------------------------------------*/
2699 /*--------------------------------------------------------------------*/
2701 /*--------------------------------------------------------------------*/
2703 if (STRCASEEQ('t','T',"top", value) ||
2704 STRCASEEQ('m','M',"middle",value) ||
2705 STRCASEEQ('b','B',"bottom",value) ||
2706 STRCASEEQ('l','L',"left", value) ||
2707 STRCASEEQ('r','R',"right", value)) {
2710 else if (STRCASEEQ('c','C',"center", value)) {
2711 attr_align = apr_pstrdup(doc->pool, "middle");
2715 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2716 /*--------------------------------------------------------------------*/
2718 /*--------------------------------------------------------------------*/
2725 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2726 /*--------------------------------------------------------------------*/
2728 /*--------------------------------------------------------------------*/
2735 if (strcasecmp(name, "height") == 0 && value && *value) {
2736 /*--------------------------------------------------------------------*/
2738 /*--------------------------------------------------------------------*/
2739 attr_height = value;
2742 if (strcasecmp(name, "hspace") == 0 && value && *value) {
2743 /*--------------------------------------------------------------------*/
2745 /*--------------------------------------------------------------------*/
2746 attr_hspace = value;
2752 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2753 /*--------------------------------------------------------------------*/
2755 /*--------------------------------------------------------------------*/
2756 attr_vspace = value;
2765 if (IS_CSS_ON(chtml10->entryp)) {
2766 css_prop_list_t *style = s_chtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2768 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2769 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2770 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
2771 css_property_t *cur;
2772 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2773 attr_height = apr_pstrdup(doc->pool, cur->value);
2775 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2776 attr_width = apr_pstrdup(doc->pool, cur->value);
2778 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
2779 attr_align = apr_pstrdup(doc->pool, cur->value);
2821 return chtml10->out;
2826 * It is a handler who processes the IMG tag.
2828 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2829 * destination is specified.
2830 * @param node [i] The IMG tag node is specified.
2831 * @return The conversion result is returned.
2834 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2836 chtml10_t *chtml10 = GET_CHTML10(pdoc);
2837 return chtml10->out;
2842 * It is a handler who processes the SELECT tag.
2844 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2845 * destination is specified.
2846 * @param node [i] The SELECT tag node is specified.
2847 * @return The conversion result is returned.
2850 s_chtml10_start_select_tag(void *pdoc, Node *node)
2856 char *attr_style = NULL;
2861 chtml10 = GET_CHTML10(pdoc);
2869 for (attr = qs_get_attr(doc,node);
2871 attr = qs_get_next_attr(doc,attr)) {
2872 char *nm = qs_get_attr_name (doc,attr);
2873 char *val = qs_get_attr_value(doc,attr);
2877 if (strcasecmp(nm, "size") == 0) {
2878 /*--------------------------------------------------------------------*/
2879 /* CHTML 1.0 version 2.0 */
2880 /*--------------------------------------------------------------------*/
2881 size = apr_pstrdup(doc->buf.pool, val);
2883 else if (strcasecmp(nm, "style") == 0 && val && *val) {
2884 /*--------------------------------------------------------------------*/
2885 /* CHTML 1.0 version 2.0 */
2886 /*--------------------------------------------------------------------*/
2887 attr_style = apr_pstrdup(doc->buf.pool, val);
2893 if (strcasecmp(nm, "name") == 0) {
2894 /*--------------------------------------------------------------------*/
2895 /* CHTML 1.0 version 2.0 */
2896 /*--------------------------------------------------------------------*/
2897 name = apr_pstrdup(doc->buf.pool, val);
2903 if (strcasecmp(nm, "multiple") == 0) {
2904 /*--------------------------------------------------------------------*/
2905 /* CHTML 1.0 version 2.0 */
2906 /*--------------------------------------------------------------------*/
2916 if (size && *size != 0) {
2922 if (name && *name != 0) {
2929 if (IS_CSS_ON(chtml10->entryp)) {
2930 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
2932 return chtml10->out;
2937 * It is a handler who processes the SELECT tag.
2939 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2940 * destination is specified.
2941 * @param node [i] The SELECT tag node is specified.
2942 * @return The conversion result is returned.
2945 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2951 chtml10 = GET_CHTML10(pdoc);
2956 if (IS_CSS_ON(chtml10->entryp)) {
2957 chxj_css_pop_prop_list(chtml10->css_prop_stack);
2959 return chtml10->out;
2964 * It is a handler who processes the OPTION tag.
2966 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2967 * destination is specified.
2968 * @param node [i] The OPTION tag node is specified.
2969 * @return The conversion result is returned.
2972 s_chtml10_start_option_tag(void *pdoc, Node *node)
2980 char *attr_style = NULL;
2982 chtml10 = GET_CHTML10(pdoc);
2991 for (attr = qs_get_attr(doc,node);
2993 attr = qs_get_next_attr(doc,attr)) {
2994 char *nm = qs_get_attr_name (doc,attr);
2995 char *val = qs_get_attr_value(doc,attr);
2999 if (strcasecmp(nm, "selected") == 0) {
3000 /*--------------------------------------------------------------------*/
3001 /* CHTML 1.0 version 2.0 */
3002 /*--------------------------------------------------------------------*/
3003 selected = apr_pstrdup(doc->buf.pool, val);
3005 else if (strcasecmp(nm, "style") == 0 && val && *val) {
3006 /*--------------------------------------------------------------------*/
3007 /* CHTML 1.0 version 2.0 */
3008 /*--------------------------------------------------------------------*/
3009 attr_style = apr_pstrdup(doc->buf.pool, val);
3015 if (strcasecmp(nm, "value") == 0) {
3016 /*--------------------------------------------------------------------*/
3017 /* CHTML 1.0 version 2.0 */
3018 /*--------------------------------------------------------------------*/
3019 value = apr_pstrdup(doc->buf.pool, val);
3039 if (IS_CSS_ON(chtml10->entryp)) {
3040 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3042 return chtml10->out;
3047 * It is a handler who processes the OPTION tag.
3049 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3050 * destination is specified.
3051 * @param node [i] The OPTION tag node is specified.
3052 * @return The conversion result is returned.
3055 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
3057 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3060 if (IS_CSS_ON(chtml10->entryp)) {
3061 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3064 return chtml10->out;
3069 * It is a handler who processes the DIV tag.
3071 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3072 * destination is specified.
3073 * @param node [i] The DIV tag node is specified.
3074 * @return The conversion result is returned.
3077 s_chtml10_start_div_tag(void *pdoc, Node *node)
3083 char *attr_align = NULL;
3084 char *attr_style = NULL;
3086 chtml10 = GET_CHTML10(pdoc);
3090 for (attr = qs_get_attr(doc,node);
3092 attr = qs_get_next_attr(doc,attr)) {
3093 char *nm = qs_get_attr_name(doc,attr);
3094 char *val = qs_get_attr_value(doc,attr);
3095 if (STRCASEEQ('a','A',"align", nm)) {
3096 /*----------------------------------------------------------------------*/
3097 /* CHTML 1.0 (W3C version 3.2) */
3098 /*----------------------------------------------------------------------*/
3099 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3100 attr_align = apr_pstrdup(doc->buf.pool, val);
3103 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3104 attr_style = apr_pstrdup(doc->pool, val);
3107 if (IS_CSS_ON(chtml10->entryp)) {
3108 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3110 css_property_t *text_align = chxj_css_get_property_value(doc, style, "text-align");
3111 css_property_t *cur;
3112 for (cur = text_align->next; cur != text_align; cur = cur->next) {
3113 if (STRCASEEQ('l','L',"left",cur->value)) {
3114 attr_align = apr_pstrdup(doc->pool, "left");
3116 else if (STRCASEEQ('c','C',"center",cur->value)) {
3117 attr_align = apr_pstrdup(doc->pool, "center");
3119 else if (STRCASEEQ('r','R',"right",cur->value)) {
3120 attr_align = apr_pstrdup(doc->pool, "right");
3134 return chtml10->out;
3139 * It is a handler who processes the DIV tag.
3141 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3142 * destination is specified.
3143 * @param node [i] The DIV tag node is specified.
3144 * @return The conversion result is returned.
3147 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
3153 chtml10 = GET_CHTML10(pdoc);
3159 if (IS_CSS_ON(chtml10->entryp)) {
3160 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3163 return chtml10->out;
3168 * It is a handler who processes the CHXJ:IF tag.
3170 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3171 * destination is specified.
3172 * @param node [i] The CHXJ:IF tag node is specified.
3173 * @return The conversion result is returned.
3176 s_chtml10_chxjif_tag(void *pdoc, Node *node)
3183 chtml10 = GET_CHTML10(pdoc);
3187 for (child = qs_get_child_node(doc, node);
3189 child = qs_get_next_node(doc, child)) {
3191 s_chtml10_chxjif_tag(chtml10, child);
3194 return chtml10->out;
3199 * It is a handler who processes the PRE tag.
3201 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3202 * destination is specified.
3203 * @param node [i] The PRE tag node is specified.
3204 * @return The conversion result is returned.
3207 s_chtml10_start_pre_tag(void *pdoc, Node *node)
3213 char *attr_style = NULL;
3215 chtml10 = GET_CHTML10(pdoc);
3219 for (attr = qs_get_attr(doc,node);
3221 attr = qs_get_next_attr(doc,attr)) {
3222 char *nm = qs_get_attr_name(doc,attr);
3223 char *val = qs_get_attr_value(doc,attr);
3224 if (val && STRCASEEQ('s','S',"style", nm)) {
3229 if (IS_CSS_ON(chtml10->entryp)) {
3230 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3232 chtml10->pre_flag++;
3234 return chtml10->out;
3239 * It is a handler who processes the PRE tag.
3241 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3242 * destination is specified.
3243 * @param node [i] The PRE tag node is specified.
3244 * @return The conversion result is returned.
3247 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
3253 chtml10 = GET_CHTML10(pdoc);
3258 chtml10->pre_flag--;
3259 if (IS_CSS_ON(chtml10->entryp)) {
3260 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3263 return chtml10->out;
3268 * It is a handler who processes the P tag.
3270 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3271 * destination is specified.
3272 * @param node [i] The P tag node is specified.
3273 * @return The conversion result is returned.
3276 s_chtml10_start_p_tag(void *pdoc, Node *node)
3282 char *attr_align = NULL;
3283 char *attr_style = NULL;
3285 chtml10 = GET_CHTML10(pdoc);
3289 for (attr = qs_get_attr(doc,node);
3291 attr = qs_get_next_attr(doc,attr)) {
3292 char *nm = qs_get_attr_name(doc,attr);
3293 char *val = qs_get_attr_value(doc,attr);
3294 if (STRCASEEQ('a','A',"align", nm)) {
3295 /*----------------------------------------------------------------------*/
3296 /* CHTML 1.0 (W3C version 3.2) */
3297 /*----------------------------------------------------------------------*/
3298 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3299 attr_align = apr_pstrdup(doc->buf.pool, val);
3303 else if (val && STRCASEEQ('s','S',"style", nm)) {
3307 if (IS_CSS_ON(chtml10->entryp)) {
3308 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3310 css_property_t *text_align = chxj_css_get_property_value(doc, style, "text-align");
3311 css_property_t *cur;
3312 for (cur = text_align->next; cur != text_align; cur = cur->next) {
3313 if (STRCASEEQ('l','L',"left",cur->value)) {
3314 attr_align = apr_pstrdup(doc->pool, "left");
3316 else if (STRCASEEQ('c','C',"center",cur->value)) {
3317 attr_align = apr_pstrdup(doc->pool, "center");
3319 else if (STRCASEEQ('r','R',"right",cur->value)) {
3320 attr_align = apr_pstrdup(doc->pool, "right");
3332 return chtml10->out;
3337 * It is a handler who processes the P tag.
3339 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3340 * destination is specified.
3341 * @param node [i] The P tag node is specified.
3342 * @return The conversion result is returned.
3345 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
3351 chtml10 = GET_CHTML10(pdoc);
3356 if (IS_CSS_ON(chtml10->entryp)) {
3357 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3359 return chtml10->out;
3364 * It is a handler who processes the TEXTARE tag.
3366 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3367 * destination is specified.
3368 * @param node [i] The TEXTAREA tag node is specified.
3369 * @return The conversion result is returned.
3372 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
3379 chtml10 = GET_CHTML10(pdoc);
3383 chtml10->textarea_flag++;
3387 for (attr = qs_get_attr(doc,node);
3389 attr = qs_get_next_attr(doc,attr)) {
3390 char *name = qs_get_attr_name (doc,attr);
3391 char *value = qs_get_attr_value(doc,attr);
3395 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
3396 W_L(" accesskey=\"");
3404 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3413 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3422 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3434 return chtml10->out;
3439 * It is a handler who processes the TEXTAREA tag.
3441 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3442 * destination is specified.
3443 * @param node [i] The TEXTAREA tag node is specified.
3444 * @return The conversion result is returned.
3447 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3453 chtml10 = GET_CHTML10(pdoc);
3458 chtml10->textarea_flag--;
3460 return chtml10->out;
3465 s_chtml10_text(void *pdoc, Node *child)
3476 apr_size_t z2h_input_len;
3478 chtml10 = GET_CHTML10(pdoc);
3482 textval = qs_get_node_value(doc,child);
3483 if (strlen(textval) == 0) {
3484 return chtml10->out;
3487 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3488 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3490 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3491 memset(one_byte, 0, sizeof(one_byte));
3494 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3498 rtn = s_chtml10_search_emoji(chtml10, &textval[ii], &out);
3500 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3505 if (is_sjis_kanji(textval[ii])) {
3506 one_byte[0] = textval[ii+0];
3507 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3508 one_byte[0] = textval[ii+1];
3509 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3513 if (chtml10->pre_flag) {
3514 one_byte[0] = textval[ii+0];
3515 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3518 if (chtml10->textarea_flag) {
3519 one_byte[0] = textval[ii+0];
3520 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3523 if (textval[ii] != '\r' && textval[ii] != '\n') {
3524 one_byte[0] = textval[ii+0];
3525 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3529 z2h_input_len = strlen(tdst);
3530 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, chtml10->entryp);
3533 return chtml10->out;
3538 * It is a handler who processes the BLOCKQUOTE tag.
3540 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3541 * destination is specified.
3542 * @param node [i] The BLOCKQUOTE tag node is specified.
3543 * @return The conversion result is returned.
3546 s_chtml10_start_blockquote_tag(void *pdoc, Node *node)
3551 char *attr_style = NULL;
3553 chtml10 = GET_CHTML10(pdoc);
3555 for (attr = qs_get_attr(doc,node);
3557 attr = qs_get_next_attr(doc,attr)) {
3558 char *nm = qs_get_attr_name(doc,attr);
3559 char *val = qs_get_attr_value(doc,attr);
3560 if (val && STRCASEEQ('s','S',"style", nm)) {
3564 W_L("<blockquote>");
3565 if (IS_CSS_ON(chtml10->entryp)) {
3566 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3568 return chtml10->out;
3573 * It is a handler who processes the BLOCKQUOTE tag.
3575 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3576 * destination is specified.
3577 * @param node [i] The BLOCKQUOTE tag node is specified.
3578 * @return The conversion result is returned.
3581 s_chtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3586 chtml10 = GET_CHTML10(pdoc);
3588 W_L("</blockquote>");
3589 if (IS_CSS_ON(chtml10->entryp)) {
3590 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3592 return chtml10->out;
3597 * It is a handler who processes the DIR tag.
3599 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3600 * destination is specified.
3601 * @param node [i] The DIR tag node is specified.
3602 * @return The conversion result is returned.
3605 s_chtml10_start_dir_tag(void *pdoc, Node *node)
3610 char *attr_style = NULL;
3612 chtml10 = GET_CHTML10(pdoc);
3615 for (attr = qs_get_attr(doc,node);
3617 attr = qs_get_next_attr(doc,attr)) {
3618 char *nm = qs_get_attr_name(doc,attr);
3619 char *val = qs_get_attr_value(doc,attr);
3620 if (val && STRCASEEQ('s','S',"style", nm)) {
3626 if (IS_CSS_ON(chtml10->entryp)) {
3627 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3629 return chtml10->out;
3634 * It is a handler who processes the DIR tag.
3636 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3637 * destination is specified.
3638 * @param node [i] The DIR tag node is specified.
3639 * @return The conversion result is returned.
3642 s_chtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
3647 chtml10 = GET_CHTML10(pdoc);
3651 if (IS_CSS_ON(chtml10->entryp)) {
3652 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3654 return chtml10->out;
3659 * It is a handler who processes the DL tag.
3661 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3662 * destination is specified.
3663 * @param node [i] The DL tag node is specified.
3664 * @return The conversion result is returned.
3667 s_chtml10_start_dl_tag(void *pdoc, Node *node)
3672 char *attr_style = NULL;
3674 chtml10 = GET_CHTML10(pdoc);
3677 for (attr = qs_get_attr(doc,node);
3679 attr = qs_get_next_attr(doc,attr)) {
3680 char *nm = qs_get_attr_name(doc,attr);
3681 char *val = qs_get_attr_value(doc,attr);
3682 if (val && STRCASEEQ('s','S',"style", nm)) {
3686 if (IS_CSS_ON(chtml10->entryp)) {
3687 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3690 return chtml10->out;
3695 * It is a handler who processes the DL tag.
3697 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3698 * destination is specified.
3699 * @param node [i] The DL tag node is specified.
3700 * @return The conversion result is returned.
3703 s_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
3707 chtml10 = GET_CHTML10(pdoc);
3710 if (IS_CSS_ON(chtml10->entryp)) {
3711 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3713 return chtml10->out;
3718 * It is a handter who processes the DT tag.
3720 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3721 * destination is specified.
3722 * @param node [i] The DT tag node is specified.
3723 * @return The conversion result is returned.
3726 s_chtml10_start_dt_tag(void *pdoc, Node *node)
3731 char *attr_style = NULL;
3733 chtml10 = GET_CHTML10(pdoc);
3736 for (attr = qs_get_attr(doc,node);
3738 attr = qs_get_next_attr(doc,attr)) {
3739 char *nm = qs_get_attr_name(doc,attr);
3740 char *val = qs_get_attr_value(doc,attr);
3741 if (val && STRCASEEQ('s','S',"style", nm)) {
3746 if (IS_CSS_ON(chtml10->entryp)) {
3747 s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
3749 return chtml10->out;
3754 * It is a handter who processes the DT tag.
3756 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3757 * destination is specified.
3758 * @param node [i] The DT tag node is specified.
3759 * @return The conversion result is returned.
3762 s_chtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
3764 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3765 if (IS_CSS_ON(chtml10->entryp)) {
3766 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3768 return chtml10->out;
3773 * It is a handder who processes the DD tag.
3775 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3776 * destination is specified.
3777 * @param node [i] The DD tag node is specified.
3778 * @return The conversion result is returned.
3781 s_chtml10_start_dd_tag(void *pdoc, Node *node)
3783 CHTML10_PUSH_ONLY("<dd>");
3788 * It is a handder who processes the DD tag.
3790 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3791 * destination is specified.
3792 * @param node [i] The DD tag node is specified.
3793 * @return The conversion result is returned.
3796 s_chtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
3798 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3799 if (IS_CSS_ON(chtml10->entryp)) {
3800 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3802 return chtml10->out;
3807 * It is a hanmenuer who processes the MENU tag.
3809 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3810 * destination is specified.
3811 * @param node [i] The MENU tag node is specified.
3812 * @return The conversion result is returned.
3815 s_chtml10_start_menu_tag(void *pdoc, Node *node)
3817 CHTML10_PUSH_ONLY("<menu>");
3822 * It is a hanmenuer who processes the MENU tag.
3824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3825 * destination is specified.
3826 * @param node [i] The MENU tag node is specified.
3827 * @return The conversion result is returned.
3830 s_chtml10_end_menu_tag(void *pdoc, Node *UNUSED(child))
3832 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3833 Doc *doc = chtml10->doc;
3835 if (IS_CSS_ON(chtml10->entryp)) {
3836 chxj_css_pop_prop_list(chtml10->css_prop_stack);
3838 return chtml10->out;
3843 * It is a handler who processes the PLAINTEXT tag.
3845 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3846 * destination is specified.
3847 * @param node [i] The PLAINTEXT tag node is specified.
3848 * @return The conversion result is returned.
3851 s_chtml10_start_plaintext_tag(void *pdoc, Node *node)
3856 chtml10 = GET_CHTML10(pdoc);
3859 s_chtml10_start_plaintext_tag_inner(pdoc,node);
3860 return chtml10->out;
3864 s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node)
3869 chtml10 = GET_CHTML10(pdoc);
3871 for (child = qs_get_child_node(doc, node);
3873 child = qs_get_next_node(doc, child)) {
3875 s_chtml10_start_plaintext_tag_inner(pdoc, child);
3877 return chtml10->out;
3882 * It is a handler who processes the PLAINTEXT tag.
3884 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3885 * destination is specified.
3886 * @param node [i] The PLAINTEXT tag node is specified.
3887 * @return The conversion result is returned.
3890 s_chtml10_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3892 chtml10_t *chtml10 = GET_CHTML10(pdoc);
3893 return chtml10->out;
3898 * It is a handler who processes the LINK tag.
3900 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3901 * destination is specified.
3902 * @param node [i] The LINK tag node is specified.
3903 * @return The conversion result is returned.
3906 s_chtml10_link_tag(void *pdoc, Node *node)
3915 chtml10 = GET_CHTML10(pdoc);
3918 if (! IS_CSS_ON(chtml10->entryp)) {
3919 return chtml10->out;
3922 for (attr = qs_get_attr(doc,node);
3924 attr = qs_get_next_attr(doc,attr)) {
3925 char *name = qs_get_attr_name(doc,attr);
3926 char *value = qs_get_attr_value(doc,attr);
3927 if (STRCASEEQ('r','R',"rel", name)) {
3928 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
3932 else if (STRCASEEQ('h','H',"href", name)) {
3933 if (value && *value) {
3937 else if (STRCASEEQ('t','T',"type", name)) {
3938 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
3944 if (rel && href && type) {
3945 DBG(doc->r, "start load CSS. url:[%s]", href);
3946 chtml10->style = chxj_css_parse_from_uri(doc->r, doc->pool, chtml10->style, href);
3947 DBG(doc->r, "end load CSS. url:[%s]", href);
3950 return chtml10->out;
3954 * It is a handler who processes the STYLE tag.
3956 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3957 * destination is specified.
3958 * @param node [i] The STYLE tag node is specified.
3959 * @return The conversion result is returned.
3962 s_chtml10_style_tag(void *pdoc, Node *node)
3969 chtml10 = GET_CHTML10(pdoc);
3972 if (! IS_CSS_ON(chtml10->entryp)) {
3973 return chtml10->out;
3976 for (attr = qs_get_attr(doc,node);
3978 attr = qs_get_next_attr(doc,attr)) {
3979 char *name = qs_get_attr_name(doc,attr);
3980 char *value = qs_get_attr_value(doc,attr);
3981 if (STRCASEEQ('t','T',"type", name)) {
3982 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
3988 Node *child = qs_get_child_node(doc, node);
3989 if (type && child) {
3990 char *name = qs_get_node_name(doc, child);
3991 if (STRCASEEQ('t','T',"text", name)) {
3992 char *value = qs_get_node_value(doc, child);
3993 DBG(doc->r, "start load CSS. buf:[%s]", value);
3994 chtml10->style = chxj_css_parse_style_value(doc, chtml10->style, value);
3995 DBG(doc->r, "end load CSS. value:[%s]", value);
3998 return chtml10->out;
4003 s_chtml10_newline_mark(void *pdoc, Node *UNUSED(node))
4005 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4006 Doc *doc = chtml10->doc;
4008 return chtml10->out;
4011 static css_prop_list_t *
4012 s_chtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
4014 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4015 Doc *doc = chtml10->doc;
4016 css_prop_list_t *last_css = NULL;
4017 if (IS_CSS_ON(chtml10->entryp)) {
4018 css_prop_list_t *dup_css;
4019 css_selector_t *selector;
4021 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4022 dup_css = chxj_dup_css_prop_list(doc, last_css);
4023 selector = chxj_css_find_selector(doc, chtml10->style, node);
4025 chxj_css_prop_list_merge_property(doc, dup_css, selector);
4027 chxj_css_push_prop_list(chtml10->css_prop_stack, dup_css);
4028 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4030 if (style_attr_value) {
4031 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
4033 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
4041 static css_prop_list_t *
4042 s_chtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
4044 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4045 Doc *doc = chtml10->doc;
4046 css_prop_list_t *last_css = NULL;
4047 if (IS_CSS_ON(chtml10->entryp)) {
4048 css_prop_list_t *dup_css;
4049 css_selector_t *selector;
4051 last_css = chxj_css_get_last_prop_list(chtml10->css_prop_stack);
4052 dup_css = chxj_dup_css_prop_list(doc, last_css);
4053 selector = chxj_css_find_selector(doc, chtml10->style, node);
4055 chxj_css_prop_list_merge_property(doc, dup_css, selector);
4059 if (style_attr_value) {
4060 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
4062 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
4072 * It is a handler who processes the SPAN tag.
4074 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4075 * destination is specified.
4076 * @param node [i] The SPAN tag node is specified.
4077 * @return The conversion result is returned.
4080 s_chtml10_start_span_tag(void *pdoc, Node *node)
4085 char *attr_style = NULL;
4086 char *attr_color = NULL;
4087 char *attr_align = NULL;
4089 chtml10 = GET_CHTML10(pdoc);
4092 for (attr = qs_get_attr(doc,node);
4094 attr = qs_get_next_attr(doc,attr)) {
4095 char *nm = qs_get_attr_name(doc,attr);
4096 char *val = qs_get_attr_value(doc,attr);
4097 if (val && STRCASEEQ('s','S',"style", nm)) {
4101 if (IS_CSS_ON(chtml10->entryp)) {
4102 css_prop_list_t *style = s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
4104 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4105 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
4106 css_property_t *cur;
4107 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4108 attr_color = apr_pstrdup(doc->pool, cur->value);
4110 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
4111 if (STRCASEEQ('l','L',"left", cur->value)) {
4112 attr_align = apr_pstrdup(doc->pool, "left");
4114 else if (STRCASEEQ('c','C',"center",cur->value)) {
4115 attr_align = apr_pstrdup(doc->pool, "center");
4117 else if (STRCASEEQ('r','R',"right",cur->value)) {
4118 attr_align = apr_pstrdup(doc->pool, "right");
4123 if (attr_color || attr_align) {
4124 chtml10_flags_t *flg = apr_palloc(doc->pool, sizeof(*flg));
4125 memset(flg, 0, sizeof(*flg));
4127 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4128 W_L("<font color=\"");
4131 flg->with_font_flag = 1;
4134 W_L("<div align=\"");
4137 flg->with_div_flag = 1;
4139 node->userData = flg;
4142 node->userData = NULL;
4144 return chtml10->out;
4149 * It is a handler who processes the SPAN tag.
4151 * @param pdoc [i/o] The pointer to the CHTML structure at the output
4152 * destination is specified.
4153 * @param node [i] The SPAN tag node is specified.
4154 * @return The conversion result is returned.
4157 s_chtml10_end_span_tag(void *pdoc, Node *node)
4159 chtml10_t *chtml10 = GET_CHTML10(pdoc);
4160 Doc *doc = chtml10->doc;
4162 chtml10_flags_t *flg = (chtml10_flags_t *)node->userData;
4163 if (flg && flg->with_div_flag) {
4166 if (flg && flg->with_font_flag) {
4169 if (IS_CSS_ON(chtml10->entryp)) {
4170 chxj_css_pop_prop_list(chtml10->css_prop_stack);
4172 return chtml10->out;