Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(972)

Unified Diff: Source/core/html/TextFieldInputType.cpp

Issue 17514010: Can't submit AR-11 form in egov.uscis.gov unless filling out optional fields (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/TextFieldInputType.cpp
diff --git a/Source/core/html/TextFieldInputType.cpp b/Source/core/html/TextFieldInputType.cpp
index c5df696efbe3517d3c442a6059c67eff6fc12ceb..d52e604e0c5e3f2c653ca8d34d2321f704101eb7 100644
--- a/Source/core/html/TextFieldInputType.cpp
+++ b/Source/core/html/TextFieldInputType.cpp
@@ -48,6 +48,7 @@
#include "core/page/ChromeClient.h"
#include "core/page/Frame.h"
#include "core/page/Page.h"
+#include "core/page/Settings.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderTextControlSingleLine.h"
#include "core/rendering/RenderTheme.h"
@@ -83,9 +84,18 @@ bool TextFieldInputType::isTextField() const
return true;
}
+static inline bool shouldIgnoreRequiredAttribute(const HTMLInputElement& input)
+{
+ if (!input.document()->settings() || !input.document()->settings()->needsSiteSpecificQuirks())
+ return false;
+ if (!equalIgnoringCase(input.document()->url().host(), "egov.uscis.gov"))
+ return false;
+ return input.fastGetAttribute(requiredAttr) == "no";
+}
+
bool TextFieldInputType::valueMissing(const String& value) const
{
- return element()->isRequired() && value.isEmpty();
+ return !shouldIgnoreRequiredAttribute(*element()) && element()->isRequired() && value.isEmpty();
}
bool TextFieldInputType::canSetSuggestedValue()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698