Skip to content

Properly cancel event when beforeunload handler returns null#15142

Closed
nox wants to merge 2 commits intoservo:masterfrom
nox:beforeunload
Closed

Properly cancel event when beforeunload handler returns null#15142
nox wants to merge 2 commits intoservo:masterfrom
nox:beforeunload

Conversation

@nox
Copy link
Copy Markdown
Contributor

@nox nox commented Jan 22, 2017

This change is Reviewable

@highfive
Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/eventtarget.rs, components/script/dom/beforeunloadevent.rs
  • @KiChjang: components/script/dom/eventtarget.rs, components/script/dom/beforeunloadevent.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 22, 2017
}
None => {
event.upcast::<Event>().PreventDefault();
if let Ok(value) = handler.Call_(object, event, exception_handle) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add some tests for returnValue? Stick them in event-handler-processing-algorithm.html along with the others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should have a test that uses BeforeUnloadEvent rather than Event.

@nox
Copy link
Copy Markdown
Contributor Author

nox commented Jan 23, 2017

@bors-servo try

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit 623ba9a with merge 4675448...

@nox
Copy link
Copy Markdown
Contributor Author

nox commented Jan 25, 2017

@bors-servo try

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit 9808270 with merge 01dbaa5...

bors-servo pushed a commit that referenced this pull request Jan 25, 2017
Properly cancel event when beforeunload handler returns null

<!-- 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/15142)
<!-- Reviewable:end -->
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jan 25, 2017
@nox
Copy link
Copy Markdown
Contributor Author

nox commented Jan 25, 2017

Seems like #8157 is back?

@jdm
Copy link
Copy Markdown
Member

jdm commented Jan 25, 2017

In a new timeout-based form, sure. We should file a new issue for that.

@pcwalton pcwalton assigned Ms2ger and unassigned pcwalton Jan 31, 2017
@pcwalton
Copy link
Copy Markdown
Contributor

Over to @Ms2ger

@jdm
Copy link
Copy Markdown
Member

jdm commented Jan 31, 2017

We should probably postpone this until whatwg/html#2297 is resolved.

@Ms2ger Ms2ger removed their assignment Feb 1, 2017
@Ms2ger Ms2ger added the S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. label Feb 1, 2017
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Feb 24, 2017
@nox nox added S-needs-tests New tests have been requested by a reviewer. and removed S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. labels Feb 24, 2017
@nox
Copy link
Copy Markdown
Contributor Author

nox commented Feb 24, 2017

The HTML fix landed but the tests now require full unload support to run. We don't support that.

@nox nox closed this Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed. S-needs-tests New tests have been requested by a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants