Closed Bug 1757816 Opened 3 years ago Closed 3 years ago

Inspector EditingSession:getPropertyIndex ignores rule argument and always uses the first rule

Categories

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

defect

Tracking

(firefox100 fixed)

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: jdescottes, Assigned: saihemanth9019)

Details

Attachments

(1 file)

The following method:

  getPropertyIndex: function(name, rule = this._rules[0]) {
    const elementStyleRule = this._rules[0];
    if (!elementStyleRule.declarations.length) {
      return -1;
    }

    return elementStyleRule.declarations.findIndex(p => p.name === name);
  },

is obviously wrong and ignores its rule argument

https://searchfox.org/mozilla-central/rev/48c71577cbb4ce5a218cf4385aff1ff244dc4432/devtools/client/inspector/boxmodel/utils/editing-session.js#89

elementStyleRule should be dropped and we should use rule instead. Hopefully this doesn't break any assumption.

Hi Sai!

This is a small issue I spotted while reviewing your patch for Bug 1717176. Would you be interested in trying to fix this?

Flags: needinfo?(saihemanth9019)

Thanks Julian, I can take this up. I'll send a patch in a short while.

Flags: needinfo?(saihemanth9019)
Assignee: nobody → saihemanth9019
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/902ab4b1756d Use rule parameter in inspector EditingSession:getPropertyIndex. r=jdescottes

Thanks for picking this up quickly :)

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: