CSC/ECE 517 Fall 2015 M1504 Implement support for missing XMLHttpRequest APIs

From Expertiza_Wiki
Revision as of 01:51, 9 November 2015 by Jmehta2 (talk | contribs) (Added Proposed Test Cases section)
Jump to navigation Jump to search

Introduction

Servo

Servo <ref> https://github.com/servo/servo </ref> is a web browser layout engine written in Rust<ref>https://github.com/rust-lang/rust</ref> and is currently being developed by 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.<ref>https://en.wikipedia.org/wiki/Servo_(layout_engine)</ref>

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.

Rust

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.

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.<ref> http://doc.rust-lang.org/nightly/book/README.html</ref>

XMLHttpRequest

"XMLHttpRequest is a definition of an API that provides scripted client functionality for transferring data between a client and a server."<ref>https://xhr.spec.whatwg.org/</ref> 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.<ref>https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest</ref>

Component Flow Diagram

{{wide image|Component Flow Diagram.png|1000px|alt=component flow diagram)}

Proposed Test Cases

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:

  • overrideMimeType() in unsent state enforces Shift-JIS encoding
  • overrideMimeType() in open state enforces UTF-8 encoding
  • overrideMimeType() in open state and XML MIME type with UTF-8 charset is correctly enforced
  • overrideMimeType() in HEADERS RECEIVED state enforces Shift-JIS encoding
  • responseXML attribute throws InvalidStateError if response type is not null or document
  • The various responseXML document properties are correctly initialized
  • The type of the responseXML stylesheets and implementation must be object
  • If the state of XMLHttpRequest is not done then responseXML is null
  • Check withCredentials defaults to false and set value is true
  • Setting withCredentials when not in UNSENT, OPENED state throws InvalidStateError exception
  • Setting withCredentials when synchornous flag is set throws InvalidAccessError exception

Appendix

References

<references/>