aboutsummaryrefslogtreecommitdiff
path: root/src/html_common.hh
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2016-05-11 10:02:49 -0300
committerJorge Arellano Cid <jcid@dillo.org>2016-05-11 10:02:49 -0300
commit28aa78ac9465788c745b1abb9b59a2723282c4fa (patch)
treec5d8dd7fecbcbcd58c7277c7df459564bd36081c /src/html_common.hh
parent9afbae353b722209d63786366a175ae7386e7575 (diff)
Fixed handling of BODY and HTML tags. Also improved their html-bug messages.
BODY and HTML have optional open and close, making them tricky to handle. Even more when considering Tag soup pages with multiple body or html sections, and corner cases. This patch tackles the problems by leaving the first HTML and BODY stack elements open, until EOF. There's also better html-bug detection and messages, and more accurate comments in the code. Beware: it may look simple, but it's not!
Diffstat (limited to 'src/html_common.hh')
-rw-r--r--src/html_common.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/html_common.hh b/src/html_common.hh
index 68ed0d08..6d0d8c62 100644
--- a/src/html_common.hh
+++ b/src/html_common.hh
@@ -177,9 +177,11 @@ public: //BUG: for now everything is public
bool PrevWasCR; /* Flag to help parsing of "\r\n" in PRE tags */
bool PrevWasOpenTag; /* Flag to help deferred parsing of white space */
bool InVisitedLink; /* used to 'contrast_visited_colors' */
- bool ReqTagClose; /* Flag to help handling bad-formed HTML */
+ bool ReqTagClose; /* Flag to close the stack's top tag */
bool TagSoup; /* Flag to enable the parser's cleanup functions */
bool loadCssFromStash; /* current stash content should be loaded as CSS */
+ bool PrevWasBodyClose; /* set when </body> is found */
+ bool PrevWasHtmlClose; /* set when </html> is found */
/* element counters: used for validation purposes.
* ATM they're used as three state flags {0,1,>1} */