<?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=Jsjain</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=Jsjain"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jsjain"/>
	<updated>2026-05-11T14:32:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99255</id>
		<title>CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99255"/>
		<updated>2015-11-10T01:07:39Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Refactored code for overrideMimeType&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Servo task Architecture==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
&lt;br /&gt;
* Each box corresponds to a Rust task.&lt;br /&gt;
* The primary tasks in the browser pipeline are represented by Blue boxes.&lt;br /&gt;
* Dashed lines indicate supervisor relationships.&lt;br /&gt;
* Gray boxes indicate tasks auxiliary to the browser pipeline.&lt;br /&gt;
* Communication channels are represented as solid lines.&lt;br /&gt;
* White boxes are represented as worker tasks. Each such box represents several tasks which varies with the workload.&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a specification which defines [https://en.wikipedia.org/wiki/Application_programming_interface APIs] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the APIs and properties present in XMLHttpRequest specification are '''overrideMimeType()''' , '''responseXML''' and '''withCredentials'''. The following javascript code snippets briefly explain about each of these APIs.&lt;br /&gt;
&lt;br /&gt;
;overrideMimeType&amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
//override the Mime type to retrieve the response as an XML Object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 var client = new XMLHttpRequest();&lt;br /&gt;
 client.onreadystatechange = function() {&lt;br /&gt;
          if (client.readyState !== 4) return;&lt;br /&gt;
					try{&lt;br /&gt;
            var str = client.responseXML.documentElement.tagName+&lt;br /&gt;
                      client.responseXML.documentElement.firstChild.tagName+&lt;br /&gt;
                      client.responseXML.documentElement.firstChild.textContent;&lt;br /&gt;
					}catch(e){&lt;br /&gt;
						assert_unreached('Exception when reading responseXML');&lt;br /&gt;
					}&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.tagName,  'test' );&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.firstChild.tagName,  'message' );&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.firstChild.textContent,  'Hello World！' );&lt;br /&gt;
          test.done();&lt;br /&gt;
        };&lt;br /&gt;
        client.open(&amp;quot;GET&amp;quot;, &amp;quot;resources/status.py?type=&amp;quot;&lt;br /&gt;
                    +encodeURIComponent('text/plain;charset=Shift-JIS')&lt;br /&gt;
                    +'&amp;amp;content='+ encodeURIComponent('&amp;lt;test&amp;gt;&amp;lt;message&amp;gt;Hello World！&amp;lt;/message&amp;gt;&amp;lt;/test&amp;gt;'));&lt;br /&gt;
        client.overrideMimeType('application/xml;charset=UTF-8');&lt;br /&gt;
        client.send();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;responseXML property&amp;lt;ref&amp;gt;https://msdn.microsoft.com/en-us/library/ms534370(v=vs.85).aspx&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//read the response from the server as an XML Object&lt;br /&gt;
&lt;br /&gt;
var oReq = new XMLHttpRequest();&lt;br /&gt;
oReq.open(&amp;quot;GET&amp;quot;, &amp;quot;http://localhost/books.xml&amp;quot;, false);&lt;br /&gt;
oReq.send();&lt;br /&gt;
console.log(oReq.responseXML.xml);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;withCredentials property&amp;lt;ref&amp;gt;http://arunranga.com/examples/access-control/credentialedRequest.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//create cross site requests using cookies as credentials&lt;br /&gt;
 &lt;br /&gt;
var invocation = new XMLHttpRequest();&lt;br /&gt;
var url = 'http://crossoriginurl.com/resources/access-control-with-credentials/';&lt;br /&gt;
invocation.open('GET', url, true);&lt;br /&gt;
invocation.withCredentials = &amp;quot;true&amp;quot;;&lt;br /&gt;
invocation.onreadystatechange = handler;&lt;br /&gt;
invocation.send(); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The above mentioned APIs and properties for XMLHttpRequest are currently unimplemented in servo.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
Servo has implemented many API specifications that relies upon JavaScript that executes on all the browsers. [https://xhr.spec.whatwg.org/ XMLHttpRequest] is one such specification which is used for making HTTP requests dynamically. Our project aim is to implement few of the missing XMLHttpRequest APIs. The [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/oss_M1504_JJD OSS project] involved implementing initial steps of the [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs specifications]. It basically involved implementing overrideMimeType method and adjusting related test expectations. &lt;br /&gt;
&lt;br /&gt;
The current scope of the project involves:&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Implementing the specified behavior of the final MIME type and final charset based on the implemented override_mime_type() method in the initial steps&lt;br /&gt;
* Implementing responseXML API and document response type according to the XHR specifications&lt;br /&gt;
* Implementing withCredentials API&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
Below is an overview of the various steps identified as a part of the requirement analysis:&lt;br /&gt;
&lt;br /&gt;
''' XMLHttpRequest Interface '''&lt;br /&gt;
* We have to uncomment the responseXML API&lt;br /&gt;
* A webpage can make use of this API to read the document response &lt;br /&gt;
&lt;br /&gt;
'''XMLHttpRequest DOM '''&lt;br /&gt;
&lt;br /&gt;
# Create helper methods for final_mime_type and final_charset&lt;br /&gt;
#* Implement the two methods as per the behavior mentioned in the [https://xhr.spec.whatwg.org/#final-mime-type specification]&lt;br /&gt;
# Implement correct behavior for the text_response method&lt;br /&gt;
#* Make use of the final_charset and final_mime_type helper methods to determine the correct encoding for the response and decode the response using this encoding&lt;br /&gt;
# Create and implement a new method &amp;quot;document_response&amp;quot; according to the [https://xhr.spec.whatwg.org/#document-response xhr specification]&lt;br /&gt;
# Implement the correct behavior for the responseXML API to handle exceptions and return the document response using the method implemented above &amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml&amp;lt;/ref&amp;gt;&lt;br /&gt;
# Implement the withCredentials APIs (setter and getter) as per the [https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials specification]&lt;br /&gt;
# Add support to the send() and open() API to test the value of the withCredentials attribute where necessary&lt;br /&gt;
&lt;br /&gt;
''' net_traits '''&lt;br /&gt;
* Add a new member to the LoadData Structure which will be used by the http_loader to conditionally exclude cookies from the XHR request based on the value of the member.&lt;br /&gt;
&lt;br /&gt;
''' XHR Tests '''&lt;br /&gt;
* We need to pass [[#Proposed_Test_Cases | most tests]] related to overrideMimeType, responseXML and withCredentials present in the [https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/XMLHttpRequest XHR test-suite]&lt;br /&gt;
&lt;br /&gt;
==Component Flow Diagram==&lt;br /&gt;
{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
The tests have already been written for the XMLHttpRequest APIs related to our project. So the test cases that could validate our changes to the code are as follows:&lt;br /&gt;
&lt;br /&gt;
* overrideMimeType() in unsent state enforces Shift-JIS encoding&lt;br /&gt;
* overrideMimeType() in open state enforces UTF-8 encoding&lt;br /&gt;
* overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced&lt;br /&gt;
* overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding&lt;br /&gt;
* responseXML attribute throws InvalidStateError if response type is not null or document&lt;br /&gt;
* The various responseXML document properties are correctly initialized&lt;br /&gt;
* The type of the responseXML stylesheets and implementation must be object&lt;br /&gt;
* If the state of XMLHttpRequest is not done then responseXML is null&lt;br /&gt;
* Check withCredentials defaults to false and set value is true&lt;br /&gt;
* Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception&lt;br /&gt;
* Setting withCredentials when synchornous flag is set throws InvalidAccessError exception&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
* Steps for installing [https://github.com/rust-lang/rust rust]&lt;br /&gt;
* Building [https://github.com/servo/servo Servo]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99238</id>
		<title>CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99238"/>
		<updated>2015-11-10T00:57:07Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Refactored to move up Project Description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a specification which defines [https://en.wikipedia.org/wiki/Application_programming_interface APIs] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the APIs and properties present in XMLHttpRequest specification are '''overrideMimeType()''' , '''responseXML''' and '''withCredentials'''. The following javascript code snippets briefly explain about each of these APIs.&lt;br /&gt;
&lt;br /&gt;
;overrideMimeType&amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
//override the Mime type to retrieve the response as an XML Object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 var client = new XMLHttpRequest();&lt;br /&gt;
 client.onreadystatechange = function() {&lt;br /&gt;
          if (client.readyState !== 4) return;&lt;br /&gt;
					try{&lt;br /&gt;
            var str = client.responseXML.documentElement.tagName+client.responseXML.documentElement.firstChild.tagName+client.responseXML.documentElement.firstChild.textContent;&lt;br /&gt;
					}catch(e){&lt;br /&gt;
						assert_unreached('Exception when reading responseXML');&lt;br /&gt;
					}&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.tagName,  'test' );&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.firstChild.tagName,  'message' );&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.firstChild.textContent,  'Hello World！' );&lt;br /&gt;
          test.done();&lt;br /&gt;
        };&lt;br /&gt;
        client.open(&amp;quot;GET&amp;quot;, &amp;quot;resources/status.py?type=&amp;quot;+encodeURIComponent('text/plain;charset=Shift-JIS')+'&amp;amp;content='+encodeURIComponent('&amp;lt;test&amp;gt;&amp;lt;message&amp;gt;Hello World！&amp;lt;/message&amp;gt;&amp;lt;/test&amp;gt;'));&lt;br /&gt;
        client.overrideMimeType('application/xml;charset=UTF-8');&lt;br /&gt;
        client.send();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;responseXML property&amp;lt;ref&amp;gt;https://msdn.microsoft.com/en-us/library/ms534370(v=vs.85).aspx&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//read the response from the server as an XML Object&lt;br /&gt;
&lt;br /&gt;
var oReq = new XMLHttpRequest();&lt;br /&gt;
oReq.open(&amp;quot;GET&amp;quot;, &amp;quot;http://localhost/books.xml&amp;quot;, false);&lt;br /&gt;
oReq.send();&lt;br /&gt;
console.log(oReq.responseXML.xml);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;withCredentials property&amp;lt;ref&amp;gt;http://arunranga.com/examples/access-control/credentialedRequest.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//create cross site requests using cookies as credentials&lt;br /&gt;
 &lt;br /&gt;
var invocation = new XMLHttpRequest();&lt;br /&gt;
var url = 'http://crossoriginurl.com/resources/access-control-with-credentials/';&lt;br /&gt;
invocation.open('GET', url, true);&lt;br /&gt;
invocation.withCredentials = &amp;quot;true&amp;quot;;&lt;br /&gt;
invocation.onreadystatechange = handler;&lt;br /&gt;
invocation.send(); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The above mentioned APIs and properties for XMLHttpRequest are currently unimplemented in servo.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
Servo has implemented many API specifications that relies upon JavaScript that executes on all the browsers. [https://xhr.spec.whatwg.org/ XMLHttpRequest] is one such specification which is used for making HTTP requests dynamically. Our project aim is to implement few of the missing XMLHttpRequest APIs. The [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/oss_M1504_JJD OSS project] involved implementing initial steps of the [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs specifications]. It basically involved implementing overrideMimeType method and adjusting related test expectations. &lt;br /&gt;
&lt;br /&gt;
The current scope of the project involves:&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Implementing the specified behavior of the final MIME type and final charset based on the implemented override_mime_type() method in the initial steps&lt;br /&gt;
* Implementing responseXML API and document response type according to the XHR specifications&lt;br /&gt;
* Implementing withCredentials API&lt;br /&gt;
&lt;br /&gt;
==Servo task Architecture==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
&lt;br /&gt;
* Each box corresponds to a Rust task.&lt;br /&gt;
* The primary tasks in the browser pipeline are represented by Blue boxes.&lt;br /&gt;
* Dashed lines indicate supervisor relationships.&lt;br /&gt;
* Gray boxes indicate tasks auxiliary to the browser pipeline.&lt;br /&gt;
* Communication channels are represented as solid lines.&lt;br /&gt;
* White boxes are represented as worker tasks. Each such box represents several tasks which varies with the workload.&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
Below is an overview of the various steps identified as a part of the requirement analysis:&lt;br /&gt;
&lt;br /&gt;
''' XMLHttpRequest Interface '''&lt;br /&gt;
* We have to uncomment the responseXML API&lt;br /&gt;
* A webpage can make use of this API to read the document response &lt;br /&gt;
&lt;br /&gt;
'''XMLHttpRequest DOM '''&lt;br /&gt;
&lt;br /&gt;
# Create helper methods for final_mime_type and final_charset&lt;br /&gt;
#* Implement the two methods as per the behavior mentioned in the [https://xhr.spec.whatwg.org/#final-mime-type specification]&lt;br /&gt;
# Implement correct behavior for the text_response method&lt;br /&gt;
#* Make use of the final_charset and final_mime_type helper methods to determine the correct encoding for the response and decode the response using this encoding&lt;br /&gt;
# Create and implement a new method &amp;quot;document_response&amp;quot; according to the [https://xhr.spec.whatwg.org/#document-response xhr specification]&lt;br /&gt;
# Implement the correct behavior for the responseXML API to handle exceptions and return the document response using the method implemented above &amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml&amp;lt;/ref&amp;gt;&lt;br /&gt;
# Implement the withCredentials APIs (setter and getter) as per the [https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials specification]&lt;br /&gt;
# Add support to the send() and open() API to test the value of the withCredentials attribute where necessary&lt;br /&gt;
&lt;br /&gt;
''' net_traits '''&lt;br /&gt;
* Add a new member to the LoadData Structure which will be used by the http_loader to conditionally exclude cookies from the XHR request based on the value of the member.&lt;br /&gt;
&lt;br /&gt;
''' XHR Tests '''&lt;br /&gt;
* We need to pass [[#Proposed_Test_Cases | most tests]] related to overrideMimeType, responseXML and withCredentials present in the [https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/XMLHttpRequest XHR test-suite]&lt;br /&gt;
&lt;br /&gt;
==Component Flow Diagram==&lt;br /&gt;
{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
The tests have already been written for the XMLHttpRequest APIs related to our project. So the test cases that could validate our changes to the code are as follows:&lt;br /&gt;
&lt;br /&gt;
* overrideMimeType() in unsent state enforces Shift-JIS encoding&lt;br /&gt;
* overrideMimeType() in open state enforces UTF-8 encoding&lt;br /&gt;
* overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced&lt;br /&gt;
* overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding&lt;br /&gt;
* responseXML attribute throws InvalidStateError if response type is not null or document&lt;br /&gt;
* The various responseXML document properties are correctly initialized&lt;br /&gt;
* The type of the responseXML stylesheets and implementation must be object&lt;br /&gt;
* If the state of XMLHttpRequest is not done then responseXML is null&lt;br /&gt;
* Check withCredentials defaults to false and set value is true&lt;br /&gt;
* Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception&lt;br /&gt;
* Setting withCredentials when synchornous flag is set throws InvalidAccessError exception&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
* Steps for installing [https://github.com/rust-lang/rust rust]&lt;br /&gt;
* Building [https://github.com/servo/servo Servo]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99235</id>
		<title>CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99235"/>
		<updated>2015-11-10T00:55:39Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Added information to Background&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a specification which defines [https://en.wikipedia.org/wiki/Application_programming_interface APIs] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the APIs and properties present in XMLHttpRequest specification are '''overrideMimeType()''' , '''responseXML''' and '''withCredentials'''. The following javascript code snippets briefly explain about each of these APIs.&lt;br /&gt;
&lt;br /&gt;
;overrideMimeType&amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
//override the Mime type to retrieve the response as an XML Object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 var client = new XMLHttpRequest();&lt;br /&gt;
 client.onreadystatechange = function() {&lt;br /&gt;
          if (client.readyState !== 4) return;&lt;br /&gt;
					try{&lt;br /&gt;
            var str = client.responseXML.documentElement.tagName+client.responseXML.documentElement.firstChild.tagName+client.responseXML.documentElement.firstChild.textContent;&lt;br /&gt;
					}catch(e){&lt;br /&gt;
						assert_unreached('Exception when reading responseXML');&lt;br /&gt;
					}&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.tagName,  'test' );&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.firstChild.tagName,  'message' );&lt;br /&gt;
          assert_equals( client.responseXML.documentElement.firstChild.textContent,  'Hello World！' );&lt;br /&gt;
          test.done();&lt;br /&gt;
        };&lt;br /&gt;
        client.open(&amp;quot;GET&amp;quot;, &amp;quot;resources/status.py?type=&amp;quot;+encodeURIComponent('text/plain;charset=Shift-JIS')+'&amp;amp;content='+encodeURIComponent('&amp;lt;test&amp;gt;&amp;lt;message&amp;gt;Hello World！&amp;lt;/message&amp;gt;&amp;lt;/test&amp;gt;'));&lt;br /&gt;
        client.overrideMimeType('application/xml;charset=UTF-8');&lt;br /&gt;
        client.send();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;responseXML property&amp;lt;ref&amp;gt;https://msdn.microsoft.com/en-us/library/ms534370(v=vs.85).aspx&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//read the response from the server as an XML Object&lt;br /&gt;
&lt;br /&gt;
var oReq = new XMLHttpRequest();&lt;br /&gt;
oReq.open(&amp;quot;GET&amp;quot;, &amp;quot;http://localhost/books.xml&amp;quot;, false);&lt;br /&gt;
oReq.send();&lt;br /&gt;
console.log(oReq.responseXML.xml);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;withCredentials property&amp;lt;ref&amp;gt;http://arunranga.com/examples/access-control/credentialedRequest.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//create cross site requests using cookies as credentials&lt;br /&gt;
 &lt;br /&gt;
var invocation = new XMLHttpRequest();&lt;br /&gt;
var url = 'http://crossoriginurl.com/resources/access-control-with-credentials/';&lt;br /&gt;
invocation.open('GET', url, true);&lt;br /&gt;
invocation.withCredentials = &amp;quot;true&amp;quot;;&lt;br /&gt;
invocation.onreadystatechange = handler;&lt;br /&gt;
invocation.send(); &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The above mentioned APIs and properties for XMLHttpRequest are currently unimplemented in servo.&lt;br /&gt;
==Servo task Architecture==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
&lt;br /&gt;
* Each box corresponds to a Rust task.&lt;br /&gt;
* The primary tasks in the browser pipeline are represented by Blue boxes.&lt;br /&gt;
* Dashed lines indicate supervisor relationships.&lt;br /&gt;
* Gray boxes indicate tasks auxiliary to the browser pipeline.&lt;br /&gt;
* Communication channels are represented as solid lines.&lt;br /&gt;
* White boxes are represented as worker tasks. Each such box represents several tasks which varies with the workload.&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
Servo has implemented many API specifications that relies upon JavaScript that executes on all the browsers. [https://xhr.spec.whatwg.org/ XMLHttpRequest] is one such specification which is used for making HTTP requests dynamically. Our project aim is to implement few of the missing XMLHttpRequest APIs. The [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/oss_M1504_JJD OSS project] involved implementing initial steps of the [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs specifications]. It basically involved implementing overrideMimeType method and adjusting related test expectations. &lt;br /&gt;
&lt;br /&gt;
The current scope of the project involves:&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Implementing the specified behavior of the final MIME type and final charset based on the implemented override_mime_type() method in the initial steps&lt;br /&gt;
* Implementing responseXML API and document response type according to the XHR specifications&lt;br /&gt;
* Implementing withCredentials API&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
Below is an overview of the various steps identified as a part of the requirement analysis:&lt;br /&gt;
&lt;br /&gt;
''' XMLHttpRequest Interface '''&lt;br /&gt;
* We have to uncomment the responseXML API&lt;br /&gt;
* A webpage can make use of this API to read the document response &lt;br /&gt;
&lt;br /&gt;
'''XMLHttpRequest DOM '''&lt;br /&gt;
&lt;br /&gt;
# Create helper methods for final_mime_type and final_charset&lt;br /&gt;
#* Implement the two methods as per the behavior mentioned in the [https://xhr.spec.whatwg.org/#final-mime-type specification]&lt;br /&gt;
# Implement correct behavior for the text_response method&lt;br /&gt;
#* Make use of the final_charset and final_mime_type helper methods to determine the correct encoding for the response and decode the response using this encoding&lt;br /&gt;
# Create and implement a new method &amp;quot;document_response&amp;quot; according to the [https://xhr.spec.whatwg.org/#document-response xhr specification]&lt;br /&gt;
# Implement the correct behavior for the responseXML API to handle exceptions and return the document response using the method implemented above &amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml&amp;lt;/ref&amp;gt;&lt;br /&gt;
# Implement the withCredentials APIs (setter and getter) as per the [https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials specification]&lt;br /&gt;
# Add support to the send() and open() API to test the value of the withCredentials attribute where necessary&lt;br /&gt;
&lt;br /&gt;
''' net_traits '''&lt;br /&gt;
* Add a new member to the LoadData Structure which will be used by the http_loader to conditionally exclude cookies from the XHR request based on the value of the member.&lt;br /&gt;
&lt;br /&gt;
''' XHR Tests '''&lt;br /&gt;
* We need to pass [[#Proposed_Test_Cases | most tests]] related to overrideMimeType, responseXML and withCredentials present in the [https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/XMLHttpRequest XHR test-suite]&lt;br /&gt;
&lt;br /&gt;
==Component Flow Diagram==&lt;br /&gt;
{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
The tests have already been written for the XMLHttpRequest APIs related to our project. So the test cases that could validate our changes to the code are as follows:&lt;br /&gt;
&lt;br /&gt;
* overrideMimeType() in unsent state enforces Shift-JIS encoding&lt;br /&gt;
* overrideMimeType() in open state enforces UTF-8 encoding&lt;br /&gt;
* overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced&lt;br /&gt;
* overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding&lt;br /&gt;
* responseXML attribute throws InvalidStateError if response type is not null or document&lt;br /&gt;
* The various responseXML document properties are correctly initialized&lt;br /&gt;
* The type of the responseXML stylesheets and implementation must be object&lt;br /&gt;
* If the state of XMLHttpRequest is not done then responseXML is null&lt;br /&gt;
* Check withCredentials defaults to false and set value is true&lt;br /&gt;
* Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception&lt;br /&gt;
* Setting withCredentials when synchornous flag is set throws InvalidAccessError exception&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
* Steps for installing [https://github.com/rust-lang/rust rust]&lt;br /&gt;
* Building [https://github.com/servo/servo Servo]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99201</id>
		<title>CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99201"/>
		<updated>2015-11-09T23:18:28Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Added Background Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
Below is an overview of the various steps identified as a part of the requirement analysis:&lt;br /&gt;
&lt;br /&gt;
''' XMLHttpRequest Interface '''&lt;br /&gt;
* We have to uncomment the responseXML API&lt;br /&gt;
* A webpage can make use of this API to read the document response &lt;br /&gt;
&lt;br /&gt;
'''XMLHttpRequest DOM '''&lt;br /&gt;
&lt;br /&gt;
# Create helper methods for final_mime_type and final_charset&lt;br /&gt;
#* Implement the two methods as per the behavior mentioned in the [https://xhr.spec.whatwg.org/#final-mime-type specification]&lt;br /&gt;
# Implement correct behavior for the text_response method&lt;br /&gt;
#* Make use of the final_charset and final_mime_type helper methods to determine the correct encoding for the response and decode the response using this encoding&lt;br /&gt;
# Create and implement a new method &amp;quot;document_response&amp;quot; according to the [https://xhr.spec.whatwg.org/#document-response xhr specification]&lt;br /&gt;
# Implement the correct behavior for the responseXML API to handle exceptions and return the document response using the method implemented above &amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml&amp;lt;/ref&amp;gt;&lt;br /&gt;
# Implement the withCredentials APIs (setter and getter) as per the [https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials specification]&lt;br /&gt;
# Add support to the send() and open() API to test the value of the withCredentials attribute where necessary&lt;br /&gt;
&lt;br /&gt;
''' net_traits '''&lt;br /&gt;
* Add a new member to the LoadData Structure which will be used by the http_loader to conditionally exclude cookies from the XHR request based on the value of the member.&lt;br /&gt;
&lt;br /&gt;
''' XHR Tests '''&lt;br /&gt;
* We need to pass [[#Proposed_Test_Cases | most tests]] related to overrideMimeType, responseXML and withCredentials present in the [https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/XMLHttpRequest XHR test-suite]&lt;br /&gt;
&lt;br /&gt;
==Component Flow Diagram==&lt;br /&gt;
{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
The tests have already been written for the XMLHttpRequest APIs related to our project. So the test cases that could validate our changes to the code are as follows:&lt;br /&gt;
&lt;br /&gt;
* overrideMimeType() in unsent state enforces Shift-JIS encoding&lt;br /&gt;
* overrideMimeType() in open state enforces UTF-8 encoding&lt;br /&gt;
* overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced&lt;br /&gt;
* overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding&lt;br /&gt;
* responseXML attribute throws InvalidStateError if response type is not null or document&lt;br /&gt;
* The various responseXML document properties are correctly initialized&lt;br /&gt;
* The type of the responseXML stylesheets and implementation must be object&lt;br /&gt;
* If the state of XMLHttpRequest is not done then responseXML is null&lt;br /&gt;
* Check withCredentials defaults to false and set value is true&lt;br /&gt;
* Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception&lt;br /&gt;
* Setting withCredentials when synchornous flag is set throws InvalidAccessError exception&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
* Steps for installing [https://github.com/rust-lang/rust rust]&lt;br /&gt;
* Building [https://github.com/servo/servo Servo]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99002</id>
		<title>CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=99002"/>
		<updated>2015-11-09T02:00:15Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Format requirement analysis&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
Below is an overview of the various steps identified as a part of the requirement analysis:&lt;br /&gt;
&lt;br /&gt;
''' XMLHttpRequest Interface '''&lt;br /&gt;
* We have to uncomment the responseXML API&lt;br /&gt;
* A webpage can make use of this API to read the document response &lt;br /&gt;
&lt;br /&gt;
'''XMLHttpRequest DOM '''&lt;br /&gt;
&lt;br /&gt;
# Create helper methods for final_mime_type and final_charset&lt;br /&gt;
#* Implement the two methods as per the behavior mentioned in the [https://xhr.spec.whatwg.org/#final-mime-type specification]&lt;br /&gt;
# Implement correct behavior for the text_response method&lt;br /&gt;
#* Make use of the final_charset and final_mime_type helper methods to determine the correct encoding for the response and decode the response using this encoding&lt;br /&gt;
# Create and implement a new method &amp;quot;document_response&amp;quot; according to the [https://xhr.spec.whatwg.org/#document-response xhr specification]&lt;br /&gt;
# Implement the correct behavior for the responseXML API to handle exceptions and return the document response using the method implemented above &amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml&amp;lt;/ref&amp;gt;&lt;br /&gt;
# Implement the withCredentials APIs (setter and getter) as per the [https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials specification]&lt;br /&gt;
# Add support to the send() and open() API to test the value of the withCredentials attribute where necessary&lt;br /&gt;
&lt;br /&gt;
''' net_traits '''&lt;br /&gt;
* Add a new member to the LoadData Structure which will be used by the http_loader to conditionally exclude cookies from the XHR request based on the value of the member.&lt;br /&gt;
&lt;br /&gt;
''' XHR Tests '''&lt;br /&gt;
* We need to pass [[#Proposed_Test_Cases | most tests]] related to overrideMimeType, responseXML and withCredentials present in the [https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/XMLHttpRequest XHR test-suite]&lt;br /&gt;
&lt;br /&gt;
==Component Flow Diagram==&lt;br /&gt;
{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
The tests have already been written for the XMLHttpRequest APIs related to our project. So the test cases that could validate our changes to the code are as follows:&lt;br /&gt;
&lt;br /&gt;
* overrideMimeType() in unsent state enforces Shift-JIS encoding&lt;br /&gt;
* overrideMimeType() in open state enforces UTF-8 encoding&lt;br /&gt;
* overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced&lt;br /&gt;
* overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding&lt;br /&gt;
* responseXML attribute throws InvalidStateError if response type is not null or document&lt;br /&gt;
* The various responseXML document properties are correctly initialized&lt;br /&gt;
* The type of the responseXML stylesheets and implementation must be object&lt;br /&gt;
* If the state of XMLHttpRequest is not done then responseXML is null&lt;br /&gt;
* Check withCredentials defaults to false and set value is true&lt;br /&gt;
* Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception&lt;br /&gt;
* Setting withCredentials when synchornous flag is set throws InvalidAccessError exception&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
* Steps for installing [https://github.com/rust-lang/rust rust]&lt;br /&gt;
* Building [https://github.com/servo/servo Servo]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=98999</id>
		<title>CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_M1504_Implement_support_for_missing_XMLHttpRequest_APIs&amp;diff=98999"/>
		<updated>2015-11-09T01:52:56Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Added Requirement analysis&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
Below is an overview of the various steps identified as a part of the requirement analysis:&lt;br /&gt;
&lt;br /&gt;
''' XMLHttpRequest Interface '''&lt;br /&gt;
* We have to uncomment the responseXML API&lt;br /&gt;
* A webpage can make use of this API to read the document response &lt;br /&gt;
&lt;br /&gt;
'''XMLHttpRequest DOM '''&lt;br /&gt;
&lt;br /&gt;
*Create helper methods for final_mime_type and final_charset&lt;br /&gt;
** Implement the two methods as per the behavior mentioned in the [https://xhr.spec.whatwg.org/#final-mime-type specification]&lt;br /&gt;
&lt;br /&gt;
* Implement correct behavior for the text_response method&lt;br /&gt;
** Make use of the final_charset and final_mime_type helper methods to determine the correct encoding for the response and decode the response using this encoding&lt;br /&gt;
&lt;br /&gt;
* Create and implement a new method &amp;quot;document_response&amp;quot; according to the [https://xhr.spec.whatwg.org/#document-response xhr specification]&lt;br /&gt;
 &lt;br /&gt;
* Implement the correct behavior for the responseXML API to handle exceptions and return the document response using the method implemented above &amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsexml&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Implement the withCredentials APIs (setter and getter) as per the [https://xhr.spec.whatwg.org/#dom-xmlhttprequest-withcredentials specification]&lt;br /&gt;
&lt;br /&gt;
* Add support to the send() and open() API to test the value of the withCredentials attribute where necessary&lt;br /&gt;
&lt;br /&gt;
''' net_traits '''&lt;br /&gt;
* Add a new member to the LoadData Structure which will be used by the http_loader to conditionally exclude cookies from the XHR request based on the value of the member.&lt;br /&gt;
&lt;br /&gt;
''' XHR Tests '''&lt;br /&gt;
* We need to pass [[#Proposed_Test_Cases | most tests]] related to overrideMimeType, responseXML and withCredentials present in the [https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/XMLHttpRequest XHR test-suite]&lt;br /&gt;
&lt;br /&gt;
==Component Flow Diagram==&lt;br /&gt;
{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
The tests have already been written for the XMLHttpRequest APIs related to our project. So the test cases that could validate our changes to the code are as follows:&lt;br /&gt;
&lt;br /&gt;
* overrideMimeType() in unsent state enforces Shift-JIS encoding&lt;br /&gt;
* overrideMimeType() in open state enforces UTF-8 encoding&lt;br /&gt;
* overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced&lt;br /&gt;
* overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding&lt;br /&gt;
* responseXML attribute throws InvalidStateError if response type is not null or document&lt;br /&gt;
* The various responseXML document properties are correctly initialized&lt;br /&gt;
* The type of the responseXML stylesheets and implementation must be object&lt;br /&gt;
* If the state of XMLHttpRequest is not done then responseXML is null&lt;br /&gt;
* Check withCredentials defaults to false and set value is true&lt;br /&gt;
* Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception&lt;br /&gt;
* Setting withCredentials when synchornous flag is set throws InvalidAccessError exception&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
* Steps for installing [https://github.com/rust-lang/rust rust]&lt;br /&gt;
* Building [https://github.com/servo/servo Servo]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=98985</id>
		<title>CSC/ECE 517 Fall 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=98985"/>
		<updated>2015-11-08T21:58:55Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Added link to M1504&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/sample_page]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/ossE1558BGJ]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss/M1502/AAAASS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss/M1503/IntegrateXMLParser]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/ossE1568BZHXJS]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/ossE1572VGA]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/oss_E1573_sap]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1559 rrz]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1570 avr]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1556 CHM]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1504 JJD]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1562 APS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1501 GSN]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1501 GSN]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1550 KMM]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1551 RGS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1555 GMR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1552 NFR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1565 AAJ]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1561 WZL]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1553 AAJ]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1554 AAR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1569 JNR]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1560 PSV]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss M1505 MSV]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1557 GXM]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1566 ARB]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1567 APT]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1574 BKS]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/ossA1550RAN]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1571]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1577 MayYellowRoverJump]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1586 AnonymousChatBetweenAuthorAndReviewer]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1582 Create integration tests for the instructor interface using capybara and rspec]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1576 Refactoring submitted content (hyperlinks and files)]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1590 Integration testing for Team creation]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1585 Use Ajax for Add Participants, Add TA ,Edit Questionnaires Screens]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1581 Integration testing for student interface]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1583 Fix the CSS used for Menu Item]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1591 Integration testing for peer review]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs]]&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=98194</id>
		<title>CSC/ECE 517 Fall 2015/oss M1504 JJD</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=98194"/>
		<updated>2015-11-06T00:49:02Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Added a testing section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;M1504: Implement support for missing XMLHttpRequest APIs&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://xhr.spec.whatwg.org/ XMLHttpRequest] is one of the implemented API specifications of Servo that relies upon JavaScript and is used for making dynamic HTTP requests. The goal of the project was to implement support for less common but missing features of the XMLHttpRequest API for [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo].&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is not to create a full browser but is rather to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Servo is built on top of Rust to provide a secure and reliable foundation and is focused on creating a reliable and fast browser engine.&lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
Rust is a modern, fast, memory safe and multithreaded programming language that focuses on speed and safety for developing reliable and efficient systems. It eliminates all data races by having numerous compile-time safety checks that adds no runtime overhead.&amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/book/README.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
Design patterns are not applicable as our task involved just implementing a method. However, the [[CSC/ECE_517_Fall_2015/oss_M1504_JJD#Implementation|Implementation]] section below provides details of the steps as why it was implemented, the way it was implemented.&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
The scope of the project was to complete the initial steps mentioned [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs here].&lt;br /&gt;
&lt;br /&gt;
The steps are as follows:&lt;br /&gt;
* compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* uncomment the overrideMimeType API in XMLHttpRequest.webidl, and add a stub method that allows Servo to compile again to xmlhttprequest.rs.&lt;br /&gt;
* run the tests via ./mach test-wpt tests/wpt/web-platform-tests/XMLHttpRequest/ and adjust the expectations for any that now pass (tests/wpt/metadata/XMLHttpRequest/)&lt;br /&gt;
* add new override_charset and override_mime_type fields to the XMLHttpRequest structure&lt;br /&gt;
* implement the overrideMimeType steps described in the specification&lt;br /&gt;
* update any tests that now pass&lt;br /&gt;
&lt;br /&gt;
The subsequent steps mentioned [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs here] are to be done for the final project.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
As we need to implement the overrideMimeType() method, we have uncommented the overrideMimeType() method from the XMLHttpRequest interface (components/script/dom/webidls/XMLHttpRequest.webidl).&lt;br /&gt;
&lt;br /&gt;
[[File:Uncomment-overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
As two new fields are necessary for overrideMimeType() method implementation, override_mime_type to store the mime type of the mime passed in the argument and override_charset to store the charset of the mime passed in the argument. &lt;br /&gt;
Hence, we have added two new fields: override_mime_type and override_charset to the XMLHttpRequest structure.&lt;br /&gt;
&lt;br /&gt;
[[File:XHRStruct.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
Finally, we have implemented the overrideMimeType method according to the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method XHR specifications].&lt;br /&gt;
* If the state is loading or done, we have returned Invalid State Error&lt;br /&gt;
* Then we have parsed the mime passed in the argument&lt;br /&gt;
* If the parsing of mime was successful, we have saved the appropriate values in override_mime_type and override_charset&lt;br /&gt;
&lt;br /&gt;
[[File:overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Following are the steps to run all the tests for XMLHttpRequest:&lt;br /&gt;
&lt;br /&gt;
# Install the pre-requisites required for servo as mentioned [https://github.com/servo/servo/blob/master/README.md here] &lt;br /&gt;
# Run the following commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  cd&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git clone https://github.com/jitendra29/servo.git&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd servo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 git checkout -b test origin/overrideMimeType&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach build --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: It may take around 30 mins to build&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach test-wpt XMLHttpRequest/ --release&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see that all tests pass as expected.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' We have not added any new tests to the test suite as servo follows TDD and tests were previously written for XMLHttpRequest. We have just adjusted some of the test expectations for the tests which now pass due to our implementation.&lt;br /&gt;
&lt;br /&gt;
=== Testing From UI ===&lt;br /&gt;
&lt;br /&gt;
Our project cannot be tested from UI since it is basically improving some javascript features (XMLHttpRequest) in servo. However you can check that it doesn't break the existing code and the browser runs correctly by running a test page on servo after performing the build as mentioned above.&lt;br /&gt;
&lt;br /&gt;
Run the following command after the project is build: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==Pull Request==&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/8182 pull request]. In the link you can see all code snippets changed due to implementing the above steps, as well as integration test progression information.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=97955</id>
		<title>CSC/ECE 517 Fall 2015/oss M1504 JJD</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=97955"/>
		<updated>2015-11-01T01:11:55Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;M1504: Implement support for missing XMLHttpRequest APIs&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://xhr.spec.whatwg.org/ XMLHttpRequest] is one of the implemented API specifications of Servo that relies upon JavaScript and is used for making dynamic HTTP requests. The goal of the project was to implement support for less common but missing features of the XMLHttpRequest API for [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo].&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We uncommented the overrideMimeType() method from the XMLHttpRequest interface (components/script/dom/webidls/XMLHttpRequest.webidl)&lt;br /&gt;
&lt;br /&gt;
[[File:Uncomment-overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We have added two new fields: override_mime_type and override_charset to the XMLHttpRequest structure.&lt;br /&gt;
&lt;br /&gt;
[[File:XHRStruct.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
Finally, we have implemented the overrideMimeType method according to the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method XHR specifications]&lt;br /&gt;
&lt;br /&gt;
[[File:overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
==Pull Request==&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/8182 pull request]. In the link you can see all code snippets changed due to implementing the above steps, as well as integration test progression information.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=97954</id>
		<title>CSC/ECE 517 Fall 2015/oss M1504 JJD</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=97954"/>
		<updated>2015-11-01T01:11:22Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Modified the implementation steps&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;M1504: Implement support for missing XMLHttpRequest APIs&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://xhr.spec.whatwg.org/ XMLHttpRequest] is one of the implemented API specifications of Servo that relies upon JavaScript and is used for making dynamic HTTP requests. The goal of the project was to implement support for less common but missing features of the XMLHttpRequest API for [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo].&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
&lt;br /&gt;
We uncommented the overrideMimeType() method from the XMLHttpRequest interface (components/script/dom/webidls/XMLHttpRequest.webidl)&lt;br /&gt;
&lt;br /&gt;
[[File:Uncomment-overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
&lt;br /&gt;
We have added two new fields: override_mime_type and override_charset to the XMLHttpRequest structure.&lt;br /&gt;
&lt;br /&gt;
[[File:XHRStruct.png]]&lt;br /&gt;
&lt;br /&gt;
===Step 3===&lt;br /&gt;
&lt;br /&gt;
Finally, we have implemented the overrideMimeType method according to the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method XHR specifications]&lt;br /&gt;
&lt;br /&gt;
[[File:overrideMimeType.png]]&lt;br /&gt;
&lt;br /&gt;
===Pull Request===&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/8182 pull request]. In the link you can see all code snippets changed due to implementing the above steps, as well as integration test progression information.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment-overrideMimeType.png&amp;diff=97921</id>
		<title>File:Uncomment-overrideMimeType.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment-overrideMimeType.png&amp;diff=97921"/>
		<updated>2015-11-01T00:49:00Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: uploaded a new version of &amp;amp;quot;File:Uncomment-overrideMimeType.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment-overrideMimeType.png&amp;diff=97914</id>
		<title>File:Uncomment-overrideMimeType.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment-overrideMimeType.png&amp;diff=97914"/>
		<updated>2015-11-01T00:46:00Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: uploaded a new version of &amp;amp;quot;File:Uncomment-overrideMimeType.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:OverrideMimeType.png&amp;diff=97900</id>
		<title>File:OverrideMimeType.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:OverrideMimeType.png&amp;diff=97900"/>
		<updated>2015-11-01T00:35:33Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:XHRStruct.png&amp;diff=97899</id>
		<title>File:XHRStruct.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:XHRStruct.png&amp;diff=97899"/>
		<updated>2015-11-01T00:35:19Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment-overrideMimeType.png&amp;diff=97897</id>
		<title>File:Uncomment-overrideMimeType.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Uncomment-overrideMimeType.png&amp;diff=97897"/>
		<updated>2015-11-01T00:34:30Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=97875</id>
		<title>CSC/ECE 517 Fall 2015/oss M1504 JJD</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/oss_M1504_JJD&amp;diff=97875"/>
		<updated>2015-11-01T00:15:03Z</updated>

		<summary type="html">&lt;p&gt;Jsjain: Updated implementation steps to include&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt;M1504: Implement support for missing XMLHttpRequest APIs&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://xhr.spec.whatwg.org/ XMLHttpRequest] is one of the implemented API specifications of Servo that relies upon JavaScript and is used for making dynamic HTTP requests. The goal of the project was to implement support for less common but missing features of the XMLHttpRequest API for [https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo].&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
Servo &amp;lt;ref&amp;gt; https://github.com/servo/servo &amp;lt;/ref&amp;gt; is a web browser layout engine written in [https://github.com/rust-lang/rust Rust]&amp;lt;ref&amp;gt;https://github.com/rust-lang/rust&amp;lt;/ref&amp;gt; and is currently being developed by [https://en.wikipedia.org/wiki/Mozilla Mozilla Research]. The aim of the project is to create a highly parallel environment that allows for many components be handled by fine-grained, isolated tasks.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Rust_(programming_language) Rust] is a multi-paradigm, compiled programming language that is a good language for creating highly safe systems. Rust and Servo have a symbiotic relationship as the development of servo has influenced the design of the language.&lt;br /&gt;
&lt;br /&gt;
===XMLHttpRequest===&lt;br /&gt;
&amp;quot;[https://xhr.spec.whatwg.org/ XMLHttpRequest] is a definition of an [https://en.wikipedia.org/wiki/Application_programming_interface API] that provides scripted client functionality for transferring data between a client and a server.&amp;quot;&amp;lt;ref&amp;gt;https://xhr.spec.whatwg.org/&amp;lt;/ref&amp;gt; XMLHttpRequest provides a way for data to be retrieved from a URL without having to retrieve the entire page. It supports protocols other than HTTP and can be used to retrieve any type of data.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
The following steps were followed to meet the project requirements as per this [https://github.com/servo/servo/wiki/Implement-support-for-missing-XMLHttpRequest-APIs github page].&lt;br /&gt;
&lt;br /&gt;
===Step 1===&lt;br /&gt;
*compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
*uncomment the overrideMimeType API in XMLHttpRequest.webidl (components/script/dom/webidls/XMLHttpRequest.webidl), and add a stub method that allows Servo to compile again to xmlhttprequest.rs(components/script/dom/xmlhttprequest.rs).&lt;br /&gt;
*run the tests via &amp;lt;code&amp;gt;./mach test-wpt tests/wpt/web-platform-tests/XMLHttpRequest/ &amp;lt;/code&amp;gt; and adjust the expectations for any that now pass (tests/wpt/metadata/XMLHttpRequest/)&lt;br /&gt;
*add new override_charset and override_mime_type fields to the XMLHttpRequest structure&lt;br /&gt;
*implement the overrideMimeType steps described in the [https://xhr.spec.whatwg.org/#the-overridemimetype%28%29-method xhr specifications]&lt;br /&gt;
*update any tests that now pass&lt;br /&gt;
&lt;br /&gt;
===Pull Request===&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/8182 pull request]. In the link you can see all code snippets changed due to implementing the above steps, as well as integration test progression information.&lt;br /&gt;
&lt;br /&gt;
===Design Patterns and Principles===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jsjain</name></author>
	</entry>
</feed>