Index: Source/core/html/HTMLFormElement.cpp |
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp |
index ae110acc3f4f2d73c57fcce4d1083d39e5bf86f5..880b9adeb8a9de71c2e87bc0b52c31361df87af0 100644 |
--- a/Source/core/html/HTMLFormElement.cpp |
+++ b/Source/core/html/HTMLFormElement.cpp |
@@ -109,6 +109,16 @@ void HTMLFormElement::trace(Visitor* visitor) |
HTMLElement::trace(visitor); |
} |
+bool HTMLFormElement::matchesValidityPseudoClasses() const |
+{ |
+ return true; |
+} |
+ |
+bool HTMLFormElement::isValidElement() |
+{ |
+ return checkValidity(); |
+} |
+ |
bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style) |
{ |
if (!m_wasDemoted) |
@@ -713,6 +723,14 @@ HTMLFormControlElement* HTMLFormElement::defaultButton() const |
return 0; |
} |
+void HTMLFormElement::setNeedsValidityCheck() |
+{ |
+ // For now unconditionally order style recalculation, which triggers |
+ // validity recalculation. In the near future, implement validity cache and |
+ // recalculate style only if it changed. |
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Invalid)); |
+} |
+ |
bool HTMLFormElement::checkValidity() |
{ |
return !checkInvalidControlsAndCollectUnhandled(0); |