static char *s_chtml10_start_plaintext_tag(void *pdoc, Node *node);
static char *s_chtml10_start_plaintext_tag_inner(void *pdoc, Node *node);
static char *s_chtml10_end_plaintext_tag (void *pdoc, Node *node);
+static char *s_chtml10_start_link_tag (void *pdoc, Node *node);
static void s_init_chtml10(chtml10_t *chtml, Doc *doc, request_rec *r, device_table *spec);
NULL,
NULL,
},
+ /* tagLINK */
+ {
+ s_chtml10_start_link_tag,
+ NULL,
+ },
};
/**
- * It is a hanplaintexter who processes the PLAINTEXT tag.
+ * It is a handler who processes the PLAINTEXT tag.
*
* @param pdoc [i/o] The pointer to the CHTML structure at the output
* destination is specified.
chtml10_t *chtml10 = GET_CHTML10(pdoc);
return chtml10->out;
}
+
+
+/**
+ * It is a handler who processes the LINK tag.
+ *
+ * @param pdoc [i/o] The pointer to the CHTML structure at the output
+ * destination is specified.
+ * @param node [i] The PLAINTEXT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_chtml10_start_link_tag(void *pdoc, Node *node)
+{
+ chtml10_t *chtml10;
+ Doc *doc;
+ Attr *attr;
+ char *rel = NULL;
+ char *href = NULL;
+ char *type = NULL;
+
+ chtml10 = GET_CHTML10(pdoc);
+ doc = chtml10->doc;
+
+ if (! IS_CSS_ON(chtml10->entryp)) {
+ return chtml10->out;
+ }
+
+ 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('r','R',"rel", name)) {
+ if (value && *value) {
+ rel = value;
+ }
+ }
+ else if (STRCASEEQ('h','H',"href", name)) {
+ if (value && *value) {
+ href = value;
+ }
+ }
+ else if (STRCASEEQ('t','T',"type", name)) {
+ if (value && *value) {
+ type = value;
+ }
+ }
+ }
+
+ if (rel && href && type) {
+
+ /* この辺でCSSを読み込む */
+
+ }
+
+ return chtml10->out;
+}
/*
* vim:ts=2 et
*/
cur != &stylesheet->selector_head;
cur = (css_selector_t *)((apr_size_t)cur->ref - (apr_size_t)APR_OFFSETOF(css_selector_t, next))) {
ap_regmatch_t match[256];
- DBG(r, "cur->name:[%s]", cur->name);
if (chxj_ap_regexec(pattern1, cur->name, pattern1->re_nsub + 1, match, 0) == 0) {
DBG(r, "match(independent of)");
ret_sel = cur;
}
else
if (chxj_ap_regexec(pattern2, cur->name, pattern2->re_nsub + 1, match, 0) == 0) {
- DBG(r, "match(depend on) [%s]", cur->name);
char *src = apr_pstrdup(pool, cur->name);
char *one = chxj_ap_pregsub(pool, "$1",src, pattern2->re_nsub + 1, match);
int loop = 0;
do {
- DBG(r, "start do while");
*strrchr(src, *one) = 0;
- DBG(r, "src:[%s] one:[%c]", src, *one);
switch (*one) {
case '>': /* Child selectors */
- DBG(r, "child selectors");
if (chxj_ap_regexec(pattern3, src, pattern3->re_nsub + 1, match, 0) == 0) {
- DBG(r, "has any parent");
one = chxj_ap_pregsub(pool, "$1",src, pattern3->re_nsub + 1, match);
char *ret = s_cmp_now_node_vs_current_style(doc, r, pool, strrchr(src, *one)+1, pattern4, node->parent);
}
}
else {
- DBG(r, "parent:[%x]", node->parent);
- DBG(r, "parent->name:[%s] src:[%s]", node->parent->name, src);
char *ret = s_cmp_now_node_vs_current_style(doc, r, pool, src, pattern4, node->parent);
if (ret) {
ret_sel = cur;
case '+': /* Adjacent sibling selectors */
- DBG(r, "sibling selectors");
if (chxj_ap_regexec(pattern3, src, pattern3->re_nsub + 1, match, 0) == 0) {
- DBG(r, "has any parent");
one = chxj_ap_pregsub(pool, "$1",src, pattern3->re_nsub + 1, match);
char *ret = s_cmp_now_node_vs_current_style(doc, r, pool, strrchr(src, *one)+1, pattern4, node->prev);
if (ret) {
- DBG(r, "continue do while");
loop = 1;
node = node->prev;
break;
}
}
else {
- DBG(r, "now node:[%s][%x]", node->name, node);
if (! node->prev) {
ret_sel = NULL;
goto end_of_search;
}
- DBG(r, "prev:[%x] now:[%s]", node->prev, node->name);
- DBG(r, "prev->name:[%s] src:[%s]", node->prev->name, src);
char *ret = s_cmp_now_node_vs_current_style(doc, r, pool, src, pattern4, node->prev);
if (ret) {
ret_sel = cur;
case ' ': /* Descendant selectors */
- DBG(r, "descendant selectors");
if (chxj_ap_regexec(pattern3, src, pattern3->re_nsub + 1, match, 0) == 0) {
- DBG(r, "has any parent");
one = chxj_ap_pregsub(pool, "$1",src, pattern3->re_nsub + 1, match);
for (; node && node->parent; node = node->parent) {
if (strcasecmp(node->name, "ROOT") == 0 || strcasecmp(node->parent->name, "ROOT") == 0) {
- DBG(r, "unmatch");
loop = 0;
break;
}
char *ret = s_cmp_now_node_vs_current_style(doc, r, pool, strrchr(src, *one)+1, pattern4, node->parent);
if (ret) {
- DBG(r, "continue do while");
loop = 1;
node = node->parent;
break;
}
}
else {
- DBG(r, "parent:[%x]", node);
- DBG(r, "parent->name:[%s] src:[%s]", node->name, src);
for (; node && node->parent; node = node->parent) {
if (strcasecmp(node->name, "ROOT") == 0 || strcasecmp(node->parent->name, "ROOT") == 0) {
- DBG(r, "unmatch");
loop = 0;
break;
}
break;
default:
loop = 0;
- DBG(r, "unmatch(unknown separator)");
}
} while(loop);
node = node_sv;
}
- DBG(r, "unmatch [%s]", cur->name);
}
end_of_search: