r4480 takkaria - in /trunk/hubbub/src/treebuilder: Makefile after_after_frameset.c

netsurf at semichrome.net netsurf at semichrome.net
Mon Jun 30 14:13:11 BST 2008


Author: takkaria
Date: Mon Jun 30 08:13:11 2008
New Revision: 4480

URL: http://source.netsurf-browser.org?rev=4480&view=rev
Log:
Implement the "after after frameset" insertion mode.

Added:
    trunk/hubbub/src/treebuilder/after_after_frameset.c   (with props)
Modified:
    trunk/hubbub/src/treebuilder/Makefile

Modified: trunk/hubbub/src/treebuilder/Makefile
URL: http://source.netsurf-browser.org/trunk/hubbub/src/treebuilder/Makefile?rev=4480&r1=4479&r2=4480&view=diff
==============================================================================
--- trunk/hubbub/src/treebuilder/Makefile (original)
+++ trunk/hubbub/src/treebuilder/Makefile Mon Jun 30 08:13:11 2008
@@ -38,7 +38,7 @@
 		in_caption.c in_column_group.c in_table_body.c in_row.c \
 		in_cell.c in_select.c in_select_in_table.c \
 		in_foreign_content.c after_body.c in_frameset.c \
-		after_frameset.c after_after_body.c \
+		after_frameset.c after_after_body.c after_after_frameset.c \
 		generic_rcdata.c script_collect.c
 
 # Append to sources for component

Added: trunk/hubbub/src/treebuilder/after_after_frameset.c
URL: http://source.netsurf-browser.org/trunk/hubbub/src/treebuilder/after_after_frameset.c?rev=4480&view=auto
==============================================================================
--- trunk/hubbub/src/treebuilder/after_after_frameset.c (added)
+++ trunk/hubbub/src/treebuilder/after_after_frameset.c Mon Jun 30 08:13:11 2008
@@ -1,0 +1,61 @@
+/*
+ * This file is part of Hubbub.
+ * Licensed under the MIT License,
+ *                http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2008 Andrew Sidwell
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include "treebuilder/modes.h"
+#include "treebuilder/internal.h"
+#include "treebuilder/treebuilder.h"
+#include "utils/utils.h"
+
+
+/**
+ * Handle token in "after after body" insertion mode
+ *
+ * \param treebuilder  The treebuilder instance
+ * \param token        The token to handle
+ * \return True to reprocess token, false otherwise
+ */
+bool handle_after_after_body(hubbub_treebuilder *treebuilder,
+		const hubbub_token *token)
+{
+	bool reprocess = false;
+
+	switch (token->type) {
+	case HUBBUB_TOKEN_COMMENT:
+	case HUBBUB_TOKEN_DOCTYPE:
+	case HUBBUB_TOKEN_CHARACTER:
+		process_tag_in_body(treebuilder, token);
+		break;
+	case HUBBUB_TOKEN_START_TAG:
+	{
+		element_type type = element_type_from_name(treebuilder,
+				&token->data.tag.name);
+
+		if (type == HTML) {
+			/* Process as if "in body" */
+			process_tag_in_body(treebuilder, token);
+		} else {
+			/** \todo parse error */
+			treebuilder->context.mode = IN_BODY;
+			reprocess = true;
+		}
+	}
+		break;
+	case HUBBUB_TOKEN_END_TAG:
+		/** \todo parse error */
+		treebuilder->context.mode = IN_FRAMESET;
+		reprocess = true;
+		break;
+	case HUBBUB_TOKEN_EOF:
+		break;
+	}
+
+	return reprocess;
+}
+

Propchange: trunk/hubbub/src/treebuilder/after_after_frameset.c
------------------------------------------------------------------------------
    svn:eol-style = native




More information about the netsurf-commits mailing list