mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1387905 part 1 - Count pseudo-element into specificity. r=heycam
MozReview-Commit-ID: IWlINaYAhql --HG-- extra : rebase_source : f0d12277ecda1c7e498ba208cec0e0cde6fc5a25
This commit is contained in:
parent
76c1b26215
commit
441c9db551
@ -35,7 +35,7 @@ Test that css-logic calculates CSS specificity properly
|
||||
{text: "* body#home div#warning p.message", expected: 131331},
|
||||
{text: "#footer :not(nav) li", expected: 65538},
|
||||
{text: "bar:nth-child(n)", expected: 257},
|
||||
{text: "li::-moz-list-number", expected: 1},
|
||||
{text: "li::-moz-list-number", expected: 2},
|
||||
{text: "a:hover", expected: 257}
|
||||
];
|
||||
|
||||
|
@ -503,6 +503,9 @@ int32_t nsCSSSelector::CalcWeightWithoutNegations() const
|
||||
"If pseudo-elements can have id or attribute selectors "
|
||||
"after them, specificity calculation must be updated");
|
||||
|
||||
if (IsPseudoElement()) {
|
||||
weight += 0x000001;
|
||||
}
|
||||
if (nullptr != mCasedTag) {
|
||||
weight += 0x000001;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user