[Webkit-unassigned] [Bug 56397] Suppress modal JavaScript/HTML dialogs during unload events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 28 13:21:40 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56397





--- Comment #7 from Sreeram Ramachandran <sreeram at google.com>  2011-03-28 13:21:39 PST ---
(From update of attachment 86035)
View in context: https://bugs.webkit.org/attachment.cgi?id=86035&action=review

>> LayoutTests/fast/loader/unload-alert.html:9
>> +  prompt("PASS", "PASS");
> 
> This test doesn't make sense on chromium, does it?  If any of PASS appear on chromium platform, it actually failed, right?  I don't think it's clear at all from the test output or from the comment here.

Right, it's misleading for chromium. What would be the preferred way of doing this? Should I:
1. Change the text to read something like "FAIL on chromium; PASS on other platforms"?
2. Somehow fork the test itself for chromium? (I only saw a way to specify a platform-specific expected.ext.)
Other ways?

>> Source/WebCore/page/Chrome.cpp:62
>> +}
> 
> I don't think this is the right way to do it if we want to make decisions per port.  We should add a new callback to WebView or some other class instead.

Darin (Fisher) explicitly didn't want this (decision to suppress alerts) to be something platform-specific. Though the current patch only enables it for chromium, the goal is to convince other platforms, and make it the default behaviour eventually.

>> Source/WebCore/page/Chrome.cpp:66
>> +    return page->mainFrame()->loader()->pageDismissalEventBeingDispatched();
> 
> Does this mean that we will disable modal dialogs only when the main frame is unloading?  Why do we allow modal dialogs during unload event in subframes? I'd like to see some explanation as to why such a decision was made in the change log entry.

My mistake. After chancing upon "allowsBeforeUnloadListeners()" in page/DOMWindow.cpp, I assumed that unload/beforeunload listeners were not allowed for subframes. I created some test pages just now, and I see that in fact, that's not the case; subframes can register listeners for those events. I'll change the patch to disallow alerts in these events for all frames. Meanwhile, before I create that patch, could we get agreement on the approach (i.e., global or platform-specific implementation)?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list