diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/html.cc | 15 |
2 files changed, 8 insertions, 8 deletions
@@ -38,6 +38,7 @@ dillo-2.1 +- Set the File menu label to hide when the File menu-button is shown. ? Trying a new iconv() test in configure.in. - Allowed the rc parser to skip whitespace around the equal sign. + - Fixed the parser not to call Html_tag_close_* functions twice. Patches: Jorge Arellano dw 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; } } |