mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
Remove unneeded progress checks in HTML parser
The HTML parser should now be guaranteed to make progress, so the checks became unnecessary.
This commit is contained in:
41
HTMLparser.c
41
HTMLparser.c
@ -3852,8 +3852,6 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
|
|||||||
while ((CUR != 0) &&
|
while ((CUR != 0) &&
|
||||||
(CUR != '>') &&
|
(CUR != '>') &&
|
||||||
((CUR != '/') || (NXT(1) != '>'))) {
|
((CUR != '/') || (NXT(1) != '>'))) {
|
||||||
long cons = ctxt->nbChars;
|
|
||||||
|
|
||||||
GROW;
|
GROW;
|
||||||
attname = htmlParseAttribute(ctxt, &attvalue);
|
attname = htmlParseAttribute(ctxt, &attvalue);
|
||||||
if (attname != NULL) {
|
if (attname != NULL) {
|
||||||
@ -3920,12 +3918,6 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
|
|||||||
|
|
||||||
failed:
|
failed:
|
||||||
SKIP_BLANKS;
|
SKIP_BLANKS;
|
||||||
if (cons == ctxt->nbChars) {
|
|
||||||
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
|
|
||||||
"htmlParseStartTag: problem parsing attributes\n",
|
|
||||||
NULL, NULL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4161,8 +4153,6 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
|
|||||||
currentNode = xmlStrdup(ctxt->name);
|
currentNode = xmlStrdup(ctxt->name);
|
||||||
depth = ctxt->nameNr;
|
depth = ctxt->nameNr;
|
||||||
while (1) {
|
while (1) {
|
||||||
long cons = ctxt->nbChars;
|
|
||||||
|
|
||||||
GROW;
|
GROW;
|
||||||
|
|
||||||
if (ctxt->instate == XML_PARSER_EOF)
|
if (ctxt->instate == XML_PARSER_EOF)
|
||||||
@ -4282,15 +4272,6 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
|
|||||||
else {
|
else {
|
||||||
htmlParseCharData(ctxt);
|
htmlParseCharData(ctxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cons == ctxt->nbChars) {
|
|
||||||
if (ctxt->node != NULL) {
|
|
||||||
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
|
|
||||||
"detected an error in element content\n",
|
|
||||||
NULL, NULL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
GROW;
|
GROW;
|
||||||
}
|
}
|
||||||
@ -4561,8 +4542,6 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
|
|||||||
currentNode = xmlStrdup(ctxt->name);
|
currentNode = xmlStrdup(ctxt->name);
|
||||||
depth = ctxt->nameNr;
|
depth = ctxt->nameNr;
|
||||||
while (1) {
|
while (1) {
|
||||||
long cons = ctxt->nbChars;
|
|
||||||
|
|
||||||
GROW;
|
GROW;
|
||||||
|
|
||||||
if (ctxt->instate == XML_PARSER_EOF)
|
if (ctxt->instate == XML_PARSER_EOF)
|
||||||
@ -4696,15 +4675,6 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
|
|||||||
else {
|
else {
|
||||||
htmlParseCharData(ctxt);
|
htmlParseCharData(ctxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cons == ctxt->nbChars) {
|
|
||||||
if (ctxt->node != NULL) {
|
|
||||||
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
|
|
||||||
"detected an error in element content\n",
|
|
||||||
NULL, NULL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
GROW;
|
GROW;
|
||||||
}
|
}
|
||||||
@ -5702,7 +5672,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
}
|
}
|
||||||
case XML_PARSER_CONTENT: {
|
case XML_PARSER_CONTENT: {
|
||||||
xmlChar chr[2] = { 0, 0 };
|
xmlChar chr[2] = { 0, 0 };
|
||||||
long cons;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle preparsed entities and charRef
|
* Handle preparsed entities and charRef
|
||||||
@ -5747,7 +5716,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
goto done;
|
goto done;
|
||||||
cur = in->cur[0];
|
cur = in->cur[0];
|
||||||
next = in->cur[1];
|
next = in->cur[1];
|
||||||
cons = ctxt->nbChars;
|
|
||||||
if ((xmlStrEqual(ctxt->name, BAD_CAST"script")) ||
|
if ((xmlStrEqual(ctxt->name, BAD_CAST"script")) ||
|
||||||
(xmlStrEqual(ctxt->name, BAD_CAST"style"))) {
|
(xmlStrEqual(ctxt->name, BAD_CAST"style"))) {
|
||||||
/*
|
/*
|
||||||
@ -5877,15 +5845,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cons == ctxt->nbChars) {
|
|
||||||
if (ctxt->node != NULL) {
|
|
||||||
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
|
|
||||||
"detected an error in element content\n",
|
|
||||||
NULL, NULL);
|
|
||||||
}
|
|
||||||
NEXT;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user