Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Issue 12218111: Allowing Window.onBeforeUnload event to work properly. (Closed)

Created:
7 years, 10 months ago by blois
Modified:
7 years, 8 months ago
CC:
reviews_dartlang.org, ngeoffray
Visibility:
Public.

Description

Allowing Window.onBeforeUnload event to work properly. There are a couple of issues here, fixing some of them, but not quite all. Background- the beforeunload event is used to present a dialog to the user after they have clicked a window/tab close button, usually to indicate unsaved changes. This is effectively the only mechanism available to preempt the close action. In WebKit, the user must return a string value from the beforeunload event and that string will be displayed in an alert dialog prompting the user if they are sure they want to leave the page. In FireFox, IE & the W3C spec, the beforeunload event is of type BeforeUnloadEvent. The string used to prompt the user is specified by the 'returnValue' field. Furthermore, WebKit exposes 'returnValue' as a bool on Event, where the spec does not have it on Event at all. With this change, a user can utilize the beforeunload event on all platforms: window.onBeforeUnload.listen((e) { e.returnValue = "foo!"; }); BUG=2350 Committed: https://code.google.com/p/dart/source/detail?r=21003

Patch Set 1 #

Patch Set 2 : Adding support for FireFox #

Total comments: 1

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+375 lines, -181 lines) Patch
M sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/native_helper.dart View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 13 chunks +121 lines, -53 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 13 chunks +116 lines, -59 lines 0 comments Download
M tools/dom/scripts/htmlrenamer.py View 1 2 3 chunks +4 lines, -1 line 0 comments Download
M tools/dom/scripts/systemhtml.py View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/src/EventListener.dart View 1 chunk +1 line, -1 line 0 comments Download
tools/dom/src/WrappedEvent.dart View 1 2 1 chunk +54 lines, -0 lines 0 comments Download
tools/dom/src/dart2js_KeyEvent.dart View 1 2 4 chunks +2 lines, -31 lines 0 comments Download
M tools/dom/src/dartium_KeyEvent.dart View 1 2 4 chunks +2 lines, -33 lines 0 comments Download
M tools/dom/templates/html/dart2js/html_dart2js.darttemplate View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dartium/html_dartium.darttemplate View 1 2 1 chunk +1 line, -0 lines 0 comments Download
tools/dom/templates/html/impl/impl_Window.darttemplate View 1 2 1 chunk +67 lines, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
blois
7 years, 10 months ago (2013-02-12 19:02:23 UTC) #1
ngeoffray
dart2js changes LGTM
7 years, 10 months ago (2013-02-12 21:52:00 UTC) #2
Anton Muhin
Pete, have you checked if Dartium works fine with this change? If yes, LGTM. If ...
7 years, 10 months ago (2013-02-13 08:03:01 UTC) #3
blois
On 2013/02/13 08:03:01, Anton Muhin wrote: > Pete, have you checked if Dartium works fine ...
7 years, 10 months ago (2013-02-13 21:01:25 UTC) #4
sra1
lgtm with @Creates https://codereview.chromium.org/12218111/diff/6/sdk/lib/html/dart2js/html_dart2js.dart File sdk/lib/html/dart2js/html_dart2js.dart (right): https://codereview.chromium.org/12218111/diff/6/sdk/lib/html/dart2js/html_dart2js.dart#newcode10439 sdk/lib/html/dart2js/html_dart2js.dart:10439: + Object returnValue; This needs a ...
7 years, 10 months ago (2013-02-13 21:36:21 UTC) #5
blois
Sorry, this was on the back-burner for a while, updated the CL, incorporating Anton's feedback ...
7 years, 8 months ago (2013-04-04 22:33:03 UTC) #6
Emily Fortuna
lgtm
7 years, 8 months ago (2013-04-04 23:35:46 UTC) #7
sra1
7 years, 8 months ago (2013-04-05 22:23:03 UTC) #8
sra1
lgtm
7 years, 8 months ago (2013-04-05 22:23:11 UTC) #9
blois
7 years, 8 months ago (2013-04-05 22:30:40 UTC) #10
Message was sent while issue was closed.
Committed patchset #3 manually as r21003 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698