summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsk1994 <rsk1coder99@gmail.com>2014-05-15 00:13:49 (GMT)
committer Rupinder Singh Khokhar <rsk1coder99@gmail.com>2014-06-10 22:57:07 (GMT)
commit501852e21d843601d2501cfe9cb31a13f259cf50 (patch)
tree64c082f770d6d04d3fb371a66e9f774e4d1a3deb
parent72de0d1c1b36201c72ac4881faa0b57b920aac63 (diff)
downloadlibdom-501852e21d843601d2501cfe9cb31a13f259cf50.tar.gz
libdom-501852e21d843601d2501cfe9cb31a13f259cf50.tar.bz2
Typecasting POC to correct DOMTSHandler. A minor dupliction fixed in Anchor Element. Image <img> Element
-rw-r--r--Makefile1
-rw-r--r--include/dom/dom.h1
-rw-r--r--include/dom/html/html_anchor_element.h6
-rw-r--r--include/dom/html/html_image_element.h84
-rw-r--r--src/html/Makefile4
-rw-r--r--src/html/TODO2
-rw-r--r--src/html/html_document.c4
-rw-r--r--src/html/html_document_strings.h2
-rw-r--r--src/html/html_image_element.c245
-rw-r--r--src/html/html_image_element.h45
-rw-r--r--test/DOMTSHandler.pm16
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement01.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement01.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement02.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement02.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement03.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement03.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement04.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement04.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement07.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement07.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement08.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement08.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement09.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement09.xml.kfail)0
-rw-r--r--test/testcases/tests/level1/html/HTMLImageElement10.xml (renamed from test/testcases/tests/level1/html/HTMLImageElement10.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/.HTMLImageElement05.xml.swpbin0 -> 12288 bytes
-rw-r--r--test/testcases/tests/level2/html/HTMLImageElement05.xml (renamed from test/testcases/tests/level2/html/HTMLImageElement05.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLImageElement06.xml (renamed from test/testcases/tests/level2/html/HTMLImageElement06.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLImageElement11.xml (renamed from test/testcases/tests/level2/html/HTMLImageElement11.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLImageElement12.xml (renamed from test/testcases/tests/level2/html/HTMLImageElement12.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/files/img.html13
-rw-r--r--test/testcases/tests/level2/html/files/img.xhtml15
-rw-r--r--test/testcases/tests/level2/html/files/img.xml15
27 files changed, 440 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index ab7d003..76441f2 100644
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,7 @@ INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_font_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_mod_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_anchor_element.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_basefont_element.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):$(Is)/html_image_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 7c788fd..ea61dfa 100644
--- a/include/dom/dom.h
+++ b/include/dom/dom.h
@@ -75,6 +75,7 @@
#include <dom/html/html_mod_element.h>
#include <dom/html/html_anchor_element.h>
#include <dom/html/html_basefont_element.h>
+#include <dom/html/html_image_element.h>
/* DOM Events header */
#include <dom/events/events.h>
diff --git a/include/dom/html/html_anchor_element.h b/include/dom/html/html_anchor_element.h
index 5d08e75..c7bcdea 100644
--- a/include/dom/html/html_anchor_element.h
+++ b/include/dom/html/html_anchor_element.h
@@ -64,12 +64,6 @@ dom_exception dom_html_anchor_element_get_rev(
dom_exception dom_html_anchor_element_set_rev(
dom_html_anchor_element *anchor, dom_string *rev);
-dom_exception dom_html_anchor_element_get_hreflang(
- dom_html_anchor_element *anchor, dom_string **hreflang);
-
-dom_exception dom_html_anchor_element_set_hreflang(
- dom_html_anchor_element *anchor, dom_string *hreflang);
-
dom_exception dom_html_anchor_element_get_shape(
dom_html_anchor_element *anchor, dom_string **shape);
diff --git a/include/dom/html/html_image_element.h b/include/dom/html/html_image_element.h
index 2e182d5..7e3e879 100644
--- a/include/dom/html/html_image_element.h
+++ b/include/dom/html/html_image_element.h
@@ -3,5 +3,89 @@
* 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_html_image_element_h_
+#define dom_html_image_element_h_
+
+#include <stdbool.h>
+#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
+
+typedef struct dom_html_image_element dom_html_image_element;
+
+
+dom_exception dom_html_image_element_get_name(
+ dom_html_image_element *image, dom_string **name);
+
+dom_exception dom_html_image_element_set_name(
+ dom_html_image_element *image, dom_string *name);
+
+dom_exception dom_html_image_element_get_align(
+ dom_html_image_element *image, dom_string **align);
+
+dom_exception dom_html_image_element_set_align(
+ dom_html_image_element *image, dom_string *align);
+
+dom_exception dom_html_image_element_get_alt(
+ dom_html_image_element *image, dom_string **alt);
+
+dom_exception dom_html_image_element_set_alt(
+ dom_html_image_element *image, dom_string *alt);
+
+dom_exception dom_html_image_element_get_border(
+ dom_html_image_element *image, dom_string **border);
+
+dom_exception dom_html_image_element_set_border(
+ dom_html_image_element *image, dom_string *border);
+
+dom_exception dom_html_image_element_get_long_desc(
+ dom_html_image_element *image, dom_string **long_desc);
+
+dom_exception dom_html_image_element_set_long_desc(
+ dom_html_image_element *image, dom_string *long_desc);
+
+dom_exception dom_html_image_element_get_src(
+ dom_html_image_element *image, dom_string **src);
+
+dom_exception dom_html_image_element_set_src(
+ dom_html_image_element *image, dom_string *src);
+
+dom_exception dom_html_image_element_get_use_map(
+ dom_html_image_element *image, dom_string **use_map);
+
+dom_exception dom_html_image_element_set_use_map(
+ dom_html_image_element *image, dom_string *use_map);
+
+dom_exception dom_html_image_element_get_height(
+ dom_html_image_element *image, int32_t *height);
+
+dom_exception dom_html_image_element_set_height(
+ dom_html_image_element *image, uint32_t height);
+
+dom_exception dom_html_image_element_get_hspace(
+ dom_html_image_element *image, int32_t *hspace);
+
+dom_exception dom_html_image_element_set_hspace(
+ dom_html_image_element *image, uint32_t hspace);
+
+dom_exception dom_html_image_element_get_vspace(
+ dom_html_image_element *image, int32_t *vspace);
+
+dom_exception dom_html_image_element_set_vspace(
+ dom_html_image_element *image, uint32_t vspace);
+
+dom_exception dom_html_image_element_get_width(
+ dom_html_image_element *image, int32_t *width);
+
+dom_exception dom_html_image_element_set_width(
+ dom_html_image_element *image, uint32_t width);
+
+dom_exception dom_html_image_element_get_is_map(
+ dom_html_image_element *ele, bool *is_map);
+
+dom_exception dom_html_image_element_set_is_map(
+ dom_html_image_element *ele, bool is_map);
+
+#endif
diff --git a/src/html/Makefile b/src/html/Makefile
index f988cff..b02fd54 100644
--- a/src/html/Makefile
+++ b/src/html/Makefile
@@ -13,10 +13,10 @@ DIR_SOURCES := \
html_pre_element.c html_br_element.c html_label_element.c \
html_ulist_element.c html_olist_element.c html_li_element.c \
html_font_element.c html_mod_element.c html_anchor_element.c \
- html_basefont_element.c
+ html_basefont_element.c html_image_element.c
UNINMPLEMENTED_SOURCES := \
- html_image_element.c html_object_element.c \
+ html_object_element.c \
html_param_element.c html_applet_element.c html_map_element.c \
html_area_element.c html_script_element.c html_table_element.c \
html_tablecaption_element.c html_tablecol_element.c html_tablesection_element.c \
diff --git a/src/html/TODO b/src/html/TODO
index eddb871..ddca8c4 100644
--- a/src/html/TODO
+++ b/src/html/TODO
@@ -39,7 +39,7 @@ HTMLFontElement html_font_element DONE
HTMLHRElement html_hr_element DONE
HTMLModElement html_mod_element DONE
HTMLAnchorElement html_anchor_element DONE
-HTMLImageElement html_image_element MISSING
+HTMLImageElement html_image_element DONE
HTMLObjectElement html_object_element MISSING
HTMLParamElement html_param_element MISSING
HTMLAppletElement html_applet_element MISSING
diff --git a/src/html/html_document.c b/src/html/html_document.c
index 7841087..28e3ac0 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -43,6 +43,7 @@
#include "html/html_mod_element.h"
#include "html/html_anchor_element.h"
#include "html/html_basefont_element.h"
+#include "html/html_image_element.h"
#include "core/attr.h"
#include "core/string.h"
@@ -303,6 +304,9 @@ _dom_html_document_create_element_internal(dom_html_document *html,
} else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_BASEFONT])) {
exc = _dom_html_base_font_element_create(html, namespace, prefix,
(dom_html_base_font_element **) result);
+ } else if (dom_string_caseless_isequal(tag_name, html->memoised[hds_IMG])) {
+ exc = _dom_html_image_element_create(html, namespace, prefix,
+ (dom_html_image_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 73cb64c..dae686c 100644
--- a/src/html/html_document_strings.h
+++ b/src/html/html_document_strings.h
@@ -89,9 +89,11 @@ HTML_DOCUMENT_STRINGS_ACTION1(color)
HTML_DOCUMENT_STRINGS_ACTION1(face)
HTML_DOCUMENT_STRINGS_ACTION1(coords)
HTML_DOCUMENT_STRINGS_ACTION1(shape)
+HTML_DOCUMENT_STRINGS_ACTION1(border)
HTML_DOCUMENT_STRINGS_ACTION(tab_index,tabindex)
HTML_DOCUMENT_STRINGS_ACTION(html_for,for)
HTML_DOCUMENT_STRINGS_ACTION(date_time,datetime)
+HTML_DOCUMENT_STRINGS_ACTION(long_desc,longdesc)
/* HTML_DOCUMENT_STRINGS_ACTION1(type) */
HTML_DOCUMENT_STRINGS_ACTION(use_map,usemap)
/* HTML_DOCUMENT_STRINGS_ACTION1(value) */
diff --git a/src/html/html_image_element.c b/src/html/html_image_element.c
index 2e182d5..77bdd27 100644
--- a/src/html/html_image_element.c
+++ b/src/html/html_image_element.c
@@ -3,5 +3,250 @@
* 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_image_element.h>
+
+#include "html/html_document.h"
+#include "html/html_image_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_IMAGE_ELEMENT
+ },
+ DOM_HTML_IMAGE_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_image_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_image_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element **ele)
+{
+ struct dom_node_internal *node;
+
+ *ele = malloc(sizeof(dom_html_image_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_image_element_initialise(doc, namespace, prefix, *ele);
+}
+
+/**
+ * Initialise a dom_html_image_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_image_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_image_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element *ele)
+{
+ return _dom_html_element_initialise(doc, &ele->base,
+ doc->memoised[hds_IMG],
+ namespace, prefix);
+}
+
+/**
+ * Finalise a dom_html_image_element object
+ *
+ * \param ele The dom_html_image_element object
+ */
+void _dom_html_image_element_finalise(struct dom_html_image_element *ele)
+{
+ _dom_html_element_finalise(&ele->base);
+}
+
+/**
+ * Destroy a dom_html_image_element object
+ *
+ * \param ele The dom_html_image_element object
+ */
+void _dom_html_image_element_destroy(struct dom_html_image_element *ele)
+{
+ _dom_html_image_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_image_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_image_element_destroy(dom_node_internal *node)
+{
+ _dom_html_image_element_destroy((struct dom_html_image_element *) node);
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_image_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_image_element_get_##attr( \
+ dom_html_image_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_image_element_set_##attr( \
+ dom_html_image_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(name);
+SIMPLE_GET_SET(align);
+SIMPLE_GET_SET(alt);
+SIMPLE_GET_SET(border);
+SIMPLE_GET_SET(long_desc);
+SIMPLE_GET_SET(src);
+SIMPLE_GET_SET(use_map);
+
+dom_exception dom_html_image_element_get_height(
+ dom_html_image_element *image, int32_t *height)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "height",
+ SLEN("height"), height);
+}
+
+dom_exception dom_html_image_element_set_height(
+ dom_html_image_element *image, uint32_t height)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "height",
+ SLEN("height"), height);
+}
+
+dom_exception dom_html_image_element_get_hspace(
+ dom_html_image_element *image, int32_t *hspace)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_image_element_set_hspace(
+ dom_html_image_element *image, uint32_t hspace)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "hspace",
+ SLEN("hspace"), hspace);
+}
+
+dom_exception dom_html_image_element_get_vspace(
+ dom_html_image_element *image, int32_t *vspace)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "vspace",
+ SLEN("cspace"), vspace);
+}
+
+dom_exception dom_html_image_element_set_vspace(
+ dom_html_image_element *image, uint32_t vspace)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "vspace",
+ SLEN("vsapce"), vspace);
+}
+
+dom_exception dom_html_image_element_get_width(
+ dom_html_image_element *image, int32_t *width)
+{
+ return dom_html_element_get_int32_t_property(&image->base, "width",
+ SLEN("width"), width);
+}
+
+dom_exception dom_html_image_element_set_width(
+ dom_html_image_element *image, uint32_t width)
+{
+ return dom_html_element_set_int32_t_property(&image->base, "width",
+ SLEN("width"), width);
+}
+
+/**
+ * Get the is_map property
+ *
+ * \param ele The dom_html_image_element object
+ * \param is_map The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_image_element_get_is_map(dom_html_image_element *ele,
+ bool *is_map)
+{
+ return dom_html_element_get_bool_property(&ele->base, "ismap",
+ SLEN("ismap"), is_map);
+}
+
+/**
+ * Set the is_map property
+ *
+ * \param ele The dom_html_image_element object
+ * \param is_map The status
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception dom_html_image_element_set_is_map(dom_html_image_element *ele,
+ bool is_map)
+{
+ return dom_html_element_set_bool_property(&ele->base, "ismap",
+ SLEN("ismap"), is_map);
+}
+
diff --git a/src/html/html_image_element.h b/src/html/html_image_element.h
index 2e182d5..ac73a1b 100644
--- a/src/html/html_image_element.h
+++ b/src/html/html_image_element.h
@@ -3,5 +3,50 @@
* 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_image_element_h_
+#define dom_internal_html_image_element_h_
+
+#include <dom/html/html_image_element.h>
+
+#include "html/html_element.h"
+
+struct dom_html_image_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_image_element object */
+dom_exception _dom_html_image_element_create(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element **ele);
+
+/* Initialise a dom_html_image_element object */
+dom_exception _dom_html_image_element_initialise(struct dom_html_document *doc,
+ dom_string *namespace, dom_string *prefix,
+ struct dom_html_image_element *ele);
+
+/* Finalise a dom_html_image_element object */
+void _dom_html_image_element_finalise(struct dom_html_image_element *ele);
+
+/* Destroy a dom_html_image_element object */
+void _dom_html_image_element_destroy(struct dom_html_image_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_image_element_parse_attribute(dom_element *ele,
+ dom_string *name, dom_string *value,
+ dom_string **parsed);
+void _dom_virtual_html_image_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_image_element_copy(dom_node_internal *old,
+ dom_node_internal **copy);
+
+#define DOM_HTML_IMAGE_ELEMENT_PROTECT_VTABLE \
+ _dom_html_image_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_IMAGE_ELEMENT \
+ _dom_virtual_html_image_element_destroy, \
+ _dom_html_image_element_copy
+
+#endif
diff --git a/test/DOMTSHandler.pm b/test/DOMTSHandler.pm
index 645e841..6dfaae9 100644
--- a/test/DOMTSHandler.pm
+++ b/test/DOMTSHandler.pm
@@ -479,21 +479,29 @@ sub generate_load {
my ($self, $a) = @_;
my %ats = %$a;
my $doc = $ats{"var"};
-
$test_index ++;
+ my $var = $self->{"var"};
# define the test file path, use HTML if there is, otherwise using XML
# Attention: I intend to copy the test files to the program excuting dir
print "\tconst char *test$test_index = \"$ats{'href'}.html\";\n\n";
- print "\t$doc = load_html(test$test_index, $ats{'willBeModified'});";
+ if ($var->{$doc} eq "Node") {
+ print "\t$doc = (dom_node*) load_html(test$test_index, $ats{'willBeModified'});";
+ } else {
+ print "\t$doc = load_html(test$test_index, $ats{'willBeModified'});";
+ }
print "\tif ($doc == NULL) {\n";
$test_index ++;
print "\t\tconst char *test$test_index = \"$ats{'href'}.xml\";\n\n";
- print "\t\t$doc = load_xml(test$test_index, $ats{'willBeModified'});\n";
+ if ($var->{$doc} eq "Node") {
+ print "\t\t$doc = (dom_node *) load_xml(test$test_index, $ats{'willBeModified'});\n";
+ } else {
+ print "\t\t$doc = load_xml(test$test_index, $ats{'willBeModified'});\n";
+ }
print "\t\tif ($doc == NULL)\n";
print "\t\t\treturn 1;\n";
print "\t\t}\n";
print << "__EOF__";
- exp = dom_document_get_implementation($doc, &doc_impl);
+ exp = dom_document_get_implementation((dom_document *) $doc, &doc_impl);
if (exp != DOM_NO_ERR)
return exp;
__EOF__
diff --git a/test/testcases/tests/level1/html/HTMLImageElement01.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement01.xml
index ca61559..ca61559 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement01.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement01.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement02.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement02.xml
index f314888..f314888 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement02.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement02.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement03.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement03.xml
index 75716f9..75716f9 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement03.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement03.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement04.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement04.xml
index 80a30b0..80a30b0 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement04.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement04.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement07.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement07.xml
index faca09e..faca09e 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement07.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement07.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement08.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement08.xml
index e7bedbf..e7bedbf 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement08.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement08.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement09.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement09.xml
index 6d0f584..6d0f584 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement09.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement09.xml
diff --git a/test/testcases/tests/level1/html/HTMLImageElement10.xml.kfail b/test/testcases/tests/level1/html/HTMLImageElement10.xml
index 3c13080..3c13080 100644
--- a/test/testcases/tests/level1/html/HTMLImageElement10.xml.kfail
+++ b/test/testcases/tests/level1/html/HTMLImageElement10.xml
diff --git a/test/testcases/tests/level2/html/.HTMLImageElement05.xml.swp b/test/testcases/tests/level2/html/.HTMLImageElement05.xml.swp
new file mode 100644
index 0000000..6847879
--- a/dev/null
+++ b/test/testcases/tests/level2/html/.HTMLImageElement05.xml.swp
Binary files differ
diff --git a/test/testcases/tests/level2/html/HTMLImageElement05.xml.kfail b/test/testcases/tests/level2/html/HTMLImageElement05.xml
index 92e536b..92e536b 100644
--- a/test/testcases/tests/level2/html/HTMLImageElement05.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLImageElement05.xml
diff --git a/test/testcases/tests/level2/html/HTMLImageElement06.xml.kfail b/test/testcases/tests/level2/html/HTMLImageElement06.xml
index 19fb7b0..19fb7b0 100644
--- a/test/testcases/tests/level2/html/HTMLImageElement06.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLImageElement06.xml
diff --git a/test/testcases/tests/level2/html/HTMLImageElement11.xml.kfail b/test/testcases/tests/level2/html/HTMLImageElement11.xml
index 10f3608..10f3608 100644
--- a/test/testcases/tests/level2/html/HTMLImageElement11.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLImageElement11.xml
diff --git a/test/testcases/tests/level2/html/HTMLImageElement12.xml.kfail b/test/testcases/tests/level2/html/HTMLImageElement12.xml
index 738f1c3..738f1c3 100644
--- a/test/testcases/tests/level2/html/HTMLImageElement12.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLImageElement12.xml
diff --git a/test/testcases/tests/level2/html/files/img.html b/test/testcases/tests/level2/html/files/img.html
new file mode 100644
index 0000000..b4e8b27
--- a/dev/null
+++ b/test/testcases/tests/level2/html/files/img.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
+<TITLE>NIST DOM HTML Test - IMG</TITLE>
+</HEAD>
+<BODY onload="parent.loadComplete()">
+<P>
+<IMG ID="IMAGE-1" NAME="IMAGE-1" SRC="./pix/dts.gif" ALIGN="middle" ALT="DTS IMAGE LOGO" BORDER="0" HEIGHT="47" HSPACE="4" LONGDESC="./files/desc.html" USEMAP="#DTS-MAP" VSPACE="10" WIDTH="115"/>
+</P>
+</BODY>
+</HTML>
+
diff --git a/test/testcases/tests/level2/html/files/img.xhtml b/test/testcases/tests/level2/html/files/img.xhtml
new file mode 100644
index 0000000..40e3695
--- a/dev/null
+++ b/test/testcases/tests/level2/html/files/img.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "xhtml1-transitional.dtd">
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>NIST DOM HTML Test - IMG</title>
+</head>
+<body onload="parent.loadComplete()">
+<p>
+<img id="IMAGE-1" name="IMAGE-1" src="./pix/dts.gif" align="middle" alt="DTS IMAGE LOGO" border="0" height="47" hspace="4" longdesc="./files/desc.html" usemap="#DTS-MAP" vspace="10" width="115"/>
+</p>
+</body>
+</html>
+
diff --git a/test/testcases/tests/level2/html/files/img.xml b/test/testcases/tests/level2/html/files/img.xml
new file mode 100644
index 0000000..40e3695
--- a/dev/null
+++ b/test/testcases/tests/level2/html/files/img.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "xhtml1-transitional.dtd">
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>NIST DOM HTML Test - IMG</title>
+</head>
+<body onload="parent.loadComplete()">
+<p>
+<img id="IMAGE-1" name="IMAGE-1" src="./pix/dts.gif" align="middle" alt="DTS IMAGE LOGO" border="0" height="47" hspace="4" longdesc="./files/desc.html" usemap="#DTS-MAP" vspace="10" width="115"/>
+</p>
+</body>
+</html>
+