mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Issue #2828 - Part 3: Refactor selector matching and rule cascade data into separate files/classes
This commit is contained in:
parent
7b51aa7ca1
commit
03f29e75ec
20 changed files with 4432 additions and 4171 deletions
|
|
@ -29,7 +29,7 @@
|
|||
#include "nsRuleData.h"
|
||||
#include "nsError.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsCSSRuleUtils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsHashKeys.h"
|
||||
|
|
@ -310,13 +310,13 @@ nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData)
|
|||
if (aData->mElement->IsHTMLElement(nsGkAtoms::a)) {
|
||||
if (mLinkRule || mVisitedRule || mActiveRule) {
|
||||
EventStates state =
|
||||
nsCSSRuleProcessor::GetContentStateForVisitedHandling(
|
||||
nsCSSRuleUtils::GetContentStateForVisitedHandling(
|
||||
aData->mElement,
|
||||
aData->mTreeMatchContext,
|
||||
aData->mTreeMatchContext.VisitedHandling(),
|
||||
// If the node being matched is a link,
|
||||
// it's the relevant link.
|
||||
nsCSSRuleProcessor::IsLink(aData->mElement));
|
||||
nsCSSRuleUtils::IsLink(aData->mElement));
|
||||
if (mLinkRule && state.HasState(NS_EVENT_STATE_UNVISITED)) {
|
||||
ruleWalker->Forward(mLinkRule);
|
||||
aData->mTreeMatchContext.SetHaveRelevantLink();
|
||||
|
|
@ -327,7 +327,7 @@ nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData)
|
|||
}
|
||||
|
||||
// No need to add to the active rule if it's not a link
|
||||
if (mActiveRule && nsCSSRuleProcessor::IsLink(aData->mElement) &&
|
||||
if (mActiveRule && nsCSSRuleUtils::IsLink(aData->mElement) &&
|
||||
state.HasState(NS_EVENT_STATE_ACTIVE)) {
|
||||
ruleWalker->Forward(mActiveRule);
|
||||
}
|
||||
|
|
@ -372,7 +372,7 @@ nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData)
|
|||
nsHTMLStyleSheet::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
{
|
||||
if (aData->mElement->IsHTMLElement(nsGkAtoms::a) &&
|
||||
nsCSSRuleProcessor::IsLink(aData->mElement) &&
|
||||
nsCSSRuleUtils::IsLink(aData->mElement) &&
|
||||
((mActiveRule && aData->mStateMask.HasState(NS_EVENT_STATE_ACTIVE)) ||
|
||||
(mLinkRule && aData->mStateMask.HasState(NS_EVENT_STATE_VISITED)) ||
|
||||
(mVisitedRule && aData->mStateMask.HasState(NS_EVENT_STATE_VISITED)))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue