summaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/html.cc b/src/html.cc
index bc95fe09..b3ac1ae0 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -490,7 +490,6 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
pre_column = 0;
PreFirstChar = false;
PrevWasCR = false;
- PrevWasOpenTag = false;
PrevWasSPC = false;
InVisitedLink = false;
ReqTagClose = false;
@@ -1216,7 +1215,6 @@ static void Html_process_word(DilloHtml *html, const char *word, int size)
}
}
- html->PrevWasOpenTag = false;
html->PrevWasSPC = false;
if (html->InFlags & IN_LI)
html->WordAfterLI = true;
@@ -1351,6 +1349,7 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx)
/* Close this and only this tag */
html->CloseOneTag = true;
+ MSG("Close: %*s%s\n", html->stack->size()," ",Tags[toptag_idx].name);
Tags[toptag_idx].close (html, toptag_idx);
}
@@ -3404,6 +3403,7 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag)
if (tag_idx != new_idx || IsCloseTag) {
/* implicit open */
Html_force_push_tag(html, tag_idx);
+ MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name);
Tags[tag_idx].open (html, tag, strlen(tag));
}
}
@@ -3416,6 +3416,7 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag)
if (tag_idx != new_idx || IsCloseTag) {
/* implicit open of the head element */
Html_force_push_tag(html, tag_idx);
+ MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name);
Tags[tag_idx].open (html, tag, strlen(tag));
}
}
@@ -3425,13 +3426,14 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag)
if (html->InFlags & IN_HEAD) {
tag = "</head>";
tag_idx = Html_tag_index(tag + 2);
- Tags[tag_idx].close (html, tag_idx);
+ Html_tag_cleanup_at_close(html, tag_idx);
}
tag = "<body>";
tag_idx = Html_tag_index(tag + 1);
if (tag_idx != new_idx || IsCloseTag) {
/* implicit open */
Html_force_push_tag(html, tag_idx);
+ MSG("Open : %*s%s\n", html->stack->size()," ",Tags[tag_idx].name);
Tags[tag_idx].open (html, tag, strlen(tag));
}
}
@@ -3484,6 +3486,7 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize)
Html_push_tag(html, ni);
/* Call the open function for this tag */
+ MSG("Open : %*s%s\n", html->stack->size(), " ", Tags[ni].name);
Tags[ni].open (html, tag, tagsize);
if (html->stop_parser)
break;
@@ -3513,9 +3516,6 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize)
html->NameVal = NULL;
}
- /* let the parser know this was an open tag */
- html->PrevWasOpenTag = true;
-
/* Request inmediate close for elements with forbidden close tag. */
/* TODO: XHTML always requires close tags. A simple implementation
* of the commented clause below will make it work. */
@@ -3532,9 +3532,8 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize)
html->ReqTagClose || /* request */
tag[tagsize - 2] == '/') { /* XML */
- Tags[ni].close (html, ni);
+ Html_tag_cleanup_at_close(html, ni);
/* This was a close tag */
- html->PrevWasOpenTag = false;
html->ReqTagClose = false;
}
}