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 window.closed #16920

Merged
merged 1 commit into from
May 26, 2017
Merged

Implement window.closed #16920

merged 1 commit into from
May 26, 2017

Conversation

synlestidae
Copy link

@synlestidae synlestidae commented May 18, 2017

Implements #16705. window.closed should evaluate to true if BrowsingContext is discarded


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix Implement window.closed #16705 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @asajeffrey (or someone else) soon.

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/window.rs, components/script/dom/webidls/Window.webidl
  • @KiChjang: components/script/dom/window.rs, components/script/dom/webidls/Window.webidl

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 18, 2017
@cbrewster
Copy link
Contributor

Thanks!
I suspect there will be some test expectations that need to be updated.
@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit c27dc68 with merge 156c821...

bors-servo pushed a commit that referenced this pull request May 18, 2017
Implement window.closed

<!-- Please describe your changes on the following line: -->

Implements #16705. window.closed should evaluate to true if BrowsingContext is discarded

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16705 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16920)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label May 18, 2017
@jdm
Copy link
Member

jdm commented May 19, 2017

You will need to follow https://github.com/servo/servo/blob/master/tests/wpt/README.md#updating-test-expectations in order to update the expectations for these tests:

  ▶ Unexpected subtest result in /html/browsers/the-window-object/security-window/window-security.html:
  └ PASS [expected FAIL] A SecurityError exception should not be thrown when window.closed is accessed from a different origin.

  ▶ Unexpected subtest result in /html/dom/interfaces.html:
  └ PASS [expected FAIL] Window interface: attribute closed

  ▶ Unexpected subtest result in /html/dom/interfaces.html:
  └ PASS [expected FAIL] Window interface: window must inherit property "closed" with the proper type (14)

if let Some(ref proxy) = self.window_proxy.get() {
return proxy.is_browsing_context_discarded();
}
true
Copy link
Contributor

@KiChjang KiChjang May 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have done

self.window_proxy.get().map(|ref proxy| proxy.is_browsing_context_discarded()).unwrap_or(true)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will change it to that

@asajeffrey
Copy link
Member

With the changes suggested by @KiChjang and @jdm, this LGTM.

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label May 26, 2017
@asajeffrey
Copy link
Member

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 510bea7 has been approved by asajeffrey

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 26, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 510bea7 with merge 8747ccc...

bors-servo pushed a commit that referenced this pull request May 26, 2017
Implement window.closed

<!-- Please describe your changes on the following line: -->

Implements #16705. window.closed should evaluate to true if BrowsingContext is discarded

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16705 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16920)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: asajeffrey
Pushing 8747ccc to master...

@bors-servo bors-servo merged commit 510bea7 into servo:master May 26, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 26, 2017
@synlestidae synlestidae deleted the servo-16705 branch May 26, 2017 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement window.closed
7 participants