Skip to content

Implement support for missing XMLHttpRequest APIs

Josh Matthews edited this page Sep 17, 2015 · 1 revision

Implement support for missing XMLHttpRequest APIs

Background information: Servo implements many API specifications that are relied upon by the JavaScript that executes on pages all over the internet. One of these is XMLHttpRequest, which is used to make HTTP requests dynamically. Some of the less common features of this API are currently unimplemented in Servo, so addressing this shortfall will improve our compatibility with the web of today.

Initial steps:

  • compile Servo and ensure that it runs on tests/html/about-mozilla.html
  • email the mozilla.dev.servo mailing list introducing your group and your progress
  • uncomment the overrideMimeType API in XMLHttpRequest.webidl, and add a stub method that allows Servo to compile again to xmlhttprequest.rs.
  • 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/)
  • add new override_charset and override_mime_type fields to the XMLHttpRequest structure
  • implement the overrideMimeType steps described in the specification
  • update any tests that now pass

Subsequent steps:

  • implement the specified behaviour for the override MIME type/final MIME type and override charset/final charset (see uses of final MIME type in various places in the spec)
  • uncomment and implement the responseXML API and document response type (and associated responseType behaviour)
  • support the withCredentials API
    • implement the XMLHttpRequest API and associated changes to other APIs (search for withCredentials)
    • implement basic network-level support by adding a member to LoadData that is used by http_loader.rs to conditionally exclude cookies from the HTTP request if the flag is false (default true)
Clone this wiki locally