Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement attribute getter of Location #5591 #6135

Closed
wants to merge 1 commit into from

Conversation

@shinglyu
Copy link
Member

shinglyu commented May 19, 2015

Reopening @yodalee 's #5597

Review on Reviewable

@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented May 19, 2015

Critic review: https://critic.hoppipolla.co.uk/r/5051

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@larsbergstrom
Copy link
Contributor

larsbergstrom commented May 19, 2015

// FIXME: Url null check is skipped for now
let host = match url.host() {
None => "".to_owned(),
Some(host) => format!("{}", host)

This comment has been minimized.

Copy link
@Manishearth

Manishearth May 20, 2015

Member

nit: we format host twice here, perhaps we shouldn't (instead do all formatting in the match below)

@Manishearth
Copy link
Member

Manishearth commented May 20, 2015

Could you file a followup about making these attributes writeable, and about fixing the nullable-URL thing? (the current implementation using Window is wrong; I think).

Or just fix them here :)

I think the url should be an Option<Url> or something; not referencing an existing object, and nullable. The constructors should set it from the window or elsewhere as per the steps in the spec.

(I haven't read through the spec, just making guesses from the portions I saw, so I could be wrong here)

@shinglyu
Copy link
Member Author

shinglyu commented May 20, 2015

Per @Ms2ger's suggestion, I'll add a test to data url.

@Manishearth I think I'll open a followup for writable and nullable url. I don't want to block other people for too long. :)

@shinglyu
Copy link
Member Author

shinglyu commented May 20, 2015

@Ms2ger : It turns out that there are two problems the prevent the data url test for location getters:

  1. #5500 prevents me from using iframe.contentWindow.location, the contentWindow will be null if I don't use a timeout
  2. Most of the location getters will return "", but the null check is not enabled. So I'll enable them (and add the test) in the followup bug.
@shinglyu
Copy link
Member Author

shinglyu commented May 20, 2015

Review status: 0 of 11 files reviewed, 1 unresolved discussion, all commit checks successful.


components/script/dom/urlhelper.rs, line 65 [r2] (raw file):
Done. (I'm not sure about how to use Reviewable, should I mark this as done manually?)


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented May 20, 2015

@shinglyu You can click the "acknowledge" button to mark issues as resolved in Reviewable.

@Manishearth
Copy link
Member

Manishearth commented May 23, 2015

Review status: :shipit: all files reviewed, all discussions resolved, all commit checks successful.
Reviewed files:

  • components/script/dom/location.rs @ r1
  • components/script/dom/urlhelper.rs @ r3
  • components/script/dom/webidls/URLUtils.webidl @ r1
  • tests/wpt/metadata/html/browsers/history/the-location-interface/location_host.html.ini @ r2
  • tests/wpt/metadata/html/browsers/history/the-location-interface/location_hostname.html.ini @ r2
  • tests/wpt/metadata/html/browsers/history/the-location-interface/location_pathname.html.ini @ r2
  • tests/wpt/metadata/html/browsers/history/the-location-interface/location_port.html.ini @ r2
  • tests/wpt/metadata/html/browsers/history/the-location-interface/location_protocol.html.ini @ r2
  • tests/wpt/metadata/XMLHttpRequest/send-authentication-basic-cors.htm.ini @ r2
  • tests/wpt/metadata/XMLHttpRequest/send-authentication-basic-setrequestheader.htm.ini @ r2
  • tests/wpt/metadata/XMLHttpRequest/timeout-cors-async.htm.ini @ r2

Comments from the review on Reviewable.io

@Manishearth
Copy link
Member

Manishearth commented May 23, 2015

@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2015

📌 Commit dc63efb has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2015

Testing commit dc63efb with merge 9511425...

bors-servo pushed a commit that referenced this pull request May 23, 2015
Reopening @yodalee 's #5597

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6135)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2015

💔 Test failed - mac1

@Manishearth
Copy link
Member

Manishearth commented May 23, 2015


/Users/servo/buildbot/slave/mac1/build/components/script/dom/urlhelper.rs:65:13: 65:17 error: expected one of `,`, `.`, `}`, or an operator, found `Some`
/Users/servo/buildbot/slave/mac1/build/components/script/dom/urlhelper.rs:65             Some(host) => host
@shinglyu
Copy link
Member Author

shinglyu commented May 24, 2015

Oops, let me fix that right away

@jdm
Copy link
Member

jdm commented Jun 1, 2015

@shinglyu Could you squash the compile error into the original commit?

@bors-servo
Copy link
Contributor

bors-servo commented Jun 2, 2015

Testing commit 3723684 with merge 3ede47e...

bors-servo pushed a commit that referenced this pull request Jun 2, 2015
Reopening @yodalee 's #5597

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6135)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 2, 2015

💔 Test failed - mac1

@shinglyu
Copy link
Member Author

shinglyu commented Jun 2, 2015

I remember I dealt with those tests before, let me check. Sorry!

@jdm
Copy link
Member

jdm commented Jun 2, 2015

/XMLHttpRequest/send-after-setting-document-domain.htm
------------------------------------------------------
FAIL loading documents from original origin after setting document.domain
OK expected TIMEOUT [Parent]
/XMLHttpRequest/timeout-cors-async.htm
--------------------------------------
FAIL XMLHttpRequest: timeout event and cross-origin request
/workers/WorkerLocation_host.htm
--------------------------------
FAIL  WorkerLocation URL decomposition IDL attribute: host 
/workers/WorkerLocation_hostname.htm
------------------------------------
FAIL  WorkerLocation URL decomposition IDL attribute: hostname 
/workers/WorkerLocation_port.htm
--------------------------------
FAIL  WorkerLocation URL decomposition IDL attribute: port 
/workers/WorkerLocation_protocol.htm
------------------------------------
FAIL  WorkerLocation URL decomposition IDL attribute: protocol 
@jdm jdm added S-tests-failed and removed S-awaiting-merge labels Jun 2, 2015
@shinglyu
Copy link
Member Author

shinglyu commented Jun 2, 2015

I disabled those tests locally, but didn't commit the .inis. Let me check if they should be disabled or not.

@jdm
Copy link
Member

jdm commented Jun 2, 2015

Disabling (ie. not running) is the wrong choice here. Those are valid results; the tests now check more things because they were previously stopping silently on properties of location that didn't exist.

@snf
Copy link
Contributor

snf commented Jun 3, 2015

These tests are failing because WorkerLocation implement URLUtilsReadOnly which this patch does not include. These was passing before because both (URLUtils and URLUtilsReadOnly) returned undefined. I think the right choice would be to make the tests fail and wait for another patch to implement URLUtilsReadOnly.
I was working in this but I noticed this PR so I will work it from here (also have other patches for Worker)

@shinglyu
Copy link
Member Author

shinglyu commented Jun 4, 2015

Fernandez, thanks for the information, I'll disable them.

Sebastian N. Fernandez notifications@github.com 於 2015年6月4日 週四 上午12:54寫道:

These tests are failing because WorkerLocation implement URLUtilsReadOnly
which this patch does not include. These was passing before because both
(URLUtils and URLUtilsReadOnly) returned undefined. I think the right
choice would be to make the tests fail and wait for another patch to
implement URLUtilsReadOnly.
I was working in this but I noticed this PR so I will work it from here
(also have other patches for Worker)


Reply to this email directly or view it on GitHub
#6135 (comment).

@snf
Copy link
Contributor

snf commented Jun 4, 2015

@shinglyu I think you have to change them to FAIL, not disable them.

@shinglyu
Copy link
Member Author

shinglyu commented Jun 5, 2015

@snf: sorry, I mean turn them to expected FAIL.

@shinglyu
Copy link
Member Author

shinglyu commented Jun 9, 2015

Seems like the WorkerLocation tests are failing due to the reason mentioned by @snf .
The XMLHttpRequest is failing because document.domain is undefined, which seems to be caused by #934

So can I change them to expected FAIL for now?

@Ms2ger
Copy link
Contributor

Ms2ger commented Jun 12, 2015

Sure

@nox
Copy link
Member

nox commented Jun 13, 2015

Err, didn't realise that my #6371 supersedes this.

@shinglyu shinglyu force-pushed the shinglyu:5597 branch from 3723684 to 7830f10 Jun 14, 2015
@shinglyu
Copy link
Member Author

shinglyu commented Jun 14, 2015

@nox: sorry, I should have make this merge earlier.

@vectorijk
Copy link
Contributor

vectorijk commented Jun 14, 2015

@shinglyu I am a newbie and diving into how to implement the history api(forward and back). It may be helpful for me to add origin( https://url.spec.whatwg.org/#dom-urlutils-origin) into urlhelper.rs. Is that reasonable? Thanks~

@shinglyu
Copy link
Member Author

shinglyu commented Jun 15, 2015

@vectorijk : I am also quite new to this area, I think is reasonable, but you might need to consult someone who is more experienced then me.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 21, 2015

The latest upstream changes (presumably #6371) made this pull request unmergeable. Please resolve the merge conflicts.

@shinglyu
Copy link
Member Author

shinglyu commented Jul 1, 2015

#6371 implemented this. Should I close it?

@jdm
Copy link
Member

jdm commented Jul 1, 2015

I guess so!

@jdm jdm closed this Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

You can’t perform that action at this time.