Implement remaining schema types XForms requires.

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
11 years ago
10 months ago

People

(Reporter: Doron Rosenberg (IBM), Assigned: Doron Rosenberg (IBM))

Tracking

({fixed1.8.0.2, fixed1.8.1})

Trunk
x86
All
fixed1.8.0.2, fixed1.8.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
 
(Assignee)

Comment 1

11 years ago
Created attachment 212134 [details] [diff] [review]
le patch

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

11 years ago
*** Bug 324807 has been marked as a duplicate of this bug. ***

Comment 3

11 years ago
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

11 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

11 years ago
fixed on trunk and 1.8.1
Status: NEW → ASSIGNED
Keywords: fixed1.8.1
Whiteboard: xf-to-branch
(Assignee)

Updated

11 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED

Updated

11 years ago
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.