improve how nsPluginInstanceOwner registers to receive events

NEW
Unassigned

Status

()

Core
Plug-ins
4 years ago
2 years ago

People

(Reporter: Josh Aas, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
nsPluginInstanceOwner adds the following event listeners:

  mContent->AddEventListener(NS_LITERAL_STRING("focus"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("blur"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("mouseup"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("mousedown"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("mousemove"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("click"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("dblclick"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("mouseover"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("mouseout"), this, false, false);
  mContent->AddEventListener(NS_LITERAL_STRING("keypress"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("keydown"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("keyup"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("drop"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragdrop"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("drag"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragenter"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragover"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragleave"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragexit"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragstart"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("draggesture"), this, true);
  mContent->AddEventListener(NS_LITERAL_STRING("dragend"), this, true);

I was curious about why the difference between different events when it comes to the last two boolean arguments, relating to capture and untrusted events.

After talking to smaug, it seems like we should have all of these event registrations looking like this:

  mContent->AddSystemEventListener(NS_LITERAL_STRING("eventname"), this, false, false);

This means false for capture, false for untrusted events, and register as system event listener instead of default group.
(Reporter)

Comment 1

3 years ago
Created attachment 8669520 [details] [diff] [review]
fix v1.0

Just saving my work, still need to test this.
(Reporter)

Updated

2 years ago
Assignee: jaas → nobody
You need to log in before you can comment on or make changes to this bug.