summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html/HTMLFormElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/HTMLFormElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLFormElement.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp
index 8535027..f051ea1 100644
--- a/Source/WebCore/html/HTMLFormElement.cpp
+++ b/Source/WebCore/html/HTMLFormElement.cpp
@@ -223,7 +223,12 @@ bool HTMLFormElement::validateInteractively(Event* event)
Vector<RefPtr<FormAssociatedElement> > unhandledInvalidControls;
if (!checkInvalidControlsAndCollectUnhandled(unhandledInvalidControls))
return true;
- // If the form has invalid controls, abort submission.
+ // Because the form has invalid controls, we abort the form submission and
+ // show a validation message on a focusable form control.
+
+ // Needs to update layout now because we'd like to call isFocusable(), which
+ // has !renderer()->needsLayout() assertion.
+ document()->updateLayoutIgnorePendingStylesheets();
RefPtr<HTMLFormElement> protector(this);
// Focus on the first focusable control and show a validation message.