You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-content/domInteracting with the DOM from web contentB-metaThis issue tracks the status of multiple, related pieces of workC-assignedThere is someone working on resolving the issue
This issue is tracking the implementation of the JS fetch API following the project plan. This is assigned to our RGSoC team, so please talk with me before starting to work on any part of it.
I expect the vast majority of code changes to take place in components/script/dom/ - this is the code that's responsible for implementing the APIs that websites make use of, as well as exposing them to the JS environment
in particular, each new interface that needs to be implemented (Request, Response, and Headers) will need to follow the steps for creating a new interface
there are already tests for the missing interfaces, which can be run via ./mach test-wpt tests/wpt/web-platform-tests/fetch/api/request/ (similarly for fetch/api/response/ and fetch/api/headers/) - you can learn more about the testing infrastructure in our in-tree documentation and the testharness documentation
the majority of files in components/script/dom/ correspond to similarly-named interfaces defined in WebIDL files in components/script/dom/webidls/ - when confused about something, look for examples of other interfaces and how they relate to the Rust implementation in the corresponding source files
our documentation attempts to explain the complexities of exposing Rust code via JavaScript APIs; it is entirely likely that large parts of those explanations will be confusing as you're starting out, but keep in mind that documentation exists and please make suggestions about ways it could be improved :)
when implementing new interfaces, it is recommended to comment out everything and get a working servo build, then work on uncommenting one attribute or method member of the interface at a time. If at any time some piece of WebIDL syntax causes a python exception to occur while compiling, feel free to comment it out and ask whether it's necessary - there are a number of pieces of the WebIDL specification that Servo does not support properly yet.
2 subtests: how Body is used to initialize Request
1 subtest: missing Body methods
1 is related to referrer not being properly parsed, i.e. about:client becomes client. RequestInfo (which is used as an input for constructing Request) will have a referrer Client when about:client is given. This results in Request with a referrer client when it should be about:client. Could this be an error in how input for request is created?
1 is related to referrer and referrer policy not being properly saved in request like above
if a request is disturbed, various things should/should not happen
request-disturbed.html
request header should be created with various objects (JS Object, array, headers) and get information from the body if none is given
request-headers.html
request-error.html
referrer should be properly parsed, i.e. currently, about:client becomes client. RequestInfo (which is used as an input for constructing Request) will have a referrer Client when about:client is given. This results in Request with a referrer client when it should be about:client. Could this be an error in how input for request is created?
request-init-001.sub.html
request's body should be initialized in various ways
request-init-002.html
request should be initialized correctly
request-init-003.sub.html
fetch/api/response/
static method error() should return correct response
response-static-error.html
Stream/ReadableStream should be supported
response-cancel-stream.html
response-consume-stream.html
after response's body is locked, promise should reject
response-stream-disturbed-*.html
response's body should be initialized in various ways
response-init-002.html
default Body should be given in response
response-init-001.html
body mixin methods should be implemented
response-consume-empty.html
response-consume.html
clone() should return a response that is identical to the original response
A-content/domInteracting with the DOM from web contentB-metaThis issue tracks the status of multiple, related pieces of workC-assignedThere is someone working on resolving the issue
Activity
fitzgen commentedon Jun 29, 2016
cc myself
jdm commentedon Jun 30, 2016
Things to be aware of when starting this project:
components/script/dom/- this is the code that's responsible for implementing the APIs that websites make use of, as well as exposing them to the JS environment./mach test-wpt tests/wpt/web-platform-tests/fetch/api/request/(similarly forfetch/api/response/andfetch/api/headers/) - you can learn more about the testing infrastructure in our in-tree documentation and the testharness documentationcomponents/script/dom/correspond to similarly-named interfaces defined in WebIDL files incomponents/script/dom/webidls/- when confused about something, look for examples of other interfaces and how they relate to the Rust implementation in the corresponding source filesjeenalee commentedon Jul 1, 2016
cc'ing myself
jeenalee commentedon Sep 1, 2016
NOTE: This summary is outdated. The web platform tests have been updated.
So far, the Headers, Request, and Response APIs have been mostly implemented. Some web platform tests for these APIs fail:
fetch/api/headers:FAIL: 15 subtestsappendanddelete#13004)TIMEOUT: 1 testfetch/api/headers/headers-idl.htmlfetch/api/request:FAIL: 11 subteststext()about:clientbecomesclient.RequestInfo(which is used as an input for constructingRequest) will have a referrerClientwhenabout:clientis given. This results inRequestwith a referrerclientwhen it should beabout:client. Could this be an error in how input for request is created?TIMEOUT: 4 testsfetch/api/request/request-init-003.sub.htmlfetch/api/request/request-clone.sub.htmlfetch/api/request/request-idl.htmlfetch/api/request/request-disturbed.htmlfetch/api/response:FAIL: 13 subteststext()blob()TIMEOUT: 1 testfetch/api/request/response-idl.htmljeenalee commentedon Sep 28, 2016
Updated summary of failing tests
fetch/api/basic/fetch/api/cors/fetch/api/credentials/authentication-basic-worker.htmlauthentication-basic.htmlcookies-worker.htmlcookies.htmlfetch/api/headers/headers-idl.htmlisn't passingfetch/api/policies/csp-blocked.htmlcsp-blocked-worker.htmlreferrer-no-referrer-worker.htmlreferrer-no-referrer.htmlreferrer-origin-when-cross-origin-worker.htmlreferrer-origin-when-cross-origin.htmlreferrer-origin-worker.htmlreferrer-origin.htmlreferrer-unsafe-url.htmlreferrer-unsafe-url-worker.htmlfetch/api/redirect/fetch/api/request/clone()should return a request that is identical to the original requestrequest-clone.sub.htmlrequest-cache.htmlis disabled (Intermittent timeout in /fetch/api/request/request-cache.html #13458)request-consume-empty.htmlrequest-consume.htmlrequest-disturbed.htmlrequest-headers.htmlrequest-error.htmlrequest-init-001.sub.htmlrequest-init-002.htmlrequest-init-003.sub.htmlfetch/api/response/error()should return correct responseresponse-static-error.htmlStream/ReadableStreamshould be supportedresponse-cancel-stream.htmlresponse-consume-stream.htmlresponse-stream-disturbed-*.htmlresponse-init-002.htmlresponse-init-001.htmlresponse-consume-empty.htmlresponse-consume.htmlclone()should return a response that is identical to the original responseresponse-clone.htmlAuto merge of #13733 - jeenalee:request-clone, r=jdm
jdm commentedon Oct 13, 2016
I think filing specific issues for anything that isn't working will be more useful at this point.