summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRupinder Singh Khokhar <rsk1coder99@gmail.com>2014-06-09 16:50:49 (GMT)
committer Rupinder Singh Khokhar <rsk1coder99@gmail.com>2014-06-21 12:07:15 (GMT)
commit0800f7b56d496f27283da3e76ae100e88cb0c6e3 (patch)
treed3c7ede482c47559d783c8b687d7d41079e787a8
parent3129c7484a84589794e437e071aa09888e7cbd4a (diff)
downloadlibdom-0800f7b56d496f27283da3e76ae100e88cb0c6e3.tar.gz
libdom-0800f7b56d496f27283da3e76ae100e88cb0c6e3.tar.bz2
[HTMLCollection && DOMTSHandler && dtd interface] fixes
-rw-r--r--src/html/html_options_collection.c4
-rw-r--r--test/DOMTSHandler.pm3
-rw-r--r--test/dom1-interfaces.xml47
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection01.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection01.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection02.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection02.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection03.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection03.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection04.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection04.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection05.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection05.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection06.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection06.xml.kfail)0
-rw-r--r--test/testcases/tests/level2/html/HTMLOptionsCollection07.xml (renamed from test/testcases/tests/level2/html/HTMLOptionsCollection07.xml.kfail)0
10 files changed, 51 insertions, 3 deletions
diff --git a/src/html/html_options_collection.c b/src/html/html_options_collection.c
index 85001ad..3e06915 100644
--- a/src/html/html_options_collection.c
+++ b/src/html/html_options_collection.c
@@ -190,13 +190,13 @@ dom_exception dom_html_options_collection_named_item(dom_html_options_collection
/* No children and siblings */
struct dom_node_internal *parent = n->parent;
- while (parent != col->base.root &&
+ while (n != col->base.root &&
n == parent->last_child) {
n = parent;
parent = parent->parent;
}
- if (parent == col->base.root)
+ if (n == col->base.root)
n = NULL;
else
n = n->next;
diff --git a/test/DOMTSHandler.pm b/test/DOMTSHandler.pm
index fa71365..fec9bcb 100644
--- a/test/DOMTSHandler.pm
+++ b/test/DOMTSHandler.pm
@@ -48,6 +48,7 @@ our %special_type = (
HTMLTableSectionElement => "dom_html_table_section_element *",
HTMLTableElement => "dom_html_table_element *",
HTMLTableRowElement => "dom_html_table_row_element *",
+ HTMLOptionsCollection => "dom_html_options_collection *",
);
our %special_prefix = (
DOMString => "dom_string",
@@ -1491,7 +1492,7 @@ sub to_get_attribute_cast {
sub get_get_attribute_prefix {
my $type = shift;
my $interface = shift;
- if ((($interface eq "HTMLCollection") or ($interface eq "HTMLSelectElement")) and ($type eq "length")) {
+ if ($type eq "length") {
$prefix = "uint32_t ";
} elsif (exists $special_prefix{$type}) {
$prefix = $special_prefix{$type};
diff --git a/test/dom1-interfaces.xml b/test/dom1-interfaces.xml
index fc88b80..240f2b9 100644
--- a/test/dom1-interfaces.xml
+++ b/test/dom1-interfaces.xml
@@ -3674,4 +3674,51 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details.
</attribute>
</interface>
+<interface name="HTMLOptionsCollection" id="ID-75708506">
+<descr>
+<p>An<code>HTMLOptionsCollection</code>is a list of nodes. An individual node may be accessed by either ordinal index or the node's<code>name</code>or<code>id</code>attributes.<emph>Note:</emph>Collections in the HTML DOM are assumed to be<emph>live</emph>meaning that they are automatically updated when the underlying document is changed.</p>
+</descr>
+<attribute readonly="yes" type="unsigned long" name="length" id="ID-40057551">
+<descr>
+<p>This attribute specifies the length or<emph>size</emph>of the list.</p>
+</descr>
+</attribute>
+<method name="item" id="ID-33262535">
+<descr>
+<p>This method retrieves a node specified by ordinal index. Nodes are numbered in tree order (depth-first traversal order).</p>
+</descr>
+<parameters>
+<param id="ID-3496656" name="index" type="unsigned long" attr="in">
+<descr>
+<p>The index of the node to be fetched. The index origin is 0.</p>
+</descr>
+</param>
+</parameters>
+<returns type="Node">
+<descr>
+<p>The<code>Node</code>at the corresponding position upon success. A value of<code>null</code>is returned if the index is out of range.</p>
+</descr>
+</returns>
+<raises/>
+</method>
+<method name="namedItem" id="ID-21069976">
+<descr>
+<p>This method retrieves a<code>Node</code>using a name. It first searches for a<code>Node</code>with a matching<code>id</code>attribute. If it doesn't find one, it then searches for a<code>Node</code>with a matching<code>name</code>attribute, but only on those elements that are allowed a name attribute.</p>
+</descr>
+<parameters>
+<param id="ID-76682631" name="name" type="DOMString" attr="in">
+<descr>
+<p>The name of the<code>Node</code>to be fetched.</p>
+</descr>
+</param>
+</parameters>
+<returns type="Node">
+<descr>
+<p>The<code>Node</code>with a<code>name</code>or<code>id</code>attribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returns<code>null</code>.</p>
+</descr>
+</returns>
+<raises/>
+</method>
+</interface>
+
</library>
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection01.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection01.xml
index 80df1a3..80df1a3 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection01.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection01.xml
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection02.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection02.xml
index 44b5431..44b5431 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection02.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection02.xml
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection03.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection03.xml
index 280b2bf..280b2bf 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection03.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection03.xml
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection04.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection04.xml
index 83e59d3..83e59d3 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection04.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection04.xml
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection05.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection05.xml
index d2f44d7..d2f44d7 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection05.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection05.xml
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection06.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection06.xml
index fbde429..fbde429 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection06.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection06.xml
diff --git a/test/testcases/tests/level2/html/HTMLOptionsCollection07.xml.kfail b/test/testcases/tests/level2/html/HTMLOptionsCollection07.xml
index a2731e5..a2731e5 100644
--- a/test/testcases/tests/level2/html/HTMLOptionsCollection07.xml.kfail
+++ b/test/testcases/tests/level2/html/HTMLOptionsCollection07.xml