1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

Applied the last patch from Gary Coady for #304637 changing the behaviour

* HTMLparser.c: Applied the last patch from Gary Coady for #304637
  changing the behaviour when text nodes are found in body
* result/HTML/*: this changes the output of some tests
Daniel
This commit is contained in:
Daniel Veillard
2005-09-01 09:52:30 +00:00
parent 9a27b86f53
commit 36d73403ff
33 changed files with 112 additions and 85 deletions

View File

@@ -1,3 +1,9 @@
Thu Sep 1 11:42:39 CEST 2005 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c: Applied the last patch from Gary Coady for #304637
changing the behaviour when text nodes are found in body
* result/HTML/*: this changes the output of some tests
Thu Sep 1 11:22:37 CEST 2005 Daniel Veillard <daniel@veillard.com>
* doc/downloads.html doc/xml.html: adding reference to Bull AIX rpms

View File

@@ -964,7 +964,6 @@ NULL
static const char *htmlNoContentElements[] = {
"html",
"head",
"body",
NULL
};
@@ -2042,6 +2041,7 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
unsigned int i;
int j;
xmlNodePtr lastChild;
xmlDtdPtr dtd;
for (j = 0;j < len;j++)
if (!(IS_BLANK_CH(str[j]))) return(0);
@@ -2054,8 +2054,17 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
return(1);
if (xmlStrEqual(ctxt->name, BAD_CAST"head"))
return(1);
if (xmlStrEqual(ctxt->name, BAD_CAST"body"))
return(1);
/* Only strip CDATA children of the body tag for strict HTML DTDs */
if (xmlStrEqual(ctxt->name, BAD_CAST "body") && ctxt->myDoc != NULL) {
dtd = xmlGetIntSubset(ctxt->myDoc);
if (dtd != NULL && dtd->ExternalID != NULL) {
if (!xmlStrcasecmp(dtd->ExternalID, BAD_CAST "-//W3C//DTD HTML 4.01//EN") ||
!xmlStrcasecmp(dtd->ExternalID, BAD_CAST "-//W3C//DTD HTML 4//EN"))
return(1);
}
}
if (ctxt->node == NULL) return(0);
lastChild = xmlGetLastChild(ctxt->node);
while ((lastChild) && (lastChild->type == XML_COMMENT_NODE))

View File

@@ -3,10 +3,8 @@
<head><title>This service is temporary down</title></head>
<body bgcolor="#FFFFFF">
<h1 align="center">Sorry, this service is temporary down</h1>
<p>
We are doing our best to get it back on-line,
</p>
<p>The W3C system administrators</p>
</body>
</html>

View File

@@ -16,19 +16,17 @@ SAX.ignorableWhitespace(
, 2)
SAX.startElement(body, bgcolor='#FFFFFF')
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(h1, align='center')
SAX.characters(Sorry, this service is tempora, 37)
SAX.endElement(h1)
SAX.startElement(p)
SAX.characters(
We are doing our best to get , 48)
SAX.endElement(p)
SAX.startElement(p)
SAX.characters(The W3C system administrators, 29)
SAX.endElement(p)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body bgcolor="#FFFFFF">
<a href="mailto:katherine@cbfanc.org,website@bis.doc.gov?subject=South%20San%20Francisco%20BIS%20Seminar%20-%20October%2016th"></a><br>
<a href="mailto:katherine@cbfanc.org,website@bis.doc.gov?subject=South%20San%20Francisco%20BIS%20Seminar%20-%20October%2016th"></a><br>
</body></html>

View File

@@ -4,13 +4,13 @@ SAX.startElement(html)
SAX.ignorableWhitespace(
, 2)
SAX.startElement(body, bgcolor='#FFFFFF')
SAX.ignorableWhitespace(
SAX.characters(
, 18)
SAX.startElement(a, href='mailto:katherine@cbfanc.org,website@bis.doc.gov?subject=South San Francisco BIS Seminar - October 16th')
SAX.endElement(a)
SAX.startElement(br)
SAX.endElement(br)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -1,7 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head><title>gnome-xml push mode bug</title></head>
<body><table border="4"><tr>
<body>
<table border="4"><tr>
<td bgcolor="white">
Foo1
<table border="4"><tr><td>Foo2<p></p>
@@ -9,5 +11,6 @@
</td></tr></table>
</td>
<td bgcolor="blue">Foo3</td>
</tr></table></body>
</tr></table>
</body>
</html>

View File

@@ -16,7 +16,7 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(table, border='4')
@@ -58,7 +58,7 @@ SAX.endElement(tr)
SAX.characters(
, 3)
SAX.endElement(table)
SAX.ignorableWhitespace(
SAX.characters(
, 3)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -20,7 +20,9 @@
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000" link="#000080" vlink="#000080" alink="#000080" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"><p>This page uses frames, but your browser doesn't support them.</p></body>
<body bgcolor="#FFFFFF" text="#000000" link="#000080" vlink="#000080" alink="#000080" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>

View File

@@ -51,12 +51,12 @@ SAX.characters(
, 4)
SAX.startElement(body, bgcolor='#FFFFFF', text='#000000', link='#000080', vlink='#000080', alink='#000080', topmargin='0', leftmargin='0', marginheight='0', marginwidth='0')
SAX.ignorableWhitespace(
SAX.characters(
, 3)
SAX.startElement(p)
SAX.characters(This page uses frames, but you, 61)
SAX.endElement(p)
SAX.ignorableWhitespace(
SAX.characters(
, 3)
SAX.endElement(body)
SAX.characters(

View File

@@ -73,7 +73,7 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 2)
SAX.startElement(body, alink='red', bgcolor='black', link='red', text='white', vlink='red')
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(p)
SAX.characters(
@@ -2905,12 +2905,12 @@ SAX.comment( <TR> <TD WIDTH="780"> <P ALIGN="CENTER"><FONT SIZE="1" COLOR="#9
SAX.endElement(tr)
SAX.comment( <TR> <TD WIDTH="780"> <P ALIGN="CENTER"><FONT SIZE="1" COLOR="#999999" FACE="Verdana,arial">Site design by Tim Brinkley</FONT> </TD> </TR> )
SAX.endElement(tbody)
SAX.endElement(table)
SAX.endElement(table)
SAX.endElement(div)
SAX.characters(
, 2)
SAX.startElement(script)
SAX.cdata( window.open=NS_ActualOpen; , 28)
SAX.cdata( window.open=NS_ActualOpen; , 28)
SAX.endElement(script)
SAX.characters(
, 2)

View File

@@ -44,7 +44,8 @@ configuration file, usually http.conf. To prevent the server extensions from usi
configuration files (access.conf, srm.conf), add the following lines to http.conf:</p>
</font><blockquote>
</font>
<blockquote>
<font face="Courier New">
ResourceConfig /dev/null&nbsp;<br>
AccessConfig /dev/null</font>

View File

@@ -26,7 +26,7 @@ SAX.ignorableWhitespace(
, 2)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(font, face='Verdana')
SAX.characters(
@@ -167,7 +167,7 @@ SAX.characters(
, 3)
SAX.endElement(font)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(blockquote)
SAX.characters(
@@ -184,7 +184,7 @@ SAX.endElement(font)
SAX.characters(
, 1)
SAX.endElement(blockquote)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(font, face='Verdana')
SAX.characters(
@@ -452,7 +452,7 @@ SAX.characters(
, 4)
SAX.endElement(font)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -1,10 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><title></title></head>
<body><ul>
<body>
<ul>
<li>First item
</li>
<li>Second item, closes the first one
</li>
</ul></body>
</ul>
</body>
</html>

View File

@@ -15,7 +15,7 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(ul)
SAX.characters(
@@ -28,7 +28,7 @@ SAX.startElement(li)
SAX.characters(Second item, closes the first , 34)
SAX.endElement(li)
SAX.endElement(ul)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.endElement(body)

View File

@@ -1,2 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><pre><a href="toto"></a><img src="titi"></pre></body></html>
<html><body>
<pre><a href="toto"></a><img src="titi"></pre>
</body></html>

View File

@@ -4,7 +4,7 @@ SAX.startElement(html)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(pre)
SAX.startElement(a, href='toto')
@@ -12,7 +12,7 @@ SAX.endElement(a)
SAX.startElement(img, src='titi')
SAX.endElement(img)
SAX.endElement(pre)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -1,5 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?xml-stylesheet href="./css/ht2html.css" type="text/css"?><html>
<!-- THIS PAGE IS AUTOMATICALLY GENERATED. DO NOT EDIT. --><head><title>Python Programming Language</title></head>
<body></body>
<body>
</body>
</html>

View File

@@ -20,7 +20,7 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.endElement(html)

View File

@@ -15,12 +15,12 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(h1)
SAX.characters(Regression test 1, 17)
SAX.endElement(h1)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(p)
SAX.characters(

View File

@@ -15,12 +15,12 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(h1)
SAX.characters(Regression test 2, 17)
SAX.endElement(h1)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(p)
SAX.characters(

View File

@@ -15,12 +15,12 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(h1)
SAX.characters(Regression test 3, 17)
SAX.endElement(h1)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(p)
SAX.characters(
@@ -29,7 +29,7 @@ Autoclose of tag P
SAX.endElement(p)
SAX.startElement(hr)
SAX.endElement(hr)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(p)
SAX.characters(

View File

@@ -15,12 +15,12 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(h1)
SAX.characters(Regression test 4, 17)
SAX.endElement(h1)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(p)
SAX.characters(
@@ -29,10 +29,10 @@ Wrong close of tag P
SAX.endElement(p)
SAX.startElement(hr)
SAX.endElement(hr)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.error: Unexpected end tag : p
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -11,17 +11,17 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(script, language='javascript')
SAX.cdata(
if (window.open&lt;max) ;, 28)
SAX.endElement(script)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(input, onclick='if(window.open&lt;max);')
SAX.endElement(input)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -4,11 +4,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Page</title>
</head>
<body><div id="portal">
<body>
<div id="portal">
<script type="text/javascript">
documen.write("Příliš žluťoučký kůň úpěl ďábelksé ódy");
</script><p>
Příliš žluťoučký kůň úpěl ďábelksé ódy;
</p>
</div></body>
</div>
</body>
</html>

View File

@@ -20,7 +20,7 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(div, id='portal')
SAX.characters(
@@ -38,7 +38,7 @@ SAX.endElement(p)
SAX.characters(
, 1)
SAX.endElement(div)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(

View File

@@ -2,6 +2,7 @@
<html>
<head><title>Linux Today</title></head>
<body bgcolor="White" link="Blue" text="Black" vlink="Black" alink="Red">
<center>
<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="#FFFFFF">
<td height="90">

View File

@@ -11,7 +11,7 @@ SAX.endElement(head)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body, bgcolor='White', link='Blue', text='Black', vlink='Black', alink='Red')
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(center)
@@ -130,7 +130,7 @@ SAX.endElement(font)
SAX.characters(
, 1)
SAX.endElement(center)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(p)
SAX.characters(

View File

@@ -26,7 +26,7 @@ SAX.endElement(p)
SAX.startElement(hr)
SAX.endElement(hr)
SAX.error: Unexpected end tag : p
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(dl)
SAX.characters(
@@ -59,14 +59,14 @@ SAX.characters(Interface, thats stores and ma, 58)
SAX.endElement(dd)
SAX.endElement(dd)
SAX.endElement(dl)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(p)
SAX.endElement(p)
SAX.startElement(hr)
SAX.endElement(hr)
SAX.error: Unexpected end tag : p
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(dl)
SAX.characters(
@@ -163,7 +163,7 @@ SAX.endElement(dt)
SAX.characters(
, 2)
SAX.endElement(dl)
SAX.ignorableWhitespace(
SAX.characters(
, 4)
SAX.startElement(h4)
@@ -173,7 +173,7 @@ SAX.error: Opening and ending tag mismatch: h4 and b
SAX.endElement(b)
SAX.endElement(h4)
SAX.error: Unexpected end tag : b
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(ul)
SAX.startElement(li)
@@ -185,11 +185,11 @@ SAX.characters(HumanInterface, 14)
SAX.endElement(a)
SAX.endElement(li)
SAX.endElement(ul)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(dir)
SAX.endElement(dir)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(ul)
SAX.startElement(li)
@@ -201,11 +201,11 @@ SAX.characters(DataManagement.FlatFile, 23)
SAX.endElement(a)
SAX.endElement(li)
SAX.endElement(ul)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(dir)
SAX.endElement(dir)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(ul)
SAX.startElement(li)
@@ -217,11 +217,11 @@ SAX.characters(DataManagement, 14)
SAX.endElement(a)
SAX.endElement(li)
SAX.endElement(ul)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(dir)
SAX.endElement(dir)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.endElement(body)
SAX.endElement(html)

View File

@@ -2,6 +2,7 @@
<!-- Vignette StoryServer 4 Fri Oct 15 11:37:12 1999 --><html>
<head><title>Top Stories News from Wired News</title></head>
<body bgcolor="#FFFFFF" text="#000000" link="#333399" vlink="#660066" alink="#666699">
<table border="0" width="600" cellspacing="0" cellpadding="0"><tr>
<td valign="top" align="LEFT"><table border="0" cellpadding="0" cellspacing="0" width="468" height="60" bgcolor="#FFFFFF">
<form method="GET" action="http://nsads.hotwired.com/event.ng/Type=click&amp;ProfileID=9688&amp;RunID=14074&amp;AdID=22584&amp;GroupID=1&amp;FamilyID=2684&amp;TagValues=8.25.156.159.166.171.172.174.179.180.181.182.183.196.197.199.208.389.412.436.2041.6750.78456.79630.81880&amp;Redirect=http://www.springstreet.com/aa/citysearch.htm" id="form1" name="form1">
@@ -69,7 +70,8 @@
</table></td>
<td valign="top" align="RIGHT"><a href="http://nsads.hotwired.com/event.ng/Type=click&amp;ProfileID=5597&amp;RunID=17167&amp;AdID=22588&amp;GroupID=1&amp;FamilyID=3228&amp;TagValues=8.25.159.171.172.174.179.180.181.182.183.196.197.199.208.241.389.412.436.2035.6749.6750.70367.78456.79630.81880&amp;Redirect=http:%2F%2Fwww.hp.com%2Fgo%2Foriginal%20" target="_top"><img src="http://static.wired.com/advertising/blipverts/hp_colorinkjet/hp_970c_120x60_6.gif" border="1" height="60" width="120" alt="True to the Original"></a></td>
</tr></table>
<!-- WIRED NEWS header --><!-- CMD_HOST = scoop.hotwired.com --><a name="#"></a><table border="0" width="600" cellspacing="0" cellpadding="0">
<!-- WIRED NEWS header --><!-- CMD_HOST = scoop.hotwired.com --><a name="#"></a>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td colspan="2"><img src="http://static.wired.com/news/images/spacer.gif" height="5" width="447" alt=""></td>

View File

@@ -8,7 +8,7 @@ SAX.characters(Top Stories News from Wired Ne, 32)
SAX.endElement(title)
SAX.endElement(head)
SAX.startElement(body, bgcolor='#FFFFFF', text='#000000', link='#333399', vlink='#660066', alink='#666699')
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(table, border='0', width='600', cellspacing='0', cellpadding='0')
@@ -315,19 +315,19 @@ SAX.endElement(tr)
SAX.characters(
, 1)
SAX.endElement(table)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.comment( WIRED NEWS header )
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.comment( CMD_HOST = scoop.hotwired.com )
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(a, name='#')
SAX.endElement(a)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.startElement(table, border='0', width='600', cellspacing='0', cellpadding='0')
SAX.characters(
@@ -574,14 +574,14 @@ SAX.comment(
SAX.characters(
, 1)
SAX.endElement(table)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.comment( end WIRED NEWS header )
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.comment( begin upper left side Navigation )
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(table, border='0', cellpadding='3', cellspacing='0', align='LEFT', bgcolor='#FFFFFF')
@@ -1463,14 +1463,14 @@ SAX.characters(
, 2)
SAX.endElement(table)
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.comment( end lower left side Navigation )
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.comment( CONTENT TABLE )
SAX.ignorableWhitespace(
SAX.characters(
, 2)
SAX.startElement(table, border='0', width='447', cellspacing='0', cellpadding='0', bordercolor='#66FF00')
@@ -2830,13 +2830,13 @@ SAX.endElement(tr)
SAX.characters(
, 1)
SAX.endElement(table)
SAX.ignorableWhitespace(
SAX.characters(
, 3)
SAX.startElement(br)
SAX.endElement(br)
SAX.ignorableWhitespace(
SAX.characters(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(