:default CSS pseudo-class should match checkboxes+radios with a `checked` attribute
[WebKit-https.git] / Source / WebCore / style / StyleSharingResolver.cpp
index bbd2c3e..ba16a9b 100644 (file)
@@ -185,9 +185,6 @@ static bool canShareStyleWithControl(const HTMLFormControlElement& element, cons
     if (formElement.isDisabledFormControl() != element.isDisabledFormControl())
         return false;
 
-    if (formElement.isDefaultButtonForForm() != element.isDefaultButtonForForm())
-        return false;
-
     if (formElement.isInRange() != element.isInRange())
         return false;
 
@@ -284,6 +281,9 @@ bool SharingResolver::canShareStyleWithElement(const Context& context, const Sty
     if (candidateElement.matchesIndeterminatePseudoClass() != element.matchesIndeterminatePseudoClass())
         return false;
 
+    if (candidateElement.matchesDefaultPseudoClass() != element.matchesDefaultPseudoClass())
+        return false;
+
     if (element.shadowRoot() && !element.shadowRoot()->styleResolver().ruleSets().authorStyle()->hostPseudoClassRules().isEmpty())
         return false;