Closed Bug 238758 Opened 20 years ago Closed 20 years ago

Missing CSS rule in DOM Inspector's Object CSS Style Rules

Categories

(Other Applications :: DOM Inspector, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 185431

People

(Reporter: tdd, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

When specifying an attribute-based CSS rule, such as the commonplace:

a[hreflang]:after {
     color: gray;
     content: "\0000a0[" attr(hreflang) "]";
}

This rule does not show in the DOM Inspector's CSS Style Rules view for the DOM
nodes that use it. The rule *is* applied, but only other rules (e.g. "a",
"a:hover" and so forth) show in the node's rules view.

Reproducible: Always
Steps to Reproduce:
1. Create a Web page wtih a single paragraph that contains an anchor with a
hreflang attribute (e.g. set to "en") : <a href="..." hreflang="en"
title="demo">...</a>.
2. Create a stylesheet, either internal (<style>) or external (<style>/<link>),
with a rule such as the one described in Details.
3. Load the page in your Mozilla-based browser. Verify the rule is applied.
4. Fire up the DOM Inspector (Tools | DOM Inspector)
5. Expand the nodes until you can select your anchor.
6. In the right-hand part, select CSS Style Rules in the drop-down list next to
the "Object - DOM Node" heading.
7. Voila! No mention of your rule, despite its being applied.
Actual Results:  
The rule doesn't show!

Expected Results:  
The rule should show...
Yeah, the rule should show up somewhere in the DOM Inspector. I'm not sure if
the CSS Style Rules is the best place (Computed Style is where I would look
first I guess) but it should show up somewhere.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Well, it makes perfect sense to have it show up in CSS Style Rules. Computed
styles is for cascaded/default effects. When a rule does specifically address
the node, it shows up in CSS Style Rules.

The rule above does specifically address the A node.
>The rule above does specifically address the A node.

No.  It addresses "A:after", which is generated content, not the "A" node you
are looking at....
That's a good point, however :after is a pseudo-selector, and the only possible
nodes in the DOM tree it relates to are defined by the A tag. There's just no
other way to get to these through the DOM inspector, and since content is
(pre|ap)pended to the node's contents, it seems like the right place to display it.

*** This bug has been marked as a duplicate of 185431 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Product: Core → Other Applications
Assignee: dom-inspector → nobody
QA Contact: timeless → dom-inspector
You need to log in before you can comment on or make changes to this bug.