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 up#10141 : Document::location set null for documents without a browsing context #10257
Conversation
highfive
commented
Mar 29, 2016
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @SimonSapin (or someone else) soon. |
highfive
commented
Mar 29, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Mar 29, 2016
|
Did you compile this locally? |
|
oh.. my bad! switching my laptop created the mess! |
|
No problem; let me know when it works :) |
|
The internet bandwidth in my country is really pathetic! couldn't build servo yet, it's been like 10 hours! |
|
Ah, I forgot about that. Attributes that can return null are called |
|
@slayerjain Please rebase your commit on top of master. There shouldn't be any merge commit in this branch. Feel free to ask questions if you don't know how to do this, either here or on IRC. |
|
@nox Can you please explain the process, just to verify what i'm thinking? :) |
|
@slayerjain There needs to be only one commit on the branch, 04f6488, and there shouldn't be any merge on top of it. So I update my local master branch from upstream, check out the branch first_bug, do |
|
Here's documentation on how the entire workflow works. |
|
@nox Awesome! on it! :) |
|
@nox done! :) |
| match self.browsing_context() { | ||
| Some(browsingcontext) => return Some(self.location.or_init(|| Location::new(&self.window))), | ||
| None => return None, | ||
| } |
This comment has been minimized.
This comment has been minimized.
KiChjang
Apr 4, 2016
Member
This could be
self.browsing_context().and_then(|_|
Some(self.location.or_init(|| Location::new(&self.window)))
)
This comment has been minimized.
This comment has been minimized.
nox
Apr 5, 2016
Member
AFAICT it can just be:
self.browsing_context().map(|_| self.location.or_init(|| Location::new(&self.window)))
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
frewsxcv
Apr 5, 2016
Member
Lame attempt at clarifying:
If you want the variant to go from Some → Some use map
If you want the variant to go from Some → (Some or None) use and_then
Fixes #10141. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10257) <!-- Reviewable:end -->
|
It's just telling our buildbot to accept this PR on behalf of Ms2ger. |
|
Didn't know that was possible, feels kinda odd. |
|
|
Looks like you'll need to update more test expectations. |
|
@KiChjang where to make the changes? |
|
Wait, you didn't squash your changes, you REMOVED his commit. His commit had the diff and the files that you can use to update the test expectations, see slayerjain#1 for where to edit them. |
…owsing context. r=Ms2ger
|
@bors-servo try |
|
i thought servo bot would run some tests.. :/ |
|
Unfortunately, bors-servo only listens to people with try access or reviewers. Sorry! @bors-servo r+ |
|
|
Fixes #10141. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10257) <!-- Reviewable:end -->
|
@KiChjang can't wait to use it :) |
|
|

slayerjain commentedMar 29, 2016
Fixes #10141.
This change is