diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2008-12-19 20:18:35 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2008-12-19 20:18:35 -0300 |
commit | 2950e1945283baeffea46480d14f32e21b294a44 (patch) | |
tree | 4853a8c170c552438e4b58486add51dd066bf4bc /src | |
parent | 88649e033a26be4ab3f337c856d6098e05adcd0d (diff) |
Cleaned up Html_pop_tag()
Diffstat (limited to 'src')
-rw-r--r-- | src/form.cc | 6 | ||||
-rw-r--r-- | src/html.cc | 34 | ||||
-rw-r--r-- | src/html_common.hh | 1 |
3 files changed, 2 insertions, 39 deletions
diff --git a/src/form.cc b/src/form.cc index 3f7bbaca..a36cd13a 100644 --- a/src/form.cc +++ b/src/form.cc @@ -372,8 +372,6 @@ void Html_tag_close_form(DilloHtml *html, int TagIdx) html->InFlags &= ~IN_SELECT; html->InFlags &= ~IN_OPTION; html->InFlags &= ~IN_TEXTAREA; - - a_Html_pop_tag(html, TagIdx); } /* @@ -698,7 +696,6 @@ void Html_tag_close_textarea(DilloHtml *html, int TagIdx) html->InFlags &= ~IN_TEXTAREA; } - a_Html_pop_tag(html, TagIdx); } /* @@ -787,8 +784,6 @@ void Html_tag_close_select(DilloHtml *html, int TagIdx) SelectionResource *res = (SelectionResource*)input->embed->getResource(); select->addOptionsTo (res); } - - a_Html_pop_tag(html, TagIdx); } /* @@ -902,7 +897,6 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize) void Html_tag_close_button(DilloHtml *html, int TagIdx) { html->InFlags &= ~IN_BUTTON; - a_Html_pop_tag(html, TagIdx); } /* diff --git a/src/html.cc b/src/html.cc index 196d2571..1a252055 100644 --- a/src/html.cc +++ b/src/html.cc @@ -493,7 +493,6 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url, PrevWasSPC = false; InVisitedLink = false; ReqTagClose = false; - CloseOneTag = false; TagSoup = true; NameVal = NULL; @@ -1317,12 +1316,6 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx) int stack_idx, cmp = 1; int new_idx = TagIdx; - if (html->CloseOneTag) { - Html_real_pop_tag(html); - html->CloseOneTag = false; - return; - } - /* Look for the candidate tag to close */ stack_idx = html->stack->size() - 1; while (stack_idx && @@ -1348,9 +1341,9 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx) Tags[toptag_idx].name); /* 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); + Html_real_pop_tag(html); } } else { @@ -1365,14 +1358,6 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx) } /* - * Cleanup (conditional), and Pop the tag (if it matches) - */ -void a_Html_pop_tag(DilloHtml *html, int TagIdx) -{ - Html_tag_cleanup_at_close(html, TagIdx); -} - -/* * Some parsing routines. */ @@ -1586,7 +1571,6 @@ static void Html_tag_close_html(DilloHtml *html, int TagIdx) /* beware of pages with multiple HTML close tags... :-P */ html->InFlags &= ~IN_HTML; } - a_Html_pop_tag(html, TagIdx); } /* @@ -1622,7 +1606,6 @@ static void Html_tag_close_head(DilloHtml *html, int TagIdx) html->InFlags &= ~IN_HEAD; } - a_Html_pop_tag(html, TagIdx); } /* @@ -1648,7 +1631,6 @@ static void Html_tag_close_title(DilloHtml *html, int TagIdx) } else { BUG_MSG("the TITLE element must be inside the HEAD section\n"); } - a_Html_pop_tag(html, TagIdx); } /* @@ -1668,7 +1650,6 @@ static void Html_tag_open_script(DilloHtml *html, const char *tag, int tagsize) static void Html_tag_close_script(DilloHtml *html, int TagIdx) { /* eventually the stash will be sent to an interpreter for parsing */ - a_Html_pop_tag(html, TagIdx); } /* @@ -1688,7 +1669,6 @@ static void Html_tag_open_style(DilloHtml *html, const char *tag, int tagsize) static void Html_tag_close_style(DilloHtml *html, int TagIdx) { /* eventually the stash will be sent to an interpreter for parsing */ - a_Html_pop_tag(html, TagIdx); } /* @@ -1766,7 +1746,6 @@ static void Html_tag_close_body(DilloHtml *html, int TagIdx) /* some tag soup pages use multiple BODY tags... */ html->InFlags &= ~IN_BODY; } - a_Html_pop_tag(html, TagIdx); } /* @@ -1895,7 +1874,6 @@ static void Html_tag_close_h(DilloHtml *html, int TagIdx) { a_Menu_pagemarks_set_text(html->bw, html->Stash->str); DW2TB(html->dw)->addParbreak (9, S_TOP(html)->style); - a_Html_pop_tag(html, TagIdx); } /* @@ -2251,7 +2229,6 @@ static void Html_tag_open_map(DilloHtml *html, const char *tag, int tagsize) static void Html_tag_close_map(DilloHtml *html, int TagIdx) { html->InFlags &= ~IN_MAP; - a_Html_pop_tag(html, TagIdx); } /* @@ -2528,7 +2505,6 @@ static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize) static void Html_tag_close_a(DilloHtml *html, int TagIdx) { html->InVisitedLink = false; - a_Html_pop_tag(html, TagIdx); } /* @@ -2596,7 +2572,6 @@ static void Html_tag_close_q(DilloHtml *html, int TagIdx) const char *U201D = "\xe2\x80\x9d"; DW2TB(html->dw)->addText (U201D, S_TOP(html)->style); - a_Html_pop_tag(html, TagIdx); } /* @@ -2787,7 +2762,6 @@ static void Html_tag_close_li(DilloHtml *html, int TagIdx) html->InFlags &= ~IN_LI; html->WordAfterLI = false; ((ListItem *)html->dw)->flush (); - a_Html_pop_tag(html, TagIdx); } /* @@ -2900,7 +2874,6 @@ static void Html_tag_close_pre(DilloHtml *html, int TagIdx) { html->InFlags &= ~IN_PRE; DW2TB(html->dw)->addParbreak (9, S_TOP(html)->style); - a_Html_pop_tag(html, TagIdx); } /* @@ -3119,15 +3092,13 @@ static void Html_tag_open_div(DilloHtml *html, const char *tag, int tagsize) static void Html_tag_close_div(DilloHtml *html, int TagIdx) { DW2TB(html->dw)->addParbreak (0, S_TOP(html)->style); - a_Html_pop_tag(html, TagIdx); } /* - * Default close for most tags - just pop the stack. + * Default close for most tags. */ static void Html_tag_close_default(DilloHtml *html, int TagIdx) { - a_Html_pop_tag(html, TagIdx); } /* @@ -3136,7 +3107,6 @@ static void Html_tag_close_default(DilloHtml *html, int TagIdx) static void Html_tag_close_par(DilloHtml *html, int TagIdx) { DW2TB(html->dw)->addParbreak (9, S_TOP(html)->style); - a_Html_pop_tag(html, TagIdx); } diff --git a/src/html_common.hh b/src/html_common.hh index c694123e..302d9ece 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -187,7 +187,6 @@ public: //BUG: for now everything is public bool PrevWasSPC; /* Flag to help handling collapsing white space */ bool InVisitedLink; /* used to 'contrast_visited_colors' */ bool ReqTagClose; /* Flag to help handling bad-formed HTML */ - bool CloseOneTag; /* Flag to help Html_tag_cleanup_at_close() */ bool WordAfterLI; /* Flag to help ignoring the 1st <P> after <LI> */ bool TagSoup; /* Flag to enable the parser's cleanup functions */ char *NameVal; /* used for validation of "NAME" and "ID" in <A> */ |