Open Bug 1546896 Opened 5 years ago Updated 2 years ago

Selection made by keyboard shortcuts is not cleared in Rule view when adding a New Rule

Categories

(DevTools :: Inspector: Rules, defect, P3)

defect

Tracking

(firefox-esr60 affected, firefox66 affected, firefox67 affected, firefox68 affected)

Tracking Status
firefox-esr60 --- affected
firefox66 --- affected
firefox67 --- affected
firefox68 --- affected

People

(Reporter: cfogel, Unassigned)

References

Details

Attachments

(1 file)

Attached image rules_selectAdd.png

Affected versions

  • 45.3.0esr, 66.0b13, 59.0.2, 68.0a1 (2019-04-24)

Affected platforms

  • Windows 10, Ubuntu 18.04, macOS 10.13;

Steps to reproduce

  1. Launch Firefox, access any page and right click -> inspect any element;
  2. Select all the rules in the Rules Inspector section via the keyboard shortcut(CTRL+A / CMD+A);
  3. Click on the Add New rule button.

Expected result

  • new rule is added;
  • previously selected rules in this tab should be cleared when adding a new one;

Actual result

  • existing selection remains;
  • newly added rule is also selected;

Regression range

  • does not look like a regression;
  • prior to the 45 version mentioned in the affected section the Add rule option was not present so it seems to be something introduced with it;

Additional notes

  • attached screenshot with the issue; as seen in the Track Changes tab, multiple rules where added but the selection persists;
  • if the selection is made from the context menu, it is cleared and works properly.

This seems to be a wider issue than just the Add Rule button. Whole-page selections aren't cleared when clicking on other UI controls either, like pseudo-class locks, sidebar tabs, elements in the markup view, etc. Selection is cleared when focusing an input field.

On the surface it looks like a simple case of clearing the selection with Selection.removeAllRanges() but it's not feasible to do that for all UI controls. This warrants a deeper investigation of why the selection isn't naturally cleared on click. The cause may lie in the click events with propagation stopped to prevent the XUL host page from registering duplicate events.

A caveat: the Rule view and other sidebar panels share the same document window, even when 3-pane mode is enabled. This aspect causes another bug with select all via the keyboard, bug 1530867.

Priority: -- → P3
See Also: → 1530867
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: