Diff
Modified: trunk/Source/WebCore/ChangeLog (287221 => 287222)
--- trunk/Source/WebCore/ChangeLog 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/ChangeLog 2021-12-18 15:11:29 UTC (rev 287222)
@@ -1,3 +1,31 @@
+2021-12-18 Antti Koivisto <[email protected]>
+
+ Remove unused :-internal-direct-focus pseudo-class
+ https://bugs.webkit.org/show_bug.cgi?id=234431
+
+ Reviewed by Alexey Shvayka.
+
+ It was replaced by :focus-visible on the user-agent stylesheet.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::selectorText const):
+ * css/CSSSelector.h:
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::checkOne const):
+ * css/SelectorCheckerTestFunctions.h:
+ (WebCore::matchesLegacyDirectFocusPseudoClass):
+ (WebCore::matchesFocusVisiblePseudoClass):
+ (WebCore::matchesDirectFocusPseudoClass): Deleted.
+ * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+ * css/parser/CSSSelectorParser.cpp:
+ (WebCore::CSSSelectorParser::consumePseudo):
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::addPseudoClassType):
+ * dom/Element.cpp:
+ (WebCore::Element::setFocus):
+ * style/RuleSet.cpp:
+ (WebCore::Style::RuleSet::addRule):
+
2021-12-17 Wenson Hsieh <[email protected]>
Hide viewport-constrained elements that are detected by ModalContainerObserver
Modified: trunk/Source/WebCore/css/CSSSelector.cpp (287221 => 287222)
--- trunk/Source/WebCore/css/CSSSelector.cpp 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/css/CSSSelector.cpp 2021-12-18 15:11:29 UTC (rev 287222)
@@ -444,9 +444,6 @@
case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
builder.append(":-webkit-autofill-strong-password-viewable");
break;
- case CSSSelector::PseudoClassDirectFocus:
- builder.append(":-internal-direct-focus");
- break;
case CSSSelector::PseudoClassDrag:
builder.append(":-webkit-drag");
break;
Modified: trunk/Source/WebCore/css/CSSSelector.h (287221 => 287222)
--- trunk/Source/WebCore/css/CSSSelector.h 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/css/CSSSelector.h 2021-12-18 15:11:29 UTC (rev 287222)
@@ -114,7 +114,6 @@
PseudoClassAutofillStrongPassword,
PseudoClassAutofillStrongPasswordViewable,
PseudoClassHover,
- PseudoClassDirectFocus,
PseudoClassDrag,
PseudoClassFocus,
PseudoClassFocusVisible,
Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (287221 => 287222)
--- trunk/Source/WebCore/css/SelectorChecker.cpp 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp 2021-12-18 15:11:29 UTC (rev 287222)
@@ -982,8 +982,6 @@
if (context.inFunctionalPseudoClass)
return false;
return element.isLink() && context.visitedMatchType == VisitedMatchType::Enabled;
- case CSSSelector::PseudoClassDirectFocus:
- return matchesDirectFocusPseudoClass(element);
case CSSSelector::PseudoClassDrag:
return element.isBeingDragged();
case CSSSelector::PseudoClassFocus:
Modified: trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h (287221 => 287222)
--- trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h 2021-12-18 15:11:29 UTC (rev 287222)
@@ -490,9 +490,7 @@
return element.document().frame() && element.document().frame()->selection().isFocusedAndActive();
}
-// This needs to match a subset of elements matchesFocusPseudoClass match since direct focus is treated
-// as a part of focus pseudo class selectors in ElementRuleCollector::collectMatchingRules.
-ALWAYS_INLINE bool matchesDirectFocusPseudoClass(const Element& element)
+ALWAYS_INLINE bool matchesLegacyDirectFocusPseudoClass(const Element& element)
{
if (InspectorInstrumentation::forcePseudoState(element, CSSSelector::PseudoClassFocus))
return true;
@@ -517,7 +515,7 @@
ALWAYS_INLINE bool matchesFocusVisiblePseudoClass(const Element& element)
{
if (!element.document().settings().focusVisibleEnabled())
- return matchesDirectFocusPseudoClass(element);
+ return matchesLegacyDirectFocusPseudoClass(element);
if (InspectorInstrumentation::forcePseudoState(element, CSSSelector::PseudoClassFocusVisible))
return true;
Modified: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (287221 => 287222)
--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in 2021-12-18 15:11:29 UTC (rev 287222)
@@ -1,4 +1,3 @@
--internal-direct-focus
-internal-modal-dialog
-khtml-drag
-webkit-any
Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (287221 => 287222)
--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp 2021-12-18 15:11:29 UTC (rev 287222)
@@ -642,8 +642,6 @@
if (!selector)
return nullptr;
if (selector->match() == CSSSelector::PseudoClass) {
- if (m_context.mode != UASheetMode && selector->pseudoClassType() == CSSSelector::PseudoClassDirectFocus)
- return nullptr;
if (m_context.mode != UASheetMode && selector->pseudoClassType() == CSSSelector::PseudoClassModalDialog)
return nullptr;
if (!m_context.focusVisibleEnabled && selector->pseudoClassType() == CSSSelector::PseudoClassFocusVisible)
Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (287221 => 287222)
--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp 2021-12-18 15:11:29 UTC (rev 287222)
@@ -85,7 +85,6 @@
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesDisabledPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesEnabledPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationIsDefinedElement, bool, (const Element&));
-static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesDirectFocusPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFocusPseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFocusVisiblePseudoClass, bool, (const Element&));
static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFocusWithinPseudoClass, bool, (const Element&));
@@ -641,11 +640,6 @@
return isDefinedElement(element);
}
-JSC_DEFINE_JIT_OPERATION(operationMatchesDirectFocusPseudoClass, bool, (const Element& element))
-{
- return matchesDirectFocusPseudoClass(element);
-}
-
JSC_DEFINE_JIT_OPERATION(operationMatchesFocusPseudoClass, bool, (const Element& element))
{
return matchesFocusPseudoClass(element);
@@ -846,9 +840,6 @@
case CSSSelector::PseudoClassDefined:
fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<JSC::OperationPtrTag>(operationIsDefinedElement));
return FunctionType::SimpleSelectorChecker;
- case CSSSelector::PseudoClassDirectFocus:
- fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<JSC::OperationPtrTag>(operationMatchesDirectFocusPseudoClass));
- return FunctionType::SimpleSelectorChecker;
case CSSSelector::PseudoClassFocus:
fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<JSC::OperationPtrTag>(operationMatchesFocusPseudoClass));
return FunctionType::SimpleSelectorChecker;
Modified: trunk/Source/WebCore/dom/Element.cpp (287221 => 287222)
--- trunk/Source/WebCore/dom/Element.cpp 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/dom/Element.cpp 2021-12-18 15:11:29 UTC (rev 287222)
@@ -850,7 +850,6 @@
{
Style::PseudoClassChangeInvalidation focusStyleInvalidation(*this, CSSSelector::PseudoClassFocus);
Style::PseudoClassChangeInvalidation focusVisibleStyleInvalidation(*this, CSSSelector::PseudoClassFocusVisible);
- Style::PseudoClassChangeInvalidation directFocusStyleInvalidation(*this, CSSSelector::PseudoClassDirectFocus);
document().userActionElements().setFocused(*this, flag);
// Shadow host with a slot that contain focused element is not considered focused.
Modified: trunk/Source/WebCore/style/RuleSet.cpp (287221 => 287222)
--- trunk/Source/WebCore/style/RuleSet.cpp 2021-12-18 11:19:18 UTC (rev 287221)
+++ trunk/Source/WebCore/style/RuleSet.cpp 2021-12-18 15:11:29 UTC (rev 287222)
@@ -171,7 +171,6 @@
case CSSSelector::PseudoClassAnyLinkDeprecated:
linkSelector = selector;
break;
- case CSSSelector::PseudoClassDirectFocus:
case CSSSelector::PseudoClassFocus:
case CSSSelector::PseudoClassFocusVisible:
focusSelector = selector;