OSDN Git Service

ol,ul,dl,blockquote,pre style:clear for XHTML(i,y!)
authorcoltware <coltware@94a86f0a-4377-0410-8349-a3afc59ff858>
Mon, 14 Dec 2009 21:14:28 +0000 (21:14 +0000)
committerAtsushi Konno <konn@users.sourceforge.jp>
Wed, 29 Sep 2010 18:05:51 +0000 (03:05 +0900)
src/chxj_ixhtml10.c [changed mode: 0644->0755]
src/chxj_jxhtml.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 4b56d8d..d1f4f80
@@ -2323,6 +2323,7 @@ s_ixhtml10_start_ol_tag(void *pdoc, Node *node)
   char        *attr_style = NULL;
   char        *attr_start = NULL;
   char        *attr_type  = NULL;
+  char        *css_clear  = NULL;
 
   ixhtml10 = GET_IXHTML10(pdoc);
   doc   = ixhtml10->doc;
@@ -2358,6 +2359,7 @@ s_ixhtml10_start_ol_tag(void *pdoc, Node *node)
     css_prop_list_t *style = s_ixhtml10_push_and_get_now_style(pdoc, node, attr_style);
     if (style) {
       css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
       css_property_t *cur;
       for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
         if (STRCASEEQ('d','D',"decimal", cur->value)) {
@@ -2370,14 +2372,24 @@ s_ixhtml10_start_ol_tag(void *pdoc, Node *node)
           attr_type = apr_pstrdup(doc->pool, "lower-alpha");
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<ol");
-  if (attr_type) {
+  if (attr_type || css_clear) {
     W_L(" style=\"");
-    W_L("list-style-type:");
-    W_V(attr_type);
-    W_L(";");
+    if (attr_type) {
+      W_L("list-style-type:");
+      W_V(attr_type);
+      W_L(";");
+    }
+    if (css_clear) {
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   if (attr_start) {
@@ -2553,6 +2565,7 @@ s_ixhtml10_start_pre_tag(void *pdoc, Node *node)
   Doc       *doc   = ixhtml10->doc;
   Attr      *attr;
   char      *attr_style = NULL;
+  char      *css_clear  = NULL;
 
   for (attr = qs_get_attr(doc,node);
        attr;
@@ -2565,11 +2578,27 @@ s_ixhtml10_start_pre_tag(void *pdoc, Node *node)
   }
 
   if (IS_CSS_ON(ixhtml10->entryp)) {
-    s_ixhtml10_push_and_get_now_style(pdoc, node, attr_style);
+    css_prop_list_t *style = s_ixhtml10_push_and_get_now_style(pdoc, node, attr_style);
+    if (style) {
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
+      css_property_t *cur;
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
+    }
   }
 
   ixhtml10->pre_flag++;
-  W_L("<pre>");
+  W_L("<pre");
+  if (css_clear) {
+    W_L(" style=\"");
+    W_L("clear:");
+    W_V(css_clear);
+    W_L(";");
+    W_L("\"");
+  }
+  W_L(">");
   return ixhtml10->out;
 }
 
@@ -2614,6 +2643,8 @@ s_ixhtml10_start_ul_tag(void *pdoc, Node *node)
   Attr     *attr;
   char     *attr_type = NULL;
   char     *attr_style = NULL;
+  char     *css_clear  = NULL;
+  
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
@@ -2635,6 +2666,7 @@ s_ixhtml10_start_ul_tag(void *pdoc, Node *node)
     css_prop_list_t *style = s_ixhtml10_push_and_get_now_style(pdoc, node, attr_style);
     if (style) {
       css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
+      css_property_t *clear_prop      = chxj_css_get_property_value(doc, style, "clear");
       css_property_t *cur;
       for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
         if (STRCASEEQ('d','D',"disc",cur->value)) {
@@ -2647,14 +2679,24 @@ s_ixhtml10_start_ul_tag(void *pdoc, Node *node)
           attr_type = apr_pstrdup(doc->pool, "square");
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<ul");
-  if (attr_type) {
+  if (attr_type || css_clear) {
     W_L(" style=\"");
-    W_L("list-style-type:");
-    W_V(attr_type);
-    W_L(";");
+    if (attr_type) {
+      W_L("list-style-type:");
+      W_V(attr_type);
+      W_L(";");
+    }
+    if (css_clear) {
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   W_L(">");
@@ -3813,6 +3855,7 @@ s_ixhtml10_start_blockquote_tag(void *pdoc, Node *node)
   char     *attr_style = NULL;
   char     *attr_color = NULL;
   char     *attr_size  = NULL;
+  char     *css_clear  = NULL;
 
   ixhtml10  = GET_IXHTML10(pdoc);
   doc     = ixhtml10->doc;
@@ -3830,6 +3873,8 @@ s_ixhtml10_start_blockquote_tag(void *pdoc, Node *node)
     if (style) {
       css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
       css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
       css_property_t *cur;
       for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
         if (cur->value && *cur->value) {
@@ -3861,10 +3906,13 @@ s_ixhtml10_start_blockquote_tag(void *pdoc, Node *node)
           }
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<blockquote");
-  if (attr_color || attr_size) {
+  if (attr_color || attr_size || css_clear) {
     W_L(" style=\"");
     if (attr_color) {
       attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
@@ -4090,10 +4138,13 @@ s_ixhtml10_start_dl_tag(void *pdoc, Node *node)
           }
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<dl");
-  if (attr_color || attr_size) {
+  if (attr_color || attr_size || css_clear) {
     W_L(" style=\"");
     if (attr_color) {
       attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
@@ -4318,6 +4369,11 @@ s_ixhtml10_start_dd_tag(void *pdoc, Node *node)
       W_V(attr_size);
       W_L(";");
     }
+    if (css_clear) {
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   W_L(">");
@@ -5013,6 +5069,11 @@ s_ixhtml10_start_menu_tag(void *pdoc, Node *node)
       W_V(attr_size);
       W_L(";");
     }
+    if (css_clear) {
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   W_L(">");
@@ -5113,6 +5174,8 @@ s_ixhtml10_start_blink_tag(void *pdoc, Node *node)
   char      *attr_style = NULL;
   char      *attr_color = NULL;
   char      *attr_size  = NULL;
+  char      *css_clear  = NULL;
+  
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
@@ -5127,6 +5190,8 @@ s_ixhtml10_start_blink_tag(void *pdoc, Node *node)
     if (style) {
       css_property_t *color_prop           = chxj_css_get_property_value(doc, style, "color");
       css_property_t *size_prop            = chxj_css_get_property_value(doc, style, "font-size");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
       css_property_t *cur;
       for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
         if (cur->value && *cur->value) {
old mode 100644 (file)
new mode 100755 (executable)
index 2bc7c33..addf904
@@ -2325,6 +2325,7 @@ s_jxhtml_start_ol_tag(void *pdoc, Node *node)
   char        *attr_style = NULL;
   char        *attr_start = NULL;
   char        *attr_type  = NULL;
+  char        *css_clear  = NULL;
 
   jxhtml = GET_JXHTML(pdoc);
   doc   = jxhtml->doc;
@@ -2360,6 +2361,8 @@ s_jxhtml_start_ol_tag(void *pdoc, Node *node)
     css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
     if (style) {
       css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
       css_property_t *cur;
       for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
         if (STRCASEEQ('d','D',"decimal", cur->value)) {
@@ -2372,14 +2375,24 @@ s_jxhtml_start_ol_tag(void *pdoc, Node *node)
           attr_type = apr_pstrdup(doc->pool, "lower-alpha");
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<ol");
-  if (attr_type) {
+  if (attr_type || css_clear) {
     W_L(" style=\"");
-    W_L("list-style-type:");
-    W_V(attr_type);
-    W_L(";");
+    if (attr_type) {
+      W_L("list-style-type:");
+      W_V(attr_type);
+      W_L(";");
+    }
+    if (css_clear){
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   if (attr_start) {
@@ -2555,6 +2568,7 @@ s_jxhtml_start_pre_tag(void *pdoc, Node *node)
   Doc       *doc   = jxhtml->doc;
   Attr      *attr;
   char      *attr_style = NULL;
+  char      *css_clear  = NULL;
 
   for (attr = qs_get_attr(doc,node);
        attr;
@@ -2567,11 +2581,27 @@ s_jxhtml_start_pre_tag(void *pdoc, Node *node)
   }
 
   if (IS_CSS_ON(jxhtml->entryp)) {
-    s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+    css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
+    if (style) {
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
+      css_property_t *cur;
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
+    }
   }
 
   jxhtml->pre_flag++;
-  W_L("<pre>");
+  W_L("<pre");
+  if (css_clear) {
+    W_L(" style=\"");
+    W_L("clear:");
+    W_V(css_clear);
+    W_L(";");
+    W_L("\"");
+  }
+  W_L(">");
   return jxhtml->out;
 }
 
@@ -2616,6 +2646,8 @@ s_jxhtml_start_ul_tag(void *pdoc, Node *node)
   Attr     *attr;
   char     *attr_type = NULL;
   char     *attr_style = NULL;
+  char     *css_clear  = NULL;
+  
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
@@ -2637,6 +2669,8 @@ s_jxhtml_start_ul_tag(void *pdoc, Node *node)
     css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
     if (style) {
       css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
       css_property_t *cur;
       for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
         if (STRCASEEQ('d','D',"disc",cur->value)) {
@@ -2649,14 +2683,24 @@ s_jxhtml_start_ul_tag(void *pdoc, Node *node)
           attr_type = apr_pstrdup(doc->pool, "square");
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<ul");
-  if (attr_type) {
+  if (attr_type || css_clear) {
     W_L(" style=\"");
-    W_L("list-style-type:");
-    W_V(attr_type);
-    W_L(";");
+    if (attr_type ){
+      W_L("list-style-type:");
+      W_V(attr_type);
+      W_L(";");
+    }
+    if (css_clear){
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   W_L(">");
@@ -3726,6 +3770,7 @@ s_jxhtml_start_blockquote_tag(void *pdoc, Node *node)
   char     *attr_style = NULL;
   char     *attr_color = NULL;
   char     *attr_size  = NULL;
+  char     *css_clear  = NULL;
 
   jxhtml  = GET_JXHTML(pdoc);
   doc     = jxhtml->doc;
@@ -3743,6 +3788,8 @@ s_jxhtml_start_blockquote_tag(void *pdoc, Node *node)
     if (style) {
       css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
       css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
       css_property_t *cur;
       for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
         if (cur->value && *cur->value) {
@@ -3774,10 +3821,13 @@ s_jxhtml_start_blockquote_tag(void *pdoc, Node *node)
           }
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<blockquote");
-  if (attr_color || attr_size) {
+  if (attr_color || attr_size || css_clear) {
     W_L(" style=\"");
     if (attr_color) {
       attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
@@ -4003,10 +4053,13 @@ s_jxhtml_start_dl_tag(void *pdoc, Node *node)
           }
         }
       }
+      for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
+        css_clear = apr_pstrdup(doc->pool, cur->value);
+      }
     }
   }
   W_L("<dl");
-  if (attr_color || attr_size) {
+  if (attr_color || attr_size || css_clear) {
     W_L(" style=\"");
     if (attr_color) {
       attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
@@ -4231,6 +4284,11 @@ s_jxhtml_start_dd_tag(void *pdoc, Node *node)
       W_V(attr_size);
       W_L(";");
     }
+    if (css_clear){
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   W_L(">");
@@ -4928,6 +4986,11 @@ s_jxhtml_start_menu_tag(void *pdoc, Node *node)
       W_V(attr_size);
       W_L(";");
     }
+    if (css_clear){
+      W_L("clear:");
+      W_V(css_clear);
+      W_L(";");
+    }
     W_L("\"");
   }
   W_L(">");
@@ -5028,6 +5091,8 @@ s_jxhtml_start_blink_tag(void *pdoc, Node *node)
   char      *attr_style = NULL;
   char      *attr_color = NULL;
   char      *attr_size  = NULL;
+  char      *css_clear  = NULL;
+  
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
@@ -5042,6 +5107,8 @@ s_jxhtml_start_blink_tag(void *pdoc, Node *node)
     if (style) {
       css_property_t *color_prop           = chxj_css_get_property_value(doc, style, "color");
       css_property_t *size_prop            = chxj_css_get_property_value(doc, style, "font-size");
+      css_property_t *clear_prop           = chxj_css_get_property_value(doc, style, "clear");
+      
       css_property_t *cur;
       for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
         if (cur->value && *cur->value) {