Bug 569229 - Close outer entities when they're parsed even if we're blocking the parser. r=erahm.

--HG--
extra : rebase_source : 174edac48b2d6b52dc9fe3ad289de735695c65be
extra : source : e86a8b867c7578e082d572403753b3feaf75b0de
This commit is contained in:
Peter Van der Beken 2016-09-06 15:24:06 +02:00
Родитель bf072808d3
Коммит f87fcac9f4
4 изменённых файлов: 31 добавлений и 0 удалений

Просмотреть файл

@ -4906,7 +4906,29 @@ processInternalEntity(XML_Parser parser, ENTITY *entity,
}
else {
entity->open = XML_FALSE;
/* BEGIN MOZILLA CHANGE (Deal with parser interruption from nested entities) */
#if 0
openInternalEntities = openEntity->next;
#else
if (openInternalEntities == openEntity) {
openInternalEntities = openEntity->next;
}
else {
/* openEntity should be closed, but it contains an inner entity that is
still open. Remove openEntity from the openInternalEntities linked
list by looking for the inner entity in the list that links to
openEntity and fixing up its 'next' member
*/
OPEN_INTERNAL_ENTITY *innerOpenEntity = openInternalEntities;
do {
if (innerOpenEntity->next == openEntity) {
innerOpenEntity->next = openEntity->next;
break;
}
} while ((innerOpenEntity = innerOpenEntity->next));
}
#endif
/* END MOZILLA CHANGE */
/* put openEntity back in list of free instances */
openEntity->next = freeInternalEntities;
freeInternalEntities = openEntity;

Просмотреть файл

@ -0,0 +1,2 @@
<?xml version="1.0" standalone="yes" ?>
<html xmlns="http://www.w3.org/1999/xhtml"><p>abcd</p></html>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE html [
<!ENTITY inner "<script src='script.js'></script><p>abcd</p>">
<!ENTITY outer "&inner;">
]>
<html xmlns="http://www.w3.org/1999/xhtml">&outer;</html>

Просмотреть файл

@ -1,6 +1,7 @@
== bug535530-1.html bug535530-1-ref.html
== view-source:bug535530-2.html bug535530-2-ref.html
== bug566280-1.html bug566280-1-ref.html
== bug569229-1.xml bug569229-1-ref.xml
== bug577418-1.html bug577418-1-ref.html
== bug582788-1.html bug582788-1-ref.html
fuzzy-if(skiaContent,2,5) == bug582940-1.html bug582940-1-ref.html