OSDN Git Service

Merge branch 'branch_0.12.0' into branch_0.13.0
authorAtsushi Konno <konn@users.sourceforge.jp>
Fri, 10 Apr 2009 12:15:29 +0000 (21:15 +0900)
committerAtsushi Konno <konn@users.sourceforge.jp>
Fri, 10 Apr 2009 12:15:29 +0000 (21:15 +0900)
Conflicts:
src/chxj_chtml30.c

1  2 
src/chxj_chtml30.c

@@@ -1787,101 -1496,59 +1787,104 @@@ s_chtml30_start_input_tag(void *pdoc, N
    /*--------------------------------------------------------------------------*/
    /* Get Attributes                                                           */
    /*--------------------------------------------------------------------------*/
 -  type       = qs_get_type_attr(doc, node, doc->buf.pool);
 -  name       = qs_get_name_attr(doc, node, doc->buf.pool);
 -  value      = qs_get_value_attr(doc,node,doc->buf.pool);
 -  istyle     = qs_get_istyle_attr(doc,node,doc->buf.pool);
 -  max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
 -  checked    = qs_get_checked_attr(doc,node,doc->buf.pool);
 -  accesskey  = qs_get_accesskey_attr(doc, node, doc->buf.pool);
 -  size       = qs_get_size_attr(doc, node, doc->buf.pool);
 -
 -  if (type) {
 -    type = qs_trim_string(doc->buf.pool, type);
 -    if (type && (STRCASEEQ('t','T',"text",    type) ||
 -                 STRCASEEQ('p','P',"password",type) ||
 -                 STRCASEEQ('c','C',"checkbox",type) ||
 -                 STRCASEEQ('r','R',"radio",   type) ||
 -                 STRCASEEQ('h','H',"hidden",  type) ||
 -                 STRCASEEQ('s','S',"submit",  type) ||
 -                 STRCASEEQ('r','R',"reset",   type))) {
 -      W_L(" type=\"");
 -      W_V(type);
 -      W_L("\"");
 +  for (attr = qs_get_attr(doc,node);
 +       attr;
 +       attr = qs_get_next_attr(doc,attr)) {
 +    char *name  = qs_get_attr_name(doc,attr);
 +    char *value = qs_get_attr_value(doc,attr);
 +    if (STRCASEEQ('t','T',"type",name) && value && *value) {
 +      char *tmp_type = qs_trim_string(doc->buf.pool, value);
 +      if (tmp_type && (STRCASEEQ('t','T',"text",    tmp_type) ||
 +                       STRCASEEQ('p','P',"password",tmp_type) ||
 +                       STRCASEEQ('c','C',"checkbox",tmp_type) ||
 +                       STRCASEEQ('r','R',"radio",   tmp_type) ||
 +                       STRCASEEQ('h','H',"hidden",  tmp_type) ||
 +                       STRCASEEQ('s','S',"submit",  tmp_type) ||
 +                       STRCASEEQ('r','R',"reset",   tmp_type))) {
 +        attr_type = tmp_type;
 +      }
 +    }
 +    else if (STRCASEEQ('n','N',"name",name) && value && *value) {
 +      attr_name = value;
 +    }
 +    else if (STRCASEEQ('v','V',"value",name) && value && *value) {
 +      attr_value = value;
 +    }
 +    else if (STRCASEEQ('i','I',"istyle",name) && value && *value) {
 +      attr_istyle = value;
 +    }
 +    else if (STRCASEEQ('m','M',"maxlength",name) && value && *value) {
 +      attr_max_length = value;
 +    }
 +    else if (STRCASEEQ('c','C',"checked", name)) {
 +      attr_checked = value;
 +    }
 +    else if (STRCASEEQ('a','A',"accesskey", name) && value && *value) {
 +      attr_accesskey = value;
 +    }
 +    else if (STRCASEEQ('s','S',"size", name) && value && *value) {
 +      attr_size = value;
 +    }
 +    else if (STRCASEEQ('s','S',"style", name) && value && *value) {
 +      attr_style = value;
      }
    }
 -  if (size && *size) {
 +
 +  if (IS_CSS_ON(chtml30->entryp)) {
 +    css_prop_list_t *style = s_chtml30_nopush_and_get_now_style(pdoc, node, attr_style);
 +    if (style) {
 +      css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
 +      css_property_t *cur;
 +      for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
 +        if (strcasestr(cur->value, "<ja:n>")) {
 +          attr_istyle = "4";
 +        }
 +        else if (strcasestr(cur->value, "<ja:en>")) {
 +          attr_istyle = "3";
 +        }
 +        else if (strcasestr(cur->value, "<ja:hk>")) {
 +          attr_istyle = "2";
 +        }
 +        else if (strcasestr(cur->value, "<ja:h>")) {
 +          attr_istyle = "1";
 +        }
 +      }
 +    }
 +  }
 +
 +  W_L("<input");
 +  if (attr_type) {
 +    W_L(" type=\"");
 +    W_V(attr_type);
 +    W_L("\"");
 +  }
 +  if (attr_size) {
      W_L(" size=\"");
 -    W_V(size);
 +    W_V(attr_size);
      W_L("\"");
    }
 -  if (name && *name) {
 +  if (attr_name) {
      W_L(" name=\"");
 -    W_V(name);
 +    W_V(attr_name);
      W_L("\"");
    }
 -  if (value && *value) {
 -    apr_size_t value_len = strlen(value);
 -    value = chxj_conv_z2h(r, value, &value_len, chtml30->entryp);
 +  if (attr_value) {
++    apr_size_t value_len = strlen(attrvalue);
++    attr_value = chxj_conv_z2h(r, attr_value, &value_len, chtml30->entryp);
      W_L(" value=\"");
 -    W_V(chxj_add_slash_to_doublequote(doc->pool, value));
 +    W_V(chxj_add_slash_to_doublequote(doc->pool, attr_value));
      W_L("\"");
    }
 -  if (accesskey && *accesskey) {
 +  if (attr_accesskey) {
      W_L(" accesskey=\"");
 -    W_V(accesskey);
 +    W_V(attr_accesskey);
      W_L("\"");
    }
 -  if (istyle) {
 -    /*------------------------------------------------------------------------*/
 -    /* CHTML 2.0                                                              */
 -    /*------------------------------------------------------------------------*/
 -    if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
 +  if (attr_istyle) {
 +    if (*attr_istyle == '1' || *attr_istyle == '2' || *attr_istyle == '3' || *attr_istyle == '4') {
        W_L(" istyle=\"");
 -      W_V(istyle);
 +      W_V(attr_istyle);
        W_L("\"");
      }
    }