#include "core/events/TextEvent.h"
#include "core/frame/Frame.h"
#include "core/frame/FrameHost.h"
-#include "core/frame/Settings.h"
#include "core/html/FormDataList.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/shadow/ShadowElementNames.h"
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 !shouldIgnoreRequiredAttribute(element()) && element().isRequired() && value.isEmpty();
+ return element().isRequired() && value.isEmpty();
}
bool TextFieldInputType::canSetSuggestedValue()
InputType::setValue(sanitizedValue, valueChanged, DispatchNoEvent);
if (valueChanged)
- updateView();
+ input->updateView();
unsigned max = visibleValue().length();
if (input->focused())
spinButtonStepDown();
else
return;
- element().dispatchFormControlChangeEvent();
event->setDefaultHandled();
}
}
}
-void TextFieldInputType::handleFocusEvent(Element* oldFocusedNode, FocusDirection focusDirection)
+void TextFieldInputType::handleFocusEvent(Element* oldFocusedNode, FocusType focusType)
{
- InputType::handleFocusEvent(oldFocusedNode, focusDirection);
+ InputType::handleFocusEvent(oldFocusedNode, focusType);
element().beginEditing();
}
element().setValueFromRenderer(sanitizeValue(convertFromVisibleValue(element().innerTextValue())));
element().updatePlaceholderVisibility(false);
// Recalc for :invalid change.
- element().setNeedsStyleRecalc();
+ element().setNeedsStyleRecalc(SubtreeStyleChange);
didSetValueByUserEdit(wasChanged ? ValueChangeStateChanged : ValueChangeStateNone);
}
return shouldSpinButtonRespondToMouseEvents() && element().focused();
}
-void TextFieldInputType::spinButtonDidReleaseMouseCapture()
-{
- element().dispatchFormControlChangeEvent();
-}
-
} // namespace WebCore