Last Comment Bug 327511 - Implement remaining schema types XForms requires.
: Implement remaining schema types XForms requires.
Status: RESOLVED FIXED
: fixed1.8.0.2, fixed1.8.1
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: x86 All
: -- normal (vote)
: ---
Assigned To: Doron Rosenberg (IBM)
: Stephen Pride
:
Mentors:
: 324807 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-16 11:50 PST by Doron Rosenberg (IBM)
Modified: 2016-07-15 14:46 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
le patch (50.34 KB, patch)
2006-02-16 11:52 PST, Doron Rosenberg (IBM)
aaronr: review+
Details | Diff | Splinter Review

Description Doron Rosenberg (IBM) 2006-02-16 11:50:36 PST
 
Comment 1 Doron Rosenberg (IBM) 2006-02-16 11:52:07 PST
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
Comment 2 Doron Rosenberg (IBM) 2006-02-20 11:57:19 PST
*** Bug 324807 has been marked as a duplicate of this bug. ***
Comment 3 aaronr 2006-02-20 17:07:58 PST
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.
Comment 4 Doron Rosenberg (IBM) 2006-02-20 17:21:51 PST
> >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 :)
Comment 5 Doron Rosenberg (IBM) 2006-02-21 15:17:31 PST
fixed on trunk and 1.8.1

Note You need to log in before you can comment on or make changes to this bug.