summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRupinder Singh Khokhar <rsk1coder99@gmail.com>2014-07-03 22:32:29 (GMT)
committer Rupinder Singh Khokhar <rsk1coder99@gmail.com>2014-08-01 16:14:31 (GMT)
commit95c40d62de1ce5960448ef856fd6cb1845ed03eb (patch)
tree1e72ea2b4bc8cedd08288b4485fc29e85244a305
parentfab42cda1c4e8831c33f113e83f6966e38e47425 (diff)
downloadlibhubbub-95c40d62de1ce5960448ef856fd6cb1845ed03eb.tar.gz
libhubbub-95c40d62de1ce5960448ef856fd6cb1845ed03eb.tar.bz2
fixed content model switch at a place. Also added another step to handle xmp in body
-rw-r--r--src/treebuilder/in_body.c5
-rw-r--r--src/treebuilder/in_table.c4
-rw-r--r--src/treebuilder/treebuilder.c2
-rw-r--r--test/data/tree-construction/INDEX4
4 files changed, 12 insertions, 3 deletions
diff --git a/src/treebuilder/in_body.c b/src/treebuilder/in_body.c
index 33ab30a..be7071b 100644
--- a/src/treebuilder/in_body.c
+++ b/src/treebuilder/in_body.c
@@ -307,6 +307,11 @@ hubbub_error process_start_tag(hubbub_treebuilder *treebuilder,
err = process_applet_marquee_object_in_body(treebuilder,
token, type);
} else if (type == XMP) {
+ if(element_in_scope(treebuilder, P, BUTTON_SCOPE)) {
+ err = close_p_in_body(treebuilder);
+ if(err != HUBBUB_OK)
+ return err;
+ }
err = reconstruct_active_formatting_list(treebuilder);
if (err != HUBBUB_OK)
return err;
diff --git a/src/treebuilder/in_table.c b/src/treebuilder/in_table.c
index b51fbe0..d86a908 100644
--- a/src/treebuilder/in_table.c
+++ b/src/treebuilder/in_table.c
@@ -216,6 +216,10 @@ hubbub_error handle_in_table(hubbub_treebuilder *treebuilder,
if (type == TABLE) {
/** \todo fragment case */
+ if(!element_in_scope(treebuilder, TABLE, TABLE_SCOPE)) {
+ /* todo parse error */
+ break;
+ }
element_stack_pop_until(treebuilder, TABLE);
diff --git a/src/treebuilder/treebuilder.c b/src/treebuilder/treebuilder.c
index 9e5734b..115e541 100644
--- a/src/treebuilder/treebuilder.c
+++ b/src/treebuilder/treebuilder.c
@@ -476,7 +476,7 @@ hubbub_error parse_generic_rcdata(hubbub_treebuilder *treebuilder,
return error;
params.content_model.model = rcdata ? HUBBUB_CONTENT_MODEL_RCDATA
- : HUBBUB_CONTENT_MODEL_CDATA;
+ : HUBBUB_CONTENT_MODEL_RAWTEXT;
error = hubbub_tokeniser_setopt(treebuilder->tokeniser,
HUBBUB_TOKENISER_CONTENT_MODEL, &params);
/* There is no way that setopt can fail. Ensure this. */
diff --git a/test/data/tree-construction/INDEX b/test/data/tree-construction/INDEX
index 7504628..643fcc6 100644
--- a/test/data/tree-construction/INDEX
+++ b/test/data/tree-construction/INDEX
@@ -46,8 +46,8 @@ tests1.dat html5lib treebuilder tests
#tests26.dat NA
#tests2.dat NA
#tests3.dat NA
-#tests4.dat NA
-#tests5.dat NA
+tests4.dat NA
+tests5.dat NA
#tests6.dat NA
#tests7.dat NA
#tests8.dat NA