summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2010-12-05 17:19:08 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2010-12-05 17:19:08 +0000
commite420204621aba7b66e4302ab943d8158e4c3600e (patch)
tree967e9417152caef3e733be25db663aadfacc93c0 /include
parentf907092126ccfd1bfb825a99683b39237c482bbc (diff)
downloadlibdom-e420204621aba7b66e4302ab943d8158e4c3600e.tar.gz
libdom-e420204621aba7b66e4302ab943d8158e4c3600e.tar.bz2
Beginnings of some of HTMLElement
svn path=/trunk/dom/; revision=11009
Diffstat (limited to 'include')
-rw-r--r--include/dom/html/html_element.h39
1 files changed, 28 insertions, 11 deletions
diff --git a/include/dom/html/html_element.h b/include/dom/html/html_element.h
index 8c41664..ed7aa69 100644
--- a/include/dom/html/html_element.h
+++ b/include/dom/html/html_element.h
@@ -8,19 +8,36 @@
#ifndef dom_html_element_h_
#define dom_html_element_h_
+#include <dom/core/element.h>
+
typedef struct dom_html_element dom_html_element;
-/**
- * Note: DOM HTML spec is used to provide a more convenient way to
- * access Element's attribute through property. But, for implementation like
- * C, such propery provide no more convenience than Element.get(set)Attribute
- * function, so we ignore all the propety whose type is DOMString in this
- * implementation, clients can always access these property through
- * get(set)Attribute methods.
- *
- * For the readonly property, an readonly Attr node should be created, so once
- * these Attr nodes are created, they can not be changed any more.
- */
+typedef struct dom_html_element_vtable {
+ struct dom_element_vtable base;
+
+ dom_exception (*dom_html_element_get_id)(struct dom_html_element *element,
+ struct dom_string **id);
+ dom_exception (*dom_html_element_set_id)(struct dom_html_element *element,
+ struct dom_string *id);
+};
+
+static inline dom_exception dom_html_element_get_id(struct dom_html_element *element,
+ struct dom_string **id)
+{
+ return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
+ dom_html_element_get_id(element, id);
+}
+#define dom_html_element_get_id(e, id) dom_html_element_get_id( \
+ (dom_html_element *) (e), (struct dom_string **) (id))
+
+static inline dom_exception dom_html_element_set_id(struct dom_html_element *element,
+ struct dom_string *id)
+{
+ return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)->
+ dom_html_element_set_id(element, id);
+}
+#define dom_html_element_set_id(e, id) dom_html_element_set_id( \
+ (dom_html_element *) (e), (struct dom_string *) (id))
#endif