mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 13:58:40 +09:00
Issue #2790 - Part 4: Working non persistent autofill highlight
This commit is contained in:
parent
4cdfb9e16b
commit
bf8cfcc980
12 changed files with 207 additions and 68 deletions
|
|
@ -576,6 +576,16 @@ nsCSSRuleUtils::StateSelectorMatches(Element* aElement,
|
|||
for (nsPseudoClassList* pseudoClass = aSelector->mPseudoClassList;
|
||||
pseudoClass;
|
||||
pseudoClass = pseudoClass->mNext) {
|
||||
// --- Autofill explicit matching ---
|
||||
if (pseudoClass->mType == CSSPseudoClassType::autofill ||
|
||||
pseudoClass->mType == CSSPseudoClassType::mozAutofillHighlight) {
|
||||
// Match if the element has the autofill state, regardless of focus
|
||||
if (!aElement->State().HasState(NS_EVENT_STATE_AUTOFILL)) {
|
||||
return false;
|
||||
}
|
||||
continue; // This pseudo-class matches
|
||||
}
|
||||
// --- End autofill explicit matching ---
|
||||
auto idx = static_cast<CSSPseudoClassTypeBase>(pseudoClass->mType);
|
||||
EventStates statesToCheck = nsCSSPseudoClasses::sPseudoClassStates[idx];
|
||||
if (!statesToCheck.IsEmpty() && !StateSelectorMatches(aElement,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue