summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsk1994 <rsk1coder99@gmail.com>2014-05-19 01:22:56 (GMT)
committer Rupinder Singh Khokhar <rsk1coder99@gmail.com>2014-06-10 22:57:10 (GMT)
commit1dd1c7617aae1a4bd285d83a3c73d5d2f53761d7 (patch)
tree9f939c0616a1761e4db2a0ec5ab788b224713641
parent3c9d9494222d81c207cc09a7686cca50db109c0b (diff)
downloadlibdom-1dd1c7617aae1a4bd285d83a3c73d5d2f53761d7.tar.gz
libdom-1dd1c7617aae1a4bd285d83a3c73d5d2f53761d7.tar.bz2
TableCell Element & possible bug fix on TableCaption ELement
-rw-r--r--Makefile3
-rw-r--r--include/dom/dom.h1
-rw-r--r--include/dom/html/html_tablecell_element.h99
-rw-r--r--src/html/Makefile5
-rw-r--r--src/html/TODO2
-rw-r--r--src/html/html_document.c6
-rw-r--r--src/html/html_document_strings.h7
-rw-r--r--src/html/html_tablecell_element.c282
-rw-r--r--src/html/html_tablecell_element.h47
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement01.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement02.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement03.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement04.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement05.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement06.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement07.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement08.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement09.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement10.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement11.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement12.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement13.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement13.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement14.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement14.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement15.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement15.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement16.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement16.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement17.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement17.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement18.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement18.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement19.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement19.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement20.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement20.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement21.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement21.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement22.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement22.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement23.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement23.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement24.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement24.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement25.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement25.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement26.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement26.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement27.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement27.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement28.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement28.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement29.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement29.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLTableCellElement30.xml (renamed from test/testcases/tests/level1/html/HTMLTableCellElement30.xml.kfail)0
39 files changed, 448 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f7b7791..3ce867c 100644
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,8 @@ INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_applet_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_area_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_map_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_script_element.h
-INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_table_caption_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablecaption_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_tablecell_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR)/pkgconfig:lib$(COMPONENT).pc.in
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR):$(OUTPUT)
diff --git a/include/dom/dom.h b/include/dom/dom.h
index b19a298..fac1dac 100644
--- a/include/dom/dom.h
+++ b/include/dom/dom.h
@@ -83,6 +83,7 @@
#include <dom/html/html_map_element.h>
#include <dom/html/html_script_element.h>
#include <dom/html/html_tablecaption_element.h>
+#include <dom/html/html_tablecell_element.h>
/* DOM Events header */
#include <dom/events/events.h>
diff --git a/include/dom/html/html_tablecell_element.h b/include/dom/html/html_tablecell_element.h
index 2e182d5..938d148 100644
--- a/include/dom/html/html_tablecell_element.h
+++ b/include/dom/html/html_tablecell_element.h
@@ -3,5 +3,104 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1bg_colorr99@gmail.com>
*/
+#ifndef dom_html_table_cell_element_h_
+#define dom_html_table_cell_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_table_cell_element dom_html_table_cell_element;
+
+dom_exception dom_html_table_cell_element_get_cell_index(
+ dom_html_table_cell_element *table_cell, int32_t *cell_index);
+
+dom_exception dom_html_table_cell_element_get_abbr(
+ dom_html_table_cell_element *table_cell, dom_string **abbr);
+
+dom_exception dom_html_table_cell_element_set_abbr(
+ dom_html_table_cell_element *table_cell, dom_string *abbr);
+
+dom_exception dom_html_table_cell_element_get_align(
+ dom_html_table_cell_element *table_cell, dom_string **align);
+
+dom_exception dom_html_table_cell_element_set_align(
+ dom_html_table_cell_element *table_cell, dom_string *align);
+
+dom_exception dom_html_table_cell_element_get_axis(
+ dom_html_table_cell_element *table_cell, dom_string **axis);
+
+dom_exception dom_html_table_cell_element_set_axis(
+ dom_html_table_cell_element *table_cell, dom_string *axis);
+
+dom_exception dom_html_table_cell_element_get_bg_color(
+ dom_html_table_cell_element *table_cell, dom_string **bg_color);
+
+dom_exception dom_html_table_cell_element_set_bg_color(
+ dom_html_table_cell_element *table_cell, dom_string *bg_color);
+
+dom_exception dom_html_table_cell_element_get_ch(
+ dom_html_table_cell_element *table_cell, dom_string **ch);
+
+dom_exception dom_html_table_cell_element_set_ch(
+ dom_html_table_cell_element *table_cell, dom_string *ch);
+
+dom_exception dom_html_table_cell_element_get_ch_off(
+ dom_html_table_cell_element *table_cell, dom_string **ch_off);
+
+dom_exception dom_html_table_cell_element_set_ch_off(
+ dom_html_table_cell_element *table_cell, dom_string *ch_off);
+
+dom_exception dom_html_table_cell_element_get_headers(
+ dom_html_table_cell_element *table_cell, dom_string **headers);
+
+dom_exception dom_html_table_cell_element_set_headers(
+ dom_html_table_cell_element *table_cell, dom_string *headers);
+
+dom_exception dom_html_table_cell_element_get_height(
+ dom_html_table_cell_element *table_cell, dom_string **height);
+
+dom_exception dom_html_table_cell_element_set_height(
+ dom_html_table_cell_element *table_cell, dom_string *height);
+
+dom_exception dom_html_table_cell_element_get_scope(
+ dom_html_table_cell_element *table_cell, dom_string **scope);
+
+dom_exception dom_html_table_cell_element_set_scope(
+ dom_html_table_cell_element *table_cell, dom_string *scope);
+
+dom_exception dom_html_table_cell_element_get_v_align(
+ dom_html_table_cell_element *table_cell, dom_string **v_align);
+
+dom_exception dom_html_table_cell_element_set_v_align(
+ dom_html_table_cell_element *table_cell, dom_string *v_align);
+
+dom_exception dom_html_table_cell_element_get_width(
+ dom_html_table_cell_element *table_cell, dom_string **width);
+
+dom_exception dom_html_table_cell_element_set_width(
+ dom_html_table_cell_element *table_cell, dom_string *width);
+
+dom_exception dom_html_table_cell_element_get_col_span(
+ dom_html_table_cell_element *table_cell, int32_t *col_span);
+
+dom_exception dom_html_table_cell_element_set_col_span(
+ dom_html_table_cell_element *table_cell, uint32_t col_span);
+
+dom_exception dom_html_table_cell_element_get_row_span(
+ dom_html_table_cell_element *table_cell, int32_t *row_span);
+
+dom_exception dom_html_table_cell_element_set_row_span(
+ dom_html_table_cell_element *table_cell, uint32_t row_span);
+
+dom_exception dom_html_table_cell_element_get_no_wrap(
+ dom_html_table_cell_element *ele, bool *no_wrap);
+
+dom_exception dom_html_table_cell_element_set_no_wrap(
+ dom_html_table_cell_element *ele, bool no_wrap);
+
+#endif
+
diff --git a/src/html/Makefile b/src/html/Makefile
index 1de0190..fcf326f 100644
--- a/src/html/Makefile
+++ b/src/html/Makefile
@@ -15,11 +15,12 @@ DIR_SOURCES := \
html_font_element.c html_mod_element.c html_anchor_element.c \
html_basefont_element.c html_image_element.c html_object_element.c \
html_param_element.c html_applet_element.c html_area_element.c \
- html_map_element.c html_script_element.c html_tablecaption_element.c
+ html_map_element.c html_script_element.c html_tablecaption_element.c \
+ html_tablecell_element.c
UNINMPLEMENTED_SOURCES := \
html_table_element.c html_tablecol_element.c html_tablesection_element.c \
- html_tablerow_element.c html_tablecell_element.c html_frameset_element.c \
+ html_tablerow_element.c html_frameset_element.c \
html_frame_element.c html_iframe_element.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/html/TODO b/src/html/TODO
index 52dfafe..584de0e 100644
--- a/src/html/TODO
+++ b/src/html/TODO
@@ -51,7 +51,7 @@ HTMLTableCaptionElement html_tablecaption_element DONE
HTMLTableColElement html_tablecol_element MISSING
HTMLTableSectionElement html_tablesection_element MISSING
HTMLTableRowElement html_tablerow_element MISSING
-HTMLTableCellElement html_tablecell_element MISSING
+HTMLTableCellElement html_tablecell_element DONE
HTMLFrameSetElement html_frameset_element MISSING
HTMLFrameElement html_frame_element MISSING
HTMLIFrameElement html_iframe_element MISSING
diff --git a/src/html/html_document.c b/src/html/html_document.c
index 6eda5e8..939b031 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -51,6 +51,7 @@
#include "html/html_area_element.h"
#include "html/html_script_element.h"
#include "html/html_tablecaption_element.h"
+#include "html/html_tablecell_element.h"
#include "core/attr.h"
#include "core/string.h"
@@ -335,6 +336,11 @@ _dom_html_document_create_element_internal(dom_html_document *html,
} else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_CAPTION])) {
exc = _dom_html_table_caption_element_create(html, namespace, prefix,
(dom_html_table_caption_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_TD]) ||
+ dom_string_caseless_isequal(tag_name, html->memoised[hds_TH])
+ ) {
+ exc = _dom_html_table_cell_element_create(html, tag_name, namespace, prefix,
+ (dom_html_table_cell_element **) result);
} else {
exc = _dom_html_element_create(html, tag_name, namespace,
prefix, result);
diff --git a/src/html/html_document_strings.h b/src/html/html_document_strings.h
index 8ed3bb2..38b0004 100644
--- a/src/html/html_document_strings.h
+++ b/src/html/html_document_strings.h
@@ -98,6 +98,10 @@ HTML_DOCUMENT_STRINGS_ACTION1(standby)
HTML_DOCUMENT_STRINGS_ACTION1(object)
HTML_DOCUMENT_STRINGS_ACTION1(event)
HTML_DOCUMENT_STRINGS_ACTION1(defer)
+HTML_DOCUMENT_STRINGS_ACTION1(abbr)
+HTML_DOCUMENT_STRINGS_ACTION1(axis)
+HTML_DOCUMENT_STRINGS_ACTION1(headers)
+HTML_DOCUMENT_STRINGS_ACTION1(scope)
HTML_DOCUMENT_STRINGS_ACTION(tab_index,tabindex)
HTML_DOCUMENT_STRINGS_ACTION(html_for,for)
HTML_DOCUMENT_STRINGS_ACTION(date_time,datetime)
@@ -105,6 +109,9 @@ HTML_DOCUMENT_STRINGS_ACTION(long_desc,longdesc)
HTML_DOCUMENT_STRINGS_ACTION(code_base,codebase)
HTML_DOCUMENT_STRINGS_ACTION(code_type,codetype)
HTML_DOCUMENT_STRINGS_ACTION(value_type,valuetype)
+HTML_DOCUMENT_STRINGS_ACTION(v_align,valign)
+HTML_DOCUMENT_STRINGS_ACTION(ch,char)
+HTML_DOCUMENT_STRINGS_ACTION(ch_off,charoff)
/* HTML_DOCUMENT_STRINGS_ACTION1(type) */
HTML_DOCUMENT_STRINGS_ACTION(use_map,usemap)
/* HTML_DOCUMENT_STRINGS_ACTION1(value) */
diff --git a/src/html/html_tablecell_element.c b/src/html/html_tablecell_element.c
index 2e182d5..6317686 100644
--- a/src/html/html_tablecell_element.c
+++ b/src/html/html_tablecell_element.c
@@ -3,5 +3,287 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dom/html/html_tablecell_element.h>
+
+#include "html/html_document.h"
+#include "html/html_tablecell_element.h"
+
+#include "core/node.h"
+#include "core/attr.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_TABLE_CELL_ELEMENT
+ },
+ DOM_HTML_TABLE_CELL_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_table_cell_element table_cell
+ *
+ * \param doc The document table_cell
+ * \param ele The returned element table_cell
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_cell_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_table_cell_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_html_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_table_cell_element_initialise(doc, tag_name, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_table_cell_element table_cell
+ *
+ * \param doc The document table_cell
+ * \param ele The dom_html_table_cell_element table_cell
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_table_cell_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element *ele)
+{
+ ele->id = -1;
+ return _dom_html_element_initialise(doc, &ele->base,
+ tag_name,
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_table_cell_element table_cell
+ *
+ * \param ele The dom_html_table_cell_element table_cell
+ */
+void _dom_html_table_cell_element_finalise(struct dom_html_table_cell_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_table_cell_element table_cell
+ *
+ * \param ele The dom_html_table_cell_element table_cell
+ */
+void _dom_html_table_cell_element_destroy(struct dom_html_table_cell_element *ele)
+{
+ _dom_html_table_cell_element_finalise(ele);
+ free(ele);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_table_cell_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_table_cell_element_destroy(dom_node_internal *node)
+{
+ _dom_html_table_cell_element_destroy((struct dom_html_table_cell_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_table_cell_element_copy(dom_node_internal *old,
+ dom_node_internal **copy)
+{
+ return _dom_html_element_copy(old, copy);
+}
+
+/*-----------------------------------------------------------------------*/
+/* API functions */
+
+#define SIMPLE_GET(attr) \
+ dom_exception dom_html_table_cell_element_get_##attr( \
+ dom_html_table_cell_element *element, \
+ dom_string **attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+#define SIMPLE_SET(attr) \
+ dom_exception dom_html_table_cell_element_set_##attr( \
+ dom_html_table_cell_element *element, \
+ dom_string *attr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->\
+ memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, attr); \
+ \
+ return ret; \
+}
+
+#define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
+
+SIMPLE_GET_SET(abbr);
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(axis);
+SIMPLE_GET_SET(bg_color);
+SIMPLE_GET_SET(ch);
+SIMPLE_GET_SET(ch_off);
+SIMPLE_GET_SET(headers);
+SIMPLE_GET_SET(height);
+SIMPLE_GET_SET(scope);
+SIMPLE_GET_SET(v_align);
+SIMPLE_GET_SET(width);
+
+/**
+ * Get the cell_index property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param cell_index The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_cell_index(
+ dom_html_table_cell_element *table_cell, int32_t *cell_index)
+{
+ if(table_cell->id == -1) {
+ dom_node_internal *n = ((dom_node_internal *)table_cell)->parent;
+ dom_html_document *doc = (dom_html_document *)(n->owner);
+ int32_t cnt = 0;
+
+ for (n = n->first_child; n != NULL; n = n->next) {
+
+ if(n == (dom_node_internal *)table_cell) {
+ break;
+ } else if((n->type == DOM_ELEMENT_NODE) &&
+ (dom_string_caseless_isequal(doc->memoised[hds_TD],n->name) ||
+ dom_string_caseless_isequal(doc->memoised[hds_TH],n->name))) {
+ cnt += 1;
+ }
+
+ }
+ table_cell->id = cnt;
+ }
+ *cell_index = table_cell->id;
+ return DOM_NO_ERR;
+}
+
+/**
+ * Get the col_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_col_span(
+ dom_html_table_cell_element *table_cell, int32_t *col_span)
+{
+ return dom_html_element_get_int32_t_property(&table_cell->base, "colspan",
+ SLEN("colspan"), col_span);
+}
+
+/**
+ * Set the col_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_set_col_span(
+ dom_html_table_cell_element *table_cell, uint32_t col_span)
+{
+ return dom_html_element_set_int32_t_property(&table_cell->base, "colspan",
+ SLEN("colspan"), col_span);
+}
+
+/**
+ * Get the row_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The returned status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_row_span(
+ dom_html_table_cell_element *table_cell, int32_t *row_span)
+{
+ return dom_html_element_get_int32_t_property(&table_cell->base, "rowspan",
+ SLEN("rowspan"), row_span);
+}
+
+/**
+ * Set the row_span property
+ *
+ * \param table_cell The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_set_row_span(
+ dom_html_table_cell_element *table_cell, uint32_t row_span)
+{
+ return dom_html_element_set_int32_t_property(&table_cell->base, "rowspan",
+ SLEN("rowspan"), row_span);
+}
+
+/**
+ * Get the no_wrap property
+ *
+ * \param ele The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_get_no_wrap(dom_html_table_cell_element *ele,
+ bool *no_wrap)
+{
+ return dom_html_element_get_bool_property(&ele->base, "nowrap",
+ SLEN("nowrap"), no_wrap);
+}
+
+/**
+ * Set the no_wrap property
+ *
+ * \param ele The dom_html_table_cell_element object
+ * \param no_wrap The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_table_cell_element_set_no_wrap(dom_html_table_cell_element *ele,
+ bool no_wrap)
+{
+ return dom_html_element_set_bool_property(&ele->base, "nowrap",
+ SLEN("nowrap"), no_wrap);
+}
+
diff --git a/src/html/html_tablecell_element.h b/src/html/html_tablecell_element.h
index 2e182d5..801c3c0 100644
--- a/src/html/html_tablecell_element.h
+++ b/src/html/html_tablecell_element.h
@@ -3,5 +3,52 @@
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ * Copyright 2014 Rupinder Singh Khokhar <rsk1coder99@gmail.com>
*/
+#ifndef dom_internal_html_table_cell_element_h_
+#define dom_internal_html_table_cell_element_h_
+
+#include <dom/html/html_tablecell_element.h>
+#include "html/html_element.h"
+
+
+struct dom_html_table_cell_element {
+ struct dom_html_element base;
+ /**< The base class */
+ int32_t id;
+ /**< The Index Associated with the cell*/
+};
+
+/* Create a dom_html_table_cell_element object */
+dom_exception _dom_html_table_cell_element_create(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element **ele);
+
+/* Initialise a dom_html_table_cell_element object */
+dom_exception _dom_html_table_cell_element_initialise(struct dom_html_document *doc,
+ dom_string *tag_name, dom_string *namespace, dom_string *prefix,
+ struct dom_html_table_cell_element *ele);
+
+/* Finalise a dom_html_table_cell_element object */
+void _dom_html_table_cell_element_finalise(struct dom_html_table_cell_element *ele);
+
+/* Destroy a dom_html_table_cell_element object */
+void _dom_html_table_cell_element_destroy(struct dom_html_table_cell_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_table_cell_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_table_cell_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_table_cell_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_TABLE_CELL_ELEMENT_PROTECT_VTABLE \
+ _dom_html_table_cell_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_TABLE_CELL_ELEMENT \
+ _dom_virtual_html_table_cell_element_destroy, \
+ _dom_html_table_cell_element_copy
+
+#endif
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement01.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement01.xml
index 456d6d4..456d6d4 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement01.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement01.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement02.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement02.xml
index f93075e..f93075e 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement02.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement02.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement03.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement03.xml
index ed23a81..ed23a81 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement03.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement03.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement04.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement04.xml
index 2a6ba39..2a6ba39 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement04.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement04.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement05.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement05.xml
index 97e12ee..97e12ee 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement05.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement05.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement06.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement06.xml
index d642df3..d642df3 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement06.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement06.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement07.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement07.xml
index 9041f28..9041f28 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement07.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement07.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement08.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement08.xml
index 27136ed..27136ed 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement08.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement08.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement09.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement09.xml
index efd65ad..efd65ad 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement09.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement09.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement10.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement10.xml
index 64a2746..64a2746 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement10.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement10.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement11.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement11.xml
index 0c7c2b3..0c7c2b3 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement11.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement11.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement12.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement12.xml
index 17ff175..17ff175 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement12.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement12.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement13.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement13.xml
index 74beef5..74beef5 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement13.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement13.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement14.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement14.xml
index c703661..c703661 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement14.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement14.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement15.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement15.xml
index b476253..b476253 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement15.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement15.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement16.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement16.xml
index f5a7408..f5a7408 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement16.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement16.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement17.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement17.xml
index f10d801..f10d801 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement17.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement17.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement18.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement18.xml
index 0ed53d0..0ed53d0 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement18.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement18.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement19.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement19.xml
index a4ab68d..a4ab68d 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement19.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement19.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement20.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement20.xml
index a5fa5ae..a5fa5ae 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement20.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement20.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement21.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement21.xml
index 19bb5fe..19bb5fe 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement21.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement21.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement22.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement22.xml
index 98e11c4..98e11c4 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement22.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement22.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement23.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement23.xml
index b276fbc..b276fbc 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement23.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement23.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement24.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement24.xml
index 3679bee..3679bee 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement24.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement24.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement25.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement25.xml
index bc74f39..bc74f39 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement25.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement25.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement26.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement26.xml
index 5cf82e8..5cf82e8 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement26.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement26.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement27.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement27.xml
index dceae74..dceae74 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement27.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement27.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement28.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement28.xml
index 1594528..1594528 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement28.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement28.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement29.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement29.xml
index 571458b..571458b 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement29.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement29.xml
diff --git a/test/testcases/tests/level1/html/HTMLTableCellElement30.xml.kfail b/test/testcases/tests/level1/html/HTMLTableCellElement30.xml
index 332c038..332c038 100644
--- a/test/testcases/tests/level1/html/HTMLTableCellElement30.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLTableCellElement30.xml