CSC/ECE 517 Fall 2016/ M1653 Implement HTML form validation
Introduction
Servo
Servo is an open source prototype web browser layout engine that is being developed by Mozilla Research. Its source code can be found here. Current browser engines are mostly based on the single-thread model. The motivation behind building servo web browser is to build a highly parallel and reliable environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.
Rust
Rust is an open source system programming language developed by Mozilla. Rust is a language suited for creating a highly concurrent and safe system. In performance and syntax, rust is similar to C++ but semantically it is very different. Rust emphasis is on speed, safety and control of memory layout.
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
Subsequent steps
- a method to HTMLFormElement that implements the steps to interactively validate the constraints of a form element
- Implement the checkValidity API for HTMLFormElement
- Implement the reportValidity API for HTMLFormElement
- Implement each validity state defined in the spec as applicable. This can include implementing support for attributes such as min, max, minlength, etc.
- Modify the implementation of the form submission algorithm to include constraint validation