Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactoring] Make m_selectorChecker in StyleResolver an on-stack obj…
…ect. https://bugs.webkit.org/show_bug.cgi?id=108595 Reviewed by Eric Seidel. StyleResolver uses SelectorChecker's mode to change its resolving mode. However it is a state of StyleResolver. StyleResolver should have the mode and make SelectorChecker instance on a stack while required. No new tests, just refactoring. * css/SelectorChecker.cpp: (WebCore::SelectorChecker::fastCheckRightmostSelector): (WebCore::SelectorChecker::fastCheck): (WebCore::SelectorChecker::commonPseudoClassSelectorMatches): (WebCore::SelectorChecker::matchesFocusPseudoClass): Changed to static class function, because these methods never use "this". (WebCore): * css/SelectorChecker.h: (SelectorChecker): * css/StyleResolver.cpp: (WebCore::StyleResolver::StyleResolver): (WebCore::StyleResolver::collectMatchingRules): Now, matchesFocusPseudoClass is not a static method of SelectorChecker, so replaced "m_selectorChecker." with "SelectorChecker::". (WebCore::StyleResolver::sortAndTransferMatchedRules): (WebCore::StyleResolver::collectMatchingRulesForList): (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): (WebCore::StyleResolver::matchUARules): (WebCore::StyleResolver::adjustRenderStyle): (WebCore::StyleResolver::pseudoStyleRulesForElement): Use m_mode instead of m_selectorChecker.mode(). Also use document()->inQuirksMode() instead of m_selectoChecker.strictParsing(). (WebCore::StyleResolver::ruleMatches): (WebCore::StyleResolver::checkRegionSelector): Created an on-stack SelectorChecker object and used it to check selectors. * css/StyleResolver.h: (WebCore::StyleResolver::State::State): Added m_mode, this keeps m_selectorChecker's mode. (State): (StyleResolver): Removed m_selectorChecker. Canonical link: https://commits.webkit.org/127830@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
85 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters