On Sunday, October 30, 2016 at 10:09:14 AM UTC-4, Josh Matthews wrote: > On 2016-10-28 1:01 PM, ysu...@ncsu.edu wrote: > > Hi Josh, we are a little bit confused about the last initial step. "Use the > > newly-added JS<Element> member to call these new methods as appropriate in > > each of the stub methods in ValidityState". We tried to call the function > > we declared in the trait and try to print out something when it get called > > but nothing happened. Can you explain the work flow of this validation > > stuff? > > > > The idea here is that: > * ValidityState has a JS<Element> member > * Element has a `as_maybe_validatable` method, that returns > Option<&Validatable> > * Validatable has a method that can perform validations > > We can combine these to make each of the stub methods that exist in > ValidityState (ValueMissing, TypeMismatch, etc.) invoke the method on > Validatable. Does that make sense? > > Cheers, > Josh
Hello Josh Thanks for the explanation. So, when ever a form is submitted we call static validations and as we have pushed changes, for every element in the tree order, is that element is validatable, we have to invoke method is_validate which return either true or false. So, initial steps say that we have to add a method which takes enum as an argument. We had a discussion with our teaching assistant here and we wanted to confirm that by saying "method takes enum as an argument", does we have to pass whole enum set or method will take individual elements inside an enum and validate over that value. And is it possible to get your email id/ contact number so that we can discuss more about it. Regards Bhavya _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo