Closed Bug 1133568 Opened 5 years ago Closed 5 years ago

[e10s] Any keypresses after findbar has been opened in a remote browser causes "unsafe CPOW usage"

Categories

(Toolkit :: Find Toolbar, defect)

x86
macOS
defect
Not set
Points:
3

Tracking

()

RESOLVED DUPLICATE of bug 1133981
Tracking Status
e10s m7+ ---

People

(Reporter: mconley, Unassigned)

References

(Blocks 1 open bug)

Details

STR:

1) In an e10s window, open any page that has a <textarea> or <input type="text">.
2) Open the find bar (Cmd-F on OS X, Ctrl-F elsewhere), and then close it again (Esc).
3) Start typing into one of the text inputs.

For each keypress, a ton of "unsafe CPOW usage" messages get sent through the Browser Console.

They're centered around two pieces of code:

from toolkit/modules/BrowserUtils.jsm:

  /**
   * Return the current focus element and window. If the current focus
   * is in a content process, then this function returns CPOWs
   * (cross-process object wrappers) that refer to the focused
   * items. Note that calling this function synchronously contacts the
   * content process, which may block for a long time.
   *
   * @param document The document in question.
   * @return [focusedElement, focusedWindow]
   */
  getFocusSync: function(document) {
    let elt = document.commandDispatcher.focusedElement;
    var window = document.commandDispatcher.focusedWindow;

    const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    if (elt instanceof window.XULElement &&
        elt.localName == "browser" &&
        elt.namespaceURI == XUL_NS &&
        elt.getAttribute("remote")) {
      [elt, window] = elt.syncHandler.getFocusedElementAndWindow(); <-- Causes CPOW warning
    }

    return [elt, window];
  },

From toolkit/content/widgets/findbar.xml:

     <method name="_shouldFastFind">
        <parameter name="aEvent"/>
        <body><![CDATA[
          if (aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey ||
              aEvent.defaultPrevented)
            return false;

          let {BrowserUtils} = Components.utils.import("resource://gre/modules/BrowserUtils.jsm", {});
          let [elt, win] = BrowserUtils.getFocusSync(document);

          if (elt) {
            if (elt instanceof HTMLInputElement && elt.mozIsTextField(false)) <-- Causes CPOW warning
              return false;

            if (elt.isContentEditable) <-- Causes CPOW warning
              return false;

            if (elt instanceof HTMLTextAreaElement || <-- Causes CPOW warning
                elt instanceof HTMLSelectElement ||
                elt instanceof HTMLObjectElement ||
                elt instanceof HTMLEmbedElement)
              return false;
          }
Points: --- → 3
Flags: qe-verify-
Flags: firefox-backlog+
This was fixed by 1133981 right?
Flags: needinfo?(gijskruitbosch+bugs)
Yup.
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(gijskruitbosch+bugs)
Resolution: --- → DUPLICATE
Duplicate of bug: 1133981
You need to log in before you can comment on or make changes to this bug.