Closed Bug 280966 Opened 20 years ago Closed 19 years ago

submit get terminated with extra separator

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: doronr)

References

()

Details

Attachments

(2 files, 2 obsolete files)

Reported by beta1 tester:

"It looks like in submission method="get" that the separator character is being
used as a terminator.
This is an erratum that should already have been issued.  The goal is HTML 4
compatibility."

I didn't find it in the erratum, but it makes sense.

Using the testcase noted in the URL field, the actual result will look like:
http://xformstest.org/cgi-bin/echo.sh?a=1&b=2&

Using Novell's pluin, the result looks like:
http://xformstest.org/cgi-bin/echo.sh?a=1&b=2
Summary: submit get terminates with extra seperator → submit get terminated with extra separator
Quick fix.  Seems easier to just do this rathar than modify the submission
recursion code.
Looks good but it needs to trim separator, instead ofa constant '&', because by
default separator is ';' but can be set to '&'.  See the enumeration of
submission/@separator in the Schema.  (While you're there you might want to
verify that it doesn't add a '?' if one is already there.)
so what should happen if the separator is "eeeeek" - should it fail or default
to ";"?
If the separator is not ';' or '&', it is an authoring error, as the document is
invalid by the XForms Schema (which is a normative part of the definition of
XForms).  The processor should act as if the error were caught by an XML Schema
validation of the page, even if it's not using a validating XML parser.

As an author, I would expect to see the XML error page with the pretty colored
arrows pointing to the submission attribute value.  If you do that, users will
never see the error, as the page simply won't load for the authors.  

It's the same as if someone had put anything else illegal in the namespace, such
as <xforms:fnord/> .

Novell's plugin for IE does indeed follow this hidden errata, but it does allow
any type of separator.
Here are normative references for the limitation to ; and &:
[1] http://www.w3.org/TR/xforms/index-all.html#structure-abstract 
From the content model for the XForms Core Module:
   separator (';' | '&')

[2] http://www.w3.org/TR/xforms/index-all.html#schema
From the Schema:
<xsd:attribute name="separator" use="optional" default=";">
 <xsd:simpleType>
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value=";"/>
   <xsd:enumeration value="&"/>
  </xsd:restriction>
 </xsd:simpleType>
</xsd:attribute>
I am aware Novell is wrong :)

This patch will convert invalid separators to ';', since we don't have a way to
say "invalid xforms, show a error page" yet.  Once that works, we can switch
this to not care abot invalid ones.
Assignee: aaronr → doronr
Attachment #173663 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attached patch newer patchSplinter Review
This patch does:
  - strip the separator from the end
  - if the separator is not ; or &, we abort submission and report the error
(into the JS console for now).
Attachment #173773 - Attachment is obsolete: true
Attachment #189101 - Flags: review?(aaronr)
Comment on attachment 189101 [details] [diff] [review]
newer patch

make sure when you check in that you don't have the alignment problems in
SerializeData that this patch seems to show.

Also this patch is missing the .properties file.

with those, r=me
Attachment #189101 - Flags: review?(aaronr) → review+
(In reply to comment #10)
>   - if the separator is not ; or &, we abort submission and report the error
> (into the JS console for now).
Great!  

One possible twiddle: if you can swing it, reporting this (and similar
validation errors) in the various elements' OnCreated methods might be better,
if possible, because it will show up as an authoring error (which it is) rather
than a runtime error. I can understand if Mozilla policy prohibits this, but
that would make it act as if the page were read with a validating schema parser,
which would catch it when reading the page.  

DOM access would then be an open question though (what happens if someone gets
the XHTML page's DOM and changes @submission?) so I can understand holding off
on it for that point as well.


(In reply to comment #12)
> (In reply to comment #10)
> >   - if the separator is not ; or &, we abort submission and report the error
> > (into the JS console for now).
> Great!  
> 
> One possible twiddle: if you can swing it, reporting this (and similar
> validation errors) in the various elements' OnCreated methods might be better,
> if possible, because it will show up as an authoring error (which it is) rather
> than a runtime error. I can understand if Mozilla policy prohibits this, but
> that would make it act as if the page were read with a validating schema parser,
> which would catch it when reading the page.  
> 
> DOM access would then be an open question though (what happens if someone gets
> the XHTML page's DOM and changes @submission?) so I can understand holding off
> on it for that point as well.
> 
> 
> 

Should an xforms event be thrown when submission is aborted?
Attachment #189186 - Flags: review?(smaug)
Attachment #189186 - Flags: review?(smaug) → review+
> Should an xforms event be thrown when submission is aborted?

xforms-submit-error would seem to fit, but it was designed for the server to
report errors back, for not reporting authoring errors, since presumably the
author should have taken care of those in authoring, not in error handling code.
 As far as the spec is concerned, the page itself is invalid and shouldn't even
load, so there's no way for a user to get far enough to press the button.  So,
if you want to minimize work on this bug and just move forward, it would be
"fatal error processing stops" as there is no chance of recovery anyway.


checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: