r3604 jmb - in /trunk/dom: bindings/xml/xmlbinding.c include/dom/bootstrap/implpriv.h src/Makefile src/bootstrap/Makefile src/bootstrap/init_fini.c src/core/document.c src/utils/Makefile src/utils/namespace.c src/utils/namespace.h src/utils/utils.h
by netsurf@semichrome.net
Author: jmb
Date: Sat Sep 29 02:01:55 2007
New Revision: 3604
URL: http://source.netsurf-browser.org?rev=3604&view=rev
Log:
Introduce global initialistaion/finalisation for DOM library. This should be used to initialise any parts of the library before they are used. Mostly, this will comprise of static initialisers. Finalisation cleans up afterwards. This API is only exposed to language-specific binding libraries -- they should expose their own global initialisation/finalisation routines which call the core libdom ones.
Introduce new utility code for namespace and qname processing. Port dom_document_create_element_ns() and dom_document_create_attribute_ns() to this new code.
Make libdom-libxml's initialiser initialise libdom itself first of all.
Added:
trunk/dom/src/bootstrap/init_fini.c
trunk/dom/src/utils/Makefile
trunk/dom/src/utils/namespace.c
trunk/dom/src/utils/namespace.h
Modified:
trunk/dom/bindings/xml/xmlbinding.c
trunk/dom/include/dom/bootstrap/implpriv.h
trunk/dom/src/Makefile
trunk/dom/src/bootstrap/Makefile
trunk/dom/src/core/document.c
trunk/dom/src/utils/utils.h
Modified: trunk/dom/bindings/xml/xmlbinding.c
URL: http://source.netsurf-browser.org/trunk/dom/bindings/xml/xmlbinding.c?rev...
==============================================================================
--- trunk/dom/bindings/xml/xmlbinding.c (original)
+++ trunk/dom/bindings/xml/xmlbinding.c Sat Sep 29 02:01:55 2007
@@ -385,9 +385,14 @@
{
dom_exception err;
+ err = dom_initialise(alloc, pw);
+ if (err != DOM_NO_ERR)
+ return XML_NOMEM;
+
err = dom_register_source(&xml_dom_impl_src, (dom_alloc) alloc, pw);
if (err != DOM_NO_ERR)
return XML_NOMEM;
return XML_OK;
}
+
Modified: trunk/dom/include/dom/bootstrap/implpriv.h
URL: http://source.netsurf-browser.org/trunk/dom/include/dom/bootstrap/implpri...
==============================================================================
--- trunk/dom/include/dom/bootstrap/implpriv.h (original)
+++ trunk/dom/include/dom/bootstrap/implpriv.h Sat Sep 29 02:01:55 2007
@@ -17,6 +17,10 @@
*
* The DocumentType implementation includes this as it needs the declaration
* of dom_document_type_create.
+ *
+ * The DOM library's core initialisation/finalisation implementation also
+ * includes this as it needs the declaration of dom_initialise and
+ * dom_finalise.
*
* No other client should be including this.
*/
@@ -243,6 +247,12 @@
dom_alloc alloc, void *pw);
};
+/* Initialise the DOM library */
+dom_exception dom_initialise(dom_alloc alloc, void *pw);
+
+/* Finalise the DOM library */
+dom_exception dom_finalise(void);
+
/* Register a source with the DOM library */
dom_exception dom_register_source(struct dom_implementation_source *source,
dom_alloc alloc, void *pw);
Modified: trunk/dom/src/Makefile
URL: http://source.netsurf-browser.org/trunk/dom/src/Makefile?rev=3604&r1=3603...
==============================================================================
--- trunk/dom/src/Makefile (original)
+++ trunk/dom/src/Makefile Sat Sep 29 02:01:55 2007
@@ -36,16 +36,19 @@
release: $(addprefix Release/, $(addsuffix .o, $(OBJS)))
@${MAKE} -C bootstrap release
@${MAKE} -C core release
+ @${MAKE} -C utils release
@${AR} ${ARFLAGS} $(RELEASE) Release/*
debug: $(addprefix Debug/, $(addsuffix .o, $(OBJS)))
@${MAKE} -C bootstrap debug
@${MAKE} -C core debug
+ @${MAKE} -C utils debug
@${AR} ${ARFLAGS} $(DEBUG) Debug/*
clean:
@${MAKE} -C bootstrap clean
@${MAKE} -C core clean
+ @${MAKE} -C utils clean
ifneq (${OBJS}, )
-@${RM} ${RMFLAGS} $(addprefix Release/, $(addsuffix .o, ${OBJS}))
-@${RM} ${RMFLAGS} $(addprefix Debug/, $(addsuffix .o, ${OBJS}))
Modified: trunk/dom/src/bootstrap/Makefile
URL: http://source.netsurf-browser.org/trunk/dom/src/bootstrap/Makefile?rev=36...
==============================================================================
--- trunk/dom/src/bootstrap/Makefile (original)
+++ trunk/dom/src/bootstrap/Makefile Sat Sep 29 02:01:55 2007
@@ -22,7 +22,7 @@
CFLAGS += -I$(CURDIR)
# Objects
-OBJS = implregistry
+OBJS = implregistry init_fini
.PHONY: clean debug distclean export release setup test
Added: trunk/dom/src/bootstrap/init_fini.c
URL: http://source.netsurf-browser.org/trunk/dom/src/bootstrap/init_fini.c?rev...
==============================================================================
--- trunk/dom/src/bootstrap/init_fini.c (added)
+++ trunk/dom/src/bootstrap/init_fini.c Sat Sep 29 02:01:55 2007
@@ -1,0 +1,47 @@
+/*
+ * This file is part of libdom.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2007 John-Mark Bell <jmb(a)netsurf-browser.org>
+ */
+
+#include <dom/bootstrap/implpriv.h>
+
+#include "utils/namespace.h"
+
+/**
+ * Initialise the dom library
+ *
+ * \param alloc Pointer to memory (de)allocation function
+ * \param pw Pointer to client-specific private data
+ * \return DOM_NO_ERR on success.
+ *
+ * This should be invoked by the binding's initialiser and must be
+ * the first DOM library method called.
+ */
+dom_exception dom_initialise(dom_alloc alloc, void *pw)
+{
+ dom_exception err;
+
+ err = _dom_namespace_initialise(alloc, pw);
+
+ return err;
+}
+
+/**
+ * Finalise the dom library
+ *
+ * \return DOM_NO_ERR on success.
+ *
+ * This should be invoked by the binding's finaliser and must be
+ * the last DOM library method called.
+ */
+dom_exception dom_finalise(void)
+{
+ dom_exception err;
+
+ err = _dom_namespace_finalise();
+
+ return err;
+}
+
Modified: trunk/dom/src/core/document.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/document.c?rev=3604&...
==============================================================================
--- trunk/dom/src/core/document.c (original)
+++ trunk/dom/src/core/document.c Sat Sep 29 02:01:55 2007
@@ -25,6 +25,7 @@
#include "core/nodelist.h"
#include "core/pi.h"
#include "core/text.h"
+#include "utils/namespace.h"
#include "utils/utils.h"
struct dom_document_type;
@@ -551,51 +552,22 @@
struct dom_string *namespace, struct dom_string *qname,
struct dom_element **result)
{
- const uint8_t *qd, *c, *ln;
- size_t qlen;
- size_t local_len;
- size_t prefix_len;
- struct dom_string *prefix = NULL;
- struct dom_string *localname;
+ struct dom_string *prefix, *localname;
dom_exception err;
/** \todo ensure document supports XML feature */
- /** \todo validate qname */
-
- dom_string_get_data(qname, &qd, &qlen);
+
+ /* Validate qname */
+ err = _dom_namespace_validate_qname(qname, namespace);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
/* Divide QName into prefix/localname pair */
- for (c = qd; c != qd + qlen; c++) {
- if (*c == (const uint8_t) ':')
- break;
- }
-
- if (c == qd + qlen) {
- ln = qd;
- local_len = qlen;
- prefix_len = 0;
- } else {
- ln = ++c;
- local_len = qlen - (c - qd);
- prefix_len = (c - qd - 1 /* ':' */);
- }
-
- if (prefix_len > 0) {
- err = dom_string_create_from_ptr(doc, qd, prefix_len, &prefix);
- if (err != DOM_NO_ERR) {
- return err;
- }
- }
-
- err = dom_string_create_from_ptr(doc, ln, local_len, &localname);
+ err = _dom_namespace_split_qname(qname, doc, &prefix, &localname);
if (err != DOM_NO_ERR) {
- if (prefix != NULL) {
- dom_string_unref(prefix);
- }
return err;
}
-
- /** \todo validate namespace */
/* Attempt to create element */
err = dom_element_create(doc, localname, namespace, prefix, result);
@@ -641,51 +613,22 @@
struct dom_string *namespace, struct dom_string *qname,
struct dom_attr **result)
{
- const uint8_t *qd, *c, *ln;
- size_t qlen;
- size_t local_len;
- size_t prefix_len;
- struct dom_string *prefix = NULL;
- struct dom_string *localname;
+ struct dom_string *prefix, *localname;
dom_exception err;
/** \todo ensure document supports XML feature */
- /** \todo validate qname */
-
- dom_string_get_data(qname, &qd, &qlen);
+
+ /* Validate qname */
+ err = _dom_namespace_validate_qname(qname, namespace);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
/* Divide QName into prefix/localname pair */
- for (c = qd; c != qd + qlen; c++) {
- if (*c == (const uint8_t) ':')
- break;
- }
-
- if (c == qd + qlen) {
- ln = qd;
- local_len = qlen;
- prefix_len = 0;
- } else {
- ln = ++c;
- local_len = qlen - (c - qd);
- prefix_len = (c - qd - 1 /* ':' */);
- }
-
- if (prefix_len > 0) {
- err = dom_string_create_from_ptr(doc, qd, prefix_len, &prefix);
- if (err != DOM_NO_ERR) {
- return err;
- }
- }
-
- err = dom_string_create_from_ptr(doc, ln, local_len, &localname);
+ err = _dom_namespace_split_qname(qname, doc, &prefix, &localname);
if (err != DOM_NO_ERR) {
- if (prefix != NULL) {
- dom_string_unref(prefix);
- }
return err;
}
-
- /** \todo validate namespace */
/* Attempt to create attribute */
err = dom_attr_create(doc, localname, namespace, prefix, result);
Added: trunk/dom/src/utils/Makefile
URL: http://source.netsurf-browser.org/trunk/dom/src/utils/Makefile?rev=3604&v...
==============================================================================
--- trunk/dom/src/utils/Makefile (added)
+++ trunk/dom/src/utils/Makefile Sat Sep 29 02:01:55 2007
@@ -1,0 +1,53 @@
+# Makefile for libdom
+#
+# Toolchain is exported by top-level makefile
+#
+# Top-level makefile also exports the following variables:
+#
+# COMPONENT Name of component
+# EXPORT Absolute path of export directory
+# TOP Absolute path of source tree root
+#
+# The top-level makefile requires the following targets to exist:
+#
+# clean Clean source tree
+# debug Create a debug binary
+# distclean Fully clean source tree, back to pristine condition
+# export Export distributable components to ${EXPORT}
+# release Create a release binary
+# setup Perform any setup required prior to compilation
+# test Execute any test cases
+
+# Manipulate include paths
+CFLAGS += -I$(CURDIR)
+
+# Objects
+OBJS = namespace
+
+.PHONY: clean debug distclean export release setup test
+
+# Targets
+release: $(addprefix ../Release/, $(addsuffix .o, $(OBJS)))
+
+debug: $(addprefix ../Debug/, $(addsuffix .o, $(OBJS)))
+
+clean:
+ -@${RM} ${RMFLAGS} $(addprefix ../Release/, $(addsuffix .o, ${OBJS}))
+ -@${RM} ${RMFLAGS} $(addprefix ../Debug/, $(addsuffix .o, ${OBJS}))
+
+distclean:
+
+setup:
+
+export:
+
+test:
+
+# Pattern rules
+../Release/%.o: %.c
+ @${ECHO} ${ECHOFLAGS} "==> $<"
+ @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $<
+
+../Debug/%.o: %.c
+ @${ECHO} ${ECHOFLAGS} "==> $<"
+ @${CC} -c -g ${CFLAGS} -o $@ $<
Added: trunk/dom/src/utils/namespace.c
URL: http://source.netsurf-browser.org/trunk/dom/src/utils/namespace.c?rev=360...
==============================================================================
--- trunk/dom/src/utils/namespace.c (added)
+++ trunk/dom/src/utils/namespace.c Sat Sep 29 02:01:55 2007
@@ -1,0 +1,218 @@
+/*
+ * This file is part of libdom.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2007 John-Mark Bell <jmb(a)netsurf-browser.org>
+ */
+
+#include <string.h>
+
+#include <dom/core/string.h>
+
+#include "utils/namespace.h"
+#include "utils/utils.h"
+
+/** XML namespace URI */
+static struct dom_string *xml;
+/** XMLNS namespace URI */
+static struct dom_string *xmlns;
+
+/**
+ * Initialise the namespace component
+ *
+ * \param alloc Pointer to memory (de)allocation function
+ * \param pw Pointer to client-specific private data
+ * \return DOM_NO_ERR on success.
+ */
+dom_exception _dom_namespace_initialise(dom_alloc alloc, void *pw)
+{
+ dom_exception err;
+
+ err = dom_string_create_from_ptr_no_doc(alloc, pw,
+ (const uint8_t *) "http://www.w3.org/XML/1998/namespace",
+ SLEN("http://www.w3.org/XML/1998/namespace"),
+ &xml);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ err = dom_string_create_from_ptr_no_doc(alloc, pw,
+ (const uint8_t *) "http://www.w3.org/2000/xmlns",
+ SLEN("http://www.w3.org/2000/xmlns"),
+ &xmlns);
+ if (err != DOM_NO_ERR) {
+ dom_string_unref(xml);
+ return err;
+ }
+
+ return DOM_NO_ERR;
+}
+
+/**
+ * Finalise the namespace component
+ *
+ * \return DOM_NO_ERR on success.
+ */
+dom_exception _dom_namespace_finalise(void)
+{
+ dom_string_unref(xmlns);
+ dom_string_unref(xml);
+
+ return DOM_NO_ERR;
+}
+
+/**
+ * Ensure a QName is valid
+ *
+ * \param qname The qname to validate
+ * \param namespace The namespace URI associated with the QName, or NULL
+ * \return DOM_NO_ERR if valid,
+ * DOM_INVALID_CHARACTER_ERR if ::qname contains an invalid character,
+ * DOM_NAMESPACE_ERR if ::qname is malformed, or it has a
+ * prefix and ::namespace is NULL, or
+ * ::qname has a prefix "xml" and
+ * ::namespace is not
+ * "http://www.w3.org/XML/1998/namespace",
+ * or ::qname has a prefix "xmlns" and
+ * ::namespace is not
+ * "http://www.w3.org/2000/xmlns", or
+ * ::namespace is
+ * "http://www.w3.org/2000/xmlns" and
+ * ::qname is not (or is not prefixed by)
+ * "xmlns".
+ */
+dom_exception _dom_namespace_validate_qname(struct dom_string *qname,
+ struct dom_string *namespace)
+{
+ const uint8_t *qname_data, *c;
+ size_t qname_len;
+
+ dom_string_get_data(qname, &qname_data, &qname_len);
+
+ /** \todo search qname for invalid characters */
+ /** \todo ensure qname is not malformed */
+
+ /* Find colon */
+ /** \todo assumes ASCII-compatible encoding */
+ for (c = qname_data; c != qname_data + qname_len; c++) {
+ if (*c == (const uint8_t) ':') {
+ break;
+ }
+ }
+
+ if (c == qname_data + qname_len) {
+ /* No prefix */
+ /* If namespace URI is for xmlns, ensure qname == "xmlns" */
+ if (namespace != NULL &&
+ dom_string_cmp(namespace, xmlns) == 0 &&
+ (qname_len != SLEN("xmlns") ||
+ strncmp((const char *) qname_data, "xmlns",
+ SLEN("xmlns")) != 0)) {
+ return DOM_NAMESPACE_ERR;
+ }
+ } else {
+ /* Prefix */
+ /* Ensure there is a namespace URI */
+ if (namespace == NULL) {
+ return DOM_NAMESPACE_ERR;
+ }
+
+ /* Test for invalid XML namespace */
+ if (c - qname_data == SLEN("xml") &&
+ strncmp((const char *) qname_data, "xml",
+ SLEN("xml")) == 0 &&
+ dom_string_cmp(namespace, xml) != 0) {
+ return DOM_NAMESPACE_ERR;
+ }
+
+ /* Test for invalid xmlns namespace */
+ if (c - qname_data == SLEN("xmlns") &&
+ strncmp((const char *) qname_data, "xmlns",
+ SLEN("xmlns")) == 0 &&
+ dom_string_cmp(namespace, xmlns) != 0) {
+ return DOM_NAMESPACE_ERR;
+ }
+
+ /* Test for presence of xmlns namespace with non xmlns prefix */
+ if (dom_string_cmp(namespace, xmlns) == 0 &&
+ (c - qname_data != SLEN("xmlns") ||
+ strncmp((const char *) qname_data, "xmlns",
+ SLEN("xmlns")) != 0)) {
+ return DOM_NAMESPACE_ERR;
+ }
+ }
+
+ return DOM_NO_ERR;
+}
+
+/**
+ * Split a QName into a namespace prefix and localname string
+ *
+ * \param qname The qname to split
+ * \param doc The document context to create the prefix/localname in
+ * \param prefix Pointer to location to receive prefix
+ * \param localname Pointer to location to receive localname
+ * \return DOM_NO_ERR on success.
+ *
+ * If there is no prefix present in ::qname, then ::prefix will be NULL.
+ *
+ * ::prefix and ::localname will be referenced. The caller should unreference
+ * them once finished.
+ */
+dom_exception _dom_namespace_split_qname(struct dom_string *qname,
+ struct dom_document *doc, struct dom_string **prefix,
+ struct dom_string **localname)
+{
+ const uint8_t *qname_data, *c, *local_data;
+ size_t qname_len;
+ size_t local_len;
+ size_t prefix_len;
+ struct dom_string *p = NULL;
+ struct dom_string *l;
+ dom_exception err;
+
+ dom_string_get_data(qname, &qname_data, &qname_len);
+
+ /* Find colon, if any */
+ /** \todo assumes ASCII-compatible encoding */
+ for (c = qname_data; c != qname_data + qname_len; c++) {
+ if (*c == (const uint8_t) ':')
+ break;
+ }
+
+ if (c == qname_data + qname_len) {
+ /* None found => no prefix */
+ local_data = qname_data;
+ local_len = qname_len;
+ prefix_len = 0;
+ } else {
+ /* Found one => prefix */
+ local_data = ++c;
+ local_len = qname_len - (c - qname_data);
+ prefix_len = (c - qname_data - 1 /* ':' */);
+ }
+
+ /* Create prefix, if one exists */
+ if (prefix_len > 0) {
+ err = dom_string_create_from_ptr(doc, qname_data,
+ prefix_len, &p);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+ }
+
+ /* Create localname */
+ err = dom_string_create_from_ptr(doc, local_data, local_len, &l);
+ if (err != DOM_NO_ERR) {
+ if (p != NULL) {
+ dom_string_unref(p);
+ }
+ return err;
+ }
+
+ *prefix = p;
+ *localname = l;
+
+ return DOM_NO_ERR;
+}
+
Added: trunk/dom/src/utils/namespace.h
URL: http://source.netsurf-browser.org/trunk/dom/src/utils/namespace.h?rev=360...
==============================================================================
--- trunk/dom/src/utils/namespace.h (added)
+++ trunk/dom/src/utils/namespace.h Sat Sep 29 02:01:55 2007
@@ -1,0 +1,33 @@
+/*
+ * This file is part of libdom.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2007 John-Mark Bell <jmb(a)netsurf-browser.org>
+ */
+
+#ifndef dom_utils_namespace_h_
+#define dom_utils_namespace_h_
+
+#include <dom/functypes.h>
+#include <dom/core/exceptions.h>
+
+struct dom_document;
+struct dom_string;
+
+/* Initialise the namespace component */
+dom_exception _dom_namespace_initialise(dom_alloc alloc, void *pw);
+
+/* Finalise the namespace component */
+dom_exception _dom_namespace_finalise(void);
+
+/* Ensure a QName is valid */
+dom_exception _dom_namespace_validate_qname(struct dom_string *qname,
+ struct dom_string *namespace);
+
+/* Split a QName into a namespace prefix and localname string */
+dom_exception _dom_namespace_split_qname(struct dom_string *qname,
+ struct dom_document *doc, struct dom_string **prefix,
+ struct dom_string **localname);
+
+#endif
+
Modified: trunk/dom/src/utils/utils.h
URL: http://source.netsurf-browser.org/trunk/dom/src/utils/utils.h?rev=3604&r1...
==============================================================================
--- trunk/dom/src/utils/utils.h (original)
+++ trunk/dom/src/utils/utils.h Sat Sep 29 02:01:55 2007
@@ -5,8 +5,8 @@
* Copyright 2007 John-Mark Bell <jmb(a)netsurf-browser.org>
*/
-#ifndef dom_utils_h_
-#define dom_utils_h_
+#ifndef dom_utils_utils_h_
+#define dom_utils_utils_h_
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
15 years, 8 months
r3603 rjek - /trunk/netsurf/gtk/gtk_window.c
by netsurf@semichrome.net
Author: rjek
Date: Sat Sep 29 00:54:30 2007
New Revision: 3603
URL: http://source.netsurf-browser.org?rev=3603&view=rev
Log:
Use custom RISC OS-like popup menu cursor on select boxes
Modified:
trunk/netsurf/gtk/gtk_window.c
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_window.c?rev=3603...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Sat Sep 29 00:54:30 2007
@@ -78,6 +78,7 @@
/* Other useful bits */
static void nsgtk_redraw_caret(struct gui_window *g);
+static GdkCursor *nsgtk_create_menu_cursor(void);
nsgtk_scaffolding *nsgtk_get_scaffold(struct gui_window *g)
{
@@ -676,6 +677,39 @@
}
+static GdkCursor *nsgtk_create_menu_cursor(void)
+{
+ static char menu_cursor_bits[] = {
+ 0x00, 0x00, 0x80, 0x7F, 0x88, 0x40, 0x9E, 0x5E, 0x88, 0x40, 0x80, 0x56,
+ 0x80, 0x40, 0x80, 0x5A, 0x80, 0x40, 0x80, 0x5E, 0x80, 0x40, 0x80, 0x56,
+ 0x80, 0x40, 0x80, 0x7F, 0x00, 0x00, 0x00, 0x00, };
+
+ static char menu_cursor_mask_bits[] = {
+ 0xC0, 0xFF, 0xC8, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xC8, 0xFF,
+ 0xC0, 0xFF, 0xC0, 0xFF, 0xC0, 0xFF, 0xC0, 0xFF, 0xC0, 0xFF, 0xC0, 0xFF,
+ 0xC0, 0xFF, 0xC0, 0xFF, 0xC0, 0xFF, 0x00, 0x00, };
+
+ static GdkCursor *r;
+ static GdkColor fg = { 0, 0, 0, 0 };
+ static GdkColor bg = { 0, 65535, 65535, 65535 };
+
+ GdkPixmap *source, *mask;
+
+ if (r != NULL)
+ return r;
+
+ source = gdk_bitmap_create_from_data(NULL, menu_cursor_bits,
+ 16, 16);
+ mask = gdk_bitmap_create_from_data (NULL, menu_cursor_mask_bits,
+ 16, 16);
+
+ r = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 8, 8);
+ gdk_pixmap_unref(source);
+ gdk_pixmap_unref(mask);
+
+ return r;
+}
+
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
{
GdkCursor *cursor = NULL;
@@ -731,7 +765,8 @@
cursortype = GDK_QUESTION_ARROW;
break;
case GUI_POINTER_MENU:
- cursortype = GDK_CENTER_PTR;
+ cursor = nsgtk_create_menu_cursor();
+ nullcursor = true;
break;
case GUI_POINTER_PROGRESS:
/* In reality, this needs to be the funky left_ptr_watch
15 years, 8 months
r3602 jshaw - in /trunk/dom/test: transform/ xml/tests/
by netsurf@semichrome.net
Author: jshaw
Date: Sat Sep 29 00:41:30 2007
New Revision: 3602
URL: http://source.netsurf-browser.org?rev=3602&view=rev
Log:
Stub out all test templates. Remove all previous tests.
Removed:
trunk/dom/test/xml/tests/attrcreatedocumentfragment.xml
trunk/dom/test/xml/tests/attreffectivevalue.xml
trunk/dom/test/xml/tests/attrentityreplacement.xml
trunk/dom/test/xml/tests/attrname.xml
trunk/dom/test/xml/tests/attrnextsiblingnull.xml
trunk/dom/test/xml/tests/documentcreateattribute.xml
trunk/dom/test/xml/tests/documentcreateelement.xml
trunk/dom/test/xml/tests/documentcreatetextnode.xml
trunk/dom/test/xml/tests/documentgetdoctype.xml
trunk/dom/test/xml/tests/nodegetfirstchildnull.xml
trunk/dom/test/xml/tests/nodegetlastchildnull.xml
trunk/dom/test/xml/tests/nodegetnextsiblingnull.xml
trunk/dom/test/xml/tests/nodegetownerdocument.xml
trunk/dom/test/xml/tests/nodegetownerdocumentnull.xml
trunk/dom/test/xml/tests/nodeinsertbeforerefchildnull.xml
trunk/dom/test/xml/tests/nodelistindexgetlengthofemptylist.xml
trunk/dom/test/xml/tests/nodeparentnode.xml
Modified:
trunk/dom/test/transform/test-to-c.xsl
Modified: trunk/dom/test/transform/test-to-c.xsl
URL: http://source.netsurf-browser.org/trunk/dom/test/transform/test-to-c.xsl?...
==============================================================================
--- trunk/dom/test/transform/test-to-c.xsl (original)
+++ trunk/dom/test/transform/test-to-c.xsl Sat Sep 29 00:41:30 2007
@@ -27,814 +27,324 @@
-->
<xsl:param name="interfaces-docname">dom1-interfaces.xml</xsl:param>
- <!--
- The ctypes document maps interfaces, methods and attributes in the
- interfaces document to their C counterparts, proving the ability to
- override names and types.
- -->
- <xsl:param name="ctypes-docname">ctypes.xml</xsl:param>
<xsl:param name="target-uri-base">http://www.w3.org/2001/DOM-Test-Suite/tests/Level-1/</xsl:param>
<xsl:output method="text" encoding="UTF-8"/>
<xsl:variable name="domspec" select="document($interfaces-docname)"/>
- <xsl:variable name="ctypes" select="document($ctypes-docname)"/>
-
-<!-- swallow any text which we don't understand -->
-<xsl:template match="text()" mode="body"/>
-
-<!--
-for anything that doesn't match another template,
-we expect this the element to be found in the library located
-at $interfaces-docname.
-
-This should either be a <method> or <attribute>. If it is neither,
-we generate an <xsl:message> reporting that the element is not known.
--->
-<xsl:template match="*" mode="body">
- <!-- the element name matches by this template -->
- <xsl:variable name="feature" select="local-name(.)"/>
- <xsl:variable name="interface" select="@interface"/>
-
- <!--
- Try to find a method having the @name of $feature.
- If $interface is defined, make sure search for
- a match on that interface in the $domspec document.
- -->
- <xsl:variable name="method" select="$domspec/library/interface[not($interface) or @name = $interface]/method[@name = $feature]"/>
- <xsl:choose>
- <xsl:when test="$method">
- <xsl:call-template name="produce-method">
- <xsl:with-param name="method" select="$method"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--
- Try to find an attribute having the name of $feature.
- Again, if $interface is defined, restrict the search to
- that interface
- -->
- <xsl:variable name="attribute" select="$domspec/library/interface[not($interface) or @name = $interface]/attribute[@name = $feature]"/>
- <xsl:choose>
- <xsl:when test="$attribute">
- <xsl:call-template name="produce-attribute"/>
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:message>Unrecognized element <xsl:value-of select="local-name(.)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*[local-name() = 'test']">
-<xsl:text>#include <string.h>
-
-#include <dom/dom.h>
-#include "testutils.h"
-
-</xsl:text>
-
- <xsl:apply-templates select="*[local-name() = 'metadata']"/>
-<xsl:text>
-int main(int argc, char **argv)
-{
- dom_exception err;
-</xsl:text>
-<xsl:apply-templates mode="body"/>
-<xsl:text>
- return 0;
-}
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="comment()[contains(., 'Copyright')]">
-/*
-This source file was generated by test-to-c.xsl
-and is a derived work from the source document.
-The source document contained the following notice:
-
-<xsl:value-of select="."/>
-*/
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'metadata']">
-<xsl:text>/**
-</xsl:text>
- <xsl:call-template name="emit-description">
- <xsl:with-param name="description" select="translate(*[local-name() = 'description'], '	', ' ')"/>
- </xsl:call-template>
- <xsl:text> */</xsl:text>
-</xsl:template>
-
-<!-- swallowing templates in body mode -->
-<xsl:template match="*[local-name() = 'metadata']" mode="body"/>
-
-<xsl:template match="*[local-name() = 'load']" mode="body">
- <!--
- TODO: need to handle the case where we load more than one testObject.
- append a counter to the variable name?
- -->
- <xsl:text>
- TestObject *testObject = test_object_create(argc, argv, "</xsl:text><xsl:value-of select="@href"/><xsl:text>.xml", false);
- assert(testObject != NULL);
-
- </xsl:text><xsl:value-of select="@var"/><xsl:text> = test_object_get_doc(testObject);
- assert(</xsl:text><xsl:value-of select="@var"/><xsl:text> != NULL);
-</xsl:text>
+</xsl:template>
+
+<!--
+ <package>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'package']">
+ <xsl:message terminate="yes">package not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'suite']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'suite.member']">
+</xsl:template>
+
+<!--
+ <wait>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'wait']">
+ <xsl:message terminate="yes">wait not implemented</xsl:message>
</xsl:template>
<!--
-not sure what <contentType> is used for,
-but it's implemented in subclasses of DOMTestDocumentBuilderFactory.getContentType()
--->
-<xsl:template match="*[local-name() = 'contentType']" mode="body">
- <xsl:text>strcmp(test_object_get_mimetype(testObject), "</xsl:text><xsl:value-of select="@type"/><xsl:text>") == 0</xsl:text>
+================================================================
+Asserts
+================================================================
+-->
+
+<xsl:template match="*[local-name() = 'fail']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertNull']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertNotNull']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertTrue']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertFalse']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertEquals']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertNotEquals']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertInstanceOf']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertSize']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertDOMException']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertURIEquals']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertDOMException']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertImplementationException']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assertLowerSeverity']">
+</xsl:template>
+
+<!--
+ <assertEventCount>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'assertEventCount']">
+ <xsl:message terminate="yes">assertEventCount not implemented</xsl:message>
</xsl:template>
<!--
-================================
-Language construct templates
-================================
--->
-
-<!-- a variable declaration -->
-<xsl:template match="*[local-name() = 'var']" mode="body">
- <xsl:text> </xsl:text>
- <xsl:call-template name="produce-var-type-declaration">
- <xsl:with-param name="var-type" select="./@type"/>
- </xsl:call-template>
- <xsl:value-of select="@name"/>;
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'if']" mode="body">
- <!--
- Apply condition template in before-invocation mode
- to give it a chance to set up temporary variables (such as DOMStrings)
- -->
- <xsl:apply-templates select="*[1]" mode="before-invocation"/>
- <xsl:text>
- if (</xsl:text><xsl:apply-templates select="*[1]" mode="body"/><xsl:text>) {
- </xsl:text>
- <xsl:apply-templates select="*[position() > 1 and local-name() != 'else']" mode="body"/>
- <xsl:text> }</xsl:text>
- <xsl:for-each select="*[local-name() = 'else']">
- <xsl:text> else {
-</xsl:text>
- <xsl:apply-templates mode="body"/>
- <xsl:text> }</xsl:text>
- </xsl:for-each>
- <xsl:text>
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'equals']" mode="before-invocation">
- <!-- FIXME: implement -->
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'notEquals']" mode="before-invocation">
- <!-- FIXME: implement -->
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'equals']" mode="body">
- <xsl:message terminate="yes"><!-- FIXME: implement -->equals not implemented</xsl:message>
+================================================================
+Statements
+================================================================
+-->
+
+<xsl:template match="*[local-name() = 'var']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'assign']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'increment']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'decrement']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'append']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'plus']">
+</xsl:template>
+
+<!--
+ <subtract>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'subtract']">
+ <xsl:message terminate="yes">subtract not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'mult']">
+</xsl:template>
+
+<!--
+ <divide>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'divide']">
+ <xsl:message terminate="yes">divide not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'load']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'if']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'while']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'try']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'for-each']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'comment']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'return']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'substring']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'createTempURI']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'allErrors']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'allNotifications']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'operation']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'key']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'dst']">
+</xsl:template>
+
+<!--
+ <userObj>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'userObj']">
+ <xsl:message terminate="yes">userObj not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'atEvents']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'capturedEvents']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'bubbledEvents']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'allEvents']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'allEvents']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'allEvents']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'createXPathEvaluator']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'getResourceURI']">
</xsl:template>
<!--
-================================
-DOM templates
-================================
--->
-
-<xsl:template name="produce-method">
- <xsl:variable name="methodName" select="local-name(.)"/>
- <!-- if interface is specified -->
- <xsl:choose>
- <xsl:when test="@interface">
- <xsl:variable name="interface" select="@interface"/>
- <xsl:call-template name="produce-specific-method">
- <!-- TODO: move vardefs up -->
- <xsl:with-param name="vardefs" select="//*[local-name() = 'var']"/>
- <xsl:with-param name="method" select="$domspec/library/interface[@name = $interface]/method[@name = $methodName]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="methods" select="$domspec/library/interface/method[@name = $methodName]"/>
- <xsl:call-template name="produce-specific-method">
- <xsl:with-param name="vardefs" select="//*[local-name() = 'var']"/>
- <xsl:with-param name="method" select="$methods[1]"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="produce-attribute">
- <xsl:variable name="attribName" select="local-name(.)"/>
- <xsl:choose>
- <!-- if interface is specified -->
- <xsl:when test="@interface">
- <xsl:variable name="interface" select="@interface"/>
- <xsl:call-template name="produce-specific-attribute">
- <xsl:with-param name="attribute" select="$domspec/library/interface[@name = $interface]/attribute[@name = $attribName]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="produce-specific-attribute">
- <xsl:with-param name="attribute" select="$domspec/library/interface/attribute[@name = $attribName]"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!--
-Produce a statement to get or set an attribute.
-If @var is specified, the accessor is called and @var is given the result value.
-err = dom_document_get_doctype(doc, &docType);
-assert(err == DOM_NO_ERR);
-
-If @value is specified, the mutator is called and @value is used as the parameter argument.
-
--->
-<xsl:template name="produce-specific-attribute">
- <!--
- An <attribute> node in the $domspec document.
- -->
- <xsl:param name="attribute"/>
-
- <!-- the object which contains the attribute -->
- <xsl:variable name="obj" select="@obj"/>
-
- <!-- the <var> for the $obj -->
- <xsl:variable name="obj-var" select="//*[local-name() = 'var' and @name = $obj]"/>
-
- <!--
- The C type for the object's type containing $attribute.
- This may be the object's own type, or a supertype. For example, $obj
- may be an Element, but the nodeValue attribute is a member of the Node
- supertype.
- Note that this is the <type> element itself, not the @c attribute.
- -->
- <xsl:variable name="obj-ctype" select="$ctypes/types/type[@idl = $attribute/parent::interface/@name]"/>
-
- <!--
- The C name of the attribute. This is either $attribute/@name, or
- the value in $ctypes if it overrides it.
- -->
- <xsl:variable name="attribute-cname">
- <xsl:choose>
- <xsl:when test="$obj-ctype/attribute[@idl = $attribute/@name]/@c">
- <xsl:value-of select="$obj-ctype/attribute[@idl = $attribute/@name]/@c"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$attribute/@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!--
- The attribute type. This is either $attribute/@type, or
- the <override-type> in $ctypes if it is specified.
- The resulting attribute type may be an IDL-style name (e.g. DocumentType)
- or a C-style name (e.g. dom_node_type).
- -->
- <xsl:variable name="attribute-type">
- <xsl:choose>
- <xsl:when test="$obj-ctype/attribute[@idl = $attribute/@name]/override-type">
- <xsl:value-of select="$obj-ctype/attribute[@idl = $attribute/@name]/override-type/text()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$attribute/@type"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:text> err = </xsl:text>
- <xsl:if test="@value">
- <xsl:value-of select="$obj-ctype/@c"/>
- <xsl:text>_set_</xsl:text>
- <xsl:value-of select="$attribute-cname"/>
- <xsl:text>(</xsl:text>
- <!-- TODO: function parameters -->
- <xsl:text>);</xsl:text>
- </xsl:if>
- <xsl:if test="@var">
- <xsl:variable name="var" select="@var"/>
- <xsl:variable name="var-type" select="//*[local-name() = 'var' and @name = $var]/@type"/>
-
- <xsl:value-of select="$obj-ctype/@c"/>
- <xsl:text>_get_</xsl:text>
- <xsl:value-of select="$attribute-cname"/>
- <xsl:text>(</xsl:text>
- <xsl:call-template name="cast">
- <xsl:with-param name="var-type" select="//*[local-name() = 'var' and @name = $obj]/@type"/>
- <xsl:with-param name="interface-type" select="$obj-ctype/@c"/>
- </xsl:call-template>
- <xsl:value-of select="$obj"/>
- <xsl:text>, </xsl:text>
- <xsl:call-template name="cast">
- <xsl:with-param name="var-type" select="$var-type"/>
- <xsl:with-param name="interface-type" select="$attribute-type"/>
- </xsl:call-template>
- <xsl:text>&</xsl:text>
- <xsl:value-of select="@var"/>
- <xsl:text>);</xsl:text>
- </xsl:if>
- <xsl:text>
- assert(err == DOM_NO_ERR);
-</xsl:text>
-</xsl:template>
-
-<xsl:template name="produce-specific-method">
- <xsl:param name="vardefs"/>
-
- <!-- a <method> from $domspec -->
- <xsl:param name="method"/>
-
- <!-- the current context node -->
- <xsl:variable name="current-node" select="."/>
-
- <!-- the object which contains the attribute -->
- <xsl:variable name="obj" select="@obj"/>
-
- <!-- the <var> for the $obj -->
- <xsl:variable name="obj-var" select="//*[local-name() = 'var' and @name = $obj]"/>
-
- <!-- the C-type on which the method is called -->
- <xsl:variable name="interface-ctype">
- <xsl:call-template name="get-ctype">
- <xsl:with-param name="type" select="$method/parent::interface/@name"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="method-cname">
- <xsl:choose>
- <xsl:when test="$ctypes/types/type[@c = $interface-ctype]/method[@idl = $method/@name]/@c">
- <xsl:value-of select="$ctypes/types/type[@c = $interface-ctype]/method[@idl = $method/@name]/@c"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$method/@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="current-position"><xsl:number level="any" count="*"/></xsl:variable>
-
- <!--
- setup variables to hold parameter literals (for DOMStrings)
- TODO: needs testing with method that takes more than one parameter
- TODO: needs testing with more than one method call per test
- -->
- <xsl:for-each select="$method/parameters/param">
- <xsl:variable name="paramDef" select="."/>
- <xsl:variable name="value" select="$current-node/@*[name() = $paramDef/@name]"/>
-
- <xsl:if test="starts-with($value, '"')">
- <xsl:call-template name="produce-dom-string">
- <xsl:with-param name="vardefs" select="$vardefs"/>
- <xsl:with-param name="var-name"><xsl:text>domString</xsl:text><xsl:value-of select="$current-position"/>_<xsl:number/></xsl:with-param>
- <xsl:with-param name="string" select="$value"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
-
- <!-- function call -->
- <xsl:text> err = </xsl:text>
- <xsl:value-of select="$interface-ctype"/>
- <xsl:text>_</xsl:text>
- <xsl:value-of select="$method-cname"/>
- <xsl:text>(</xsl:text>
-
- <!-- the object to invoke the method upon -->
- <xsl:call-template name="cast">
- <xsl:with-param name="var-type" select="$obj-var/@type"/>
- <xsl:with-param name="interface-type" select="$method/parent::interface/@name"/>
- </xsl:call-template>
- <xsl:value-of select="$obj"/>
-
- <!-- method parameters -->
- <xsl:for-each select="$method/parameters/param">
- <xsl:variable name="paramDef" select="."/>
- <xsl:variable name="value" select="$current-node/@*[name() = $paramDef/@name]"/>
-
- <xsl:text>, </xsl:text>
-
- <xsl:call-template name="produce-param">
- <xsl:with-param name="vardefs" select="$vardefs"/>
- <xsl:with-param name="var-or-literal" select="$value"/>
- <xsl:with-param name="interface-type" select="./@type"/>
- <xsl:with-param name="current-position" select="$current-position"/>
- </xsl:call-template>
- </xsl:for-each>
-
- <!-- return variable -->
- <xsl:if test="@var">
- <xsl:variable name="var" select="@var"/>
-
- <!-- the <var> for the variable $var -->
- <xsl:variable name="var-var" select="//*[local-name() = 'var' and @name = $var]"/>
-
- <xsl:text>, </xsl:text>
- <!--
- FIXME: any explicit cast won't work because _address of_ return params are passed (using &)
- need to use extra * on the cast
- -->
- <xsl:call-template name="cast">
- <xsl:with-param name="var-type" select="$var-var/@type"/>
- <xsl:with-param name="interface-type" select="$method/returns/@type"/>
- <xsl:with-param name="indirection" select="2"/>
- </xsl:call-template>
- <xsl:text>&</xsl:text>
- <xsl:value-of select="$var"/>
- </xsl:if>
- <xsl:text>);</xsl:text>
- <xsl:text>
- assert(err == DOM_NO_ERR);
-</xsl:text>
-</xsl:template>
-
-<!--
-This template expects to be called with
-a current context of a $domspec//method/parameters/param.
-
-TODO: If this template needs to be more flexible, will need to pass $current-position
-through as a parameter
--->
-<xsl:template name="produce-param">
- <xsl:param name="vardefs"/>
-
- <!-- a string that may be a literal or a variable name -->
- <xsl:param name="var-or-literal"/>
-
- <!-- the parameter's expected type -->
- <xsl:param name="interface-type"/>
-
- <!-- used for referencing DOMStrings -->
- <xsl:param name="current-position"/>
-
- <!-- the IDL type of $var-or-literal -->
- <xsl:variable name="var-type">
- <xsl:call-template name="guess-var-or-literal-type">
- <xsl:with-param name="vardefs" select="$vardefs"/>
- <xsl:with-param name="var-or-literal" select="$var-or-literal"/>
- <xsl:with-param name="interface-type" select="$interface-type"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$var-type = 'DOMString'">
- <!--
- TODO: put this string creation in its own template so it can be reused.
- Be careful with the behaviour of xsl:number, though.
- -->
- <xsl:text>domString</xsl:text><xsl:value-of select="$current-position"/>_<xsl:number/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="cast">
- <xsl:with-param name="var-type" select="$var-type"/>
- <xsl:with-param name="interface-type" select="$interface-type"/>
- </xsl:call-template>
- <xsl:value-of select="$var-or-literal"/>
- </xsl:otherwise>
- </xsl:choose>
-
-</xsl:template>
-
-<!-- guesses at the IDL type of the supplied var or literal -->
-<xsl:template name="guess-var-or-literal-type">
- <xsl:param name="vardefs"/>
-
- <!-- the variable name or literal -->
- <xsl:param name="var-or-literal"/>
-
- <!-- the expected type of $var-or-literal -->
- <xsl:param name="interface-type"/>
-
- <xsl:choose>
- <!-- string literal -->
- <xsl:when test="starts-with($var-or-literal, '"')">
- <xsl:text>DOMString</xsl:text>
- </xsl:when>
- <!-- variable -->
- <xsl:when test="$vardefs[@name = $var-or-literal]">
- <xsl:value-of select="$vardefs[@name = $var-or-literal]/@type"/>
- </xsl:when>
- <!-- unknown; return the interface type -->
- <xsl:otherwise>
- <xsl:value-of select="$interface-type"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="cast">
- <!-- the variable's type (e.g. Document, dom_node_type or int) -->
- <xsl:param name="var-type"/>
-
- <!-- the required type (e.g. Document or dom_node_type) -->
- <xsl:param name="interface-type"/>
-
- <xsl:param name="indirection" select="1"/>
-
- <!-- the variable's C-style type -->
- <xsl:variable name="var-ctype">
- <xsl:call-template name="get-ctype">
- <xsl:with-param name="type" select="$var-type"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- the interface's C-style type -->
- <xsl:variable name="interface-ctype">
- <xsl:call-template name="get-ctype">
- <xsl:with-param name="type" select="$interface-type"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:if test="$var-ctype != $interface-ctype">
- <xsl:text>(</xsl:text>
- <xsl:call-template name="produce-var-type-declaration">
- <xsl:with-param name="var-type" select="$interface-ctype"/>
- <xsl:with-param name="indirection" select="$indirection"/>
- </xsl:call-template>
- <xsl:text>) </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<!--
-================================
-Assert templates
-================================
--->
-
-<xsl:template match="*[local-name() = 'assertNotNull']" mode="body">
- <!-- TODO: what does the @id string do, and do we need it here? -->
- <xsl:text>
- assert(</xsl:text><xsl:value-of select="@actual"/><xsl:text> != NULL);
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'assertNull']" mode="body">
- <!-- TODO: what does the @id string do, and do we need it here? -->
- <xsl:text>
- assert(</xsl:text><xsl:value-of select="@actual"/><xsl:text> == NULL);
-</xsl:text>
-</xsl:template>
-
-<!-- TODO: implement nested elements, such as <or> -->
-<xsl:template match="*[local-name() = 'assertTrue']" mode="body">
- <!-- TODO: what does the @id string do, and do we need it here? -->
- <xsl:text>
- assert(</xsl:text><xsl:value-of select="@actual"/><xsl:text> == true);
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'assertFalse']" mode="body">
- <!-- TODO: what does the @id string do, and do we need it here? -->
- <xsl:text>
- assert(</xsl:text><xsl:value-of select="@actual"/><xsl:text> == false);
-</xsl:text>
-</xsl:template>
-
-<!--
-TODO: somehow want to reuse this for <equals> tests.
-The problem is that <equals> is nested inside <if>, and for DOMStrings,
-a temporary string must be created first.
-
-Perhaps the <if> template could <xsl:apply-templates/> in two modes.
-The first generates temporary variables, and the second generates the equality
-test itself.
- -->
-<xsl:template match="*[local-name() = 'assertEquals']" mode="body">
- <xsl:variable name="vardefs" select="//*[local-name() = 'var']"/>
-
- <xsl:variable name="actual" select="@actual"/>
-
- <xsl:variable name="var-type">
- <xsl:call-template name="get-idltype">
- <xsl:with-param name="vardefs" select="$vardefs"/>
- <xsl:with-param name="var-name" select="$actual"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$var-type = 'DOMString'">
- <!-- a globally unique identifier for the temporary string -->
- <xsl:variable name="dom-string-id"><xsl:number level="any" count="*"/></xsl:variable>
-
- <xsl:call-template name="produce-dom-string">
- <xsl:with-param name="vardefs" select="$vardefs"/>
- <xsl:with-param name="var-name">matchString_<xsl:value-of select="$dom-string-id"/></xsl:with-param>
- <xsl:with-param name="string" select="@expected"/>
- </xsl:call-template>
- <xsl:text> assert(</xsl:text>
- <xsl:choose>
- <xsl:when test="@ignoreCase = 'true'">
- <xsl:text>dom_string_icmp</xsl:text>
- </xsl:when>
- <xsl:when test="@ignoreCase = 'auto'">
- <!--
- TODO: implement auto case comparison (see java's DOMTestCase.assertEqualsAutoCase()
- -->
- <xsl:message><assertEquals ignoreCase='auto'> not supported</xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>dom_string_cmp</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>(</xsl:text>
- <xsl:value-of select="@actual"/>
- <xsl:text>, matchString_</xsl:text>
- <xsl:value-of select="$dom-string-id"/>
- <xsl:text>) == 0);
-</xsl:text>
- </xsl:when>
- <xsl:when test="$var-type = 'int'">
- <xsl:text> assert(</xsl:text>
- <xsl:value-of select="@actual"/>
- <xsl:text> == </xsl:text>
- <xsl:value-of select="@expected"/>
- <xsl:text>);
-</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>assertEquals on unknown type <xsl:value-of select="$var-type"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="*[local-name() = 'assertSize']" mode="body">
- <xsl:variable name="vardefs" select="//*[local-name() = 'var']"/>
-
- <xsl:variable name="collection" select="@collection"/>
-
- <xsl:variable name="current-position"><xsl:number level="any" count="*"/></xsl:variable>
-
- <xsl:text>
- unsigned long len_</xsl:text>
- <xsl:value-of select="$current-position"/>
- <xsl:text>;</xsl:text>
- <xsl:text>
- err = </xsl:text>
- <xsl:call-template name="get-ctype">
- <xsl:with-param name="type" select="$vardefs[@name = $collection]/@type"/>
- </xsl:call-template>
- <xsl:text>_get_length(</xsl:text>
- <xsl:value-of select="$collection"/>
- <xsl:text>, &len_</xsl:text>
- <xsl:value-of select="$current-position"/>
- <xsl:text>);</xsl:text>
-
- <xsl:text>
- assert(err == DOM_NO_ERR);
- assert(len_</xsl:text>
- <xsl:value-of select="$current-position"/>
- <xsl:text> == </xsl:text>
- <xsl:value-of select="@size"/>
- <xsl:text>);</xsl:text>
-</xsl:template>
-
-<!-- TODO: difficult, because it contains nested elements -->
-<xsl:template match="*[local-name() = 'assertDOMException']" mode="body">
-
- <xsl:message terminate="yes"><!-- FIXME: implement -->assertDOMException not implemented</xsl:message>
-</xsl:template>
-
-<!--
-================================
-Helper templates
-================================
--->
-
-<xsl:template name="produce-var-type-declaration">
- <!-- a type (e.g. Document, dom_node_type or int) -->
- <xsl:param name="var-type"/>
-
- <!--
- Number of *s to generate.
- Applies to structs and enums only (not primitives)
- Default is 1
- -->
- <xsl:param name="indirection" select="1"/>
-
- <xsl:variable name="var-ctype">
- <xsl:call-template name="get-ctype">
- <xsl:with-param name="type" select="$var-type"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$ctypes/types/primitive[@c = $var-ctype]">
- <!-- TODO: support the overriding of primitive name in ctypes document -->
- <xsl:value-of select="$var-ctype"/><xsl:text> </xsl:text>
- </xsl:when>
- <xsl:when test="$ctypes/types/type[@c = $var-ctype]">
- <xsl:text>struct </xsl:text>
- <xsl:value-of select="$ctypes/types/type[@c = $var-ctype]/@c"/>
- <xsl:text> </xsl:text>
- <xsl:call-template name="str:generate-string">
- <xsl:with-param name="text" select="'*'"/>
- <xsl:with-param name="count" select="$indirection"/>
- </xsl:call-template>
- </xsl:when>
-
- <!-- assume this is not a struct, and not a primitive (e.g. an enum) -->
- <xsl:otherwise>
- <xsl:value-of select="$var-ctype"/>
- <!-- TODO: should this * be here? Probably, for normal parameters, no.
- Probably need one fewer *s that $indirection -->
- <xsl:text> *</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="produce-dom-string">
- <xsl:param name="vardefs"/>
-
- <!-- the variable name for the dom_string -->
- <xsl:param name="var-name"/>
-
- <!-- The string literal. Should already be enclosed in double quotes. -->
- <xsl:param name="string"/>
-
- <!-- a list of all Document variables -->
- <xsl:variable name="docs" select="$vardefs[@type = 'Document']"/>
-
- <xsl:text>
- struct dom_string *</xsl:text><xsl:value-of select="$var-name"/>
- <xsl:text>;
- err = dom_string_create_from_const_ptr(</xsl:text>
- <xsl:value-of select="$docs[1]/@name"/>
- <xsl:text>, (uint8_t *) </xsl:text>
- <xsl:value-of select="$string"/>
- <xsl:text>, SLEN(</xsl:text>
- <xsl:value-of select="$string"/>
- <xsl:text>), &</xsl:text>
- <xsl:value-of select="$var-name"/>
- <xsl:text>);
- assert(err == DOM_NO_ERR);
-</xsl:text>
-</xsl:template>
-
-<xsl:template name="get-idltype">
- <xsl:param name="vardefs"/>
-
- <!-- variable name -->
- <xsl:param name="var-name"/>
-
- <xsl:value-of select="$vardefs[@name = $var-name]/@type"/>
-</xsl:template>
-
-<xsl:template name="get-ctype">
- <!--
- a type (e.g. Document, dom_node_type or int)
- if $type is already a C-style type, or was a primitive, this is
- used instead
- -->
- <xsl:param name="type"/>
-
- <xsl:choose>
- <xsl:when test="$ctypes/types/type[@idl = $type]/@c">
- <xsl:value-of select="$ctypes/types/type[@idl = $type]/@c"/>
- </xsl:when>
- <xsl:when test="$ctypes/types/primitive[@idl = $type]/@c">
- <xsl:value-of select="$ctypes/types/primitive[@idl = $type]/@c"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$type"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!--
-Taken from test-to-java.xsl
-Prepends every line with asterisks, suitable for use in a block comment
--->
-<xsl:template name="emit-description">
- <xsl:param name="description"/>
- <xsl:choose>
- <xsl:when test="contains($description, '
')">
- <xsl:variable name="preceding" select="substring-before($description, '
')"/>
- <xsl:if test="string-length($preceding) > 0">
- <xsl:text> * </xsl:text>
- <xsl:value-of select="substring-before($description, '
')"/>
-<xsl:text>
-</xsl:text>
- </xsl:if>
- <xsl:variable name="following" select="substring-after($description, '
')"/>
- <xsl:if test="string-length($following) > 0">
- <xsl:call-template name="emit-description">
- <xsl:with-param name="description" select="substring-after($description, '
')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> * </xsl:text>
- <xsl:value-of select="$description"/>
- <xsl:text>
- </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
+================================================================
+Conditions
+================================================================
+-->
+
+<!--
+ <same>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'same']">
+ <xsl:message terminate="yes">same not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'equals']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'notEquals']">
+</xsl:template>
+
+<!--
+ <lessOrEquals>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'lessOrEquals']">
+ <xsl:message terminate="yes">lessOrEquals not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'greater']">
+</xsl:template>
+
+<!--
+ <greaterOrEquals>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'greaterOrEquals']">
+ <xsl:message terminate="yes">greaterOrEquals not implemented</xsl:message>
+</xsl:template>
+
+<!--
+ <isNull>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'isNull']">
+ <xsl:message terminate="yes">isNull not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'notNull']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'and']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'or']">
+</xsl:template>
+
+<!--
+ <xor>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'xor']">
+ <xsl:message terminate="yes">xor not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'not']">
+</xsl:template>
+
+<!--
+ <instanceOf>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'instanceOf']">
+ <xsl:message terminate="yes">instanceOf not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'isTrue']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'isFalse']">
+</xsl:template>
+
+<!--
+ <hasSize>
+
+ Not used.
+ -->
+<xsl:template match="*[local-name() = 'hasSize']">
+ <xsl:message terminate="yes">hasSize not implemented</xsl:message>
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'contentType']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'contains']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'hasFeature']">
+</xsl:template>
+
+<xsl:template match="*[local-name() = 'implementationAttribute']">
</xsl:template>
</xsl:stylesheet>
Removed: trunk/dom/test/xml/tests/attrcreatedocumentfragment.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/attrcreatedocu...
==============================================================================
--- trunk/dom/test/xml/tests/attrcreatedocumentfragment.xml (original)
+++ trunk/dom/test/xml/tests/attrcreatedocumentfragment.xml (removed)
@@ -1,51 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="attrcreatedocumentfragment">
-<metadata>
-<title>attrCreateDocumentFragment</title>
-<creator>NIST</creator>
-<description>
- Attr nodes may be associated with Element nodes contained within a DocumentFragment.
- Create a new DocumentFragment and add a newly created Element node(with one attribute).
- Once the element is added, its attribute should be available as an attribute associated
- with an Element within a DocumentFragment.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<!-- createDocumentFragment -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB..."/>
-<!-- setAttribute -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082"/>
-<!-- DocumentFragment -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63E..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="docFragment" type="DocumentFragment"/>
-<var name="newOne" type="Element"/>
-<var name="domesticNode" type="Node"/>
-<var name="domesticAttr" type="NamedNodeMap"/>
-<var name="attrs" type="Attr"/>
-<var name="attrName" type="DOMString"/>
-<var name="appendedChild" type="Node"/>
-<load var="doc" href="staff" willBeModified="true"/>
-<createDocumentFragment obj="doc" var="docFragment"/>
-<createElement obj="doc" var="newOne" tagName=""newElement""/>
-<setAttribute obj="newOne" name=""newdomestic"" value=""Yes""/>
-<appendChild var="appendedChild" obj="docFragment" newChild="newOne"/>
-<firstChild interface="Node" obj="docFragment" var="domesticNode"/>
-<attributes obj="domesticNode" var="domesticAttr"/>
-<item interface="NamedNodeMap" obj="domesticAttr" var="attrs" index="0"/>
-<name interface="Attr" obj="attrs" var="attrName"/>
-<assertEquals actual="attrName" expected=""newdomestic"" id="attrCreateDocumentFragmentAssert" ignoreCase="false"/>
-</test>
Removed: trunk/dom/test/xml/tests/attreffectivevalue.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/attreffectivev...
==============================================================================
--- trunk/dom/test/xml/tests/attreffectivevalue.xml (original)
+++ trunk/dom/test/xml/tests/attreffectivevalue.xml (removed)
@@ -1,44 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="attreffectivevalue">
-<metadata>
-<title>attrEffectiveValue</title>
-<creator>NIST</creator>
-<description>
- If an Attr is explicitly assigned any value, then that value is the attributes effective value.
- Retrieve the attribute named "domestic" from the last child of of the first employee
- and examine its nodeValue attribute. This test uses the "getNamedItem(name)" method
- from the NamedNodeMap interface.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<!-- Element.attributes -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096"/>
-<!-- NamedNodeMap.getNamedItem -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="addressList" type="NodeList"/>
-<var name="testNode" type="Node"/>
-<var name="attributes" type="NamedNodeMap"/>
-<var name="domesticAttr" type="Attr"/>
-<var name="value" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" var="addressList" tagname=""address""/>
-<item interface="NodeList" obj="addressList" var="testNode" index="0"/>
-<attributes obj="testNode" var="attributes"/>
-<getNamedItem obj="attributes" var="domesticAttr" name=""domestic""/>
-<nodeValue obj="domesticAttr" var="value"/>
-<assertEquals actual="value" expected=""Yes"" id="attrEffectiveValueAssert" ignoreCase="false"/>
-</test>
Removed: trunk/dom/test/xml/tests/attrentityreplacement.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/attrentityrepl...
==============================================================================
--- trunk/dom/test/xml/tests/attrentityreplacement.xml (original)
+++ trunk/dom/test/xml/tests/attrentityreplacement.xml (removed)
@@ -1,48 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001-2004 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="attrentityreplacement">
-<metadata>
-<title>attrEntityReplacement</title>
-<creator>NIST</creator>
-<description>
- The "getValue()" method will return the value of the
- attribute as a string. The general entity references
- are replaced with their values.
- Retrieve the attribute named "street" from the last
- child of of the fourth employee and examine the string
- returned by the "getValue()" method. The value should
- be set to "Yes" after the EntityReference is
- replaced with its value. This test uses the
- "getNamedItem(name)" method from the NamedNodeMap
- interface.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<!-- Attr.value -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2216..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="addressList" type="NodeList"/>
-<var name="testNode" type="Node"/>
-<var name="attributes" type="NamedNodeMap"/>
-<var name="streetAttr" type="Attr"/>
-<var name="value" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="true"/>
-<getElementsByTagName interface="Document" obj="doc" var="addressList" tagname=""address""/>
-<item interface="NodeList" obj="addressList" var="testNode" index="3"/>
-<attributes obj="testNode" var="attributes"/>
-<getNamedItem obj="attributes" var="streetAttr" name=""street""/>
-<value interface="Attr" obj="streetAttr" var="value"/>
-<assertEquals actual="value" expected='"Yes"' id="streetYes" ignoreCase="false"/>
-</test>
Removed: trunk/dom/test/xml/tests/attrname.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/attrname.xml?r...
==============================================================================
--- trunk/dom/test/xml/tests/attrname.xml (original)
+++ trunk/dom/test/xml/tests/attrname.xml (removed)
@@ -1,47 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="attrname">
-<metadata>
-<title>attrName</title>
-<creator>NIST</creator>
-<description>
- The getNodeName() method of an Attribute node.
- Retrieve the attribute named street from the last
- child of of the second employee and examine its
- NodeName. This test uses the getNamedItem(name) method from the NamedNodeMap
- interface.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<!-- Node.nodeName -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095"/>
-<!-- Attr.name -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="addressList" type="NodeList"/>
-<var name="testNode" type="Node"/>
-<var name="attributes" type="NamedNodeMap"/>
-<var name="streetAttr" type="Attr"/>
-<var name="name" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" var="addressList" tagname=""address""/>
-<item interface="NodeList" obj="addressList" var="testNode" index="1"/>
-<attributes obj="testNode" var="attributes"/>
-<getNamedItem obj="attributes" var="streetAttr" name=""street""/>
-<nodeName obj="streetAttr" var="name"/>
-<assertEquals actual="name" expected=""street"" id="nodeName" ignoreCase="false"/>
-<name obj="streetAttr" var="name" interface="Attr"/>
-<assertEquals actual="name" expected=""street"" id="name" ignoreCase="false"/>
-</test>
Removed: trunk/dom/test/xml/tests/attrnextsiblingnull.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/attrnextsiblin...
==============================================================================
--- trunk/dom/test/xml/tests/attrnextsiblingnull.xml (original)
+++ trunk/dom/test/xml/tests/attrnextsiblingnull.xml (removed)
@@ -1,44 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="attrnextsiblingnull">
-<metadata>
-<title>attrNextSiblingNull</title>
-<creator>NIST</creator>
-<description>
-The "getNextSibling()" method for an Attr node should return null.
-Retrieve the attribute named "domestic" from the last child of of the
-first employee and examine its NextSibling node. This test uses the
-"getNamedItem(name)" method from the NamedNodeMap interface.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<!--nextSibling attribute -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC5..."/>
-<!-- Attr interface -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6376..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="addressList" type="NodeList"/>
-<var name="testNode" type="Node"/>
-<var name="attributes" type="NamedNodeMap"/>
-<var name="domesticAttr" type="Attr"/>
-<var name="s" type="Node"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" var="addressList" tagname=""address""/>
-<item interface="NodeList" obj="addressList" var="testNode" index="0"/>
-<attributes obj="testNode" var="attributes"/>
-<getNamedItem obj="attributes" var="domesticAttr" name=""domestic""/>
-<nextSibling interface="Node" obj="domesticAttr" var="s"/>
-<assertNull actual="s" id="attrNextSiblingNullAssert"/>
-</test>
Removed: trunk/dom/test/xml/tests/documentcreateattribute.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/documentcreate...
==============================================================================
--- trunk/dom/test/xml/tests/documentcreateattribute.xml (original)
+++ trunk/dom/test/xml/tests/documentcreateattribute.xml (removed)
@@ -1,45 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="documentcreateattribute">
-<metadata>
-<title>documentCreateAttribute</title>
-<creator>NIST</creator>
-<description>
- The "createAttribute(name)" method creates an Attribute
- node of the given name.
-
- Retrieve the entire DOM document and invoke its
- "createAttribute(name)" method. It should create a
- new Attribute node with the given name. The name, value
- and type of the newly created object are retrieved and
- output.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="newAttrNode" type="Attr"/>
-<var name="attrValue" type="DOMString"/>
-<var name="attrName" type="DOMString"/>
-<var name="attrType" type="int"/>
-<load var="doc" href="staff" willBeModified="true"/>
-<createAttribute obj="doc" var="newAttrNode" name=""district""/>
-<nodeValue obj="newAttrNode" var="attrValue"/>
-<assertEquals actual="attrValue" expected="""" ignoreCase="false" id="value"/>
-<nodeName obj="newAttrNode" var="attrName"/>
-<assertEquals actual="attrName" expected=""district"" ignoreCase="false" id="name"/>
-<nodeType obj="newAttrNode" var="attrType"/>
-<assertEquals actual="attrType" expected="2" ignoreCase="false" id="type"/>
-</test>
Removed: trunk/dom/test/xml/tests/documentcreateelement.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/documentcreate...
==============================================================================
--- trunk/dom/test/xml/tests/documentcreateelement.xml (original)
+++ trunk/dom/test/xml/tests/documentcreateelement.xml (removed)
@@ -1,44 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="documentcreateelement">
-<metadata>
-<title>documentCreateElement</title>
-<creator>NIST</creator>
-<description>
- The "createElement(tagName)" method creates an Element
- of the type specified.
- Retrieve the entire DOM document and invoke its
- "createElement(tagName)" method with tagName="address".
- The method should create an instance of an Element node
- whose tagName is "address". The NodeName, NodeType
- and NodeValue are returned.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="newElement" type="Element"/>
-<var name="newElementName" type="DOMString"/>
-<var name="newElementType" type="int"/>
-<var name="newElementValue" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="true"/>
-<createElement obj="doc" var="newElement" tagName=""address""/>
-<nodeName obj="newElement" var="newElementName"/>
-<assertEquals actual="newElementName" expected=""address"" ignoreCase="false" id="name"/>
-<nodeType obj="newElement" var="newElementType"/>
-<assertEquals actual="newElementType" expected="1" ignoreCase="false" id="type"/>
-<nodeValue obj="newElement" var="newElementValue"/>
-<assertNull actual="newElementValue" id="valueInitiallyNull"/>
-</test>
Removed: trunk/dom/test/xml/tests/documentcreatetextnode.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/documentcreate...
==============================================================================
--- trunk/dom/test/xml/tests/documentcreatetextnode.xml (original)
+++ trunk/dom/test/xml/tests/documentcreatetextnode.xml (removed)
@@ -1,43 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="documentcreatetextnode">
-<metadata>
-<title>documentCreateTextNode</title>
-<creator>NIST</creator>
-<description>
- The "createTextNode(data)" method creates a Text node
- given the specfied string.
- Retrieve the entire DOM document and invoke its
- "createTextNode(data)" method. It should create a
- new Text node whose "data" is the specified string.
- The NodeName and NodeType are also checked.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="newTextNode" type="Text"/>
-<var name="newTextName" type="DOMString"/>
-<var name="newTextValue" type="DOMString"/>
-<var name="newTextType" type="int"/>
-<load var="doc" href="staff" willBeModified="true"/>
-<createTextNode obj="doc" var="newTextNode" data=""This is a new Text node""/>
-<nodeValue obj="newTextNode" var="newTextValue"/>
-<assertEquals actual="newTextValue" expected=""This is a new Text node"" ignoreCase="false" id="value"/>
-<nodeName obj="newTextNode" var="newTextName"/>
-<assertEquals actual="newTextName" expected=""#text"" ignoreCase="false" id="name"/>
-<nodeType obj="newTextNode" var="newTextType"/>
-<assertEquals actual="newTextType" expected="3" ignoreCase="false" id="type"/>
-</test>
Removed: trunk/dom/test/xml/tests/documentgetdoctype.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/documentgetdoc...
==============================================================================
--- trunk/dom/test/xml/tests/documentgetdoctype.xml (original)
+++ trunk/dom/test/xml/tests/documentgetdoctype.xml (removed)
@@ -1,49 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001-2004 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="documentgetdoctype">
-<metadata>
-<title>documentGetDocType</title>
-<creator>NIST</creator>
-<description>
- The "getDoctype()" method returns the Document
- Type Declaration associated with this document.
- Retrieve the entire DOM document and invoke its
- "getDoctype()" method. The name of the document
- type should be returned. The "getName()" method
- should be equal to "staff" or "svg".
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63E..."/>
-<!-- Node.nodeValue -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080"/>
-<subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=249"/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="docType" type="DocumentType"/>
-<var name="docTypeName" type="DOMString"/>
-<var name="nodeValue" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<doctype obj="doc" var="docType"/>
-<assertNotNull actual="docType" id="docTypeNotNull"/>
-<name interface="DocumentType" obj="docType" var="docTypeName"/>
-<if><contentType type="image/svg+xml"/>
- <assertEquals actual="docTypeName" expected='"svg"' id="doctypeNameSVG" ignoreCase="false"/>
- <else>
- <assertEquals actual="docTypeName" expected='"staff"' id="doctypeName" ignoreCase="false"/>
- </else>
-</if>
-<nodeValue obj="docType" var="nodeValue"/>
-<assertNull actual="nodeValue" id="initiallyNull"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodegetfirstchildnull.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodegetfirstch...
==============================================================================
--- trunk/dom/test/xml/tests/nodegetfirstchildnull.xml (original)
+++ trunk/dom/test/xml/tests/nodegetfirstchildnull.xml (removed)
@@ -1,52 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodegetfirstchildnull">
-<metadata>
-<title>nodeGetFirstChildNull</title>
-<creator>NIST</creator>
-<description>
-
- If there is not a first child then the "getFirstChild()"
-
- method returns null.
-
-
-
- Retrieve the Text node form the second child of the first
-
- employee and invoke the "getFirstChild()" method. It
-
- should return null.
-
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1697..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="employeeNode" type="Node"/>
-<var name="employeeList" type="NodeList"/>
-<var name="secondChildNode" type="Node"/>
-<var name="textNode" type="Node"/>
-<var name="noChildNode" type="Node"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" tagname=""employee"" var="elementList"/>
-<item interface="NodeList" obj="elementList" index="0" var="employeeNode"/>
-<childNodes obj="employeeNode" var="employeeList"/>
-<item interface="NodeList" obj="employeeList" index="1" var="secondChildNode"/>
-<firstChild interface="Node" obj="secondChildNode" var="textNode"/>
-<firstChild interface="Node" obj="textNode" var="noChildNode"/>
-<assertNull actual="noChildNode" id="nodeGetFirstChildNullAssert1"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodegetlastchildnull.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodegetlastchi...
==============================================================================
--- trunk/dom/test/xml/tests/nodegetlastchildnull.xml (original)
+++ trunk/dom/test/xml/tests/nodegetlastchildnull.xml (removed)
@@ -1,52 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodegetlastchildnull">
-<metadata>
-<title>nodeGetLastChildNull</title>
-<creator>NIST</creator>
-<description>
-
- If there is not a last child then the "getLastChild()"
-
- method returns null.
-
-
-
- Retrieve the Text node from the second child of the first
-
- employee and invoke the "getLastChild()" method. It
-
- should return null.
-
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="employeeNode" type="Node"/>
-<var name="employeeList" type="NodeList"/>
-<var name="secondChildNode" type="Node"/>
-<var name="textNode" type="Node"/>
-<var name="noChildNode" type="Node"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" tagname=""employee"" var="elementList"/>
-<item interface="NodeList" obj="elementList" index="0" var="employeeNode"/>
-<childNodes obj="employeeNode" var="employeeList"/>
-<item interface="NodeList" obj="employeeList" index="1" var="secondChildNode"/>
-<firstChild interface="Node" obj="secondChildNode" var="textNode"/>
-<lastChild interface="Node" obj="textNode" var="noChildNode"/>
-<assertNull actual="noChildNode" id="nodeGetLastChildNullAssert1"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodegetnextsiblingnull.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodegetnextsib...
==============================================================================
--- trunk/dom/test/xml/tests/nodegetnextsiblingnull.xml (original)
+++ trunk/dom/test/xml/tests/nodegetnextsiblingnull.xml (removed)
@@ -1,48 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodegetnextsiblingnull">
-<metadata>
-<title>nodeGetNextSiblingNull</title>
-<creator>NIST</creator>
-<description>
-
- If there is not a node immediately following this node the
-
- "getNextSibling()" method returns null.
-
-
-
- Retrieve the first child of the second employee and
-
- invoke the "getNextSibling()" method. It should
-
- be set to null.
-
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC5..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="employeeNode" type="Node"/>
-<var name="lcNode" type="Node"/>
-<var name="nsNode" type="Node"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" tagname=""employee"" var="elementList"/>
-<item interface="NodeList" obj="elementList" index="1" var="employeeNode"/>
-<lastChild interface="Node" obj="employeeNode" var="lcNode"/>
-<nextSibling interface="Node" obj="lcNode" var="nsNode"/>
-<assertNull actual="nsNode" id="nodeGetNextSiblingNullAssert1"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodegetownerdocument.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodegetownerdo...
==============================================================================
--- trunk/dom/test/xml/tests/nodegetownerdocument.xml (original)
+++ trunk/dom/test/xml/tests/nodegetownerdocument.xml (removed)
@@ -1,50 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001-2003 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodegetownerdocument">
-<metadata>
-<title>nodeGetOwnerDocument</title>
-<creator>NIST</creator>
-<description>
- The "getOwnerDocument()" method returns the Document
- object associated with this node.
-
- Retrieve the second employee and examine Document
- returned by the "getOwnerDocument()" method. Invoke
- the "getDocumentElement()" on the Document which will
- return an Element that is equal to "staff".
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ow..."/>
-<subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251"/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="docNode" type="Node"/>
-<var name="ownerDocument" type="Document"/>
-<var name="docElement" type="Element"/>
-<var name="elementName" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" tagname=""employee"" var="elementList"/>
-<item interface="NodeList" obj="elementList" index="1" var="docNode"/>
-<ownerDocument obj="docNode" var="ownerDocument"/>
-<documentElement obj="ownerDocument" var="docElement"/>
-<nodeName obj="docElement" var="elementName"/>
-<if><contentType type="image/svg+xml"/>
-<assertEquals actual="elementName" expected='"svg"' id="svgTagName" ignoreCase="false"/>
-<else>
-<assertEquals actual="elementName" expected=""staff"" id="nodeGetOwnerDocumentAssert1" ignoreCase="false"/>
-</else>
-</if>
-</test>
Removed: trunk/dom/test/xml/tests/nodegetownerdocumentnull.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodegetownerdo...
==============================================================================
--- trunk/dom/test/xml/tests/nodegetownerdocumentnull.xml (original)
+++ trunk/dom/test/xml/tests/nodegetownerdocumentnull.xml (removed)
@@ -1,31 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001-2004 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodegetownerdocumentnull">
-<metadata>
-<title>nodeGetOwnerDocumentNull</title>
-<creator>NIST</creator>
-<description>
- The "getOwnerDocument()" method returns null if the target
- node itself is a document.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ow..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="ownerDocument" type="Document"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<ownerDocument obj="doc" var="ownerDocument"/>
-<assertNull actual="ownerDocument" id="documentOwnerDocumentNull"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodeinsertbeforerefchildnull.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodeinsertbefo...
==============================================================================
--- trunk/dom/test/xml/tests/nodeinsertbeforerefchildnull.xml (original)
+++ trunk/dom/test/xml/tests/nodeinsertbeforerefchildnull.xml (removed)
@@ -1,52 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodeinsertbeforerefchildnull">
-<metadata>
-<title>nodeInsertBeforeRefChildNull</title>
-<creator>NIST</creator>
-<description>
- If the "refChild" is null then the
- "insertBefore(newChild,refChild)" method inserts the
- node "newChild" at the end of the list of children.
-
- Retrieve the second employee and invoke the
- "insertBefore(newChild,refChild)" method with
- refChild=null. Since "refChild" is null the "newChild"
- should be added to the end of the list. The last item
- in the list is checked after insertion. The last Element
- node of the list should be "newChild".
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-9522..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="employeeNode" type="Node"/>
-<var name="childList" type="NodeList"/>
-<var name="refChild" type="Node" isNull="true"/>
-<var name="newChild" type="Node"/>
-<var name="child" type="Node"/>
-<var name="childName" type="DOMString"/>
-<var name="insertedNode" type="Node"/>
-<load var="doc" href="staff" willBeModified="true"/>
-<getElementsByTagName interface="Document" obj="doc" tagname=""employee"" var="elementList"/>
-<item interface="NodeList" obj="elementList" index="1" var="employeeNode"/>
-<childNodes obj="employeeNode" var="childList"/>
-<createElement obj="doc" tagName=""newChild"" var="newChild"/>
-<insertBefore var="insertedNode" obj="employeeNode" newChild="newChild" refChild="refChild"/>
-<lastChild interface="Node" obj="employeeNode" var="child"/>
-<nodeName obj="child" var="childName"/>
-<assertEquals actual="childName" expected=""newChild"" id="nodeInsertBeforeRefChildNullAssert1" ignoreCase="false"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodelistindexgetlengthofemptylist.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodelistindexg...
==============================================================================
--- trunk/dom/test/xml/tests/nodelistindexgetlengthofemptylist.xml (original)
+++ trunk/dom/test/xml/tests/nodelistindexgetlengthofemptylist.xml (removed)
@@ -1,47 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodelistindexgetlengthofemptylist">
-<metadata>
-<title>nodelistIndexGetLengthOfEmptyList</title>
-<creator>NIST</creator>
-<description>
- The "getLength()" method returns the number of nodes
- in the list.(Test for EMPTY list)
-
- Create a list of all the children of the Text node
- inside the first child of the third employee and
- invoke the "getLength()" method. It should contain
- the value 0.
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<!--length attribute -->
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2035..."/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="employeeNode" type="Node"/>
-<var name="employeeList" type="NodeList"/>
-<var name="childNode" type="Node"/>
-<var name="textNode" type="Node"/>
-<var name="textList" type="NodeList"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" var="elementList" tagname=""employee""/>
-<item interface="NodeList" obj="elementList" var="employeeNode" index="2"/>
-<childNodes obj="employeeNode" var="employeeList"/>
-<item interface="NodeList" obj="employeeList" var="childNode" index="1"/>
-<firstChild interface="Node" obj="childNode" var="textNode"/>
-<childNodes obj="textNode" var="textList"/>
-<assertSize collection="textList" size="0" id="nodelistIndexGetLengthOfEmptyListAssert"/>
-</test>
Removed: trunk/dom/test/xml/tests/nodeparentnode.xml
URL: http://source.netsurf-browser.org/trunk/dom/test/xml/tests/nodeparentnode...
==============================================================================
--- trunk/dom/test/xml/tests/nodeparentnode.xml (original)
+++ trunk/dom/test/xml/tests/nodeparentnode.xml (removed)
@@ -1,47 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2001-2003 World Wide Web Consortium,
-(Massachusetts Institute of Technology, Institut National de
-Recherche en Informatique et en Automatique, Keio University). All
-Rights Reserved. This program is distributed under the W3C's Software
-Intellectual Property License. This program is distributed in the
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
---><!DOCTYPE test SYSTEM "dom1.dtd">
-
-<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodeparentnode">
-<metadata>
-<title>nodeParentNode</title>
-<creator>NIST</creator>
-<description>
- The "getParentNode()" method returns the parent
- of this node.
-
- Retrieve the second employee and invoke the
- "getParentNode()" method on this node. It should
- be set to "staff".
-</description>
-<contributor>Mary Brady</contributor>
-<date qualifier="created">2001-08-17</date>
-<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060..."/>
-<subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=251"/>
-</metadata>
-<var name="doc" type="Document"/>
-<var name="elementList" type="NodeList"/>
-<var name="employeeNode" type="Node"/>
-<var name="parentNode" type="Node"/>
-<var name="parentName" type="DOMString"/>
-<load var="doc" href="staff" willBeModified="false"/>
-<getElementsByTagName interface="Document" obj="doc" tagname=""employee"" var="elementList"/>
-<item interface="NodeList" obj="elementList" index="1" var="employeeNode"/>
-<parentNode interface="Node" obj="employeeNode" var="parentNode"/>
-<nodeName obj="parentNode" var="parentName"/>
-<if><contentType type="image/svg+xml"/>
-<assertEquals actual="parentName" expected='"svg"' id="svgTagName" ignoreCase="false"/>
-<else>
-<assertEquals actual="parentName" expected='"staff"' id="nodeParentNodeAssert1" ignoreCase="false"/>
-</else>
-</if>
-</test>
15 years, 8 months
r3601 rjek - in /trunk/netsurf: Docs/BUILDING-GTK gtk/gtk_window.c
by netsurf@semichrome.net
Author: rjek
Date: Fri Sep 28 22:04:57 2007
New Revision: 3601
URL: http://source.netsurf-browser.org?rev=3601&view=rev
Log:
Add mention of GTK 2.8 dependancy
Modified:
trunk/netsurf/Docs/BUILDING-GTK
trunk/netsurf/gtk/gtk_window.c
Modified: trunk/netsurf/Docs/BUILDING-GTK
URL: http://source.netsurf-browser.org/trunk/netsurf/Docs/BUILDING-GTK?rev=360...
==============================================================================
--- trunk/netsurf/Docs/BUILDING-GTK (original)
+++ trunk/netsurf/Docs/BUILDING-GTK Fri Sep 28 22:04:57 2007
@@ -5,6 +5,10 @@
apt-get install libglade2-dev libcurl3-dev libxml2-dev libmng-dev
apt-get install librsvg2-dev lemon re2c
+
+NetSurf requires at minimum GTK 2.8. Earlier versions will not work. It
+also depends on Cairo for rendering, but you should have this already with
+versions of GTK 2.8 or later.
This will pull in loads of things, like all the GTK dev libraries, the PNG and
JPEG libraries, colour management libraries, zlib, OpenSSL etc that NetSurf
Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/gtk_window.c?rev=3601...
==============================================================================
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Fri Sep 28 22:04:57 2007
@@ -731,7 +731,7 @@
cursortype = GDK_QUESTION_ARROW;
break;
case GUI_POINTER_MENU:
- cursortype = GDK_RIGHTBUTTON;
+ cursortype = GDK_CENTER_PTR;
break;
case GUI_POINTER_PROGRESS:
/* In reality, this needs to be the funky left_ptr_watch
15 years, 8 months
r3600 jmb - /trunk/dom/src/core/document.c
by netsurf@semichrome.net
Author: jmb
Date: Fri Sep 28 00:30:54 2007
New Revision: 3600
URL: http://source.netsurf-browser.org?rev=3600&view=rev
Log:
Implement dom_document_create_element_ns().
Implement dom_document_create_attribute_ns().
These need more sanity checking.
Modified:
trunk/dom/src/core/document.c
Modified: trunk/dom/src/core/document.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/document.c?rev=3600&...
==============================================================================
--- trunk/dom/src/core/document.c (original)
+++ trunk/dom/src/core/document.c Fri Sep 28 00:30:54 2007
@@ -523,11 +523,11 @@
* Create an element from the qualified name and namespace URI
*
* \param doc The document owning the element
- * \param namespace The namespace URI to use
+ * \param namespace The namespace URI to use, or NULL for none
* \param qname The qualified name of the element
* \param result Pointer to location to receive result
* \return DOM_NO_ERR on success,
- * DOM_INVALID_CHARACTER_ERR if ::tag_name is invalid,
+ * DOM_INVALID_CHARACTER_ERR if ::qname is invalid,
* DOM_NAMESPACE_ERR if ::qname is malformed, or it has a
* prefix and ::namespace is NULL, or
* ::qname has a prefix "xml" and
@@ -551,12 +551,62 @@
struct dom_string *namespace, struct dom_string *qname,
struct dom_element **result)
{
- UNUSED(doc);
- UNUSED(namespace);
- UNUSED(qname);
- UNUSED(result);
-
- return DOM_NOT_SUPPORTED_ERR;
+ const uint8_t *qd, *c, *ln;
+ size_t qlen;
+ size_t local_len;
+ size_t prefix_len;
+ struct dom_string *prefix = NULL;
+ struct dom_string *localname;
+ dom_exception err;
+
+ /** \todo ensure document supports XML feature */
+ /** \todo validate qname */
+
+ dom_string_get_data(qname, &qd, &qlen);
+
+ /* Divide QName into prefix/localname pair */
+ for (c = qd; c != qd + qlen; c++) {
+ if (*c == (const uint8_t) ':')
+ break;
+ }
+
+ if (c == qd + qlen) {
+ ln = qd;
+ local_len = qlen;
+ prefix_len = 0;
+ } else {
+ ln = ++c;
+ local_len = qlen - (c - qd);
+ prefix_len = (c - qd - 1 /* ':' */);
+ }
+
+ if (prefix_len > 0) {
+ err = dom_string_create_from_ptr(doc, qd, prefix_len, &prefix);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+ }
+
+ err = dom_string_create_from_ptr(doc, ln, local_len, &localname);
+ if (err != DOM_NO_ERR) {
+ if (prefix != NULL) {
+ dom_string_unref(prefix);
+ }
+ return err;
+ }
+
+ /** \todo validate namespace */
+
+ /* Attempt to create element */
+ err = dom_element_create(doc, localname, namespace, prefix, result);
+
+ /* Tidy up */
+ dom_string_unref(localname);
+ if (prefix != NULL) {
+ dom_string_unref(prefix);
+ }
+
+ return err;
}
/**
@@ -567,7 +617,7 @@
* \param qname The qualified name of the attribute
* \param result Pointer to location to receive result
* \return DOM_NO_ERR on success,
- * DOM_INVALID_CHARACTER_ERR if ::tag_name is invalid,
+ * DOM_INVALID_CHARACTER_ERR if ::qname is invalid,
* DOM_NAMESPACE_ERR if ::qname is malformed, or it has a
* prefix and ::namespace is NULL, or
* ::qname has a prefix "xml" and
@@ -591,12 +641,62 @@
struct dom_string *namespace, struct dom_string *qname,
struct dom_attr **result)
{
- UNUSED(doc);
- UNUSED(namespace);
- UNUSED(qname);
- UNUSED(result);
-
- return DOM_NOT_SUPPORTED_ERR;
+ const uint8_t *qd, *c, *ln;
+ size_t qlen;
+ size_t local_len;
+ size_t prefix_len;
+ struct dom_string *prefix = NULL;
+ struct dom_string *localname;
+ dom_exception err;
+
+ /** \todo ensure document supports XML feature */
+ /** \todo validate qname */
+
+ dom_string_get_data(qname, &qd, &qlen);
+
+ /* Divide QName into prefix/localname pair */
+ for (c = qd; c != qd + qlen; c++) {
+ if (*c == (const uint8_t) ':')
+ break;
+ }
+
+ if (c == qd + qlen) {
+ ln = qd;
+ local_len = qlen;
+ prefix_len = 0;
+ } else {
+ ln = ++c;
+ local_len = qlen - (c - qd);
+ prefix_len = (c - qd - 1 /* ':' */);
+ }
+
+ if (prefix_len > 0) {
+ err = dom_string_create_from_ptr(doc, qd, prefix_len, &prefix);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+ }
+
+ err = dom_string_create_from_ptr(doc, ln, local_len, &localname);
+ if (err != DOM_NO_ERR) {
+ if (prefix != NULL) {
+ dom_string_unref(prefix);
+ }
+ return err;
+ }
+
+ /** \todo validate namespace */
+
+ /* Attempt to create attribute */
+ err = dom_attr_create(doc, localname, namespace, prefix, result);
+
+ /* Tidy up */
+ dom_string_unref(localname);
+ if (prefix != NULL) {
+ dom_string_unref(prefix);
+ }
+
+ return err;
}
/**
15 years, 8 months
r3599 jmb - in /trunk/dom/src/core: attr.c attr.h characterdata.c doc_fragment.c document.c document_type.c element.c element.h entity_ref.c node.c node.h pi.c
by netsurf@semichrome.net
Author: jmb
Date: Fri Sep 28 00:03:13 2007
New Revision: 3599
URL: http://source.netsurf-browser.org?rev=3599&view=rev
Log:
Modify dom_node_initialise() API to permit specification of namespace URI and prefix.
Fix up everything else to cope.
Modified:
trunk/dom/src/core/attr.c
trunk/dom/src/core/attr.h
trunk/dom/src/core/characterdata.c
trunk/dom/src/core/doc_fragment.c
trunk/dom/src/core/document.c
trunk/dom/src/core/document_type.c
trunk/dom/src/core/element.c
trunk/dom/src/core/element.h
trunk/dom/src/core/entity_ref.c
trunk/dom/src/core/node.c
trunk/dom/src/core/node.h
trunk/dom/src/core/pi.c
Modified: trunk/dom/src/core/attr.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/attr.c?rev=3599&r1=3...
==============================================================================
--- trunk/dom/src/core/attr.c (original)
+++ trunk/dom/src/core/attr.c Fri Sep 28 00:03:13 2007
@@ -39,9 +39,11 @@
/**
* Create an attribute node
*
- * \param doc The owning document
- * \param name The name of the node to create
- * \param result Pointer to location to receive created attribute
+ * \param doc The owning document
+ * \param name The (local) name of the node to create
+ * \param namespace The namespace URI of the attribute, or NULL
+ * \param prefix The namespace prefix of the attribute, or NULL
+ * \param result Pointer to location to receive created attribute
* \return DOM_NO_ERR on success,
* DOM_INVALID_CHARACTER_ERR if ::name is invalid,
* DOM_NO_MEM_ERR on memory exhaustion.
@@ -51,7 +53,8 @@
* The returned attribute will already be referenced.
*/
dom_exception dom_attr_create(struct dom_document *doc,
- struct dom_string *name, struct dom_attr **result)
+ struct dom_string *name, struct dom_string *namespace,
+ struct dom_string *prefix, struct dom_attr **result)
{
struct dom_attr *a;
dom_exception err;
@@ -65,7 +68,7 @@
/* Initialise the base class */
err = dom_node_initialise(&a->base, doc, DOM_ATTRIBUTE_NODE,
- name, NULL);
+ name, NULL, namespace, prefix);
if (err != DOM_NO_ERR) {
dom_document_alloc(doc, a, 0);
return err;
Modified: trunk/dom/src/core/attr.h
URL: http://source.netsurf-browser.org/trunk/dom/src/core/attr.h?rev=3599&r1=3...
==============================================================================
--- trunk/dom/src/core/attr.h (original)
+++ trunk/dom/src/core/attr.h Fri Sep 28 00:03:13 2007
@@ -15,7 +15,8 @@
struct dom_string;
dom_exception dom_attr_create(struct dom_document *doc,
- struct dom_string *name, struct dom_attr **result);
+ struct dom_string *name, struct dom_string *namespace,
+ struct dom_string *prefix, struct dom_attr **result);
void dom_attr_destroy(struct dom_document *doc, struct dom_attr *attr);
#endif
Modified: trunk/dom/src/core/characterdata.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/characterdata.c?rev=...
==============================================================================
--- trunk/dom/src/core/characterdata.c (original)
+++ trunk/dom/src/core/characterdata.c Fri Sep 28 00:03:13 2007
@@ -28,7 +28,8 @@
struct dom_document *doc, dom_node_type type,
struct dom_string *name, struct dom_string *value)
{
- return dom_node_initialise(&cdata->base, doc, type, name, value);
+ return dom_node_initialise(&cdata->base, doc, type,
+ name, value, NULL, NULL);
}
/**
Modified: trunk/dom/src/core/doc_fragment.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/doc_fragment.c?rev=3...
==============================================================================
--- trunk/dom/src/core/doc_fragment.c (original)
+++ trunk/dom/src/core/doc_fragment.c Fri Sep 28 00:03:13 2007
@@ -45,7 +45,7 @@
/* And initialise the node */
err = dom_node_initialise(&f->base, doc, DOM_DOCUMENT_FRAGMENT_NODE,
- name, value);
+ name, value, NULL, NULL);
if (err != DOM_NO_ERR) {
dom_document_alloc(doc, f, 0);
return err;
Modified: trunk/dom/src/core/document.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/document.c?rev=3599&...
==============================================================================
--- trunk/dom/src/core/document.c (original)
+++ trunk/dom/src/core/document.c Fri Sep 28 00:03:13 2007
@@ -142,7 +142,7 @@
* rest of the code, as it doesn't need to special case Documents)
*/
err = dom_node_initialise(&d->base, d, DOM_DOCUMENT_NODE,
- NULL, NULL);
+ NULL, NULL, NULL, NULL);
if (err != DOM_NO_ERR) {
/* Clean up interned strings */
for (int i = 0; i <= DOM_NODE_TYPE_COUNT; i++) {
@@ -330,7 +330,7 @@
dom_exception dom_document_create_element(struct dom_document *doc,
struct dom_string *tag_name, struct dom_element **result)
{
- return dom_element_create(doc, tag_name, result);
+ return dom_element_create(doc, tag_name, NULL, NULL, result);
}
/**
@@ -450,7 +450,7 @@
dom_exception dom_document_create_attribute(struct dom_document *doc,
struct dom_string *name, struct dom_attr **result)
{
- return dom_attr_create(doc, name, result);
+ return dom_attr_create(doc, name, NULL, NULL, result);
}
/**
Modified: trunk/dom/src/core/document_type.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/document_type.c?rev=...
==============================================================================
--- trunk/dom/src/core/document_type.c (original)
+++ trunk/dom/src/core/document_type.c Fri Sep 28 00:03:13 2007
@@ -57,7 +57,7 @@
/* Initialise base node */
err = dom_node_initialise(&result->base, NULL, DOM_DOCUMENT_TYPE_NODE,
- qname, NULL);
+ qname, NULL, NULL, NULL);
if (err != DOM_NO_ERR) {
alloc(result, 0, pw);
return err;
Modified: trunk/dom/src/core/element.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/element.c?rev=3599&r...
==============================================================================
--- trunk/dom/src/core/element.c (original)
+++ trunk/dom/src/core/element.c Fri Sep 28 00:03:13 2007
@@ -32,19 +32,23 @@
/**
* Create an element node
*
- * \param doc The owning document
- * \param name The name of the node to create
- * \param result Pointer to location to receive created element
+ * \param doc The owning document
+ * \param name The (local) name of the node to create
+ * \param namespace The namespace URI of the element, or NULL
+ * \param prefix The namespace prefix of the element, or NULL
+ * \param result Pointer to location to receive created element
* \return DOM_NO_ERR on success,
* DOM_INVALID_CHARACTER_ERR if ::name is invalid,
* DOM_NO_MEM_ERR on memory exhaustion.
*
- * ::doc and ::name will have their reference counts increased.
+ * ::doc, ::name, ::namespace and ::prefix will have their
+ * reference counts increased.
*
* The returned element will already be referenced.
*/
dom_exception dom_element_create(struct dom_document *doc,
- struct dom_string *name, struct dom_element **result)
+ struct dom_string *name, struct dom_string *namespace,
+ struct dom_string *prefix, struct dom_element **result)
{
struct dom_element *el;
dom_exception err;
@@ -58,7 +62,7 @@
/* Initialise the base class */
err = dom_node_initialise(&el->base, doc, DOM_ELEMENT_NODE,
- name, NULL);
+ name, NULL, namespace, prefix);
if (err != DOM_NO_ERR) {
dom_document_alloc(doc, el, 0);
return err;
@@ -234,7 +238,7 @@
dom_exception err;
struct dom_attr *attr;
- err = dom_attr_create(e->owner, name, &attr);
+ err = dom_attr_create(e->owner, name, NULL, NULL, &attr);
if (err != DOM_NO_ERR)
return err;
Modified: trunk/dom/src/core/element.h
URL: http://source.netsurf-browser.org/trunk/dom/src/core/element.h?rev=3599&r...
==============================================================================
--- trunk/dom/src/core/element.h (original)
+++ trunk/dom/src/core/element.h Fri Sep 28 00:03:13 2007
@@ -19,7 +19,8 @@
struct dom_string;
dom_exception dom_element_create(struct dom_document *doc,
- struct dom_string *name, struct dom_element **result);
+ struct dom_string *name, struct dom_string *namespace,
+ struct dom_string *prefix, struct dom_element **result);
void dom_element_destroy(struct dom_document *doc,
struct dom_element *element);
Modified: trunk/dom/src/core/entity_ref.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/entity_ref.c?rev=359...
==============================================================================
--- trunk/dom/src/core/entity_ref.c (original)
+++ trunk/dom/src/core/entity_ref.c Fri Sep 28 00:03:13 2007
@@ -46,7 +46,7 @@
/* And initialise the node */
err = dom_node_initialise(&e->base, doc, DOM_ENTITY_REFERENCE_NODE,
- name, value);
+ name, value, NULL, NULL);
if (err != DOM_NO_ERR) {
dom_document_alloc(doc, e, 0);
return err;
Modified: trunk/dom/src/core/node.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/node.c?rev=3599&r1=3...
==============================================================================
--- trunk/dom/src/core/node.c (original)
+++ trunk/dom/src/core/node.c Fri Sep 28 00:03:13 2007
@@ -130,18 +130,22 @@
/**
* Initialise a DOM node
*
- * \param node The node to initialise
- * \param doc The document which owns the node
- * \param type The node type required
- * \param name The node name, or NULL
- * \param value The node value, or NULL
+ * \param node The node to initialise
+ * \param doc The document which owns the node
+ * \param type The node type required
+ * \param name The node (local) name, or NULL
+ * \param value The node value, or NULL
+ * \param namespace Namespace URI to use for node, or NULL
+ * \param prefix Namespace prefix to use for node, or NULL
* \return DOM_NO_ERR on success.
*
- * ::name and ::value will have their reference counts increased.
+ * ::name, ::value, ::namespace, and ::prefix will have their reference
+ * counts increased.
*/
dom_exception dom_node_initialise(struct dom_node *node,
struct dom_document *doc, dom_node_type type,
- struct dom_string *name, struct dom_string *value)
+ struct dom_string *name, struct dom_string *value,
+ struct dom_string *namespace, struct dom_string *prefix)
{
if (name != NULL)
dom_string_ref(name);
@@ -179,9 +183,15 @@
*/
node->owner = doc;
- /** \todo Namespace handling */
- node->namespace = NULL;
- node->prefix = NULL;
+ if (namespace != NULL) {
+ dom_string_ref(namespace);
+ }
+ node->namespace = namespace;
+
+ if (prefix != NULL) {
+ dom_string_ref(prefix);
+ }
+ node->prefix = prefix;
node->user_data = NULL;
Modified: trunk/dom/src/core/node.h
URL: http://source.netsurf-browser.org/trunk/dom/src/core/node.h?rev=3599&r1=3...
==============================================================================
--- trunk/dom/src/core/node.h (original)
+++ trunk/dom/src/core/node.h Fri Sep 28 00:03:13 2007
@@ -57,7 +57,8 @@
dom_exception dom_node_initialise(struct dom_node *node,
struct dom_document *doc, dom_node_type type,
- struct dom_string *name, struct dom_string *value);
+ struct dom_string *name, struct dom_string *value,
+ struct dom_string *namespace, struct dom_string *prefix);
void dom_node_finalise(struct dom_document *doc, struct dom_node *node);
Modified: trunk/dom/src/core/pi.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/pi.c?rev=3599&r1=359...
==============================================================================
--- trunk/dom/src/core/pi.c (original)
+++ trunk/dom/src/core/pi.c Fri Sep 28 00:03:13 2007
@@ -46,7 +46,7 @@
/* And initialise the node */
err = dom_node_initialise(&p->base, doc,
DOM_PROCESSING_INSTRUCTION_NODE,
- name, value);
+ name, value, NULL, NULL);
if (err != DOM_NO_ERR) {
dom_document_alloc(doc, p, 0);
return err;
15 years, 8 months
r3598 jmb - /trunk/netsurf/render/form.c
by netsurf@semichrome.net
Author: jmb
Date: Thu Sep 27 14:57:29 2007
New Revision: 3598
URL: http://source.netsurf-browser.org?rev=3598&view=rev
Log:
Also try charsets without transliteration -- not all iconv() implementations support //TRANSLIT as it's a non-standard extension.
Modified:
trunk/netsurf/render/form.c
Modified: trunk/netsurf/render/form.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/form.c?rev=3598&r1...
==============================================================================
--- trunk/netsurf/render/form.c (original)
+++ trunk/netsurf/render/form.c Thu Sep 27 14:57:29 2007
@@ -707,15 +707,36 @@
err = utf8_to_enc(item, cset, 0, &ret);
if (err == UTF8_CONVERT_BADENC) {
- /* charset not understood, try fallback charset (if any) */
- if (fallback) {
- snprintf(cset, sizeof cset, "%s//TRANSLIT", fallback);
- err = utf8_to_enc(item, cset, 0, &ret);
- }
- if (err == UTF8_CONVERT_BADENC)
- /* that also failed, use 8859-1 */
- err = utf8_to_enc(item, "ISO-8859-1//TRANSLIT",
- 0, &ret);
+ /* charset not understood, try without transliteration */
+ snprintf(cset, sizeof cset, "%s", charset);
+ err = utf8_to_enc(item, cset, 0, &ret);
+
+ if (err == UTF8_CONVERT_BADENC) {
+ /* nope, try fallback charset (if any) */
+ if (fallback) {
+ snprintf(cset, sizeof cset,
+ "%s//TRANSLIT", fallback);
+ err = utf8_to_enc(item, cset, 0, &ret);
+
+ if (err == UTF8_CONVERT_BADENC) {
+ /* and without transliteration */
+ snprintf(cset, sizeof cset,
+ "%s", fallback);
+ err = utf8_to_enc(item, cset, 0, &ret);
+ }
+ }
+
+ if (err == UTF8_CONVERT_BADENC) {
+ /* that also failed, use 8859-1 */
+ err = utf8_to_enc(item, "ISO-8859-1//TRANSLIT",
+ 0, &ret);
+ if (err == UTF8_CONVERT_BADENC) {
+ /* and without transliteration */
+ err = utf8_to_enc(item, "ISO-8859-1",
+ 0, &ret);
+ }
+ }
+ }
}
if (err == UTF8_CONVERT_NOMEM) {
return NULL;
@@ -723,3 +744,4 @@
return ret;
}
+
15 years, 8 months
r3597 jmb - /trunk/dom/src/core/attr.c
by netsurf@semichrome.net
Author: jmb
Date: Thu Sep 27 00:59:26 2007
New Revision: 3597
URL: http://source.netsurf-browser.org?rev=3597&view=rev
Log:
Replace implementation of dom_attr_get_name() with call to dom_node_get_node_name(), which implements the gory details.
Modified:
trunk/dom/src/core/attr.c
Modified: trunk/dom/src/core/attr.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/attr.c?rev=3597&r1=3...
==============================================================================
--- trunk/dom/src/core/attr.c (original)
+++ trunk/dom/src/core/attr.c Thu Sep 27 00:59:26 2007
@@ -10,6 +10,7 @@
#include <dom/core/attr.h>
#include <dom/core/document.h>
+#include <dom/core/node.h>
#include <dom/core/string.h>
#include "core/attr.h"
@@ -139,15 +140,8 @@
dom_exception dom_attr_get_name(struct dom_attr *attr,
struct dom_string **result)
{
- struct dom_node *a = (struct dom_node *) attr;
-
- /** \todo Handle case where a->localname != NULL */
-
- if (a->name != NULL)
- dom_string_ref(a->name);
- *result = a->name;
-
- return DOM_NO_ERR;
+ /* This is the same as nodeName */
+ return dom_node_get_node_name((struct dom_node *) attr, result);
}
/**
15 years, 8 months
r3596 jmb - in /trunk/dom/src/core: element.c node.c node.h nodelist.c
by netsurf@semichrome.net
Author: jmb
Date: Thu Sep 27 00:55:36 2007
New Revision: 3596
URL: http://source.netsurf-browser.org?rev=3596&view=rev
Log:
Begin to cater for XML namespaces.
The localname member of Node has been removed. The name member already caters for this.
Fix NodeList to cope with this and add some pointer vs NULL comparisons for sanity.
Replace implementation of dom_element_get_tag_name() with a simple call to dom_node_get_node_name(), which is where the gory details lie.
Add the QName building stuff to dom_node_get_node_name() (as per previous implementation of dom_element_get_tag_name()).
Implement dom_node_set_prefix().
Ensure dom_node_get_local_name() returns NULL for nodes created by non-namespace-aware methods (nodes must also be Elements or Attributes)
Modified:
trunk/dom/src/core/element.c
trunk/dom/src/core/node.c
trunk/dom/src/core/node.h
trunk/dom/src/core/nodelist.c
Modified: trunk/dom/src/core/element.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/element.c?rev=3596&r...
==============================================================================
--- trunk/dom/src/core/element.c (original)
+++ trunk/dom/src/core/element.c Thu Sep 27 00:55:36 2007
@@ -9,6 +9,7 @@
#include <dom/core/attr.h>
#include <dom/core/element.h>
+#include <dom/core/node.h>
#include <dom/core/string.h>
#include "core/attr.h"
@@ -156,41 +157,8 @@
dom_exception dom_element_get_tag_name(struct dom_element *element,
struct dom_string **name)
{
- struct dom_node *e = (struct dom_node *) element;
- struct dom_string *tag_name;
-
- if (e->localname != NULL) {
- /* Has a localname, so build a qname string */
- size_t local_len = 0, prefix_len = 0;
- const uint8_t *local = NULL, *prefix = NULL;
- dom_exception err;
-
- if (e->prefix != NULL)
- dom_string_get_data(e->prefix, &prefix, &prefix_len);
-
- dom_string_get_data(e->localname, &local, &local_len);
-
- uint8_t qname[prefix_len + 1 /* : */ + local_len + 1 /* \0 */];
-
- sprintf((char *) qname, "%s:%s",
- prefix ? (const char *) prefix : "",
- (const char *) local);
-
- err = dom_string_create_from_ptr(e->owner, qname,
- prefix_len + 1 + local_len, &tag_name);
- if (err != DOM_NO_ERR)
- return err;
-
- /* tag_name is referenced for us */
- } else {
- tag_name = e->name;
-
- dom_string_ref(tag_name);
- }
-
- *name = tag_name;
-
- return DOM_NO_ERR;
+ /* This is the same as nodeName */
+ return dom_node_get_node_name((struct dom_node *) element, name);
}
/**
Modified: trunk/dom/src/core/node.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/node.c?rev=3596&r1=3...
==============================================================================
--- trunk/dom/src/core/node.c (original)
+++ trunk/dom/src/core/node.c Thu Sep 27 00:55:36 2007
@@ -7,6 +7,7 @@
#include <assert.h>
#include <stdbool.h>
+#include <stdio.h>
#include <dom/core/attr.h>
#include <dom/core/document.h>
@@ -181,7 +182,6 @@
/** \todo Namespace handling */
node->namespace = NULL;
node->prefix = NULL;
- node->localname = NULL;
node->user_data = NULL;
@@ -215,9 +215,6 @@
dom_document_alloc(doc, u, 0);
}
-
- if (node->localname != NULL)
- dom_string_unref(node->localname);
if (node->prefix != NULL)
dom_string_unref(node->prefix);
@@ -286,10 +283,45 @@
dom_exception dom_node_get_node_name(struct dom_node *node,
struct dom_string **result)
{
- if (node->name != NULL)
+ struct dom_string *node_name;
+
+ assert(node->name != NULL);
+
+ /* If this node was created using a namespace-aware method and
+ * has a defined prefix, then nodeName is a QName comprised
+ * of prefix:name. */
+ if ((node->type == DOM_ELEMENT_NODE ||
+ node->type == DOM_ATTRIBUTE_NODE) &&
+ node->prefix != NULL) {
+ const uint8_t *prefix, *localname;
+ size_t prefix_len, local_len;
+ dom_exception err;
+
+ dom_string_get_data(node->prefix, &prefix, &prefix_len);
+
+ dom_string_get_data(node->name, &localname, &local_len);
+
+ uint8_t qname[prefix_len + 1 /* : */ + local_len + 1 /* \0 */];
+
+ sprintf((char *) qname, "%.*s:%.*s",
+ prefix_len, (const char *) prefix,
+ local_len, (const char *) localname);
+
+ /* Create the string */
+ err = dom_string_create_from_ptr(node->owner, qname,
+ prefix_len + 1 + local_len, &node_name);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ /* QName is referenced on exit from constructor */
+ } else {
dom_string_ref(node->name);
- *result = node->name;
+ node_name = node->name;
+ }
+
+ *result = node_name;
return DOM_NO_ERR;
}
@@ -1064,10 +1096,45 @@
dom_exception dom_node_set_prefix(struct dom_node *node,
struct dom_string *prefix)
{
- UNUSED(node);
- UNUSED(prefix);
-
- return DOM_NOT_SUPPORTED_ERR;
+ /* Only Element and Attribute nodes created using
+ * namespace-aware methods may have a prefix */
+ if ((node->type != DOM_ELEMENT_NODE &&
+ node->type != DOM_ATTRIBUTE_NODE) ||
+ node->namespace == NULL) {
+ return DOM_NO_ERR;
+ }
+
+ /** \todo validate prefix */
+
+ /* Ensure node is writable */
+ if (_dom_node_readonly(node)) {
+ return DOM_NO_MODIFICATION_ALLOWED_ERR;
+ }
+
+ /* No longer want existing prefix */
+ if (node->prefix != NULL) {
+ dom_string_unref(node->prefix);
+ }
+
+ /* Set the prefix */
+ if (prefix != NULL) {
+ const uint8_t *data;
+ size_t len;
+
+ dom_string_get_data(prefix, &data, &len);
+
+ /* Empty string is treated as NULL */
+ if (len == 0) {
+ node->prefix = NULL;
+ } else {
+ dom_string_ref(prefix);
+ node->prefix = prefix;
+ }
+ } else {
+ node->prefix = NULL;
+ }
+
+ return DOM_NO_ERR;
}
/**
@@ -1084,11 +1151,24 @@
dom_exception dom_node_get_local_name(struct dom_node *node,
struct dom_string **result)
{
- /* If there is a local name, increase its reference count */
- if (node->localname != NULL)
- dom_string_ref(node->localname);
-
- *result = node->localname;
+ /* Only Element and Attribute nodes may have a local name */
+ if (node->type != DOM_ELEMENT_NODE &&
+ node->type != DOM_ATTRIBUTE_NODE) {
+ *result = NULL;
+ return DOM_NO_ERR;
+ }
+
+ /* Node must have been created using a namespace-aware method */
+ if (node->namespace == NULL) {
+ *result = NULL;
+ return DOM_NO_ERR;
+ }
+
+ /* The node may have a local name, reference it if so */
+ if (node->name != NULL) {
+ dom_string_ref(node->name);
+ }
+ *result = node->name;
return DOM_NO_ERR;
}
Modified: trunk/dom/src/core/node.h
URL: http://source.netsurf-browser.org/trunk/dom/src/core/node.h?rev=3596&r1=3...
==============================================================================
--- trunk/dom/src/core/node.h (original)
+++ trunk/dom/src/core/node.h Thu Sep 27 00:55:36 2007
@@ -32,7 +32,9 @@
* DOM nodes are reference counted
*/
struct dom_node {
- struct dom_string *name; /**< Node name */
+ struct dom_string *name; /**< Node name (this is the local part
+ * of a QName in the cases where a
+ * namespace exists) */
struct dom_string *value; /**< Node value */
dom_node_type type; /**< Node type */
struct dom_node *parent; /**< Parent node */
@@ -45,7 +47,6 @@
struct dom_string *namespace; /**< Namespace URI */
struct dom_string *prefix; /**< Namespace prefix */
- struct dom_string *localname; /**< Local part of qualified name */
struct dom_user_data *user_data; /**< User data list */
Modified: trunk/dom/src/core/nodelist.c
URL: http://source.netsurf-browser.org/trunk/dom/src/core/nodelist.c?rev=3596&...
==============================================================================
--- trunk/dom/src/core/nodelist.c (original)
+++ trunk/dom/src/core/nodelist.c Thu Sep 27 00:55:36 2007
@@ -174,13 +174,17 @@
if (list->type == DOM_NODELIST_CHILDREN) {
len++;
} else if (list->type == DOM_NODELIST_BY_NAME) {
- if (dom_string_cmp(cur->name, list->data.name) == 0) {
+ if (cur->name != NULL &&
+ dom_string_cmp(cur->name,
+ list->data.name) == 0) {
len++;
}
} else {
- if (dom_string_cmp(cur->namespace,
+ if (cur->namespace != NULL &&
+ dom_string_cmp(cur->namespace,
list->data.ns.namespace) == 0 &&
- dom_string_cmp(cur->localname,
+ cur->name != NULL &&
+ dom_string_cmp(cur->name,
list->data.ns.localname) == 0) {
len++;
}
@@ -245,13 +249,17 @@
if (list->type == DOM_NODELIST_CHILDREN) {
count++;
} else if (list->type == DOM_NODELIST_BY_NAME) {
- if (dom_string_cmp(cur->name, list->data.name) == 0) {
+ if (cur->name != NULL &&
+ dom_string_cmp(cur->name,
+ list->data.name) == 0) {
count++;
}
} else {
- if (dom_string_cmp(cur->namespace,
+ if (cur->namespace != NULL &&
+ dom_string_cmp(cur->namespace,
list->data.ns.namespace) == 0 &&
- dom_string_cmp(cur->localname,
+ cur->name != NULL &&
+ dom_string_cmp(cur->name,
list->data.ns.localname) == 0) {
count++;
}
15 years, 8 months
r3595 jshaw - /trunk/dom/docs/TestSuite
by netsurf@semichrome.net
Author: jshaw
Date: Wed Sep 26 21:56:54 2007
New Revision: 3595
URL: http://source.netsurf-browser.org?rev=3595&view=rev
Log:
Update test suite docs
Modified:
trunk/dom/docs/TestSuite
Modified: trunk/dom/docs/TestSuite
URL: http://source.netsurf-browser.org/trunk/dom/docs/TestSuite?rev=3595&r1=35...
==============================================================================
--- trunk/dom/docs/TestSuite (original)
+++ trunk/dom/docs/TestSuite Wed Sep 26 21:56:54 2007
@@ -1,29 +1,42 @@
Assertions
-------------------------------------------------------------------------------
fail
+ assert(false);
+
assertTrue
assertFalse
+ @actual is a variable name, of type boolean (or castable to boolean?)
+ or evaluate nested condition to boolean
+
assertNull
assertNotNull
+ @actual is a variable name
+ or evaluate nested condition
+
assertEquals
- Test actual is equal to expected.
+assertNotEquals
+ Test actual is equal (or not equal) to expected.
<assertEquals actual="result" expected="expectedResult" ignoreCase="true/false/auto" context="attribute/element" bitmask="..."/>
For Collections (or Lists), need to check neither list is null, then that both lists have the same size, then that all their elements are equal.
- ignoreCase="auto"
+ @ignoreCase="auto"
if contentType == "text/html":
if context == "attribute", do case insensitive test
if context == "element", do case sensitive test against expected.toUpperCase()
- context attribute used in combination with ignoreCase="auto"
- bitmask attribute used in DOM Level 3 only. Tests: (actual & bitmask) equals (expectedResult & bitmask) where bitmask is an int
-
-assertNotEquals
+ @context used in combination with ignoreCase="auto"
+ @bitmask used in DOM Level 3 only. Tests: (actual & bitmask) equals (expectedResult & bitmask) where bitmask is an int
+
+ Alternatively, can include nested statement (presumably as a substitute to @actual), but can't see this is used anywhere.
assertSame
Tests two objects for identity.
- If not identical, test if either are null, or either are not Nodes. If so, delegate to assertEquals()
+ If not, call assertEquals()
+ Don't really understand the point of this assert
+
+(note about assertNull, assertNotNull, assertEquals, assertNotEquals, assertSame)
+ Alternatively, can include nested statement (presumably as a substitute to @actual), but can't see this is used anywhere.
assertInstanceOf
Used in [hc_]namednodemapreturnattrnode.xml
@@ -35,8 +48,23 @@
<assertSize size="2" collection="notifications"/>
assertEventCount
+ (not used)
+
assertURIEquals
+ Compare pieces of the URI in @actual
+
+ @actual
+ @scheme
+ @path
+ @host
+ @file
+ @name
+ @query
+ @fragment
+ @isAbsolute boolean
+
assertImplementationException
+ DOM Level 2 Events dispatchEvent01.xml
assertDOMException
Tests that a DOMException is thrown with a specified code. Try/catching not nested.
@@ -66,14 +94,25 @@
equals
notEquals
less
+
lessOrEquals
+ (not used)
+
greater
+
greaterOrEquals
+ (not used)
+
isNull
+ (not used)
+
notNull
and
or
+
xor
+ (not used)
+
not
instanceOf
@@ -81,11 +120,26 @@
isTrue
isFalse
+
hasSize
+ (not used)
+
contentType
+
contains
+ DOM Level 3 Core and LS only
+
hasFeature
+ calls DOMImplementation.hasFeature()
+
+ @feature quoted string e.g. "XML"
+ @version quoted string e.g. "1.0"
+ @value boolean
+ @var variable to assign the result to
+ @obj name of var holding the DOMImplementation
+
implementationAttribute
+ pass param to the test suite's DOMTestDocumentBuilderFactory (e.g. validating)
Statements
@@ -110,27 +164,22 @@
mult
divide
load
-implementation
-hasFeature
-
-implementationAttribute
- Set DocumentBuilder attributes (such as validating)
if
while
try
-Fail if reach the end of the try without throwing an exception specified in <catch>
-<try>
- ...
- <catch>
- <DOMException code="..."/>
- <DOMException code="..."/>
+ Fail if reach the end of the try without throwing an exception specified in <catch>
+ <try>
...
- </catch>
-</try>
-
-No nesting in test cases, but sometimes more than one instance in a single test.
+ <catch>
+ <DOMException code="..."/>
+ <DOMException code="..."/>
+ ...
+ </catch>
+ </try>
+
+ No nesting in test cases, but sometimes more than one instance in a single test.
for-each
<for-each collection="..." member="...">
@@ -171,6 +220,7 @@
operation
key
dst
+ DOM Level 3 Core only
Datatypes
-------------------------------------------------------------------------------
15 years, 8 months