summaryrefslogtreecommitdiff
path: root/src/core/node.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-08-30 13:06:19 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-08-30 13:06:19 +0000
commitb657c277f517f4ab0a4da21e4f8c4cb6f8f53013 (patch)
tree4ce25caee01c0a2a2ebbe052999b5eb8a2fbe2e3 /src/core/node.c
parent229af12d7ab2c071a6888eb8ffc49bb0bbeb9ddd (diff)
downloadlibdom-b657c277f517f4ab0a4da21e4f8c4cb6f8f53013.tar.gz
libdom-b657c277f517f4ab0a4da21e4f8c4cb6f8f53013.tar.bz2
Merge branches/struggleyb/libdom-html to trunk.
A few additional fixes to reduce the number of regressions to single figures. svn path=/trunk/dom/; revision=10724
Diffstat (limited to 'src/core/node.c')
-rw-r--r--src/core/node.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/core/node.c b/src/core/node.c
index 5f35f61..ef2baf2 100644
--- a/src/core/node.c
+++ b/src/core/node.c
@@ -1491,10 +1491,10 @@ dom_exception _dom_node_has_attributes(dom_node_internal *node, bool *result)
dom_exception _dom_node_get_base(dom_node_internal *node,
struct dom_string **result)
{
- UNUSED(node);
- UNUSED(result);
+ struct dom_document *doc = node->owner;
+ assert(doc != NULL);
- return DOM_NOT_SUPPORTED_ERR;
+ return dom_document_get_base(doc, result);
}
/**
@@ -2072,6 +2072,10 @@ bool _dom_node_readonly(const dom_node_internal *node)
if (n->type == DOM_DOCUMENT_TYPE_NODE ||
n->type == DOM_NOTATION_NODE)
return true;
+
+ /* Some Attr node are readonly */
+ if (n->type == DOM_ATTRIBUTE_NODE)
+ return _dom_attr_readonly((const dom_attr *) n);
/* Entity ns and their descendants are read only
* EntityReference ns and their descendants are read only */
@@ -2363,6 +2367,25 @@ void _dom_node_unref_intern_string(dom_node_internal *node,
}
/**
+ * Create a lwc_string using the node's owner's lwc_context
+ *
+ * \param node The node object
+ * \param data The string data
+ * \param len The length of the string data
+ * \param str The returned lwc_string
+ * \return DOM_NO_ERR on success, appropirate dom_exception on failure.
+ */
+dom_exception _dom_node_create_lwcstring(dom_node_internal *node,
+ const uint8_t *data, size_t len, struct lwc_string_s **str)
+{
+ dom_document *doc = dom_node_get_owner(node);
+
+ assert(doc != NULL);
+
+ return _dom_document_create_lwcstring(doc, data, len, str);
+}
+
+/**
* Try to destroy this node.
*
* \param node The node to destroy