Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplemented XMLHttpRequest.responseURL #9518
Conversation
|
Hi @shinglyu! Does the problem you mentioned in the issue still occur? |
| "url": "/XMLHttpRequest/responseurl.html" | ||
| } | ||
| ], | ||
| "html/webappapis/scripting/events/event-handler-onresize.html": [ |
This comment has been minimized.
This comment has been minimized.
| @@ -3,12 +3,6 @@ | |||
| [domain] | |||
| expected: FAIL | |||
|
|
|||
| [URL] | |||
This comment has been minimized.
This comment has been minimized.
jdm
Feb 3, 2016
Member
Huh, I'm confused why this test result changed. The test doesn't use responseURL at all.
| assert_equals(client.responseURL, "") | ||
| client.open("GET", "foo.html", false) | ||
| client.send() | ||
| assert_equals(client.responseURL, "http://web-platform.test:8000/XMLHttpRequest/foo.html") |
This comment has been minimized.
This comment has been minimized.
jdm
Feb 3, 2016
Member
This should use http://mxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/XMLHttpRequest/responsexml-document-properties.htm?force=1#18 so it will work on other hosts as well.
| <body> | ||
| <div id="log"></div> | ||
| <script> | ||
| test(function() { |
This comment has been minimized.
This comment has been minimized.
jdm
Feb 3, 2016
Member
We should also have a test that uses an HTTP redirect (resources/redirect.py) and ensures that responseURL shows the post-redirect URL.
| @@ -901,6 +901,7 @@ impl XMLHttpRequest { | |||
|
|
|||
| // Subsubsteps 5-7 | |||
| self.send_flag.set(false); | |||
| *self.response_url.borrow_mut() = self.request_url.borrow().clone().unwrap().serialize_no_fragment(); | |||
This comment has been minimized.
This comment has been minimized.
jdm
Feb 3, 2016
Member
self.request_url.borrow().as_ref().unwrap().serialize_no_fragment() will avoid the clone.
|
@bors-servo: try |
Implemented XMLHttpRequest.responseURL Resolves #8830 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9518) <!-- Reviewable:end -->
|
|
|
Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions. tests/wpt/web-platform-tests/XMLHttpRequest/responseurl.html, line 12 [r1] (raw file): Comments from the review on Reviewable.io |
|
@KiChjang : Yes I still have the issue, so I run the full XMLHttpRequest suite everytime. |
|
|
|
Aha, I figured out why the responseXML tests started passing - we use Reviewed 1 of 4 files at r1, 3 of 3 files at r2. Comments from the review on Reviewable.io |
|
I changed the redirect test to redirect to |
|
Redirections are handled entirely |
|
@shinglyu Almost there! Do you need help with rebasing? |
|
Errrrrr! I found out that this computer's servo clone is a very old one, which has the |
|
I though I could use my old desktop computer as my build machine, so I can free my laptop for development, but it turns out the Servo repository in that machine is too old. :'( |
| client.send() | ||
|
|
||
| expected = location.href.replace(/[^/]*$/, "resources/" + target) | ||
| assert_not_equals(client.status, 404) |
This comment has been minimized.
This comment has been minimized.
jdm
Mar 21, 2016
Member
I left a review comment about making this assert the actual status we're looking for; could you address that?
| expected = location.href.replace(/[^/]*$/, 'foo.html') | ||
| assert_equals(client.status, 404) | ||
| assert_equals(client.responseURL, expected) | ||
| }) |
This comment has been minimized.
This comment has been minimized.
jdm
Mar 21, 2016
Member
Let's add a description for this test (, "404 response has proper responseURL")).
| expected = location.href.replace(/[^/]*$/, "resources/" + target) | ||
| assert_not_equals(client.status, 404) | ||
| assert_equals(client.responseURL, expected) | ||
| }) |
This comment has been minimized.
This comment has been minimized.
|
Sorry, just noticed a couple final issues. Almost there! |
|
Sorry, ambiguous wording on my part previously. Reviewed 2 of 2 files at r9, 1 of 1 files at r10. tests/wpt/web-platform-tests/XMLHttpRequest/responseurl.html, line 22 [r9] (raw file): tests/wpt/web-platform-tests/XMLHttpRequest/responseurl.html, line 34 [r9] (raw file): Comments from the review on Reviewable.io |
|
@bors-servo: r+ Reviewed 1 of 1 files at r11. Comments from the review on Reviewable.io |
|
|
Implemented XMLHttpRequest.responseURL Resolves #8830 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9518) <!-- Reviewable:end -->
|
|
shinglyu commentedFeb 3, 2016
Resolves #8830