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

#10141 : Document::location set null for documents without a browsing context #10257

Merged
merged 1 commit into from Apr 9, 2016

Conversation

@slayerjain
Copy link
Contributor

slayerjain commented Mar 29, 2016

Fixes #10141.

This change is Reviewable

@highfive
Copy link

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
Copy link

highfive commented Mar 29, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webidls/Document.webidl, components/script/dom/document.rs
@highfive
Copy link

highfive commented Mar 29, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 29, 2016

Did you compile this locally?

@slayerjain
Copy link
Contributor Author

slayerjain commented Mar 29, 2016

oh.. my bad! switching my laptop created the mess!

@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 29, 2016

No problem; let me know when it works :)

@slayerjain
Copy link
Contributor Author

slayerjain commented Mar 29, 2016

The internet bandwidth in my country is really pathetic! couldn't build servo yet, it's been like 10 hours!

@slayerjain
Copy link
Contributor Author

slayerjain commented Mar 30, 2016

I've fixed my laptop's repo, but now I'm stuck with an error. I've also modified xmldocument.rs's location method to return Option<Root>
screen shot 2016-03-30 at 10 53 22 am

@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 30, 2016

Ah, I forgot about that. Attributes that can return null are called GetFoo rather than Foo, so you'll need to rename those two implementations.

@slayerjain slayerjain force-pushed the slayerjain:first_bug branch from db12f91 to 1e1f6a6 Mar 30, 2016
@nox
Copy link
Member

nox commented Mar 31, 2016

@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 nox added the S-needs-rebase label Mar 31, 2016
@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 1, 2016

@nox Can you please explain the process, just to verify what i'm thinking? :)

@nox
Copy link
Member

nox commented Apr 3, 2016

@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 git rebase -i master, remove the second line, save the file and quit, and let Git do its magic.

@KiChjang
Copy link
Member

KiChjang commented Apr 3, 2016

Here's documentation on how the entire workflow works.

@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 4, 2016

@nox Awesome! on it! :)

@slayerjain slayerjain force-pushed the slayerjain:first_bug branch from 1e1f6a6 to 2bc3c70 Apr 4, 2016
@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 4, 2016

@nox done! :)

@jdm jdm removed the S-needs-rebase label Apr 4, 2016
match self.browsing_context() {
Some(browsingcontext) => return Some(self.location.or_init(|| Location::new(&self.window))),
None => return None,
}

This comment has been minimized.

Copy link
@KiChjang

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.

Copy link
@nox

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.

Copy link
@KiChjang

KiChjang Apr 5, 2016

Member

Ugh. I still can't tell when it's okay to use .map().

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv Apr 5, 2016

Member

Lame attempt at clarifying:

If you want the variant to go from SomeSome use map

If you want the variant to go from Some → (Some or None) use and_then

@bors-servo
Copy link
Contributor

bors-servo commented Apr 9, 2016

Testing commit 4de04bb with merge 59d205c...

bors-servo added a commit that referenced this pull request Apr 9, 2016
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
Copy link
Member

KiChjang commented Apr 9, 2016

It's just telling our buildbot to accept this PR on behalf of Ms2ger.

@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 9, 2016

Didn't know that was possible, feels kinda odd.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 9, 2016

💔 Test failed - mac-rel-wpt

@KiChjang
Copy link
Member

KiChjang commented Apr 9, 2016

Ran 4652 tests finished in 1073.0 seconds.
  • 4647 ran as expected. 1361 tests skipped.
  • 5 tests had unexpected subtest results

Tests with unexpected results:
  ▶ Unexpected subtest result in /XMLHttpRequest/responsexml-document-properties.htm:
  └ PASS [expected FAIL] location

  ▶ Unexpected subtest result in /domparsing/DOMParser-parseFromString-html.html:
  └ PASS [expected FAIL] Location value

  ▶ Unexpected subtest result in /domparsing/DOMParser-parseFromString-xml.html:
  └ PASS [expected FAIL] Should parse correctly in type text/xml

  ▶ Unexpected subtest result in /html/browsers/history/the-location-interface/document_location.html:
  └ PASS [expected FAIL] document not in a browsing context

  ▶ Unexpected subtest result in /_mozilla/mozilla/windowproxy.html:
  └ PASS [expected FAIL] document.location is the right thing on non-rendered document

Looks like you'll need to update more test expectations.

@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 9, 2016

@KiChjang where to make the changes?

@KiChjang
Copy link
Member

KiChjang commented Apr 9, 2016

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.

@slayerjain slayerjain force-pushed the slayerjain:first_bug branch from 4de04bb to 8ba8edb Apr 9, 2016
…owsing context. r=Ms2ger
@slayerjain slayerjain force-pushed the slayerjain:first_bug branch from 8ba8edb to 6626c5c Apr 9, 2016
@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 9, 2016

@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 9, 2016

i thought servo bot would run some tests.. :/

@KiChjang
Copy link
Member

KiChjang commented Apr 9, 2016

Unfortunately, bors-servo only listens to people with try access or reviewers. Sorry!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 9, 2016

📌 Commit 6626c5c has been approved by KiChjang

@bors-servo
Copy link
Contributor

bors-servo commented Apr 9, 2016

Testing commit 6626c5c with merge c33bf49...

bors-servo added a commit that referenced this pull request Apr 9, 2016
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 -->
@slayerjain
Copy link
Contributor Author

slayerjain commented Apr 9, 2016

@KiChjang can't wait to use it :)

@bors-servo
Copy link
Contributor

bors-servo commented Apr 9, 2016

@bors-servo bors-servo merged commit 6626c5c into servo:master Apr 9, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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

8 participants
You can’t perform that action at this time.