Open Bug 1000881 Opened 10 years ago Updated 2 years ago

Style editor lists the same sheet twice

Categories

(DevTools :: Style Editor, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: jwalker, Unassigned)

References

Details

top.html:

  <link rel="stylesheet" type="text/css" href="style.css">
  <iframe src=inner.html></iframe>

inner.html:

  <link rel="stylesheet" type="text/css" href="style.css">

In that case we get 2 entries for style.css in the style editor.
I'm not even 100% sure that this is the wrong behaviour. It's surprising, but maybe you want to edit the CSS in an iframe without seeing the changes in the parent sheet?

I'm leaning to it being a bug though.
I agree with this being considered as a bug.
We could start using the per-resource preformance API that just landed to fix this:

performance.getEntries().forEach(e => console.log(e.name));

This returns the list of unique resources loaded by the page. I'm not sure how easy it is to get the type of each of these resources though.
Just talking this thorough with :harth. The CSSOM will have 2 separately editable things, so we can't trivially de-dupe the items in the list.

So there are 2 options:

* De-dupe (with some sort of unchanged check). This will be nice and simple for the 99% case, but confusing as heck for the 1% case and probably give people the wrong impression

* Present the list of sources as a tree, with style.css showing up at 2 levels (in the above example). Webkit does the latter.

Chrome devtools does the former, Webkit does the latter. I'm leaning towards the latter.
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.