| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class ListAttributeTargetObserver; | 44 class ListAttributeTargetObserver; |
| 45 struct DateTimeChooserParameters; | 45 struct DateTimeChooserParameters; |
| 46 | 46 |
| 47 class HTMLInputElement : public HTMLTextFormControlElement { | 47 class HTMLInputElement : public HTMLTextFormControlElement { |
| 48 public: | 48 public: |
| 49 static PassRefPtr<HTMLInputElement> create(Document&, HTMLFormElement*, bool
createdByParser); | 49 static PassRefPtr<HTMLInputElement> create(Document&, HTMLFormElement*, bool
createdByParser); |
| 50 virtual ~HTMLInputElement(); | 50 virtual ~HTMLInputElement(); |
| 51 | 51 |
| 52 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange); | 52 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange); |
| 53 | 53 |
| 54 virtual bool shouldAutocomplete() const; | 54 virtual bool shouldAutocomplete() const OVERRIDE FINAL; |
| 55 | 55 |
| 56 // For ValidityState | 56 // For ValidityState |
| 57 virtual bool hasBadInput() const OVERRIDE; | 57 virtual bool hasBadInput() const OVERRIDE FINAL; |
| 58 virtual bool patternMismatch() const OVERRIDE; | 58 virtual bool patternMismatch() const OVERRIDE FINAL; |
| 59 virtual bool rangeUnderflow() const OVERRIDE; | 59 virtual bool rangeUnderflow() const OVERRIDE FINAL; |
| 60 virtual bool rangeOverflow() const; | 60 virtual bool rangeOverflow() const OVERRIDE FINAL; |
| 61 virtual bool stepMismatch() const OVERRIDE; | 61 virtual bool stepMismatch() const OVERRIDE FINAL; |
| 62 virtual bool tooLong() const OVERRIDE; | 62 virtual bool tooLong() const OVERRIDE FINAL; |
| 63 virtual bool typeMismatch() const OVERRIDE; | 63 virtual bool typeMismatch() const OVERRIDE FINAL; |
| 64 virtual bool valueMissing() const OVERRIDE; | 64 virtual bool valueMissing() const OVERRIDE FINAL; |
| 65 virtual String validationMessage() const OVERRIDE; | 65 virtual String validationMessage() const OVERRIDE FINAL; |
| 66 | 66 |
| 67 // Returns the minimum value for type=date, number, or range. Don't call th
is for other types. | 67 // Returns the minimum value for type=date, number, or range. Don't call th
is for other types. |
| 68 double minimum() const; | 68 double minimum() const; |
| 69 // Returns the maximum value for type=date, number, or range. Don't call th
is for other types. | 69 // Returns the maximum value for type=date, number, or range. Don't call th
is for other types. |
| 70 // This always returns a value which is >= minimum(). | 70 // This always returns a value which is >= minimum(). |
| 71 double maximum() const; | 71 double maximum() const; |
| 72 // Sets the "allowed value step" defined in the HTML spec to the specified d
ouble pointer. | 72 // Sets the "allowed value step" defined in the HTML spec to the specified d
ouble pointer. |
| 73 // Returns false if there is no "allowed value step." | 73 // Returns false if there is no "allowed value step." |
| 74 bool getAllowedValueStep(Decimal*) const; | 74 bool getAllowedValueStep(Decimal*) const; |
| 75 StepRange createStepRange(AnyStepHandling) const; | 75 StepRange createStepRange(AnyStepHandling) const; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 int selectionStartForBinding(ExceptionState&) const; | 166 int selectionStartForBinding(ExceptionState&) const; |
| 167 int selectionEndForBinding(ExceptionState&) const; | 167 int selectionEndForBinding(ExceptionState&) const; |
| 168 String selectionDirectionForBinding(ExceptionState&) const; | 168 String selectionDirectionForBinding(ExceptionState&) const; |
| 169 void setSelectionStartForBinding(int, ExceptionState&); | 169 void setSelectionStartForBinding(int, ExceptionState&); |
| 170 void setSelectionEndForBinding(int, ExceptionState&); | 170 void setSelectionEndForBinding(int, ExceptionState&); |
| 171 void setSelectionDirectionForBinding(const String&, ExceptionState&); | 171 void setSelectionDirectionForBinding(const String&, ExceptionState&); |
| 172 void setSelectionRangeForBinding(int start, int end, ExceptionState&); | 172 void setSelectionRangeForBinding(int start, int end, ExceptionState&); |
| 173 void setSelectionRangeForBinding(int start, int end, const String& direction
, ExceptionState&); | 173 void setSelectionRangeForBinding(int start, int end, const String& direction
, ExceptionState&); |
| 174 | 174 |
| 175 virtual bool rendererIsNeeded(const RenderStyle&); | 175 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE FINAL; |
| 176 virtual RenderObject* createRenderer(RenderStyle*); | 176 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
| 177 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; | 177 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE FINAL; |
| 178 | 178 |
| 179 // FIXME: For isActivatedSubmit and setActivatedSubmit, we should use the NV
I-idiom here by making | 179 // FIXME: For isActivatedSubmit and setActivatedSubmit, we should use the NV
I-idiom here by making |
| 180 // it private virtual in all classes and expose a public method in HTMLFormC
ontrolElement to call | 180 // it private virtual in all classes and expose a public method in HTMLFormC
ontrolElement to call |
| 181 // the private virtual method. | 181 // the private virtual method. |
| 182 virtual bool isActivatedSubmit() const; | 182 virtual bool isActivatedSubmit() const OVERRIDE FINAL; |
| 183 virtual void setActivatedSubmit(bool flag); | 183 virtual void setActivatedSubmit(bool flag) OVERRIDE FINAL; |
| 184 | 184 |
| 185 String altText() const; | 185 String altText() const; |
| 186 | 186 |
| 187 int maxResults() const { return m_maxResults; } | 187 int maxResults() const { return m_maxResults; } |
| 188 | 188 |
| 189 const AtomicString& defaultValue() const; | 189 const AtomicString& defaultValue() const; |
| 190 void setDefaultValue(const AtomicString&); | 190 void setDefaultValue(const AtomicString&); |
| 191 | 191 |
| 192 Vector<String> acceptMIMETypes(); | 192 Vector<String> acceptMIMETypes(); |
| 193 Vector<String> acceptFileExtensions(); | 193 Vector<String> acceptFileExtensions(); |
| 194 const AtomicString& alt() const; | 194 const AtomicString& alt() const; |
| 195 | 195 |
| 196 void setSize(unsigned); | 196 void setSize(unsigned); |
| 197 void setSize(unsigned, ExceptionState&); | 197 void setSize(unsigned, ExceptionState&); |
| 198 | 198 |
| 199 KURL src() const; | 199 KURL src() const; |
| 200 | 200 |
| 201 virtual int maxLength() const; | 201 virtual int maxLength() const OVERRIDE FINAL; |
| 202 void setMaxLength(int, ExceptionState&); | 202 void setMaxLength(int, ExceptionState&); |
| 203 | 203 |
| 204 bool multiple() const; | 204 bool multiple() const; |
| 205 | 205 |
| 206 FileList* files(); | 206 FileList* files(); |
| 207 void setFiles(PassRefPtr<FileList>); | 207 void setFiles(PassRefPtr<FileList>); |
| 208 | 208 |
| 209 // Returns true if the given DragData has more than one dropped files. | 209 // Returns true if the given DragData has more than one dropped files. |
| 210 bool receiveDroppedFiles(const DragData*); | 210 bool receiveDroppedFiles(const DragData*); |
| 211 | 211 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 bool capture() const; | 245 bool capture() const; |
| 246 #endif | 246 #endif |
| 247 | 247 |
| 248 static const int maximumLength; | 248 static const int maximumLength; |
| 249 | 249 |
| 250 unsigned height() const; | 250 unsigned height() const; |
| 251 unsigned width() const; | 251 unsigned width() const; |
| 252 void setHeight(unsigned); | 252 void setHeight(unsigned); |
| 253 void setWidth(unsigned); | 253 void setWidth(unsigned); |
| 254 | 254 |
| 255 virtual void blur() OVERRIDE; | 255 virtual void blur() OVERRIDE FINAL; |
| 256 void defaultBlur(); | 256 void defaultBlur(); |
| 257 | 257 |
| 258 virtual const AtomicString& name() const OVERRIDE; | 258 virtual const AtomicString& name() const OVERRIDE FINAL; |
| 259 | 259 |
| 260 void beginEditing(); | 260 void beginEditing(); |
| 261 void endEditing(); | 261 void endEditing(); |
| 262 | 262 |
| 263 static Vector<FileChooserFileInfo> filesFromFileInputFormControlState(const
FormControlState&); | 263 static Vector<FileChooserFileInfo> filesFromFileInputFormControlState(const
FormControlState&); |
| 264 | 264 |
| 265 virtual bool matchesReadOnlyPseudoClass() const OVERRIDE; | 265 virtual bool matchesReadOnlyPseudoClass() const OVERRIDE FINAL; |
| 266 virtual bool matchesReadWritePseudoClass() const OVERRIDE; | 266 virtual bool matchesReadWritePseudoClass() const OVERRIDE FINAL; |
| 267 virtual void setRangeText(const String& replacement, ExceptionState&) OVERRI
DE; | 267 virtual void setRangeText(const String& replacement, ExceptionState&) OVERRI
DE FINAL; |
| 268 virtual void setRangeText(const String& replacement, unsigned start, unsigne
d end, const String& selectionMode, ExceptionState&) OVERRIDE; | 268 virtual void setRangeText(const String& replacement, unsigned start, unsigne
d end, const String& selectionMode, ExceptionState&) OVERRIDE FINAL; |
| 269 | 269 |
| 270 bool hasImageLoader() const { return m_imageLoader; } | 270 bool hasImageLoader() const { return m_imageLoader; } |
| 271 HTMLImageLoader* imageLoader(); | 271 HTMLImageLoader* imageLoader(); |
| 272 | 272 |
| 273 bool setupDateTimeChooserParameters(DateTimeChooserParameters&); | 273 bool setupDateTimeChooserParameters(DateTimeChooserParameters&); |
| 274 | 274 |
| 275 bool supportsInputModeAttribute() const; | 275 bool supportsInputModeAttribute() const; |
| 276 | 276 |
| 277 protected: | 277 protected: |
| 278 HTMLInputElement(Document&, HTMLFormElement*, bool createdByParser); | 278 HTMLInputElement(Document&, HTMLFormElement*, bool createdByParser); |
| 279 | 279 |
| 280 virtual void defaultEventHandler(Event*); | 280 virtual void defaultEventHandler(Event*); |
| 281 | 281 |
| 282 private: | 282 private: |
| 283 enum AutoCompleteSetting { Uninitialized, On, Off }; | 283 enum AutoCompleteSetting { Uninitialized, On, Off }; |
| 284 | 284 |
| 285 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE; | 285 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE FINAL; |
| 286 virtual void didAddShadowRoot(ShadowRoot&) OVERRIDE; | 286 virtual void didAddShadowRoot(ShadowRoot&) OVERRIDE FINAL; |
| 287 | 287 |
| 288 virtual void willChangeForm() OVERRIDE; | 288 virtual void willChangeForm() OVERRIDE FINAL; |
| 289 virtual void didChangeForm() OVERRIDE; | 289 virtual void didChangeForm() OVERRIDE FINAL; |
| 290 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 290 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
| 291 virtual void removedFrom(ContainerNode*) OVERRIDE; | 291 virtual void removedFrom(ContainerNode*) OVERRIDE FINAL; |
| 292 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 292 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE FINAL; |
| 293 | 293 |
| 294 virtual bool hasCustomFocusLogic() const OVERRIDE; | 294 virtual bool hasCustomFocusLogic() const OVERRIDE FINAL; |
| 295 virtual bool isKeyboardFocusable() const OVERRIDE; | 295 virtual bool isKeyboardFocusable() const OVERRIDE FINAL; |
| 296 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE; | 296 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE FINAL; |
| 297 virtual bool isEnumeratable() const; | 297 virtual bool isEnumeratable() const OVERRIDE FINAL; |
| 298 virtual bool isInteractiveContent() const OVERRIDE; | 298 virtual bool isInteractiveContent() const OVERRIDE FINAL; |
| 299 virtual bool supportLabels() const OVERRIDE; | 299 virtual bool supportLabels() const OVERRIDE FINAL; |
| 300 virtual void updateFocusAppearance(bool restorePreviousSelection); | 300 virtual void updateFocusAppearance(bool restorePreviousSelection) OVERRIDE F
INAL; |
| 301 virtual bool shouldUseInputMethod(); | 301 virtual bool shouldUseInputMethod() OVERRIDE FINAL; |
| 302 | 302 |
| 303 virtual bool isTextFormControl() const { return isTextField(); } | 303 virtual bool isTextFormControl() const OVERRIDE FINAL { return isTextField()
; } |
| 304 | 304 |
| 305 virtual bool canTriggerImplicitSubmission() const { return isTextField(); } | 305 virtual bool canTriggerImplicitSubmission() const OVERRIDE FINAL { return is
TextField(); } |
| 306 | 306 |
| 307 virtual const AtomicString& formControlType() const; | 307 virtual const AtomicString& formControlType() const OVERRIDE FINAL; |
| 308 | 308 |
| 309 virtual bool shouldSaveAndRestoreFormControlState() const OVERRIDE; | 309 virtual bool shouldSaveAndRestoreFormControlState() const OVERRIDE FINAL; |
| 310 virtual FormControlState saveFormControlState() const OVERRIDE; | 310 virtual FormControlState saveFormControlState() const OVERRIDE FINAL; |
| 311 virtual void restoreFormControlState(const FormControlState&) OVERRIDE; | 311 virtual void restoreFormControlState(const FormControlState&) OVERRIDE FINAL
; |
| 312 | 312 |
| 313 virtual bool canStartSelection() const; | 313 virtual bool canStartSelection() const OVERRIDE FINAL; |
| 314 | 314 |
| 315 virtual void accessKeyAction(bool sendMouseEvents); | 315 virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE FINAL; |
| 316 | 316 |
| 317 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 317 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 318 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 318 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE FI
NAL; |
| 319 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; | 319 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE FINAL; |
| 320 virtual void finishParsingChildren(); | 320 virtual void finishParsingChildren() OVERRIDE FINAL; |
| 321 | 321 |
| 322 virtual void copyNonAttributePropertiesFromElement(const Element&); | 322 virtual void copyNonAttributePropertiesFromElement(const Element&) OVERRIDE
FINAL; |
| 323 | 323 |
| 324 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 324 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE FINAL; |
| 325 | 325 |
| 326 virtual bool appendFormData(FormDataList&, bool) OVERRIDE; | 326 virtual bool appendFormData(FormDataList&, bool) OVERRIDE FINAL; |
| 327 virtual String resultForDialogSubmit() OVERRIDE; | 327 virtual String resultForDialogSubmit() OVERRIDE FINAL; |
| 328 | 328 |
| 329 virtual bool canBeSuccessfulSubmitButton() const OVERRIDE; | 329 virtual bool canBeSuccessfulSubmitButton() const OVERRIDE FINAL; |
| 330 | 330 |
| 331 virtual void resetImpl() OVERRIDE; | 331 virtual void resetImpl() OVERRIDE FINAL; |
| 332 | 332 |
| 333 virtual void* preDispatchEventHandler(Event*); | 333 virtual void* preDispatchEventHandler(Event*) OVERRIDE FINAL; |
| 334 virtual void postDispatchEventHandler(Event*, void* dataFromPreDispatch); | 334 virtual void postDispatchEventHandler(Event*, void* dataFromPreDispatch) OVE
RRIDE FINAL; |
| 335 | 335 |
| 336 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 336 virtual bool isURLAttribute(const Attribute&) const OVERRIDE FINAL; |
| 337 virtual bool isInRange() const; | 337 virtual bool isInRange() const OVERRIDE FINAL; |
| 338 virtual bool isOutOfRange() const; | 338 virtual bool isOutOfRange() const OVERRIDE FINAL; |
| 339 | 339 |
| 340 bool isTextType() const; | 340 bool isTextType() const; |
| 341 bool tooLong(const String&, NeedsToCheckDirtyFlag) const; | 341 bool tooLong(const String&, NeedsToCheckDirtyFlag) const; |
| 342 | 342 |
| 343 virtual bool supportsPlaceholder() const; | 343 virtual bool supportsPlaceholder() const OVERRIDE FINAL; |
| 344 virtual void updatePlaceholderText(); | 344 virtual void updatePlaceholderText() OVERRIDE FINAL; |
| 345 virtual bool isEmptyValue() const OVERRIDE { return innerTextValue().isEmpty
(); } | 345 virtual bool isEmptyValue() const OVERRIDE FINAL { return innerTextValue().i
sEmpty(); } |
| 346 virtual bool isEmptySuggestedValue() const { return suggestedValue().isEmpty
(); } | 346 virtual bool isEmptySuggestedValue() const OVERRIDE FINAL { return suggested
Value().isEmpty(); } |
| 347 virtual void handleFocusEvent(Element* oldFocusedElement, FocusDirection) OV
ERRIDE; | 347 virtual void handleFocusEvent(Element* oldFocusedElement, FocusDirection) OV
ERRIDE FINAL; |
| 348 virtual void handleBlurEvent(); | 348 virtual void handleBlurEvent() OVERRIDE FINAL; |
| 349 | 349 |
| 350 virtual bool isOptionalFormControl() const { return !isRequiredFormControl()
; } | 350 virtual bool isOptionalFormControl() const OVERRIDE FINAL { return !isRequir
edFormControl(); } |
| 351 virtual bool isRequiredFormControl() const; | 351 virtual bool isRequiredFormControl() const OVERRIDE FINAL; |
| 352 virtual bool recalcWillValidate() const; | 352 virtual bool recalcWillValidate() const OVERRIDE FINAL; |
| 353 virtual void requiredAttributeChanged() OVERRIDE; | 353 virtual void requiredAttributeChanged() OVERRIDE FINAL; |
| 354 | 354 |
| 355 void updateType(); | 355 void updateType(); |
| 356 | 356 |
| 357 virtual void subtreeHasChanged(); | 357 virtual void subtreeHasChanged() OVERRIDE FINAL; |
| 358 | 358 |
| 359 void resetListAttributeTargetObserver(); | 359 void resetListAttributeTargetObserver(); |
| 360 void parseMaxLengthAttribute(const AtomicString&); | 360 void parseMaxLengthAttribute(const AtomicString&); |
| 361 void updateValueIfNeeded(); | 361 void updateValueIfNeeded(); |
| 362 | 362 |
| 363 // Returns null if this isn't associated with any radio button group. | 363 // Returns null if this isn't associated with any radio button group. |
| 364 CheckedRadioButtons* checkedRadioButtons() const; | 364 CheckedRadioButtons* checkedRadioButtons() const; |
| 365 void addToRadioButtonGroup(); | 365 void addToRadioButtonGroup(); |
| 366 void removeFromRadioButtonGroup(); | 366 void removeFromRadioButtonGroup(); |
| 367 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 367 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 392 // that it lives as long as its owning element lives. If we move the loader
into | 392 // that it lives as long as its owning element lives. If we move the loader
into |
| 393 // the ImageInput object we may delete the loader while this element lives o
n. | 393 // the ImageInput object we may delete the loader while this element lives o
n. |
| 394 OwnPtr<HTMLImageLoader> m_imageLoader; | 394 OwnPtr<HTMLImageLoader> m_imageLoader; |
| 395 OwnPtr<ListAttributeTargetObserver> m_listAttributeTargetObserver; | 395 OwnPtr<ListAttributeTargetObserver> m_listAttributeTargetObserver; |
| 396 }; | 396 }; |
| 397 | 397 |
| 398 DEFINE_NODE_TYPE_CASTS(HTMLInputElement, hasTagName(HTMLNames::inputTag)); | 398 DEFINE_NODE_TYPE_CASTS(HTMLInputElement, hasTagName(HTMLNames::inputTag)); |
| 399 | 399 |
| 400 } //namespace | 400 } //namespace |
| 401 #endif | 401 #endif |
| OLD | NEW |