Select1 selection gives invalid state

RESOLVED WONTFIX

Status

Core Graveyard
XForms
RESOLVED WONTFIX
11 years ago
a year ago

People

(Reporter: Josef Spillner, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

2.38 KB, application/xhtml+xml
Details
(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.0.5) Gecko/20060619 Firefox/1.5.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.0.5) Gecko/20060619 Firefox/1.5.0.5

In the example file, both an input and a select1 are bound to the same (integer) variable. Even though the select1 only contains numbers, selecting any of them moves the state to invalid (as can be seen by red colour due to some CSS). However, entering the same numbers into the input field works ok (and obviously, entering letters there leads to invalid state).

Reproducible: Always




Happens with all recent xforms extensions.
I was smart enough to test this on Minefield too, same result.
Assignee: nobody → xforms
Component: General → XForms
Product: Firefox → Core
QA Contact: general → spride
Summary: [xforms] Select1 selection gives invalid state → Select1 selection gives invalid state
Version: unspecified → Trunk

Comment 1

11 years ago
Can you attach testcase?

Comment 2

11 years ago
sor(In reply to comment #1)
> Can you attach testcase?
> 

Sorry, I see.

Comment 3

11 years ago
XForms specs says (http://www.w3.org/TR/xforms/slice8.html#ui-selectOne):

Note that the datatype bound to this form control may include a non-enumerated value space, e.g., xsd:string, or a union of a enumeration and a non-enumerated datatype (called an open enumeration).
(Reporter)

Comment 4

11 years ago
But in my case, it doesn't have an "open enumeration" (on purpose).

On a related note (separate bug report?) select1 in xforms even allows selection="open" with "closed enumerations" as my one.

Comment 5

11 years ago
The issue here is that we are counting the carriage returns and whitespaces as part of the values.  According to the Schema spec, we shouldn't do that for numerical and string types.  cr and lf should be changed to spaces and then the leading and trailing spaces should be dropped.  So we shouldn't be marking the controls invalid.  HOWEVER, it isn't clear that xforms should modify the values so that they DON'T have the cr's and lf's so your select1 could still show as out-of-range if you just put '10' in the input.

If you want to work around this in your form, you should change:

<xf:value>
1
</xf:value>

to

<xf:value>1</xf:value>

Comment 6

11 years ago
Created attachment 229275 [details]
testcase 2

should selecting an item from this select1 cause everything to be invalid or not?

Comment 7

11 years ago
(In reply to comment #6)
> Created an attachment (id=229275) [edit]
> testcase 2
> 
> should selecting an item from this select1 cause everything to be invalid or
> not?
> 

I guess everything should have one and the same behaviour like select1 since instance node contains invalid data in accordance with type.
RIP xforms
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.