Closed Bug 910501 Opened 11 years ago Closed 11 years ago

Selecting "Prevent this page from creating additional dialogs" on an alert/prompt/confirm should prevent all future alert/prompt/confirm on that page

Categories

(Firefox :: General, defect)

x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 27

People

(Reporter: TimAbraldes, Assigned: TimAbraldes)

Details

Attachments

(2 files, 4 obsolete files)

STR: 1. Go to http://dolske.net/mozilla/tests/prompt/sizes.html 2. Use the buttons to quickly create prompts and dismiss them (spacebar is helpful for this) 3. When the "Prevent this page from creating additional dialogs" checkbox appears, select it 4. Continue to click on one of the buttons (or use spacebar) and note that eventually dialogs are created
The patch I'm working on in bug 856977 also fixes this issue, so I'll just assign myself
Assignee: nobody → tabraldes
Attached file Dialog storm
This testcase demonstrates the issue without the user needing to push any buttons (except the ok/cancel buttons of the dialog, of course) I've recently learned (see bug 856977 comment 15 and bug 856977 comment 16) that the "prevent this page from creating additional dialogs" doesn't intend to prevent ALL additional dialogs from being created; it just intends to limit the rate at which new dialogs can be created. Using the attached test case, I found that my version of Aurora limits new dialogs to 1 dialog every 3 seconds after I've selected "prevent this page from creating additional dialogs." I find this behavior confusing: I expect a checkbox labeled "prevent this page from creating additional dialogs" to prevent the page from creating dialogs, without exception. Also, I don't really want the ability to rate-limit dialogs on a page; I want the ability to disable them completely. I'm leaving this bug open, pending the outcome of discussion about this behavior.
Summary: Even if you select "Prevent this page from creating additional dialogs", dialogs will sometimes be created → Selecting "Prevent this page from creating additional dialogs" on an alert/prompt/confirm should prevent all future alert/prompt/confirm on that page
Attached patch Patch v1 (obsolete) — Splinter Review
This patch should be applied on top of the patch in bug 856977. This patch removes the rate-limiting behavior for dialogs and prefers a simpler enable/disable mechanism. I haven't yet built/tested this patch.
Attached patch Patch v2 (obsolete) — Splinter Review
Attachment #812825 - Attachment is obsolete: true
Attached patch Patch v3 (obsolete) — Splinter Review
:gavin for the browser piece. :bz for the dom pieces.
Attachment #812827 - Attachment is obsolete: true
Attachment #812865 - Flags: review?(gavin.sharp)
Attachment #812865 - Flags: review?(bzbarsky)
Comment on attachment 812865 [details] [diff] [review] Patch v3 This seems fine, assuming we've agreed on the behavior.
Attachment #812865 - Flags: review?(bzbarsky) → review+
Comment on attachment 812865 [details] [diff] [review] Patch v3 >diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml >- windowUtils.limitDialogs(); >+ windowUtils.disableDialogs(); Hmm, I guess this is just fixing a bug introduced by the patch for bug 856977? Ideally that patch would have just done this to begin with, right? Or am I missing something?
Attachment #812865 - Flags: review?(gavin.sharp) → review+
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #7) > Comment on attachment 812865 [details] [diff] [review] > Patch v3 > > >diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml > > >- windowUtils.limitDialogs(); > >+ windowUtils.disableDialogs(); > > Hmm, I guess this is just fixing a bug introduced by the patch for bug > 856977? Ideally that patch would have just done this to begin with, right? > Or am I missing something? The patch in bug 856977 renamed "preventFurtherDialogs" to "limitDialogs" in order to make the existing behavior more obvious: The bug existed before the patch for bug 856977, it's just that now the function is named appropriately so it's more obvious that there's a bug. The patch in bug 856977 hasn't landed yet, so I'm happy to include this change as part of that patch instead of this patch. We've already fixed another similar instance in that patch (bug 856977 comment 39).
Attached patch Patch v4 (obsolete) — Splinter Review
Removing the tabbrowser.xml change (this is moving to bug 856977) and carrying forward r+
Attachment #812865 - Attachment is obsolete: true
Attachment #813227 - Flags: review+
(In reply to Tim Abraldes [:TimAbraldes] [:tabraldes] from comment #8) > (In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment > #7) > > Comment on attachment 812865 [details] [diff] [review] > > Patch v3 > > > > >diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml > > > > >- windowUtils.limitDialogs(); > > >+ windowUtils.disableDialogs(); > > > > Hmm, I guess this is just fixing a bug introduced by the patch for bug > > 856977? Ideally that patch would have just done this to begin with, right? > > Or am I missing something? > > The patch in bug 856977 renamed "preventFurtherDialogs" to "limitDialogs" in > order to make the existing behavior more obvious: The bug existed before the > patch for bug 856977, it's just that now the function is named appropriately > so it's more obvious that there's a bug. Oops, this is inaccurate. nsIDOMWindowUtils.preventFurtherDialogs calls nsGlobalWindow::PreventFurtherDialogs with an argument of 'true,' which would indeed disable dialogs (instead of rate-limiting them). > The patch in bug 856977 hasn't landed yet, so I'm happy to include this > change as part of that patch instead of this patch. We've already fixed > another similar instance in that patch (bug 856977 comment 39). I've updated the patches in this bug and in bug 856977.
Attached patch Patch v5Splinter Review
Rebasing to apply cleanly on top of latest patch in bug 856977
Attachment #813227 - Attachment is obsolete: true
Attachment #813245 - Flags: review+
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: