diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-12-08 16:32:27 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-12-08 16:32:27 +0100 |
commit | c8b549abe1c85700c91e805e51b677a49ed5fd1d (patch) | |
tree | cd7c4053123335b3af203b6aaf6cdd99da5fa222 /src/html.cc | |
parent | 9e9dd0866570bcded7a26f0cbf1c0134c35e81d6 (diff) | |
parent | 4e93afcf54baaa4d2b689357ec47fd3ec585e44f (diff) |
merge
Diffstat (limited to 'src/html.cc')
-rw-r--r-- | src/html.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/html.cc b/src/html.cc index 74039314..a59339cd 100644 --- a/src/html.cc +++ b/src/html.cc @@ -464,7 +464,6 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url, pre_column = 0; PreFirstChar = false; PrevWasCR = false; - PrevWasOpenTag = false; PrevWasSPC = false; InVisitedLink = false; ReqTagClose = false; @@ -1176,7 +1175,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; @@ -1310,6 +1308,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); } @@ -3305,6 +3304,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)); } } @@ -3317,6 +3317,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)); } } @@ -3326,13 +3327,14 @@ static void Html_test_section(DilloHtml *html, int new_idx, int IsCloseTag) if (html->InFlags & IN_HEAD) { tag = "</head>"; tag_idx = a_Html_tag_index(tag + 2); - Tags[tag_idx].close (html, tag_idx); + Html_tag_cleanup_at_close(html, tag_idx); } tag = "<body>"; tag_idx = a_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)); } } @@ -3385,6 +3387,7 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) Html_push_tag(html, ni); html->styleEngine->startElement (ni); + MSG("Open : %*s%s\n", html->stack->size(), " ", Tags[ni].name); /* Now parse attributes that can appear on any tag */ if (tagsize >= 8 && /* length of "<t id=i>" */ @@ -3433,9 +3436,6 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) if (html->stop_parser) break; - /* 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. */ @@ -3450,12 +3450,11 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) /* Test for </x>, ReqTagClose, <x /> and <x/> */ if (*start == '/' || /* </x> */ html->ReqTagClose || /* request */ - (tag[tagsize - 2] == '/')) { /* XML: */ + tag[tagsize - 2] == '/') { /* XML */ - Tags[ni].close (html, ni); + Html_tag_cleanup_at_close(html, ni); // html->styleEngine->endElement (ni); /* This was a close tag */ - html->PrevWasOpenTag = false; html->ReqTagClose = false; } } |