<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Atyagi2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Atyagi2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Atyagi2"/>
	<updated>2026-06-27T02:08:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=102024</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=102024"/>
		<updated>2016-04-11T06:51:17Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Decorator pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Requirements'''==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
=='''Design'''==&lt;br /&gt;
This section only covers the aspects relating to this project. Complete design documentation of servo can be found at [https://github.com/servo/servo/wiki/Design Servo's Design] page&lt;br /&gt;
&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Event-driven architecture pattern'''====&lt;br /&gt;
Servo primarily uses Event-driven architecture. Event-driven architecture is a software architecture pattern based on producing, detecting, consuming and reacting to events. An event is any change to the state (of an object). Whenever a state changes, a message (typically asynchronous) is generated by Event Generator and propagated through an Event Channel to an Event processing Engine. The Engine identifies the event and appropriate actions is selected and executed. There might be some downstream activity occurring as a consequence of the event.The event driven architecture is extremely loosely coupled and well distributed.The event can occur anywhere and the event itself may not know the when and where it affects. For more details click [https://en.wikipedia.org/wiki/Event-driven_architecture here]&lt;br /&gt;
&lt;br /&gt;
===='''Decorator pattern'''====&lt;br /&gt;
The Decorator pattern is used to extend the functionality of a class, without sub-classing it. The decoration features are usually defined by interface, mixin / trait or class inheritance which is shared by the decorator and the decorated class.&lt;br /&gt;
For more details click [https://en.wikipedia.org/wiki/Decorator_pattern here].&lt;br /&gt;
&lt;br /&gt;
In this project elements are made validateable by implementing &amp;quot;Validatable&amp;quot; trait.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;br /&gt;
&lt;br /&gt;
{{Reflist}}&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=102023</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=102023"/>
		<updated>2016-04-11T06:50:59Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Decorator pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Requirements'''==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
=='''Design'''==&lt;br /&gt;
This section only covers the aspects relating to this project. Complete design documentation of servo can be found at [https://github.com/servo/servo/wiki/Design Servo's Design] page&lt;br /&gt;
&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Event-driven architecture pattern'''====&lt;br /&gt;
Servo primarily uses Event-driven architecture. Event-driven architecture is a software architecture pattern based on producing, detecting, consuming and reacting to events. An event is any change to the state (of an object). Whenever a state changes, a message (typically asynchronous) is generated by Event Generator and propagated through an Event Channel to an Event processing Engine. The Engine identifies the event and appropriate actions is selected and executed. There might be some downstream activity occurring as a consequence of the event.The event driven architecture is extremely loosely coupled and well distributed.The event can occur anywhere and the event itself may not know the when and where it affects. For more details click [https://en.wikipedia.org/wiki/Event-driven_architecture here]&lt;br /&gt;
&lt;br /&gt;
===='''Decorator pattern'''====&lt;br /&gt;
The Decorator pattern is used to extend the functionality of a class, without sub-classing it. The decoration features are usually defined by interface, mixin / trait or class inheritance which is shared by the decorator and the decorated class.&lt;br /&gt;
For more details click [https://en.wikipedia.org/wiki/Decorator_pattern here]&lt;br /&gt;
In this project elements are made validateable by implementing &amp;quot;Validatable&amp;quot; trait.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;br /&gt;
&lt;br /&gt;
{{Reflist}}&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=102022</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=102022"/>
		<updated>2016-04-11T06:47:51Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Event-driven architecture pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Requirements'''==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
=='''Design'''==&lt;br /&gt;
This section only covers the aspects relating to this project. Complete design documentation of servo can be found at [https://github.com/servo/servo/wiki/Design Servo's Design] page&lt;br /&gt;
&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''Event-driven architecture pattern'''====&lt;br /&gt;
Servo primarily uses Event-driven architecture. Event-driven architecture is a software architecture pattern based on producing, detecting, consuming and reacting to events. An event is any change to the state (of an object). Whenever a state changes, a message (typically asynchronous) is generated by Event Generator and propagated through an Event Channel to an Event processing Engine. The Engine identifies the event and appropriate actions is selected and executed. There might be some downstream activity occurring as a consequence of the event.The event driven architecture is extremely loosely coupled and well distributed.The event can occur anywhere and the event itself may not know the when and where it affects. For more details click [https://en.wikipedia.org/wiki/Event-driven_architecture here]&lt;br /&gt;
&lt;br /&gt;
===='''Decorator pattern'''====&lt;br /&gt;
The Decorator pattern is used to extend the functionality of a class, without sub-classing it. The decoration features are usually defined by interface, mixin / trait or class inheritance which is shared by the decorator and the decorated class.&lt;br /&gt;
For more details click [https://en.wikipedia.org/wiki/Decorator_pattern here]&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;br /&gt;
&lt;br /&gt;
{{Reflist}}&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101915</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101915"/>
		<updated>2016-04-06T01:07:07Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Requirements'''==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
=='''Design'''==&lt;br /&gt;
This section only covers the aspects relating to this project. Complete design documentation of servo can be found at [https://github.com/servo/servo/wiki/Design Servo's Design] page&lt;br /&gt;
&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101914</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101914"/>
		<updated>2016-04-06T01:06:53Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Requirements'''==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
This section only covers the aspects relating to this project. Complete design documentation of servo can be found at [https://github.com/servo/servo/wiki/Design Servo's Design] page&lt;br /&gt;
&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101888</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101888"/>
		<updated>2016-04-05T14:04:32Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
This section only covers the aspects relating to this project. Complete design documentation of servo can be found at [https://github.com/servo/servo/wiki/Design Servo's Design] page&lt;br /&gt;
&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101887</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101887"/>
		<updated>2016-04-05T03:34:18Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101886</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101886"/>
		<updated>2016-04-05T03:33:23Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101885</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101885"/>
		<updated>2016-04-05T03:32:53Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Class Diagram===&lt;br /&gt;
Following is the class diagram of the class which are involved in this project. For readability purpose few details are omitted. Only relevant information is captured in this diagram&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Servo_Class.png&amp;diff=101884</id>
		<title>File:Servo Class.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Servo_Class.png&amp;diff=101884"/>
		<updated>2016-04-05T03:30:37Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: uploaded a new version of &amp;amp;quot;File:Servo Class.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Servo_Class.png&amp;diff=101883</id>
		<title>File:Servo Class.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Servo_Class.png&amp;diff=101883"/>
		<updated>2016-04-05T03:11:23Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101882</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101882"/>
		<updated>2016-04-05T03:11:07Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
The main aim of this project is to implement HTML5 from validation. Currently in browsers such as chrome and firefox, this feature has been implemented. This feature is used to validate the input provided in the form. This is required to check for empty input or input that does not match with the requirements such as too long etc. In order to implement this feature for servo, we would need to implement a few methods such as Value missing and type mismatch for different elements like HTMLInputElement, HTMLTextAreaElement etc. Following is a brief overview of the steps which are discussed in detail in the later sections: &lt;br /&gt;
Initial steps:&lt;br /&gt;
* Implement the interface and enums required to describe the state such as valid or invalid or range overflow.&lt;br /&gt;
* Make the required HTML elements validatable in order to perform initial check.&lt;br /&gt;
Subsequent Steps:&lt;br /&gt;
* Implement static validation for existing methods using the previously defined methods.&lt;br /&gt;
* Implement interactive validation for methods which are not handled previously. &lt;br /&gt;
* Define handlers to handle invalid events.&lt;br /&gt;
&lt;br /&gt;
Most of these steps are explained in detail in the solution overview section. This is just a brief overview of the project. The next section describes how to do the initial setup for servo in order to compile the project.&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
The following is a flow chart that depicts the flow of code once the form is submitted and the validation begins - &lt;br /&gt;
&lt;br /&gt;
[[File:OSSimg.png]]&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:Servo_Class.png]]&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101819</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101819"/>
		<updated>2016-04-04T19:14:39Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Front-end Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101818</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101818"/>
		<updated>2016-04-04T19:14:26Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Front-end Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
[[File:HTML5test.png]]&lt;br /&gt;
&lt;br /&gt;
once this page is loaded, different HTML5 constraints would be tested by submitting this form. Few of these scenarios can be&lt;br /&gt;
* Value missing in Required field&lt;br /&gt;
* Type mismatch (Text value in numeric field)&lt;br /&gt;
* Length requirement not matching (Min/Max length of input)&lt;br /&gt;
* Value range requirement not satisfied (Min/Max value for numeric field)&lt;br /&gt;
* Pattern mismatch (URL/email in incorrect format)&lt;br /&gt;
&lt;br /&gt;
There are few more validation. Complete list can be found [https://html.spec.whatwg.org/multipage/forms.html#the-constraint-validation-api here].&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101817</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101817"/>
		<updated>2016-04-04T18:58:19Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Front-end Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run tests/html/form_html5_validations.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once servo loads with this web page, following form would be loaded by servo.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101816</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101816"/>
		<updated>2016-04-04T18:45:46Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Front-end Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
Servo can be run by executing '''./mach run [url]''' from command line. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101815</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101815"/>
		<updated>2016-04-04T18:44:55Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
==='''Unit Testing'''===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
==='''Front-end Testing'''===&lt;br /&gt;
To test the requirements from UI, servo needs to be run with command line parameter as the path to web page which needs to be tested&lt;br /&gt;
&lt;br /&gt;
To run servo '''./mach run [url]''' is used. To load our test web page '''tests/html/form_html5_validations.html''' following command will be used&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach run &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101814</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101814"/>
		<updated>2016-04-04T18:37:42Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
Our project requirement was to implement client side form validation and extend the supported subset of defined form elements. In order to implement this we were required to implement the following steps:&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* We were required to compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* Our next requirement was to uncomment the attributes in ValidityState.webidl and implement appropriate stub methods in validitystate.rs in order to fix build errors&lt;br /&gt;
*We had to make the ValidityState constructor take an &amp;amp;Element argument and store it as a JS&amp;lt;Element&amp;gt; member in ValidityState&lt;br /&gt;
* We had to add a new enum that represents each possible validity check in ValidityState&lt;br /&gt;
* We had to define a Validatable trait that contains a method which accepts this enum as an argument &lt;br /&gt;
* Implement Validatable trait for the form element types &lt;br /&gt;
* We had to use the newly-added JS&amp;lt;Element&amp;gt; member to call the appropriate new methods in ValidityState&lt;br /&gt;
&lt;br /&gt;
===Later Steps===&lt;br /&gt;
* We have to add a method to HTMLFormElement to statically validate form element constraints &lt;br /&gt;
* Next we need to add a method to HTMLFormElement to interactively validate the constraints of a form element&lt;br /&gt;
* We have to implement the checkValidity API and reportValidity API for HTMLFormElement&lt;br /&gt;
* We have to Implement each validity state by adding support for attributes such as min,max, minlength etc&lt;br /&gt;
* Our last requirement is to modify the form submission algorithm to include constraint validation&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
* Create 3 lists 'control', 'invalid_control', 'unhadled_invalid-control'&lt;br /&gt;
* Initialize 'control' with all the submitted elements of the form.&lt;br /&gt;
* For each submitted element, check the elements for constraint validation and if check fails - add that element to 'invalid_control' list. &lt;br /&gt;
* If the 'invalid_control' list is empty return true.&lt;br /&gt;
* For each element in 'invalid_control' list, fire a simple event cancelable at field and if the event was not cancelled - add that element to 'unhadled_invalid-control' list.&lt;br /&gt;
* If the 'unhandled_invalid_control' list is empty return true.&lt;br /&gt;
* Return false along with the 'unhandled_invalid_control' list to the user_agent, which will focus on one or more of the reported issues to user for further action.&lt;br /&gt;
&lt;br /&gt;
* Implements the validation methods in validitystate.rs&lt;br /&gt;
* Each method checks the element submitted to it for a particular constraint like value_missing, range_underflow etc and return false if the constraint check fails.&lt;br /&gt;
* Finally, the submit() method of form submission needs to be updated to invoke the interactive_validation() method. &lt;br /&gt;
&lt;br /&gt;
    method1: checkValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; static_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    method2: reportValidity&lt;br /&gt;
    boolean,list&amp;lt;elements&amp;gt; interactive_validation(list&amp;lt;elements&amp;gt; control){&lt;br /&gt;
    	//invoke method 1&lt;br /&gt;
    	status, unhandled_invalid_control = static_validation(control)&lt;br /&gt;
    	&lt;br /&gt;
        if (status==true) &lt;br /&gt;
            return true, empty_list&lt;br /&gt;
    	else &lt;br /&gt;
            return false, unhandled_invalid_control&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
In this phase, front-end UI testing would be possible. Different kind of scenarios would be tested from frontend using a test HTML5 webpage.&lt;br /&gt;
&lt;br /&gt;
===Unit Test===&lt;br /&gt;
Before starting frontend testing, Unit testing needs to be performed by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before running above command, The expectation for some tests needs to been changed from FAIL to PASS.&lt;br /&gt;
&lt;br /&gt;
===Frond-end Testing===&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101670</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101670"/>
		<updated>2016-04-02T20:26:40Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end UI testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are passing. The expectation for these tests has been changed from FAIL to PASS. Further tests are only required for the next round where we will implement the methods for validation.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101669</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101669"/>
		<updated>2016-04-02T20:24:58Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
Write some description here&lt;br /&gt;
&lt;br /&gt;
===Compiling and Building Servo===&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The first requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end UI testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are passing. The expectation for these tests has been changed from FAIL to PASS. Further tests are only required for the next round where we will implement the methods for validation.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101668</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101668"/>
		<updated>2016-04-02T20:23:40Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
===Steps Completed During Last Phase===&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end UI testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are passing. The expectation for these tests has been changed from FAIL to PASS. Further tests are only required for the next round where we will implement the methods for validation.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101667</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101667"/>
		<updated>2016-04-02T20:22:38Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
[[File:Uncomment.png]]&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
[[File:vsconstructor.png]]&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
[[File:constructor.png]]&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
[[File:enum.png]]&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
[[File:newMethod.png]]&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
Blah blah&lt;br /&gt;
===Solution Overview===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===Validation Workflow===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
Blah blah&lt;br /&gt;
&lt;br /&gt;
==='''Design Patterns &amp;amp; OO Practices'''===&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end UI testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are passing. The expectation for these tests has been changed from FAIL to PASS. Further tests are only required for the next round where we will implement the methods for validation.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101666</id>
		<title>CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016_M1601_Implement_HTML5_form_validation&amp;diff=101666"/>
		<updated>2016-04-02T20:09:40Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: Created page with &amp;quot;''' Implementation of HTML5 form validation in servo'''  Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project impleme...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo. The validations are implemented via methods such as &amp;quot;valueMissing&amp;quot; which determine for different elements such a HTMLInput element etc. if it is ok to leave the input blank or if input is required. The code snippets given in this wiki explain how these methods are called in the HTML elements via different enums. The actual code to validate these inputs, will be implemented in the next phase of the project.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs. This facilitates in declaring the methods which we will be using for validation&lt;br /&gt;
[[File:Uncomment.png]]&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
[[File:vsconstructor.png]]&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files as the constructor was referred to in these files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
[[File:constructor.png]]&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. This enum is used to specify the state in order to describe if there is a Value missing or if there is no error and the state is valid&lt;br /&gt;
[[File:enum.png]]&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait. This is used to check if the element is infact validatable before performing further operations to check the form validations&lt;br /&gt;
[[File:newMethod.png]]&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. While using enums and also while defining new methods, we tried to follow the DRY principle in order to avoid repetition of code. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards. We have fixed all the issues reported by tidy. Further design patterns will be used in the next phase of the project, where validation functions will be implemented.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end UI testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are passing. The expectation for these tests has been changed from FAIL to PASS. Further tests are only required for the next round where we will implement the methods for validation.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101665</id>
		<title>CSC/ECE 517 Spring 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101665"/>
		<updated>2016-04-02T20:09:21Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Active Job]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calibration Assignment Submissions==&lt;br /&gt;
*[[Calibration Assignment Submission (OmniAuth)]]&lt;br /&gt;
*[[Calibration Assignment Submission (Patch_verb)]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional Tests for Questionnaire Controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 / Expertiza Self-Review Feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement private browsing]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Write automated tests for WebDriver]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor sign_up_sheet_controller.rb and sign_up_topic.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement Common Parts of the CSSOM API]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional tests for assignment creation function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/E1604. Functional tests for Calibration function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor and write unit tests for question type.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor response controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016_OSS_M1606]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016/OSS_E1601]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 M1601 Implement HTML5 form validation]]&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101664</id>
		<title>CSC/ECE 517 Spring 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101664"/>
		<updated>2016-04-02T20:08:33Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Active Job]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calibration Assignment Submissions==&lt;br /&gt;
*[[Calibration Assignment Submission (OmniAuth)]]&lt;br /&gt;
*[[Calibration Assignment Submission (Patch_verb)]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional Tests for Questionnaire Controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016 / Expertiza Self-Review Feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement private browsing]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Write automated tests for WebDriver]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor sign_up_sheet_controller.rb and sign_up_topic.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Implement Common Parts of the CSSOM API]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Functional tests for assignment creation function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/E1604. Functional tests for Calibration function]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor and write unit tests for question type.rb]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2016/Refactor response controller]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016_OSS_M1606]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE_517_Spring_2016/OSS_E1601]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1601 Implement HTML5 form validation]]&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:NewMethod.png&amp;diff=101350</id>
		<title>File:NewMethod.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:NewMethod.png&amp;diff=101350"/>
		<updated>2016-03-24T17:59:37Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Enum.png&amp;diff=101349</id>
		<title>File:Enum.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Enum.png&amp;diff=101349"/>
		<updated>2016-03-24T17:59:23Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Constructor.png&amp;diff=101348</id>
		<title>File:Constructor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Constructor.png&amp;diff=101348"/>
		<updated>2016-03-24T17:59:08Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Vsconstructor.png&amp;diff=101347</id>
		<title>File:Vsconstructor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Vsconstructor.png&amp;diff=101347"/>
		<updated>2016-03-24T17:58:44Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101346</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101346"/>
		<updated>2016-03-24T17:58:15Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
[[File:Uncomment.png]]&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
[[File:vsconstructor.png]]&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
[[File:constructor.png]]&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
[[File:enum.png]]&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
[[File:newMethod.png]]&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are pass.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101345</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101345"/>
		<updated>2016-03-24T17:57:27Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
[[File:Uncomment.png]]&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
[[File:Uncomment.png]]&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
[[File:constructor.png]]&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
[[File:enum.png]]&lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
[[File:newMethod.png]]&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are pass.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101344</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101344"/>
		<updated>2016-03-24T17:56:08Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
[[File:Uncomment.png]]&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are pass.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101343</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101343"/>
		<updated>2016-03-24T17:55:23Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
[[File:Uncomment.jpg]]&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are pass.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment.png&amp;diff=101342</id>
		<title>File:Uncomment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment.png&amp;diff=101342"/>
		<updated>2016-03-24T17:54:04Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101341</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101341"/>
		<updated>2016-03-24T17:48:38Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are pass.&lt;br /&gt;
&lt;br /&gt;
=='''Pull Request'''==&lt;br /&gt;
Pull request # [https://github.com/servo/servo/pull/10108 10108] was created for these changes. This pull request was accepted and closed by Mozilla team.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101340</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101340"/>
		<updated>2016-03-24T17:46:03Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Testing'''==&lt;br /&gt;
As of now, front-end testing is not possible as this requirement will be completely implemented during subsequent phases. However unit testing can be done by running  following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-wpt --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There were 11 tests which were failing earlier but now these tests are pass.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements. The state of the element depending upon the validation checks is one of the possible values in the enum. If the element validates all the possible checks, the state of the element is recorded as valid, else the state is either ValueMissing or one of the remaining enums in ValidityStatus. This state is recorded in the &amp;quot;state&amp;quot; variable in the ValidityState struct.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    https://doc.rust-lang.org/book/&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101050</id>
		<title>CSC/ECE 517 Spring 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101050"/>
		<updated>2016-03-22T22:40:43Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calibration Assignment Submissions==&lt;br /&gt;
*[[Calibration Assignment Submission (OmniAuth)]]&lt;br /&gt;
*[[Calibration Assignment Submission (Patch_verb)]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
[[CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101048</id>
		<title>CSC 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101048"/>
		<updated>2016-03-22T22:38:16Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: moved CSC 517 Spring 2016/Mozilla Implement HTML5 form validation to CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation: Fixing title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101047</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101047"/>
		<updated>2016-03-22T22:38:16Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: moved CSC 517 Spring 2016/Mozilla Implement HTML5 form validation to CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation: Fixing title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101045</id>
		<title>CSC/ECE 517 Spring 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016&amp;diff=101045"/>
		<updated>2016-03-22T22:37:13Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calibration Assignment Submissions==&lt;br /&gt;
*[[Calibration Assignment Submission (OmniAuth)]]&lt;br /&gt;
*[[Calibration Assignment Submission (Patch_verb)]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
[[CSC_517_Spring_2016/Mozilla_Implement_HTML5_form_validation]]&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Atyagi2&amp;diff=101040</id>
		<title>User:Atyagi2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Atyagi2&amp;diff=101040"/>
		<updated>2016-03-22T18:58:59Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: moved User:Atyagi2 to CSC 517 Spring 2016/Mozilla Implement HTML5 form validation: Publishing page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC 517 Spring 2016/Mozilla Implement HTML5 form validation]]&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101039</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101039"/>
		<updated>2016-03-22T18:58:59Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: moved User:Atyagi2 to CSC 517 Spring 2016/Mozilla Implement HTML5 form validation: Publishing page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101038</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101038"/>
		<updated>2016-03-22T18:56:33Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&lt;br /&gt;
    htmltextareaelement.rs&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmllabelelement.rs&lt;br /&gt;
    htmlinputelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlanchorelement.rs&lt;br /&gt;
&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101037</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101037"/>
		<updated>2016-03-22T18:55:47Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
    htmlselectelement.rs&lt;br /&gt;
    htmloutputelement.rs&lt;br /&gt;
    htmlobjectelement.rs&lt;br /&gt;
    htmlbuttonelement.rs&lt;br /&gt;
    htmlfieldsetelement.rs&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101036</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101036"/>
		<updated>2016-03-22T18:53:30Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmloutputelement.rs&lt;br /&gt;
htmlobjectelement.rs&lt;br /&gt;
htmlfieldsetelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. In next phase of project, actual validation would be performed on list of Validatable elements&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101035</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101035"/>
		<updated>2016-03-22T18:52:33Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Design Patterns &amp;amp; OO Practices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmloutputelement.rs&lt;br /&gt;
htmlobjectelement.rs&lt;br /&gt;
htmlfieldsetelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101034</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101034"/>
		<updated>2016-03-22T18:49:52Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Servo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work (like interpreting HTML and laying out pages) is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmloutputelement.rs&lt;br /&gt;
htmlobjectelement.rs&lt;br /&gt;
htmlfieldsetelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101033</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101033"/>
		<updated>2016-03-22T18:47:38Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work of interpreting HTML and laying out pages is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmloutputelement.rs&lt;br /&gt;
htmlobjectelement.rs&lt;br /&gt;
htmlfieldsetelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101032</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101032"/>
		<updated>2016-03-22T18:47:11Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Design Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work of interpreting HTML and laying out pages is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmloutputelement.rs&lt;br /&gt;
htmlobjectelement.rs&lt;br /&gt;
htmlfieldsetelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Patterns &amp;amp; OO Practices'''==&lt;br /&gt;
We were not supposed to modify the existing design apart from adding a new behaviour/ability for HTML Element. We attempted to follow good OO practices throughout development. Servo has it's own coding standards which are checked by running following command&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./mach test-tidy&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Issues reported by test are to be fixed before pull request can be generated. This ensures that developers would adhere to coding standards&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. &lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqQUlvQXZkUUJPRzA/view?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101031</id>
		<title>CSC/ECE 517 Spring 2016/Mozilla Implement HTML5 form validation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Mozilla_Implement_HTML5_form_validation&amp;diff=101031"/>
		<updated>2016-03-22T18:33:49Z</updated>

		<summary type="html">&lt;p&gt;Atyagi2: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Implementation of HTML5 form validation in servo'''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine being developed by Mozilla and written in the Rust language. This project implements  [https://en.wikipedia.org/wiki/HTML5 HTML5] validations for servo.&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HTML5 HTML5]is a markup language used for displaying content on the World Wide Web&lt;br /&gt;
&lt;br /&gt;
HTML5 defines set of specification which users needs to follow to make web pages HTML5 compliant. HTML 5 defines a mechanism by which contents of forms can be validated before user is allowed to submit them. [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] currently implements support for few of the form elements. This project is intended to implement client-side validations for these elements and extend the existing form element subset to include additional form elements that will support client side validation.&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is an open source prototype web browser layout engine that is being developed by Mozilla Research. It is written in [https://www.rust-lang.org/ Rust] language. Current browser engines are mostly based on single-threaded model. Although there are some tasks (as decompressing images) which can be done on separate processor cores but most of the work of interpreting HTML and laying out pages is single-threaded.&lt;br /&gt;
Motivation behind servo is to create a highly parallel environment, where different components (such as rendering, layout, HTML parsing, image decoding, etc.) can be handled by fine-grained, isolated tasks.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla Research. Rust is designed to provide the same level of performance and power as C++, but without the risk of bugs and security flaws, and also with built-in mechanisms for exploiting multi-core processors.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to uncomment the attributes in ValidityState.weidl and fix the resulting build errors by implementing appropriate stub methods in validitystate.rs&lt;br /&gt;
* Next, we had to modify the ValidityState constructor to take an &amp;amp;Element argument and store it as element variable of JS&amp;lt;Element&amp;gt; type member in the ValidityState.&lt;br /&gt;
* The changes to the constructor resulted in build errors in following files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmloutputelement.rs&lt;br /&gt;
htmlobjectelement.rs&lt;br /&gt;
htmlfieldsetelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the constructors called in these files were modified to send the required extra parameter.&lt;br /&gt;
* Next, we had to add a new enum “ValidityStatus” in ValidityState having each possible validity check in ValidityState. &lt;br /&gt;
* Next, we had to define a new trait Validatable having method “is_instance_validatable”. (which takes the new ValidityStatus enum as an argument.)&lt;br /&gt;
* Next, we implemented this trait and the corresponding method in the following files&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	htmltextareaelement.rs&lt;br /&gt;
htmlselectelement.rs&lt;br /&gt;
htmllabelelement.rs&lt;br /&gt;
htmlinputelement.rs&lt;br /&gt;
htmlbuttonelement.rs&lt;br /&gt;
htmlanchorelement.rs &amp;lt;/code&amp;gt;&lt;br /&gt;
* Then, we had to define method as_maybe_validatable in file “element.rs”  which returns an &amp;amp;Validatable value if the element implements the newly defined trait.&lt;br /&gt;
* Finally, we added a new html file “form_html5_validations.html” to test the HTML5 validation for the mentioned conditions&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
As a result of these initial changes, currently validation of the form elements has a basic implementation of the code required. The enum “ValidityStatus” is used to identify different states for the element. For each element in the form, the flow goes in this manner - First the “as_maybe_validatable” method in the element.rs file is called, which in turn finds out the type of the element and then calls the “is_instance_validatable” method on that element. &lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqQUlvQXZkUUJPRzA/view?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Form-validation-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.   https://doc.rust-lang.org/book/&lt;/div&gt;</summary>
		<author><name>Atyagi2</name></author>
	</entry>
</feed>