CSC/ECE 517 Fall 2016/ M1653 Implement HTML form validation: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
==Project description==
==Project description==
===Initial steps===
===Initial steps===
compile Servo and ensure that it runs on tests/html/about-mozilla.html
*compile Servo and ensure that it runs on tests/html/about-mozilla.html
email the mozilla.dev.servo mailing list (be sure to subscribe first!) introducing your group and asking any necessary questions
*email the mozilla.dev.servo mailing list (be sure to subscribe first!) introducing your group and asking any necessary questions
uncomment the attributes in ValidityState.webidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs
*uncomment the attributes in ValidityState.webidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs
make the ValidityState constructor take an &Element argument and store it as a JS<Element> member in ValidityState
*make the ValidityState constructor take an &Element argument and store it as a JS<Element> member in ValidityState
add a new enum that represents each possible validity check in ValidityState
*add a new enum that represents each possible validity check in ValidityState
define a Validatable trait that contains a method which accepts this enum as an argument (see the Activatable trait for inspiration)
*define a Validatable trait that contains a method which accepts this enum as an argument (see the Activatable trait for inspiration)
implement this trait for the form element types (HTMLInputElement, HTMLSelectElement, HTMLButtonElement, etc.), and define an as_maybe_validatable method on Element which returns an &Validatable value if the element implements the trait (see as_maybe_activatable for inspiration)
*implement this trait for the form element types (HTMLInputElement, HTMLSelectElement, HTMLButtonElement, etc.), and define an as_maybe_validatable *method on Element which returns an &Validatable value if the element implements the trait (see as_maybe_activatable for inspiration)
Use the newly-added JS<Element> member to call these new methods as appropriate in each of the stub methods in ValidityState
*Use the newly-added JS<Element> member to call these new methods as appropriate in each of the stub methods in ValidityState

Revision as of 01:20, 10 November 2016

Introduction

Servo

Rust

Project description

Initial steps

  • compile Servo and ensure that it runs on tests/html/about-mozilla.html
  • email the mozilla.dev.servo mailing list (be sure to subscribe first!) introducing your group and asking any necessary questions
  • uncomment the attributes in ValidityState.webidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs
  • make the ValidityState constructor take an &Element argument and store it as a JS<Element> member in ValidityState
  • add a new enum that represents each possible validity check in ValidityState
  • define a Validatable trait that contains a method which accepts this enum as an argument (see the Activatable trait for inspiration)
  • implement this trait for the form element types (HTMLInputElement, HTMLSelectElement, HTMLButtonElement, etc.), and define an as_maybe_validatable *method on Element which returns an &Validatable value if the element implements the trait (see as_maybe_activatable for inspiration)
  • Use the newly-added JS<Element> member to call these new methods as appropriate in each of the stub methods in ValidityState