#include "config.h"
#include "core/html/forms/InputType.h"
-#include "InputTypeNames.h"
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
+#include "bindings/core/v8/ExceptionMessages.h"
+#include "bindings/core/v8/ExceptionState.h"
+#include "core/InputTypeNames.h"
#include "core/accessibility/AXObjectCache.h"
#include "core/dom/NodeRenderStyle.h"
#include "core/events/KeyboardEvent.h"
#include "core/html/HTMLShadowElement.h"
#include "core/html/forms/ButtonInputType.h"
#include "core/html/forms/CheckboxInputType.h"
+#include "core/html/forms/ColorChooser.h"
#include "core/html/forms/ColorInputType.h"
#include "core/html/forms/DateInputType.h"
#include "core/html/forms/DateTimeLocalInputType.h"
#include "core/html/forms/WeekInputType.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/rendering/RenderTheme.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/text/PlatformLocale.h"
#include "platform/text/TextBreakIterator.h"
-namespace WebCore {
+namespace blink {
using blink::WebLocalizedString;
using namespace HTMLNames;
-using namespace std;
typedef PassRefPtrWillBeRawPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
return false;
}
-bool InputType::isTextType() const
-{
- return false;
-}
-
-bool InputType::isRangeControl() const
-{
- return false;
-}
-
bool InputType::shouldSaveAndRestoreFormControlState() const
{
return true;
double InputType::valueAsDouble() const
{
- return numeric_limits<double>::quiet_NaN();
+ return std::numeric_limits<double>::quiet_NaN();
}
void InputType::setValueAsDouble(double doubleValue, TextFieldEventBehavior eventBehavior, ExceptionState& exceptionState) const
return false;
}
+bool InputType::tooLong(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFlag) const
+{
+ return false;
+}
+
bool InputType::patternMismatch(const String&) const
{
return false;
return false;
}
-bool InputType::shouldUseInputMethod() const
-{
- return false;
-}
-
void InputType::enableSecureTextInput()
{
}
return proposedValue;
}
+void InputType::warnIfValueIsInvalidAndElementIsVisible(const String& value) const
+{
+ // Don't warn if the value is set in Modernizr.
+ RenderStyle* style = element().renderStyle();
+ if (style && style->visibility() != HIDDEN)
+ warnIfValueIsInvalid(value);
+}
+
+void InputType::warnIfValueIsInvalid(const String&) const
+{
+}
+
bool InputType::receiveDroppedFiles(const DragData*)
{
ASSERT_NOT_REACHED();
return String();
}
-void InputType::copyNonAttributeProperties(const HTMLInputElement&)
-{
-}
-
bool InputType::shouldRespectListAttribute()
{
return false;
return false;
}
-bool InputType::isRadioButton() const
-{
- return false;
-}
-
-bool InputType::isSearchField() const
-{
- return false;
-}
-
-bool InputType::isHiddenType() const
-{
- return false;
-}
-
-bool InputType::isPasswordField() const
-{
- return false;
-}
-
-bool InputType::isCheckbox() const
-{
- return false;
-}
-
-bool InputType::isEmailField() const
-{
- return false;
-}
-
-bool InputType::isFileUpload() const
-{
- return false;
-}
-
-bool InputType::isImageButton() const
-{
- return false;
-}
-
bool InputType::isInteractiveContent() const
{
return true;
}
-bool InputType::isNumberField() const
-{
- return false;
-}
-
-bool InputType::isTelephoneField() const
-{
- return false;
-}
-
-bool InputType::isURLField() const
-{
- return false;
-}
-
-bool InputType::isDateField() const
-{
- return false;
-}
-
-bool InputType::isDateTimeLocalField() const
-{
- return false;
-}
-
-bool InputType::isMonthField() const
-{
- return false;
-}
-
-bool InputType::isTimeField() const
-{
- return false;
-}
-
-bool InputType::isWeekField() const
-{
- return false;
-}
-
bool InputType::isEnumeratable()
{
return true;
return false;
}
-bool InputType::isColorControl() const
+bool InputType::shouldRespectHeightAndWidthAttributes()
{
return false;
}
-bool InputType::shouldRespectHeightAndWidthAttributes()
+int InputType::maxLength() const
{
- return false;
+ return HTMLInputElement::maximumLength;
}
bool InputType::supportsPlaceholder() const
const QualifiedName& InputType::subResourceAttributeName() const
{
- return nullQName();
+ return QualifiedName::null();
}
-bool InputType::supportsIndeterminateAppearance() const
+bool InputType::shouldAppearIndeterminate() const
{
return false;
}
return 0;
}
+TextDirection InputType::computedTextDirection()
+{
+ return element().computedStyle()->direction();
+}
+
+ColorChooserClient* InputType::colorChooserClient()
+{
+ return 0;
+}
+
void InputType::applyStep(const Decimal& current, int count, AnyStepHandling anyStepHandling, TextFieldEventBehavior eventBehavior, ExceptionState& exceptionState)
{
StepRange stepRange(createStepRange(anyStepHandling));
return StepRange(stepBase, minimum, maximum, step, stepDescription);
}
-} // namespace WebCore
+} // namespace blink