Closed Bug 398500 Opened 18 years ago Closed 18 years ago

[checked]:checked rule applying after input type is changed

Categories

(Core :: CSS Parsing and Computation, defect)

x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: cmtalbert, Unassigned)

Details

Attachments

(2 files)

The rule is mis-applying after the change in the input element. It seems like the input[disabled]:disabled rule should apply to item "two" and not the [checked]:checked rule. Perhaps I am wrong about that. I will attach a testcase and an expected case of html.
I think this is invalid, sorry. If you look in DOM inspector, you'll see the problem: the "input[checked]:checked:default ~ span {color: green}" rule applies to both spans (which is correct, given the use of the '~' combinator). It also has he highest specificity of the three rules in the testcase (something else that DOM inspector would tell you). So both spans end up green.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
I saw that both rules applied to both spans in DOMi, which I expected, but I thought that the + rule would apply over the ~ rule. How does DOMi indicate specificity? Is it in the ordering of the rules in the DOMi CSS window? Thanks!
Status: RESOLVED → VERIFIED
In this case, the ~ rule has two tag names, two classes, and one attribute. The + rule has two tag names, one class, and one attribute. So the ~ rule wins in terms of specificity. And yes, DOM inspector shows the rules applying to a node sorted from least specific to most specific.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: