r13617 dsilvers - in /trunk/libdom: include/dom/html/html_document.h src/html/html_document.c src/html/html_document.h

netsurf at semichrome.net netsurf at semichrome.net
Sat Mar 24 20:11:50 GMT 2012


Author: dsilvers
Date: Sat Mar 24 15:11:50 2012
New Revision: 13617

URL: http://source.netsurf-browser.org?rev=13617&view=rev
Log:
Change bool for an enum because quirks are tristate.

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

Modified: trunk/libdom/include/dom/html/html_document.h
URL: http://source.netsurf-browser.org/trunk/libdom/include/dom/html/html_document.h?rev=13617&r1=13616&r2=13617&view=diff
==============================================================================
--- trunk/libdom/include/dom/html/html_document.h (original)
+++ trunk/libdom/include/dom/html/html_document.h Sat Mar 24 15:11:50 2012
@@ -19,6 +19,16 @@
 struct dom_nodelist;
 
 typedef struct dom_html_document dom_html_document;
+
+/**
+ * Quirks mode flag
+ */
+typedef enum dom_html_document_quirks_mode {
+	DOM_HTML_DOCUMENT_QUIRKS_MODE_NONE,
+	DOM_HTML_DOCUMENT_QUIRKS_MODE_LIMITED,
+	DOM_HTML_DOCUMENT_QUIRKS_MODE_FULL
+} dom_html_document_quirks_mode;
+
 
 typedef struct dom_html_document_vtable {
 	struct dom_document_vtable base;
@@ -61,9 +71,9 @@
 	dom_exception (*get_elements_by_name)(dom_html_document *doc,
 			dom_string *name, struct dom_nodelist **list);
 	dom_exception (*get_quirks_mode)(dom_html_document *doc,
-					 bool *result);
+					 dom_html_document_quirks_mode *result);
 	dom_exception (*set_quirks_mode)(dom_html_document *doc,
-					 bool quirks);
+					 dom_html_document_quirks_mode quirks);
 } dom_html_document_vtable;
 
 static inline dom_exception dom_html_document_get_title(
@@ -255,7 +265,7 @@
 			(dom_string *) (n), (struct dom_nodelist **) (l))
 
 static inline dom_exception dom_html_document_get_quirks_mode(
-	dom_html_document *doc, bool *result)
+	dom_html_document *doc, dom_html_document_quirks_mode *result)
 {
 	return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
 		get_quirks_mode(doc, result);
@@ -264,7 +274,7 @@
 	dom_html_document_get_quirks_mode((dom_html_document *) (d), (r))
 
 static inline dom_exception dom_html_document_set_quirks_mode(
-	dom_html_document *doc, bool quirks)
+	dom_html_document *doc, dom_html_document_quirks_mode quirks)
 {
 	return ((dom_html_document_vtable *) ((dom_node *) doc)->vtable)->
 		set_quirks_mode(doc, quirks);

Modified: trunk/libdom/src/html/html_document.c
URL: http://source.netsurf-browser.org/trunk/libdom/src/html/html_document.c?rev=13617&r1=13616&r2=13617&view=diff
==============================================================================
--- trunk/libdom/src/html/html_document.c (original)
+++ trunk/libdom/src/html/html_document.c Sat Mar 24 15:11:50 2012
@@ -352,14 +352,14 @@
 /* Semi-internal API extensions for NetSurf */
 
 dom_exception _dom_html_document_get_quirks_mode(dom_html_document *doc,
-						 bool *result)
+		dom_html_document_quirks_mode *result)
 {
 	*result = doc->quirks;
 	return DOM_NO_ERR;
 }
 
 dom_exception _dom_html_document_set_quirks_mode(dom_html_document *doc,
-						 bool quirks)
+		dom_html_document_quirks_mode quirks)
 {
 	doc->quirks = quirks;
 	return DOM_NO_ERR;

Modified: trunk/libdom/src/html/html_document.h
URL: http://source.netsurf-browser.org/trunk/libdom/src/html/html_document.h?rev=13617&r1=13616&r2=13617&view=diff
==============================================================================
--- trunk/libdom/src/html/html_document.h (original)
+++ trunk/libdom/src/html/html_document.h Sat Mar 24 15:11:50 2012
@@ -23,7 +23,8 @@
 	dom_string *domain;	/**< HTML document domain */
 	dom_string *url;	/**< HTML document URL */
 	dom_string *cookie;	/**< HTML document cookie */
-	bool quirks;		/**< HTML document is in quirks mode */
+	dom_html_document_quirks_mode quirks;
+				/**< HTML document is in quirks mode */
 };
 
 /* Create a HTMLDocument */
@@ -82,9 +83,9 @@
 dom_exception _dom_html_document_get_elements_by_name(dom_html_document *doc,
 		dom_string *name, struct dom_nodelist **list);
 dom_exception _dom_html_document_get_quirks_mode(dom_html_document *doc,
-                                                 bool *result);
+		dom_html_document_quirks_mode *result);
 dom_exception _dom_html_document_set_quirks_mode(dom_html_document *doc,
-                                                 bool result);
+		dom_html_document_quirks_mode result);
 
 
 #define DOM_HTML_DOCUMENT_VTABLE \




More information about the netsurf-commits mailing list