Bugs in XForms 1.1 Test Suite Section "10. XForms Actions"

Dear Group,

when the Firefox Plugin Implementation Report [1] was published I  
started to play around with the Mozilla XForms Plugin [2]. I  
encountered some errors in the Actions Section of the XForms 1.1 Test  
Suite [3].

The following applies to Firefox 3.0.5 with Mozilla XForms Plugin  
0.8.6ff3 under Mac OS X (10.5.6).

* Test Case 10.3.d

This is not buggy, but the Implementation Report marks it as Failed  
for FF3. However, it works completely fine for me. Please double-check.

* Test Case 10.17.d

There is an logical error in this test case. It states "When you  
activate a Delete Row trigger the trigger and the output control on  
that row must disappear from the page and the focus must move to the  
Insert Row trigger." However, this is not true for all of the rows but  
only for the last one.

The crucial part is the conditional setindex action:

     <xforms:setfocus control="InsertControl" if="last()=1"/>

The if attribute evaluates to true() if and only if the nodeset has 1  
element. So the index is set to the Insert Row trigger when you delete  
the last row. Which is exactly what happens with the Mozilla Plugin.

Again, this test case is mistakenly marked as Failed for FF3. To fix  
this test case it would be enough to make clear that the focus is only  
set to the Insert Row trigger after the last row has been deleted. In  
contrast, setting focus to the Insert Row trigger when deleting a row  
from the nodeset having a size greater than 1 would clearly be an error.

* Test Case 10.18.a

This test case contains the following insert action:

     <xforms:insert ev:event="xforms-ready" nodeset="number" at="1"  
position="after" while="count('number') &lt; 11)"/>

The while expression is broken in multiple ways:
1. It is not syntactically correct (trailing ')').
2. The argument to the count function should be the /nodeset/ called  
number instead of the string "number".
3. In order to create a nodeset of size 10, the exit condition must be  
"&lt; 10".

So the fixed action should read:

     <xforms:insert ev:event="xforms-ready" nodeset="number" at="1"  
position="after" while="count(number) &lt; 10"/>

With the while expression being fixed FF3 passes the test.

* Test Cases 10.18.b and 10.18.c

The same applies as for 10.18.a.

* Test Case 10.18.d

The same applies as for 10.18.a. Additionally, there is a broken if  
expression, which repeats the wrong count() function call and a wrong  
exit condition. Consequently, it should read

     if="count(number) &lt; 5"

* Test Case 10.18.e

This test case has many wrong XPath expressions in its actions. There  
are several attributes where expressions start with "/some/nodes".  
Given the test instance these expressions evaluate to the empty  
nodeset. They must be rewritten either as "/root/some/nodes" or as  
"instance('temps')/some/nodes". Also, the counter must be initially  
set to 0 to satisfy the condition expressed in the test case. A fixed  
action block would read:

     <xforms:action ev:event="DOMActivate">
         <xforms:setvalue ref="instance('temps')/counter" value="0"/>
         <xforms:setvalue ref="instance('temps')/accumulator"  
value="0"/>
         <xforms:action while="instance('temps')/counter &lt;=  
count(instance('temps')/some/nodes)">
             <xforms:setvalue ref="instance('temps')/accumulator"
                 value=". + instance('temps')/some/ 
nodes[instance('temps')/counter]"
                 if="boolean-from-string(instance('temps')/some/ 
nodes[instance('temps')/counter]/@selected)"/>
             <xforms:setvalue ref="instance('temps')/counter" value=".  
+ 1"/>
         </xforms:action>
     </xforms:action>

Furthermore there are no "selected" attributes on the elements of  
nodeset "instance('temps')/some/nodes". In order to provide a valid  
test case the instance should read:

     <xforms:instance id="temps">
         <root>
             <counter/>
             <accumulator/>
             <some>
                 <nodes selected="true">1</nodes>
                 <nodes selected="true">2</nodes>
                 <nodes selected="true">3</nodes>
             </some>
         </root>
     </xforms:instance>

FF3 still doesn't pass the now valid test case. It needs an extra  
number() conversion for the counter to work as a positional predicate:

     <xforms:action ev:event="DOMActivate">
         <xforms:setvalue ref="instance('temps')/counter" value="0"/>
         <xforms:setvalue ref="instance('temps')/accumulator"  
value="0"/>
         <xforms:action while="instance('temps')/counter &lt;=  
count(instance('temps')/some/nodes)">
             <xforms:setvalue ref="instance('temps')/accumulator"
                 value=". + instance('temps')/some/ 
nodes[number(instance('temps')/counter)]"
                 if="boolean-from-string(instance('temps')/some/ 
nodes[number(instance('temps')/counter)]/@selected)"/>
             <xforms:setvalue ref="instance('temps')/counter" value=".  
+ 1"/>
         </xforms:action>
     </xforms:action>

This is clearly a FF3 bug, but it is not related to this test case.

@Keith: Could you please fix the test cases mentioned? The  
implementation reports would have to be regenerated as well. I wonder  
if any implementation passed those...

Regards,
Uli.

[1] http://www.w3.org/MarkUp/Forms/2008/XForms11ImplReports/FFplugins/ResultsTable.html
[2] https://addons.mozilla.org/firefox/addons/versions/824
[3] http://www.w3.org/MarkUp/Forms/Test/XForms1.1/Edition1/driverPages/html/
--
Ulrich Nicolas Lissé

Received on Wednesday, 7 January 2009 21:34:39 UTC