Closed
Bug 327511
Opened 19 years ago
Closed 19 years ago
Implement remaining schema types XForms requires.
Categories
(Core Graveyard :: XForms, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: doronr, Assigned: doronr)
References
Details
(Keywords: fixed1.8.0.2, fixed1.8.1)
Attachments
(1 file)
|
50.34 KB,
patch
|
aaronr
:
review+
|
Details | Diff | Splinter Review |
| Assignee | ||
Comment 1•19 years ago
|
||
Implements the remaining types, some other minor cleanup, and update the schema testsuite with the new types
Attachment #212134 -
Flags: review?(aaronr)
| Assignee | ||
Comment 2•19 years ago
|
||
*** Bug 324807 has been marked as a duplicate of this bug. ***
Comment on attachment 212134 [details] [diff] [review]
le patch
>Index: extensions/schema-validation/src/nsSchemaValidator.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/schema-validation/src/nsSchemaValidator.cpp,v
>retrieving revision 1.19
>diff -u -1 -0 -r1.19 nsSchemaValidator.cpp
>--- extensions/schema-validation/src/nsSchemaValidator.cpp 31 Jan 2006 18:36:16 -0000 1.19
>+++ extensions/schema-validation/src/nsSchemaValidator.cpp 16 Feb 2006 19:49:14 -0000
>@@ -796,38 +1027,119 @@
> break;
> }
>
> case nsISchemaBuiltinType::BUILTIN_TYPE_INTEGER: {
> isValid = nsSchemaValidatorUtils::IsValidSchemaInteger(aNodeValue, nsnull);
> break;
> }
>
> /* http://w3.org/TR/xmlschema-2/#nonPositiveInteger */
> case nsISchemaBuiltinType::BUILTIN_TYPE_NONPOSITIVEINTEGER: {
>- // nonPositiveInteger inherits from integer, with maxExclusive
>- // being 1
>- ValidateBuiltinTypeInteger(aNodeValue, nsnull, NS_LITERAL_STRING("1"),
>- EmptyString(), EmptyString(), EmptyString(),
>- nsnull, &isValid);
>+ // nonPositiveInteger inherits from integer, with maxInclusive
>+ // being 0
>+ ValidateBuiltinTypeInteger(aNodeValue, nsnull, EmptyString(),
>+ EmptyString(), NS_LITERAL_STRING("1"),
>+ EmptyString(), nsnull, &isValid);
> break;
> }
>
Ummmm, I think that this should be NS_LITERAL_STRING("0"), not NS_LITERAL_STRING("1")
>Index: extensions/schema-validation/src/nsSchemaValidatorUtils.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/schema-validation/src/nsSchemaValidatorUtils.cpp,v
>retrieving revision 1.9
>diff -u -1 -0 -r1.9 nsSchemaValidatorUtils.cpp
>--- extensions/schema-validation/src/nsSchemaValidatorUtils.cpp 31 Jan 2006 18:36:16 -0000 1.9
>+++ extensions/schema-validation/src/nsSchemaValidatorUtils.cpp 16 Feb 2006 19:49:14 -0000
>@@ -80,22 +80,21 @@
> {
> if (*aString == 0)
> return PR_FALSE;
>
> char * pEnd;
> long intValue = strtol(aString, &pEnd, 10);
>
> if (aResult)
> *aResult = intValue;
>
>- return (!((intValue == LONG_MAX || intValue == LONG_MIN) && errno == ERANGE))
>- && *pEnd == '\0';
>+ return (*pEnd == '\0');
> }
>
Are you sure that this is a proper test? I didn't see anything in my ANSI C book that would say what pEnd would be if intValue was LONG_MAX, LONG_MIN or ERANGE.
>@@ -1170,20 +1169,21 @@
> */
> int
> nsSchemaValidatorUtils::CompareDurations(nsISchemaDuration *aDuration1,
> nsISchemaDuration *aDuration2)
> {
> int cmp = 0, tmpcmp, i = 0;
>
> PRTime foo;
> PRExplodedTime explodedTime, newTime1, newTime2;
>
>+ // XXX: nspr doesn't handle pre-1900 dates and will return an error!
bug opened on us for being able to handle pre-1900 dates? We'll need to either fix this or readme this. Either way should probably have at least a placeholder on this.
rest of your fix looks ok. I pretty much skipped looking at your testcase changes, though.
With the above comments addressed, r=me.
Attachment #212134 -
Flags: review?(aaronr) → review+
| Assignee | ||
Comment 4•19 years ago
|
||
> >Index: extensions/schema-validation/src/nsSchemaValidatorUtils.cpp
> >===================================================================
> >RCS file: /cvsroot/mozilla/extensions/schema-validation/src/nsSchemaValidatorUtils.cpp,v
> >retrieving revision 1.9
> >diff -u -1 -0 -r1.9 nsSchemaValidatorUtils.cpp
> >--- extensions/schema-validation/src/nsSchemaValidatorUtils.cpp 31 Jan 2006 18:36:16 -0000 1.9
> >+++ extensions/schema-validation/src/nsSchemaValidatorUtils.cpp 16 Feb 2006 19:49:14 -0000
> >@@ -80,22 +80,21 @@
> > {
> > if (*aString == 0)
> > return PR_FALSE;
> >
> > char * pEnd;
> > long intValue = strtol(aString, &pEnd, 10);
> >
> > if (aResult)
> > *aResult = intValue;
> >
> >- return (!((intValue == LONG_MAX || intValue == LONG_MIN) && errno == ERANGE))
> >- && *pEnd == '\0';
> >+ return (*pEnd == '\0');
> > }
> >
>
> Are you sure that this is a proper test? I didn't see anything in my ANSI C
> book that would say what pEnd would be if intValue was LONG_MAX, LONG_MIN or
> ERANGE.
>
that line was removed :)
| Assignee | ||
Comment 5•19 years ago
|
||
fixed on trunk and 1.8.1
| Assignee | ||
Updated•19 years ago
|
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•