r13723 dsilvers - in /trunk/libdom/src/html: html_document.c html_document.h

netsurf at semichrome.net netsurf at semichrome.net
Mon Mar 26 18:57:06 BST 2012


Author: dsilvers
Date: Mon Mar 26 12:57:06 2012
New Revision: 13723

URL: http://source.netsurf-browser.org?rev=13723&view=rev
Log:
Intern an 'id' string for our HTML elements to use

Modified:
    trunk/libdom/src/html/html_document.c
    trunk/libdom/src/html/html_document.h

Modified: trunk/libdom/src/html/html_document.c
URL: http://source.netsurf-browser.org/trunk/libdom/src/html/html_document.c?rev=13723&r1=13722&r2=13723&view=diff
==============================================================================
--- trunk/libdom/src/html/html_document.c (original)
+++ trunk/libdom/src/html/html_document.c Mon Mar 26 12:57:06 2012
@@ -75,7 +75,9 @@
 	doc->url = NULL;
 	doc->cookie = NULL;
 
-	return DOM_NO_ERR;
+	error = dom_string_create_interned((const uint8_t *) "id", SLEN("id"), 
+					   &doc->_memo_id);
+	return error;
 }
 
 /* Finalise a HTMLDocument */
@@ -86,7 +88,9 @@
 	dom_string_unref(doc->domain);
 	dom_string_unref(doc->referrer);
 	dom_string_unref(doc->title);
-
+	
+	dom_string_unref(doc->_memo_id);
+	
 	_dom_document_finalise(&doc->base);
 }
 

Modified: trunk/libdom/src/html/html_document.h
URL: http://source.netsurf-browser.org/trunk/libdom/src/html/html_document.h?rev=13723&r1=13722&r2=13723&view=diff
==============================================================================
--- trunk/libdom/src/html/html_document.h (original)
+++ trunk/libdom/src/html/html_document.h Mon Mar 26 12:57:06 2012
@@ -23,6 +23,9 @@
 	dom_string *domain;	/**< HTML document domain */
 	dom_string *url;	/**< HTML document URL */
 	dom_string *cookie;	/**< HTML document cookie */
+	
+	/* Cached strings for html objects to use */
+	dom_string *_memo_id;	/**< Memoised 'id' */
 };
 
 /* Create a HTMLDocument */




More information about the netsurf-commits mailing list