Closed Bug 1541907 Opened 5 years ago Closed 5 years ago

Add New Rule default value is "a" instead of "body" on Ubuntu platform

Categories

(DevTools :: Inspector: Rules, defect)

Desktop
Linux
defect
Not set
normal

Tracking

(firefox66 affected, firefox67 affected, firefox68 affected)

RESOLVED WONTFIX
Tracking Status
firefox66 --- affected
firefox67 --- affected
firefox68 --- affected

People

(Reporter: vlucaci, Unassigned)

References

Details

(Keywords: regressionwindow-wanted)

Attachments

(1 file)

Affected versions

  • 67.0b7
  • 68.0a1(2019-04-03)
  • 66.0.2

Affected platforms

  • Ubuntu 16.04x64
  • Ubuntu 18.04x64

Steps to reproduce

  1. Launch FF.
  2. Go to any webpage.(e.g:wikipedia.com)
  3. Press F12 while on the page.
  4. Go to the second pane and click right.
  5. Select Add New Rule button.

Expected result

  • Clicking on the Add New Rule button opens up a text field with the default "body" value in it being highlighted.

Actual result

  • Clicking on the Add New Rule button opens a text field with the default "a" value in it being highlighted

*Regression range

  • Will return with regression ASAP

Thanks for filing.
Looking at the gif, it doesn't look like the <body> node is selected in the inspector. Would you mind saying which node you had selected when you added the new rule?

Flags: needinfo?(vlad.lucaci)

Hello,

After further investigation I have managed to determine which element is selected when this issue occurs.

So in order to properly reproduce this:

  1. Go to https://en.wikipedia.org/wiki/Main_Page
  2. Click inspect element on the number from "5,836,689 articles in English" string near the header of the page.
  3. Then proceed to add a new rule via the context menu in the newly opened section.
  4. Notice that <a href="/wiki/Special:Statistics" title="Special:Statistics">5,836,689</a> is selected.
  5. Only "a" is displayed in the new rule text field. (managed to reproduce this with any number or date that is hyperlinked).
Flags: needinfo?(vlad.lucaci)
Blocks: 1515875
Has Regression Range: --- → no
Has STR: --- → yes

Thanks Vlad for providing these steps.
Based on those, I can say that this is the expected behavior. Indeed, when adding a new rule in the Rules panel, DevTools attempts to create a selector for it that will match the currently selected element. If this element has a class or an id, it will use those too, but in the present case, the element you mentioned does not have any of those. So the selector that gets created matches the element by its tag name.

Did you expect the selector to have another value?

Flags: needinfo?(vlad.lucaci)
Has Regression Range: no → ---
Flags: needinfo?(vlad.lucaci)

Hello Patrick,

No, not another value, but I expected that at least <a href> to be displayed.
But this is mostly a quality of life improvement so mark it as you see fit.

Thanks Vlad. Ok I'll mark it as WONTFIX for now since this is the expected behavior, and I don't think it would be a good idea to include the href attribute in the selector. Attribute selectors are not as common as tag/id/class selectors, and I don't think it would be right for devtools to pick an attribute to use when no class or id are available.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: