r4593 takkaria - /trunk/hubbub/src/treebuilder/script_collect.c

netsurf at semichrome.net netsurf at semichrome.net
Fri Jul 11 14:43:31 BST 2008


Author: takkaria
Date: Fri Jul 11 08:43:30 2008
New Revision: 4593

URL: http://source.netsurf-browser.org?rev=4593&view=rev
Log:
Fix <script> handling in "after head".

Modified:
    trunk/hubbub/src/treebuilder/script_collect.c

Modified: trunk/hubbub/src/treebuilder/script_collect.c
URL: http://source.netsurf-browser.org/trunk/hubbub/src/treebuilder/script_collect.c?rev=4593&r1=4592&r2=4593&view=diff
==============================================================================
--- trunk/hubbub/src/treebuilder/script_collect.c (original)
+++ trunk/hubbub/src/treebuilder/script_collect.c Fri Jul 11 08:43:30 2008
@@ -93,6 +93,17 @@
 
 		/** \todo insertion point manipulation */
 
+		/* Scripts in "after head" should be inserted into <head> */
+		/* See 8.2.5.9 The "after head" insertion mode */
+		if (treebuilder->context.collect.mode == AFTER_HEAD) {
+			if (!element_stack_push(treebuilder,
+					HUBBUB_NS_HTML,
+					HEAD,
+					treebuilder->context.head_element)) {
+			        /** \todo errors */
+		        }
+		}
+
 		/* Append script node to current node */
 		success = treebuilder->tree_handler->append_child(
 				treebuilder->tree_handler->ctx,
@@ -101,6 +112,17 @@
 				treebuilder->context.collect.node, &appended);
 		if (success != 0) {
 			/** \todo errors */
+		}
+
+		if (treebuilder->context.collect.mode == AFTER_HEAD) {
+			hubbub_ns ns;
+			element_type otype;
+			void *node;
+
+ 			if (!element_stack_pop(treebuilder, &ns, &otype,
+					&node)) {
+				/** \todo errors */
+			}
 		}
 
 		/** \todo restore insertion point */




More information about the netsurf-commits mailing list