Unify PopupBlocker algorithm in 1 single file

RESOLVED FIXED in Firefox 66

Status

()

enhancement
P2
normal
RESOLVED FIXED
5 months ago
2 months ago

People

(Reporter: baku, Assigned: baku)

Tracking

Trunk
mozilla66
Points:
---

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

5 months ago
Currently, it's spread on several files: nsPIDOMWindow, nsGlobalWindowOuter, Event, and so on.
Assignee

Comment 1

5 months ago
Attachment #9031117 - Flags: review?(bugs)

Updated

5 months ago
Priority: -- → P2
Comment on attachment 9031117 [details] [diff] [review]
popupBlocker.patch





> /* static */
>-void nsContentUtils::HidePopupsInDocument(nsIDocument* aDocument) {
>-#ifdef MOZ_XUL
>-  nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
>-  if (pm && aDocument) {
>-    nsCOMPtr<nsIDocShellTreeItem> docShellToHide = aDocument->GetDocShell();
>-    if (docShellToHide) pm->HidePopupsInDocShell(docShellToHide);
>-  }
>-#endif
>-}
This method shouldn't be moved to PopupBlocker. XUL menus and such have nothing to do with the popups PopupBlocker is about.





>+++ b/dom/base/nsContentUtils.h
>@@ -1874,22 +1874,16 @@ class nsContentUtils {
>   static nsIWidget* GetTopLevelWidget(nsIWidget* aWidget);
> 
>   /**
>    * Return the localized ellipsis for UI.
>    */
>   static const nsDependentString GetLocalizedEllipsis();
> 
>   /**
>-   * Hide any XUL popups associated with aDocument, including any documents
>-   * displayed in child frames. Does nothing if aDocument is null.
>-   */
>-  static void HidePopupsInDocument(nsIDocument* aDocument);
>-
This is about xul menus and what not, not about popups. Don't move.






>@@ -564,21 +564,17 @@ nsresult HTMLFormElement::DoSubmit(Widge
>     mIsSubmitting = false;
>     return rv;
>   }
> 
>   // XXXbz if the script global is that for an sXBL/XBL2 doc, it won't
>   // be a window...
>   nsPIDOMWindowOuter* window = OwnerDoc()->GetWindow();
> 
>-  if (window) {
>-    mSubmitPopupState = window->GetPopupControlState();
>-  } else {
>-    mSubmitPopupState = openAbused;
>-  }
>+  mSubmitPopupState = PopupBlocker::GetPopupControlState();

This changes behavior. Not all elements have window. So, please keep the old behavior, if no window, state should be openAbused.
Attachment #9031117 - Flags: review?(bugs) → review+

Comment 3

5 months ago
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9f36859b7db2
Unify PopupBlocker algorithm in 1 single file, r=smaug

Comment 4

5 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9f36859b7db2
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.