Changeset 85998 in webkit


Ignore:
Timestamp:
May 6, 2011 9:24:09 PM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-05-06 Kent Tamura <tkent@chromium.org>

Reviewed by Ryosuke Niwa.

Eliminate WebCore/dom/InputElement.{cpp,h}
https://bugs.webkit.org/show_bug.cgi?id=60262

  • Fold in all of the code of InputElement.{cpp,h} into HTMLInputElement and TextFieldInputType.
  • Change the return type of Node::toInputElement(): InputElement* -> HTMLInputElement*

No new tests. This change should not change the existing behaviour.

  • CMakeLists.txt: Remove InpuntElement.cpp and/or InputElement.h.
  • GNUmakefile.list.am: ditto.
  • WebCore.exp.in: Add symbols of functions exposed to WebKit.
  • WebCore.gypi: Remove InpuntElement.cpp and/or InputElement.h.
  • WebCore.pro: ditto.
  • WebCore.vcproj/WebCore.vcproj: ditto.
  • WebCore.xcodeproj/project.pbxproj: ditto.
  • accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): Follow the return type change of Node::toInputElement().
  • accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::isPasswordField): ditto. (WebCore::AccessibilityRenderObject::isIndeterminate): ditto. (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio): ditto. (WebCore::AccessibilityRenderObject::isChecked): ditto.
  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::canShareStyleWithElement): ditto. (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): ditto.
  • dom/CheckedRadioButtons.cpp: (WebCore::CheckedRadioButtons::removeButton): ditto.
  • dom/DOMAllInOne.cpp: Remove InputElement.h.
  • dom/InputElement.cpp: Removed.
  • dom/InputElement.h: Removed.
  • dom/Node.cpp: (WebCore::Node::toInputElement): Change the return type from InputElement* to HTMLInputElement*.
  • dom/Node.h: ditto.
  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::HTMLInputElement): (WebCore::HTMLInputElement::formControlName): (WebCore::HTMLInputElement::tooLong): (WebCore::HTMLInputElement::updateFocusAppearance): (WebCore::HTMLInputElement::aboutToUnload): (WebCore::HTMLInputElement::handleFocusEvent): (WebCore::HTMLInputElement::handleBlurEvent): (WebCore::HTMLInputElement::updateType): (WebCore::HTMLInputElement::parseMappedAttribute): (WebCore::HTMLInputElement::size): (WebCore::HTMLInputElement::copyNonAttributeProperties): (WebCore::HTMLInputElement::value): (WebCore::HTMLInputElement::suggestedValue): (WebCore::HTMLInputElement::setSuggestedValue): (WebCore::HTMLInputElement::setValue): (WebCore::HTMLInputElement::setValueFromRenderer): (WebCore::HTMLInputElement::setFileListFromRenderer): (WebCore::HTMLInputElement::setDefaultName): (WebCore::HTMLInputElement::maxLength): (WebCore::HTMLInputElement::cacheSelection): (WebCore::formatCodes): Moved from InputElement. (WebCore::cursorPositionToMaskIndex): ditto. (WebCore::HTMLInputElement::isConformToInputMask): ditto. (WebCore::HTMLInputElement::validateInputMask): ditto. (WebCore::HTMLInputElement::setWapInputFormat): ditto. (WebCore::HTMLInputElement::notifyFormStateChanged): ditto. (WebCore::HTMLInputElement::parseMaxLengthAttribute): ditto. (WebCore::HTMLInputElement::updateValueIfNeeded):ditto.
  • html/HTMLInputElement.h:
    • Add data members which were defined in InputElementData.
    • Make some functions public because the public interface InputElement is removed.
    • Make some functions non-virtual because they don't override corresponding virtual functions of InputElement anymore.

(WebCore::HTMLInputElement::toInputElement):

Follow the return type change of Node::toInputElement().

(WebCore::HTMLInputElement::isIndeterminate):
(WebCore::HTMLInputElement::isAutofilled):
(WebCore::HTMLInputElement::supportsMaxLength):
(WebCore::HTMLInputElement::cachedSelectionStart):
(WebCore::HTMLInputElement::cachedSelectionEnd):

  • html/HTMLTextAreaElement.cpp: Remove unused InputElement.h.
  • html/InputType.cpp: (WebCore::InputType::handleBeforeTextInsertedEvent): Remove the code.
  • html/InputType.h: Update for the above.
  • html/TextFieldInputType.cpp: (WebCore::replaceEOLAndLimitLength): Moved from InputElement.cpp. (WebCore::TextFieldInputType::sanitizeValue): Implement with replaceEOLAndLimitLength(). (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): Move the code from InputElement::handleBeforeTextInsertedEvent().
  • html/TextFieldInputType.h: Update declarations.
  • rendering/RenderTextControlSingleLine.cpp:
    • Remove ASSERT(node()->isHTMLElement()) because it is checked in the constructor.
    • Follow the return type change of inputElement().

(WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):

Make sure node() is an HTMLInputElement instance.

(WebCore::RenderTextControlSingleLine::addSearchResult):
(WebCore::RenderTextControlSingleLine::stopSearchEventTimer):
(WebCore::RenderTextControlSingleLine::showPopup):
(WebCore::RenderTextControlSingleLine::hidePopup):
(WebCore::RenderTextControlSingleLine::subtreeHasChanged):
(WebCore::RenderTextControlSingleLine::updateFromElement):
(WebCore::RenderTextControlSingleLine::createInnerBlockStyle):
(WebCore::RenderTextControlSingleLine::createResultsButtonStyle):
(WebCore::RenderTextControlSingleLine::createCancelButtonStyle):
(WebCore::RenderTextControlSingleLine::createInnerSpinButtonStyle):
(WebCore::RenderTextControlSingleLine::createOuterSpinButtonStyle):
(WebCore::RenderTextControlSingleLine::createSpeechButtonStyle):
(WebCore::RenderTextControlSingleLine::visibilityForCancelButton):
(WebCore::RenderTextControlSingleLine::startSearchEventTimer):
(WebCore::RenderTextControlSingleLine::searchEventTimerFired):
(WebCore::RenderTextControlSingleLine::valueChanged):
(WebCore::RenderTextControlSingleLine::setTextFromItem):
(WebCore::RenderTextControlSingleLine::inputElement):

  • rendering/RenderTextControlSingleLine.h: Change the return type of inputElement(): InputElement* -> HTMLInputElement*.
  • rendering/RenderTheme.cpp: (WebCore::RenderTheme::isChecked): Follow the return type change of Node::toInputElement(). (WebCore::RenderTheme::isIndeterminate): ditto. (WebCore::RenderTheme::shouldHaveSpinButton): Change the parameter type: InputElement* -> HTMLInputElement*.
  • rendering/RenderTheme.h: ditto.

2011-05-06 Kent Tamura <tkent@chromium.org>

Reviewed by Ryosuke Niwa.

Eliminate WebCore/dom/InputElement.{cpp,h}
https://bugs.webkit.org/show_bug.cgi?id=60262

  • src/WebInputElement.cpp: (WebKit::WebInputElement::defaultMaxLength): Replace InputElement::s_maximumLength with HTMLInputElement::maximumLength. (WebKit::toWebInputElement): Follow the return type change of Node::toInputElement().

2011-05-06 Kent Tamura <tkent@chromium.org>

Reviewed by Ryosuke Niwa.

Eliminate WebCore/dom/InputElement.{cpp,h}
https://bugs.webkit.org/show_bug.cgi?id=60262

  • WebCoreSupport/DumpRenderTreeSupportGtk.cpp: (DumpRenderTreeSupportGtk::setAutofilled): Follow the return type change of Node::toInputElement(). (DumpRenderTreeSupportGtk::setValueForUser): ditto.

2011-05-06 Kent Tamura <tkent@chromium.org>

Reviewed by Ryosuke Niwa.

Eliminate WebCore/dom/InputElement.{cpp,h}
https://bugs.webkit.org/show_bug.cgi?id=60262

  • Api/qwebpage.cpp: (QWebPage::inputMethodQuery): Replace InputElement::s_maximumLength with HTMLInputElement::maximumLength.
  • WebCoreSupport/DumpRenderTreeSupportQt.cpp: (DumpRenderTreeSupportQt::setAutofilled): Follow the return type change of Node::toInputElement().
Location:
trunk/Source
Files:
2 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r85909 r85998  
    571571    dom/ExceptionCode.cpp
    572572    dom/IconURL.cpp
    573     dom/InputElement.cpp
    574573    dom/KeyboardEvent.cpp
    575574    dom/MessageChannel.cpp
  • trunk/Source/WebCore/ChangeLog

    r85993 r85998  
     12011-05-06  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Eliminate WebCore/dom/InputElement.{cpp,h}
     6        https://bugs.webkit.org/show_bug.cgi?id=60262
     7
     8        - Fold in all of the code of InputElement.{cpp,h} into HTMLInputElement
     9          and TextFieldInputType.
     10        - Change the return type of Node::toInputElement():
     11          InputElement* -> HTMLInputElement*
     12
     13        No new tests. This change should not change the existing behaviour.
     14
     15        * CMakeLists.txt: Remove InpuntElement.cpp and/or InputElement.h.
     16        * GNUmakefile.list.am: ditto.
     17        * WebCore.exp.in: Add symbols of functions exposed to WebKit.
     18        * WebCore.gypi: Remove InpuntElement.cpp and/or InputElement.h.
     19        * WebCore.pro: ditto.
     20        * WebCore.vcproj/WebCore.vcproj: ditto.
     21        * WebCore.xcodeproj/project.pbxproj: ditto.
     22        * accessibility/AXObjectCache.cpp:
     23        (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
     24          Follow the return type change of Node::toInputElement().
     25        * accessibility/AccessibilityRenderObject.cpp:
     26        (WebCore::AccessibilityRenderObject::isPasswordField): ditto.
     27        (WebCore::AccessibilityRenderObject::isIndeterminate): ditto.
     28        (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio): ditto.
     29        (WebCore::AccessibilityRenderObject::isChecked): ditto.
     30        * css/CSSStyleSelector.cpp:
     31        (WebCore::CSSStyleSelector::canShareStyleWithElement): ditto.
     32        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): ditto.
     33        * dom/CheckedRadioButtons.cpp:
     34        (WebCore::CheckedRadioButtons::removeButton): ditto.
     35        * dom/DOMAllInOne.cpp: Remove InputElement.h.
     36        * dom/InputElement.cpp: Removed.
     37        * dom/InputElement.h: Removed.
     38        * dom/Node.cpp:
     39        (WebCore::Node::toInputElement):
     40          Change the return type from InputElement* to HTMLInputElement*.
     41        * dom/Node.h: ditto.
     42        * html/HTMLInputElement.cpp:
     43        (WebCore::HTMLInputElement::HTMLInputElement):
     44        (WebCore::HTMLInputElement::formControlName):
     45        (WebCore::HTMLInputElement::tooLong):
     46        (WebCore::HTMLInputElement::updateFocusAppearance):
     47        (WebCore::HTMLInputElement::aboutToUnload):
     48        (WebCore::HTMLInputElement::handleFocusEvent):
     49        (WebCore::HTMLInputElement::handleBlurEvent):
     50        (WebCore::HTMLInputElement::updateType):
     51        (WebCore::HTMLInputElement::parseMappedAttribute):
     52        (WebCore::HTMLInputElement::size):
     53        (WebCore::HTMLInputElement::copyNonAttributeProperties):
     54        (WebCore::HTMLInputElement::value):
     55        (WebCore::HTMLInputElement::suggestedValue):
     56        (WebCore::HTMLInputElement::setSuggestedValue):
     57        (WebCore::HTMLInputElement::setValue):
     58        (WebCore::HTMLInputElement::setValueFromRenderer):
     59        (WebCore::HTMLInputElement::setFileListFromRenderer):
     60        (WebCore::HTMLInputElement::setDefaultName):
     61        (WebCore::HTMLInputElement::maxLength):
     62        (WebCore::HTMLInputElement::cacheSelection):
     63        (WebCore::formatCodes): Moved from InputElement.
     64        (WebCore::cursorPositionToMaskIndex): ditto.
     65        (WebCore::HTMLInputElement::isConformToInputMask): ditto.
     66        (WebCore::HTMLInputElement::validateInputMask): ditto.
     67        (WebCore::HTMLInputElement::setWapInputFormat): ditto.
     68        (WebCore::HTMLInputElement::notifyFormStateChanged): ditto.
     69        (WebCore::HTMLInputElement::parseMaxLengthAttribute): ditto.
     70        (WebCore::HTMLInputElement::updateValueIfNeeded):ditto.
     71        * html/HTMLInputElement.h:
     72          - Add data members which were defined in InputElementData.
     73          - Make some functions public because the public interface InputElement is removed.
     74          - Make some functions non-virtual because they don't override
     75            corresponding virtual functions of InputElement anymore.
     76        (WebCore::HTMLInputElement::toInputElement):
     77          Follow the return type change of Node::toInputElement().
     78        (WebCore::HTMLInputElement::isIndeterminate):
     79        (WebCore::HTMLInputElement::isAutofilled):
     80        (WebCore::HTMLInputElement::supportsMaxLength):
     81        (WebCore::HTMLInputElement::cachedSelectionStart):
     82        (WebCore::HTMLInputElement::cachedSelectionEnd):
     83        * html/HTMLTextAreaElement.cpp: Remove unused InputElement.h.
     84        * html/InputType.cpp:
     85        (WebCore::InputType::handleBeforeTextInsertedEvent): Remove the code.
     86        * html/InputType.h: Update for the above.
     87        * html/TextFieldInputType.cpp:
     88        (WebCore::replaceEOLAndLimitLength): Moved from InputElement.cpp.
     89        (WebCore::TextFieldInputType::sanitizeValue): Implement with replaceEOLAndLimitLength().
     90        (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
     91          Move the code from InputElement::handleBeforeTextInsertedEvent().
     92        * html/TextFieldInputType.h: Update declarations.
     93        * rendering/RenderTextControlSingleLine.cpp:
     94          - Remove ASSERT(node()->isHTMLElement()) because it is checked in the constructor.
     95          - Follow the return type change of inputElement().
     96        (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
     97          Make sure node() is an HTMLInputElement instance.
     98        (WebCore::RenderTextControlSingleLine::addSearchResult):
     99        (WebCore::RenderTextControlSingleLine::stopSearchEventTimer):
     100        (WebCore::RenderTextControlSingleLine::showPopup):
     101        (WebCore::RenderTextControlSingleLine::hidePopup):
     102        (WebCore::RenderTextControlSingleLine::subtreeHasChanged):
     103        (WebCore::RenderTextControlSingleLine::updateFromElement):
     104        (WebCore::RenderTextControlSingleLine::createInnerBlockStyle):
     105        (WebCore::RenderTextControlSingleLine::createResultsButtonStyle):
     106        (WebCore::RenderTextControlSingleLine::createCancelButtonStyle):
     107        (WebCore::RenderTextControlSingleLine::createInnerSpinButtonStyle):
     108        (WebCore::RenderTextControlSingleLine::createOuterSpinButtonStyle):
     109        (WebCore::RenderTextControlSingleLine::createSpeechButtonStyle):
     110        (WebCore::RenderTextControlSingleLine::visibilityForCancelButton):
     111        (WebCore::RenderTextControlSingleLine::startSearchEventTimer):
     112        (WebCore::RenderTextControlSingleLine::searchEventTimerFired):
     113        (WebCore::RenderTextControlSingleLine::valueChanged):
     114        (WebCore::RenderTextControlSingleLine::setTextFromItem):
     115        (WebCore::RenderTextControlSingleLine::inputElement):
     116        * rendering/RenderTextControlSingleLine.h:
     117          Change the return type of inputElement(): InputElement* -> HTMLInputElement*.
     118        * rendering/RenderTheme.cpp:
     119        (WebCore::RenderTheme::isChecked):
     120          Follow the return type change of Node::toInputElement().
     121        (WebCore::RenderTheme::isIndeterminate): ditto.
     122        (WebCore::RenderTheme::shouldHaveSpinButton):
     123          Change the parameter type: InputElement* -> HTMLInputElement*.
     124        * rendering/RenderTheme.h: ditto.
     125
    11262011-05-06  Adam Barth  <abarth@webkit.org>
    2127
  • trunk/Source/WebCore/GNUmakefile.list.am

    r85987 r85998  
    11541154        Source/WebCore/dom/IconURL.cpp \
    11551155        Source/WebCore/dom/IconURL.h \
    1156         Source/WebCore/dom/InputElement.cpp \
    1157         Source/WebCore/dom/InputElement.h \
    11581156        Source/WebCore/dom/HashChangeEvent.h \
    11591157        Source/WebCore/dom/KeyboardEvent.cpp \
  • trunk/Source/WebCore/WebCore.exp.in

    r85901 r85998  
    446446__ZN7WebCore16FontPlatformDataD1Ev
    447447__ZN7WebCore16HTMLInputElement13setAutofilledEb
     448__ZN7WebCore16HTMLInputElement15setValueForUserERKN3WTF6StringE
    448449__ZN7WebCore16IconDatabaseBase28synchronousIconURLForPageURLERKN3WTF6StringE
    449450__ZN7WebCore16IconDatabaseBase4openERKN3WTF6StringES4_
     
    11471148__ZNK7WebCore15VisiblePosition8previousENS_27EditingBoundaryCrossingRuleE
    11481149__ZNK7WebCore16FontFallbackList10fontDataAtEPKNS_4FontEj
     1150__ZNK7WebCore16HTMLInputElement11isTextFieldEv
    11491151__ZNK7WebCore16HTMLInputElement12autoCompleteEv
     1152__ZNK7WebCore16HTMLInputElement15isPasswordFieldEv
    11501153__ZNK7WebCore16HTMLInputElement21lastChangeWasUserEditEv
    11511154__ZNK7WebCore16IconDatabaseBase12databasePathEv
  • trunk/Source/WebCore/WebCore.gypi

    r85909 r85998  
    530530            'dom/ExceptionCode.h',
    531531            'dom/FragmentScriptingPermission.h',
    532             'dom/InputElement.h',
    533532            'dom/KeyboardEvent.h',
    534533            'dom/MappedAttributeEntry.h',
     
    24742473            'dom/IconURL.cpp',
    24752474            'dom/IconURL.h',
    2476             'dom/InputElement.cpp',
    24772475            'dom/KeyboardEvent.cpp',
    24782476            'dom/MessageChannel.cpp',
  • trunk/Source/WebCore/WebCore.pro

    r85944 r85998  
    494494    dom/ExceptionCode.cpp \
    495495    dom/IconURL.cpp \
    496     dom/InputElement.cpp \
    497496    dom/KeyboardEvent.cpp \
    498497    dom/MessageChannel.cpp \
     
    14711470    dom/ExceptionCode.h \
    14721471    dom/FragmentScriptingPermission.h \
    1473     dom/InputElement.h \
    14741472    dom/KeyboardEvent.h \
    14751473    dom/MessageChannel.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r85909 r85998  
    4457544575                        </File>
    4457644576                        <File
    44577                                 RelativePath="..\dom\InputElement.cpp"
    44578                                 >
    44579                                 <FileConfiguration
    44580                                         Name="Debug|Win32"
    44581                                         ExcludedFromBuild="true"
    44582                                         >
    44583                                         <Tool
    44584                                                 Name="VCCLCompilerTool"
    44585                                         />
    44586                                 </FileConfiguration>
    44587                                 <FileConfiguration
    44588                                         Name="Release|Win32"
    44589                                         ExcludedFromBuild="true"
    44590                                         >
    44591                                         <Tool
    44592                                                 Name="VCCLCompilerTool"
    44593                                         />
    44594                                 </FileConfiguration>
    44595                                 <FileConfiguration
    44596                                         Name="Debug_Cairo_CFLite|Win32"
    44597                                         ExcludedFromBuild="true"
    44598                                         >
    44599                                         <Tool
    44600                                                 Name="VCCLCompilerTool"
    44601                                         />
    44602                                 </FileConfiguration>
    44603                                 <FileConfiguration
    44604                                         Name="Release_Cairo_CFLite|Win32"
    44605                                         ExcludedFromBuild="true"
    44606                                         >
    44607                                         <Tool
    44608                                                 Name="VCCLCompilerTool"
    44609                                         />
    44610                                 </FileConfiguration>
    44611                                 <FileConfiguration
    44612                                         Name="Debug_All|Win32"
    44613                                         ExcludedFromBuild="true"
    44614                                         >
    44615                                         <Tool
    44616                                                 Name="VCCLCompilerTool"
    44617                                         />
    44618                                 </FileConfiguration>
    44619                                 <FileConfiguration
    44620                                         Name="Production|Win32"
    44621                                         ExcludedFromBuild="true"
    44622                                         >
    44623                                         <Tool
    44624                                                 Name="VCCLCompilerTool"
    44625                                         />
    44626                                 </FileConfiguration>
    44627                         </File>
    44628                         <File
    44629                                 RelativePath="..\dom\InputElement.h"
    44630                                 >
    44631                         </File>
    44632                         <File
    4463344577                                RelativePath="..\dom\KeyboardEvent.cpp"
    4463444578                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r85909 r85998  
    9696                0854B0251255E4E600B9CDD0 /* SVGTextQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */; };
    9797                085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */; settings = {ATTRIBUTES = (Private, ); }; };
    98                 08591AA50F085C4E009BACB1 /* InputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08591AA40F085C4E009BACB1 /* InputElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
    9998                085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10099                085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */; };
     
    103102                08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
    104103                086BBD0F136039C2008B15D8 /* Glyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 086BBD0E136039C2008B15D8 /* Glyph.h */; settings = {ATTRIBUTES = (Private, ); }; };
    105                 08700BE70F086C5300919419 /* InputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08700BE60F086C5300919419 /* InputElement.cpp */; };
    106104                087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281510F26B9B600AFC596 /* OptionElement.cpp */; };
    107105                087281560F26B9B600AFC596 /* OptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087281520F26B9B600AFC596 /* OptionElement.h */; };
     
    64596457                0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextQuery.h; sourceTree = "<group>"; };
    64606458                085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedBoolean.h; sourceTree = "<group>"; };
    6461                 08591AA40F085C4E009BACB1 /* InputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputElement.h; sourceTree = "<group>"; };
    64626459                085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformListPropertyTearOff.h; sourceTree = "<group>"; };
    64636460                085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; };
     
    64666463                08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageResourceStyleImage.h; sourceTree = "<group>"; };
    64676464                086BBD0E136039C2008B15D8 /* Glyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Glyph.h; sourceTree = "<group>"; };
    6468                 08700BE60F086C5300919419 /* InputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputElement.cpp; sourceTree = "<group>"; };
    64696465                087281510F26B9B600AFC596 /* OptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionElement.cpp; sourceTree = "<group>"; };
    64706466                087281520F26B9B600AFC596 /* OptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionElement.h; sourceTree = "<group>"; };
     
    1925119247                                8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
    1925219248                                8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */,
    19253                                 08700BE60F086C5300919419 /* InputElement.cpp */,
    19254                                 08591AA40F085C4E009BACB1 /* InputElement.h */,
    1925519249                                85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
    1925619250                                85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */,
     
    2115621150                                BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
    2115721151                                BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */,
    21158                                 08591AA50F085C4E009BACB1 /* InputElement.h in Headers */,
    2115921152                                37E3524D12450C6600BAF5D9 /* InputType.h in Headers */,
    2116021153                                93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */,
     
    2394723940                                A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */,
    2394823941                                BCEA4859097D93020094C9E4 /* InlineTextBox.cpp in Sources */,
    23949                                 08700BE70F086C5300919419 /* InputElement.cpp in Sources */,
    2395023942                                37E3524B12450C5200BAF5D9 /* InputType.cpp in Sources */,
    2395123943                                93309DE9099E64920056E581 /* InsertIntoTextNodeCommand.cpp in Sources */,
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r80811 r85998  
    5656#include "HTMLAreaElement.h"
    5757#include "HTMLImageElement.h"
     58#include "HTMLInputElement.h"
    5859#include "HTMLNames.h"
    5960#if ENABLE(VIDEO)
    6061#include "MediaControlElements.h"
    6162#endif
    62 #include "InputElement.h"
    6363#include "Page.h"
    6464#include "RenderListBox.h"
     
    617617   
    618618    if (domNode->isHTMLElement()) {
    619         InputElement* inputElement = domNode->toInputElement();
     619        HTMLInputElement* inputElement = domNode->toInputElement();
    620620        if (inputElement && inputElement->isPasswordField())
    621621            return;
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r85864 r85998  
    497497        return false;
    498498
    499     InputElement* inputElement = m_renderer->node()->toInputElement();
     499    HTMLInputElement* inputElement = m_renderer->node()->toInputElement();
    500500    if (!inputElement)
    501501        return false;
     
    590590        return false;
    591591
    592     InputElement* inputElement = m_renderer->node()->toInputElement();
     592    HTMLInputElement* inputElement = m_renderer->node()->toInputElement();
    593593    if (!inputElement)
    594594        return false;
     
    601601    Node* elementNode = node();
    602602    if (elementNode) {
    603         InputElement* input = elementNode->toInputElement();
     603        HTMLInputElement* input = elementNode->toInputElement();
    604604        if (input)
    605605            return input->isCheckbox() || input->isRadioButton();
     
    616616
    617617    // First test for native checkedness semantics
    618     InputElement* inputElement = m_renderer->node()->toInputElement();
     618    HTMLInputElement* inputElement = m_renderer->node()->toInputElement();
    619619    if (inputElement)
    620620        return inputElement->isChecked();
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r85938 r85998  
    10701070
    10711071    if (isControl) {
    1072         InputElement* thisInputElement = element->toInputElement();
    1073         InputElement* otherInputElement = m_element->toInputElement();
     1072        HTMLInputElement* thisInputElement = element->toInputElement();
     1073        HTMLInputElement* otherInputElement = m_element->toInputElement();
    10741074
    10751075        if (!thisInputElement || !otherInputElement)
     
    27742774                if (!e || !e->isFormControlElement())
    27752775                    break;
    2776                 if (InputElement* inputElement = e->toInputElement())
     2776                if (HTMLInputElement* inputElement = e->toInputElement())
    27772777                    return inputElement->isAutofilled();
    27782778                break;
     
    28672867                // you can't be both checked and indeterminate.  We will behave like WinIE behind the scenes and just
    28682868                // obey the CSS spec here in the test for matching the pseudo.
    2869                 InputElement* inputElement = e->toInputElement();
     2869                HTMLInputElement* inputElement = e->toInputElement();
    28702870                if (inputElement && inputElement->isChecked() && !inputElement->isIndeterminate())
    28712871                    return true;
     
    28752875                if (!e || !e->isFormControlElement())
    28762876                    break;
    2877                 InputElement* inputElement = e->toInputElement();
     2877                HTMLInputElement* inputElement = e->toInputElement();
    28782878                if (inputElement && inputElement->isIndeterminate())
    28792879                    return true;
  • trunk/Source/WebCore/dom/CheckedRadioButtons.cpp

    r84828 r85998  
    7878        return;
    7979   
    80     InputElement* inputElement = element->toInputElement();
     80    HTMLInputElement* inputElement = element->toInputElement();
    8181    ASSERT_UNUSED(inputElement, inputElement);
    8282    ASSERT(inputElement->isChecked());
  • trunk/Source/WebCore/dom/DOMAllInOne.cpp

    r85785 r85998  
    7777#include "ExceptionCode.cpp"
    7878#include "IconURL.cpp"
    79 #include "InputElement.cpp"
    8079#include "KeyboardEvent.cpp"
    8180#include "MessageChannel.cpp"
  • trunk/Source/WebCore/dom/Node.cpp

    r85799 r85998  
    560560}
    561561
    562 InputElement* Node::toInputElement()
     562HTMLInputElement* Node::toInputElement()
    563563{
    564564    // If one of the below ASSERTs trigger, you are calling this function
  • trunk/Source/WebCore/dom/Node.h

    r85650 r85998  
    5555class FloatPoint;
    5656class Frame;
    57 class InputElement;
     57class HTMLInputElement;
    5858class IntRect;
    5959class KeyboardEvent;
     
    525525    virtual Node* toNode() { return this; }
    526526
    527     virtual InputElement* toInputElement();
     527    virtual HTMLInputElement* toInputElement();
    528528
    529529    virtual ScriptExecutionContext* scriptExecutionContext() const;
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r85617 r85998  
    77 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
    88 * Copyright (C) 2010 Google Inc. All rights reserved.
     9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
    910 *
    1011 * This library is free software; you can redistribute it and/or
     
    3132#include "Attribute.h"
    3233#include "BeforeTextInsertedEvent.h"
     34#include "Chrome.h"
     35#include "ChromeClient.h"
    3336#include "CSSPropertyNames.h"
    3437#include "Document.h"
     
    3639#include "ExceptionCode.h"
    3740#include "FileList.h"
     41#include "Frame.h"
    3842#include "HTMLCollection.h"
    3943#include "HTMLDataListElement.h"
     
    4650#include "LocalizedStrings.h"
    4751#include "MouseEvent.h"
     52#include "Page.h"
    4853#include "PlatformMouseEvent.h"
    4954#include "RenderTextControlSingleLine.h"
     
    6166using namespace HTMLNames;
    6267
     68// FIXME: According to HTML4, the length attribute's value can be arbitrarily
     69// large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things
     70// get rather sluggish when a text field has a larger number of characters than
     71// this, even when just clicking in the text field.
     72const int HTMLInputElement::maximumLength = 524288;
     73const int defaultSize = 20;
    6374const int maxSavedResults = 256;
    6475
    6576HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form, bool createdByParser)
    6677    : HTMLTextFormControlElement(tagName, document, form)
     78    , m_size(defaultSize)
     79    , m_maxLength(maximumLength)
     80    , m_cachedSelectionStart(-1)
     81    , m_cachedSelectionEnd(-1)
     82#if ENABLE(WCSS)
     83    , m_inputFormatMask("*m")
     84    , m_maxInputCharsAllowed(maximumLength)
     85#endif
    6786    , m_maxResults(-1)
    6887    , m_isChecked(false)
     
    99118const AtomicString& HTMLInputElement::formControlName() const
    100119{
    101     return m_data.name();
     120    return m_name.isNull() ? emptyAtom : m_name;
    102121}
    103122
     
    201220    if (check == CheckDirtyFlag) {
    202221        // Return false for the default value even if it is longer than maxLength.
    203         bool userEdited = !m_data.value().isNull();
     222        bool userEdited = !m_value.isNull();
    204223        if (!userEdited)
    205224            return false;
     
    394413void HTMLInputElement::updateFocusAppearance(bool restorePreviousSelection)
    395414{
    396     if (isTextField())
    397         InputElement::updateFocusAppearance(m_data, this, this, restorePreviousSelection);
    398     else
     415    if (isTextField()) {
     416        if (!restorePreviousSelection || m_cachedSelectionStart == -1)
     417            select();
     418        else {
     419            // Restore the cached selection.
     420            WebCore::setSelectionRange(this, m_cachedSelectionStart, m_cachedSelectionEnd);
     421        }
     422        if (document()->frame())
     423            document()->frame()->selection()->revealSelection();
     424    } else
    399425        HTMLFormControlElementWithState::updateFocusAppearance(restorePreviousSelection);
    400426}
     
    402428void HTMLInputElement::aboutToUnload()
    403429{
    404     InputElement::aboutToUnload(this, this);
     430    if (!isTextField() || !focused())
     431        return;
     432
     433    Frame* frame = document()->frame();
     434    if (!frame)
     435        return;
     436
     437    frame->editor()->textFieldDidEndEditing(this);
    405438}
    406439
     
    412445void HTMLInputElement::handleFocusEvent()
    413446{
    414     InputElement::dispatchFocusEvent(this, this);
     447    if (!isTextField())
     448        return;
     449    if (isPasswordField() && document()->frame())
     450        document()->setUseSecureKeyboardEntryWhenActive(true);
    415451}
    416452
     
    418454{
    419455    m_inputType->handleBlurEvent();
    420     InputElement::dispatchBlurEvent(this, this);
     456
     457    if (!isTextField())
     458        return;
     459    Frame* frame = document()->frame();
     460    if (!frame)
     461        return;
     462    if (isPasswordField())
     463        document()->setUseSecureKeyboardEntryWhenActive(false);
     464    frame->editor()->textFieldDidEndEditing(this);
    421465}
    422466
     
    467511    bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
    468512
    469     if (didStoreValue && !willStoreValue && !m_data.value().isNull()) {
    470         setAttribute(valueAttr, m_data.value());
    471         m_data.setValue(String());
     513    if (didStoreValue && !willStoreValue && !m_value.isNull()) {
     514        setAttribute(valueAttr, m_value);
     515        m_value = String();
    472516    }
    473517    if (!didStoreValue && willStoreValue)
    474         m_data.setValue(sanitizeValue(fastGetAttribute(valueAttr)));
     518        m_value = sanitizeValue(fastGetAttribute(valueAttr));
    475519    else
    476         InputElement::updateValueIfNeeded(m_data, this);
     520        updateValueIfNeeded();
    477521
    478522    if (neededActivationCallback)
     
    503547
    504548    setNeedsValidityCheck();
    505     InputElement::notifyFormStateChanged(this);
     549    notifyFormStateChanged();
    506550}
    507551
     
    561605    if (attr->name() == nameAttr) {
    562606        checkedRadioButtons().removeButton(this);
    563         m_data.setName(attr->value());
     607        m_name = attr->value();
    564608        checkedRadioButtons().addButton(this);
    565609        HTMLFormControlElementWithState::parseMappedAttribute(attr);
     
    583627    } else if (attr->name() == valueAttr) {
    584628        // We only need to setChanged if the form is looking at the default value right now.
    585         if (m_data.value().isNull())
     629        if (m_value.isNull())
    586630            setNeedsStyleRecalc();
    587631        setFormControlValueMatchesRenderer(false);
     
    596640            m_reflectsCheckedAttribute = true;
    597641        }
    598     } else if (attr->name() == maxlengthAttr) {
    599         InputElement::parseMaxLengthAttribute(m_data, this, this, attr);
    600         setNeedsValidityCheck();
    601     } else if (attr->name() == sizeAttr)
    602         InputElement::parseSizeAttribute(m_data, this, attr);
    603     else if (attr->name() == altAttr)
     642    } else if (attr->name() == maxlengthAttr)
     643        parseMaxLengthAttribute(attr);
     644    else if (attr->name() == sizeAttr) {
     645        m_size = attr->isNull() ? defaultSize : attr->value().toInt();
     646        if (renderer())
     647            renderer()->setNeedsLayoutAndPrefWidthsRecalc();
     648    } else if (attr->name() == altAttr)
    604649        m_inputType->altAttributeChanged();
    605650    else if (attr->name() == srcAttr)
     
    809854int HTMLInputElement::size() const
    810855{
    811     return m_data.size();
     856    return m_size;
    812857}
    813858
     
    816861    const HTMLInputElement* sourceElement = static_cast<const HTMLInputElement*>(source);
    817862
    818     m_data.setValue(sourceElement->m_data.value());
     863    m_value = sourceElement->m_value;
    819864    setChecked(sourceElement->m_isChecked);
    820865    m_reflectsCheckedAttribute = sourceElement->m_reflectsCheckedAttribute;
     
    830875        return value;
    831876
    832     value = m_data.value();
     877    value = m_value;
    833878    if (!value.isNull())
    834879        return value;
     
    858903const String& HTMLInputElement::suggestedValue() const
    859904{
    860     return m_data.suggestedValue();
     905    return m_suggestedValue;
    861906}
    862907
     
    866911        return;
    867912    setFormControlValueMatchesRenderer(false);
    868     m_data.setSuggestedValue(sanitizeValue(value));
     913    m_suggestedValue = sanitizeValue(value);
    869914    updatePlaceholderVisibility(false);
    870915    if (renderer())
     
    883928            files()->clear();
    884929        else {
    885             m_data.setValue(sanitizeValue(value));
     930            m_value = sanitizeValue(value);
    886931            if (isTextField())
    887932                updatePlaceholderVisibility(false);
     
    894939
    895940    if (isTextField()) {
    896         unsigned max = m_data.value().length();
     941        unsigned max = m_value.length();
    897942        if (document()->focusedNode() == this)
    898             InputElement::updateSelectionRange(this, this, max, max);
     943            WebCore::setSelectionRange(this, max, max);
    899944        else
    900945            cacheSelection(max, max);
    901         m_data.setSuggestedValue(String());
     946        m_suggestedValue = String();
    902947    }
    903948    m_inputType->valueChanged();
     
    915960        setTextAsOfLastFormControlChangeEvent(value);
    916961
    917     InputElement::notifyFormStateChanged(this);
     962    notifyFormStateChanged();
    918963}
    919964
     
    9621007    ASSERT(!isFileUpload());
    9631008
    964     m_data.setSuggestedValue(String());
    965     InputElement::setValueFromRenderer(m_data, this, this, value);
     1009    m_suggestedValue = String();
     1010
     1011    // Renderer and our event handler are responsible for sanitizing values.
     1012    ASSERT(value == sanitizeValue(value) || sanitizeValue(value).isEmpty());
     1013
     1014    // Workaround for bug where trailing \n is included in the result of textContent.
     1015    // The assert macro above may also be simplified to: value == constrainValue(value)
     1016    // http://bugs.webkit.org/show_bug.cgi?id=9661
     1017    m_value = value == "\n" ? String("") : value;
     1018
     1019    setFormControlValueMatchesRenderer(true);
     1020
     1021    // Input event is fired by the Node::defaultEventHandler for editable controls.
     1022    if (!isTextField())
     1023        dispatchInputEvent();
     1024    notifyFormStateChanged();
     1025
    9661026    updatePlaceholderVisibility(false);
    9671027    setNeedsValidityCheck();
     
    9761036
    9771037    setFormControlValueMatchesRenderer(true);
    978     InputElement::notifyFormStateChanged(this);
     1038    notifyFormStateChanged();
    9791039    setNeedsValidityCheck();
    9801040}
     
    11061166void HTMLInputElement::setDefaultName(const AtomicString& name)
    11071167{
    1108     m_data.setName(name);
     1168    m_name = name;
    11091169}
    11101170
     
    11211181int HTMLInputElement::maxLength() const
    11221182{
    1123     return m_data.maxLength();
     1183    return m_maxLength;
    11241184}
    11251185
     
    12201280void HTMLInputElement::cacheSelection(int start, int end)
    12211281{
    1222     m_data.setCachedSelectionStart(start);
    1223     m_data.setCachedSelectionEnd(end);
     1282    m_cachedSelectionStart = start;
     1283    m_cachedSelectionEnd = end;
    12241284}
    12251285
     
    14451505#if ENABLE(WCSS)
    14461506
     1507static inline const AtomicString& formatCodes()
     1508{
     1509    DEFINE_STATIC_LOCAL(AtomicString, codes, ("AaNnXxMm"));
     1510    return codes;
     1511}
     1512
     1513static unsigned cursorPositionToMaskIndex(const String& inputFormatMask, unsigned cursorPosition)
     1514{
     1515    UChar mask;
     1516    int index = -1;
     1517    do {
     1518        mask = inputFormatMask[++index];
     1519        if (mask == '\\')
     1520            ++index;
     1521        else if (mask == '*' || (isASCIIDigit(mask) && mask != '0')) {
     1522            index = inputFormatMask.length() - 1;
     1523            break;
     1524        }
     1525    } while (cursorPosition--);
     1526
     1527    return index;
     1528}
     1529
     1530bool HTMLInputElement::isConformToInputMask(const String& inputChars) const
     1531{
     1532    for (unsigned i = 0; i < inputChars.length(); ++i) {
     1533        if (!isConformToInputMask(inputChars[i], i))
     1534            return false;
     1535    }
     1536    return true;
     1537}
     1538
     1539bool HTMLInputElement::isConformToInputMask(UChar inChar, unsigned cursorPosition) const
     1540{
     1541    if (m_inputFormatMask.isEmpty() || m_inputFormatMask == "*M" || m_inputFormatMask == "*m")
     1542        return true;
     1543
     1544    if (cursorPosition >= m_maxInputCharsAllowed())
     1545        return false;
     1546
     1547    unsigned maskIndex = cursorPositionToMaskIndex(m_inputFormatMask, cursorPosition);
     1548    bool ok = true;
     1549    UChar mask = m_inputFormatMask[maskIndex];
     1550    // Match the inputed character with input mask
     1551    switch (mask) {
     1552    case 'A':
     1553        ok = !isASCIIDigit(inChar) && !isASCIILower(inChar) && isASCIIPrintable(inChar);
     1554        break;
     1555    case 'a':
     1556        ok = !isASCIIDigit(inChar) && !isASCIIUpper(inChar) && isASCIIPrintable(inChar);
     1557        break;
     1558    case 'N':
     1559        ok = isASCIIDigit(inChar);
     1560        break;
     1561    case 'n':
     1562        ok = !isASCIIAlpha(inChar) && isASCIIPrintable(inChar);
     1563        break;
     1564    case 'X':
     1565        ok = !isASCIILower(inChar) && isASCIIPrintable(inChar);
     1566        break;
     1567    case 'x':
     1568        ok = !isASCIIUpper(inChar) && isASCIIPrintable(inChar);
     1569        break;
     1570    case 'M':
     1571    case 'm':
     1572        ok = isASCIIPrintable(inChar);
     1573        break;
     1574    default:
     1575        ok = (mask == inChar);
     1576        break;
     1577    }
     1578
     1579    return ok;
     1580}
     1581
     1582String HTMLInputElement::validateInputMask(String& inputMask)
     1583{
     1584    inputMask.replace("\\\\", "\\");
     1585
     1586    bool isValid = true;
     1587    bool hasWildcard = false;
     1588    unsigned escapeCharCount = 0;
     1589    unsigned maskLength = inputMask.length();
     1590    UChar formatCode;
     1591    for (unsigned i = 0; i < maskLength; ++i) {
     1592        formatCode = inputMask[i];
     1593        if (formatCodes().find(formatCode) == -1) {
     1594            if (formatCode == '*' || (isASCIIDigit(formatCode) && formatCode != '0')) {
     1595                // Validate codes which ends with '*f' or 'nf'
     1596                formatCode = inputMask[++i];
     1597                if ((i + 1 != maskLength) || formatCodes().find(formatCode) == -1) {
     1598                    isValid = false;
     1599                    break;
     1600                }
     1601                hasWildcard = true;
     1602            } else if (formatCode == '\\') {
     1603                // skip over the next mask character
     1604                ++i;
     1605                ++escapeCharCount;
     1606            } else {
     1607                isValid = false;
     1608                break;
     1609            }
     1610        }
     1611    }
     1612
     1613    if (!isValid)
     1614        return String();
     1615    // calculate the number of characters allowed to be entered by input mask
     1616    unsigned allowedLength = maskLength;
     1617    if (escapeCharCount)
     1618        allowedLength -= escapeCharCount;
     1619
     1620    if (hasWildcard) {
     1621        formatCode = inputMask[maskLength - 2];
     1622        if (formatCode == '*')
     1623            allowedLength = m_maxInputCharsAllowed;
     1624        else {
     1625            unsigned leftLen = String(&formatCode).toInt();
     1626            allowedLength = leftLen + allowedLength - 2;
     1627        }
     1628    }
     1629
     1630    if (allowedLength < m_maxInputCharsAllowed)
     1631        m_maxInputCharsAllowed = allowedLength;
     1632
     1633    return inputMask;
     1634}
     1635
    14471636void HTMLInputElement::setWapInputFormat(String& mask)
    14481637{
    1449     String validateMask = validateInputMask(m_data, mask);
     1638    String validateMask = validateInputMask(mask);
    14501639    if (!validateMask.isEmpty())
    1451         m_data.setInputFormatMask(validateMask);
     1640        m_inputFormatMask = validateMask;
    14521641}
    14531642
     
    15611750}
    15621751
    1563 void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event)
    1564 {
    1565     InputElement::handleBeforeTextInsertedEvent(m_data, this, this, event);
     1752void HTMLInputElement::notifyFormStateChanged()
     1753{
     1754    Frame* frame = document()->frame();
     1755    if (!frame)
     1756        return;
     1757
     1758    if (Page* page = frame->page())
     1759        page->chrome()->client()->formStateDidChange(this);
     1760}
     1761
     1762void HTMLInputElement::parseMaxLengthAttribute(Attribute* attribute)
     1763{
     1764    int maxLength = attribute->isNull() ? maximumLength : attribute->value().toInt();
     1765    if (maxLength <= 0 || maxLength > maximumLength)
     1766        maxLength = maximumLength;
     1767    int oldMaxLength = m_maxLength;
     1768    m_maxLength = maxLength;
     1769    if (oldMaxLength != maxLength)
     1770        updateValueIfNeeded();
     1771    setNeedsStyleRecalc();
     1772    setNeedsValidityCheck();
     1773}
     1774
     1775void HTMLInputElement::updateValueIfNeeded()
     1776{
     1777    String newValue = sanitizeValue(m_value);
     1778    if (newValue != m_value)
     1779        setValue(newValue);
    15661780}
    15671781
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r84695 r85998  
    2626
    2727#include "HTMLFormControlElement.h"
    28 #include "InputElement.h"
    2928
    3029namespace WebCore {
     
    3635class KURL;
    3736
    38 class HTMLInputElement : public HTMLTextFormControlElement, public InputElement {
     37class HTMLInputElement : public HTMLTextFormControlElement {
    3938public:
    4039    static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
     
    4342    DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange);
    4443
    45     virtual InputElement* toInputElement() { return this; }
     44    virtual HTMLInputElement* toInputElement() { return this; }
    4645
    4746    bool autoComplete() const;
     
    7978    void stepDown(ExceptionCode& ec) { stepDown(1, ec); }
    8079    // stepUp()/stepDown() for user-interaction.
    81     virtual bool isSteppable() const;
     80    bool isSteppable() const;
    8281    void stepUpFromRenderer(int);
    8382
     
    8584
    8685    virtual bool isRadioButton() const;
    87     virtual bool isTextField() const;
    88     virtual bool isSearchField() const;
    89     virtual bool isInputTypeHidden() const;
    90     virtual bool isPasswordField() const;
    91     virtual bool isCheckbox() const;
    92     virtual bool isRangeControl() const;
     86    bool isTextField() const;
     87    bool isSearchField() const;
     88    bool isInputTypeHidden() const;
     89    bool isPasswordField() const;
     90    bool isCheckbox() const;
     91    bool isRangeControl() const;
    9392
    9493    // FIXME: It's highly likely that any call site calling this function should instead
     
    107106
    108107#if ENABLE(INPUT_SPEECH)
    109     virtual bool isSpeechEnabled() const;
     108    bool isSpeechEnabled() const;
    110109#endif
    111110
     
    117116    void setIndeterminate(bool);
    118117
    119     virtual int size() const;
     118    // isChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
     119    virtual bool isChecked() const;
     120    virtual bool isIndeterminate() const { return indeterminate(); }
     121
     122    int size() const;
    120123
    121124    void setType(const String&);
    122125
    123     virtual String value() const;
    124     virtual void setValue(const String&, bool sendChangeEvent = false);
    125     virtual void setValueForUser(const String&);
     126    String value() const;
     127    void setValue(const String&, bool sendChangeEvent = false);
     128    void setValueForUser(const String&);
    126129    // Checks if the specified string would be a valid value.
    127130    // We should not call this for types with no string value such as CHECKBOX and RADIO.
    128131    bool isValidValue(const String&) const;
    129132
    130     virtual const String& suggestedValue() const;
     133    String sanitizeValue(const String&) const;
     134
     135    // The value which is drawn by a renderer.
     136    String visibleValue() const;
     137    String convertFromVisibleValue(const String&) const;
     138    // Returns true if the specified string can be set as the value of HTMLInputElement.
     139    bool isAcceptableValue(const String&) const;
     140
     141    const String& suggestedValue() const;
    131142    void setSuggestedValue(const String&);
    132143
     
    142153    String valueWithDefault() const;
    143154
    144     virtual void setValueFromRenderer(const String&);
     155    void setValueFromRenderer(const String&);
    145156    void setFileListFromRenderer(const Vector<String>&);
    146157
    147158    bool canHaveSelection() const;
    148     virtual void select() { HTMLTextFormControlElement::select(); }
    149159
    150160    virtual bool rendererIsNeeded(RenderStyle*);
     
    179189    bool multiple() const;
    180190
    181     virtual bool isAutofilled() const { return m_isAutofilled; }
     191    bool isAutofilled() const { return m_isAutofilled; }
    182192    void setAutofilled(bool = true);
    183193
     
    186196    void addSearchResult();
    187197    void onSearch();
     198    bool searchEventsShouldBeDispatched() const;
    188199
    189200#if ENABLE(DATALIST)
     
    199210    // Otherwise, they would be private.
    200211    CheckedRadioButtons& checkedRadioButtons() const;
    201     void handleBeforeTextInsertedEvent(Event*);
    202212    void updateCheckedRadioButtons();
     213#if ENABLE(WCSS)
     214    bool isConformToInputMask(const String&) const;
     215#endif
    203216
    204217    bool lastChangeWasUserEdit() const;
    205    
     218    void cacheSelection(int start, int end);
     219
     220    static const int maximumLength;
     221
    206222protected:
    207223    HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
     
    224240    virtual const AtomicString& formControlName() const;
    225241
    226     // isChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
    227     virtual bool isChecked() const;
    228     virtual bool isIndeterminate() const { return indeterminate(); }
    229 
    230242    virtual bool isTextFormControl() const { return isTextField(); }
    231243
     
    233245
    234246    virtual const AtomicString& formControlType() const;
    235 
    236     virtual bool searchEventsShouldBeDispatched() const;
    237247
    238248    virtual bool saveFormControlState(String& value) const;
     
    262272    virtual bool isURLAttribute(Attribute*) const;
    263273
    264     virtual void cacheSelection(int start, int end);
    265 
    266     virtual String visibleValue() const;
    267     virtual String convertFromVisibleValue(const String&) const;
    268     virtual bool isAcceptableValue(const String&) const;
    269     virtual String sanitizeValue(const String&) const;
    270274    virtual bool hasUnacceptableValue() const;
    271275
     
    281285    void unregisterForActivationCallbackIfNeeded();
    282286
    283     virtual bool supportsMaxLength() const { return isTextType(); }
     287    bool supportsMaxLength() const { return isTextType(); }
    284288    bool isTextType() const;
    285289
     
    289293    virtual void handleFocusEvent();
    290294    virtual void handleBlurEvent();
    291     virtual int cachedSelectionStart() const { return m_data.cachedSelectionStart(); }
    292     virtual int cachedSelectionEnd() const { return m_data.cachedSelectionEnd(); }
     295    virtual int cachedSelectionStart() const { return m_cachedSelectionStart; }
     296    virtual int cachedSelectionEnd() const { return m_cachedSelectionEnd; }
    293297
    294298    virtual bool isOptionalFormControl() const { return !isRequiredFormControl(); }
     
    304308    HTMLDataListElement* dataList() const;
    305309#endif
    306 
     310    void notifyFormStateChanged();
     311    void parseMaxLengthAttribute(Attribute*);
     312    void updateValueIfNeeded();
    307313#if ENABLE(WCSS)
    308     virtual InputElementData data() const { return m_data; }
    309 #endif
    310 
    311     InputElementData m_data;
     314    bool isConformToInputMask(UChar, unsigned) const;
     315    String validateInputMask(String&);
     316#endif
     317
     318    AtomicString m_name;
     319    String m_value;
     320    String m_suggestedValue;
     321    int m_size;
     322    int m_maxLength;
     323    int m_cachedSelectionStart;
     324    int m_cachedSelectionEnd;
     325#if ENABLE(WCSS)
     326    String m_inputFormatMask;
     327    unsigned m_maxInputCharsAllowed;
     328#endif
    312329    short m_maxResults;
    313330    bool m_isChecked : 1;
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r82908 r85998  
    4040#include "Frame.h"
    4141#include "HTMLNames.h"
    42 #include "InputElement.h"
    4342#include "Page.h"
    4443#include "RenderStyle.h"
  • trunk/Source/WebCore/html/InputType.cpp

    r85603 r85998  
    327327}
    328328
    329 void InputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* event)
    330 {
    331     element()->handleBeforeTextInsertedEvent(event);
     329void InputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*)
     330{
    332331}
    333332
  • trunk/Source/WebCore/html/TextFieldInputType.cpp

    r79951 r85998  
    3333#include "TextFieldInputType.h"
    3434
     35#include "BeforeTextInsertedEvent.h"
    3536#include "Frame.h"
    3637#include "HTMLInputElement.h"
     
    3839#include "RenderTextControlSingleLine.h"
    3940#include "TextEvent.h"
     41#include "TextIterator.h"
    4042#include "WheelEvent.h"
    4143#include <wtf/text/WTFString.h>
     
    120122}
    121123
     124static String replaceEOLAndLimitLength(const String& proposedValue, int maxLength)
     125{
     126    String string = proposedValue;
     127    string.replace("\r\n", " ");
     128    string.replace('\r', ' ');
     129    string.replace('\n', ' ');
     130
     131    unsigned newLength = numCharactersInGraphemeClusters(string, maxLength);
     132    for (unsigned i = 0; i < newLength; ++i) {
     133        const UChar current = string[i];
     134        if (current < ' ' && current != '\t') {
     135            newLength = i;
     136            break;
     137        }
     138    }
     139    return string.left(newLength);
     140}
     141
    122142String TextFieldInputType::sanitizeValue(const String& proposedValue)
    123143{
    124     return InputElement::sanitizeValueForTextField(element(), proposedValue);
     144#if ENABLE(WCSS)
     145    if (!element()->isConformToInputMask(proposedValue)) {
     146        if (isConformToInputMask(element()->value()))
     147            return element->value();
     148        return String();
     149    }
     150#endif
     151    return replaceEOLAndLimitLength(proposedValue, HTMLInputElement::maximumLength);
     152}
     153
     154void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* event)
     155{
     156    // Make sure that the text to be inserted will not violate the maxLength.
     157
     158    // We use RenderTextControlSingleLine::text() instead of InputElement::value()
     159    // because they can be mismatched by sanitizeValue() in
     160    // RenderTextControlSingleLine::subtreeHasChanged() in some cases.
     161    unsigned oldLength = numGraphemeClusters(toRenderTextControlSingleLine(element()->renderer())->text());
     162
     163    // selectionLength represents the selection length of this text field to be
     164    // removed by this insertion.
     165    // If the text field has no focus, we don't need to take account of the
     166    // selection length. The selection is the source of text drag-and-drop in
     167    // that case, and nothing in the text field will be removed.
     168    unsigned selectionLength = element()->focused() ? numGraphemeClusters(plainText(element()->document()->frame()->selection()->selection().toNormalizedRange().get())) : 0;
     169    ASSERT(oldLength >= selectionLength);
     170
     171    // Selected characters will be removed by the next text event.
     172    unsigned baseLength = oldLength - selectionLength;
     173    unsigned maxLength = static_cast<unsigned>(isTextType() ? element()->maxLength() : HTMLInputElement::maximumLength); // maxLength can never be negative.
     174    unsigned appendableLength = maxLength > baseLength ? maxLength - baseLength : 0;
     175
     176    // Truncate the inserted text to avoid violating the maxLength and other constraints.
     177#if ENABLE(WCSS)
     178    RefPtr<Range> range = element()->document()->frame()->selection()->selection().toNormalizedRange();
     179    String candidateString = toRenderTextControlSingleLine(element()->renderer())->text();
     180    if (selectionLength)
     181        candidateString.replace(range->startOffset(), range->endOffset(), event->text());
     182    else
     183        candidateString.insert(event->text(), range->startOffset());
     184    if (!element()->isConformToInputMask(candidateString)) {
     185        event->setText("");
     186        return;
     187    }
     188#endif
     189    event->setText(replaceEOLAndLimitLength(event->text(), appendableLength));
    125190}
    126191
  • trunk/Source/WebCore/html/TextFieldInputType.h

    r77228 r85998  
    4949    virtual bool isTextField() const;
    5050    virtual bool valueMissing(const String&) const;
     51    virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*);
    5152    virtual void forwardEvent(Event*);
    5253    virtual bool shouldSubmitImplicitly(Event*);
    5354    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
    5455    virtual bool shouldUseInputMethod() const;
    55     virtual String sanitizeValue(const String& proposedValue);
     56    virtual String sanitizeValue(const String&);
    5657    virtual bool shouldRespectListAttribute();
    5758};
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r85864 r85998  
    3535#include "HTMLNames.h"
    3636#include "HitTestResult.h"
    37 #include "InputElement.h"
    3837#include "LocalizedStrings.h"
    3938#include "MouseEvent.h"
     
    7675    , m_searchPopup(0)
    7776{
     77    ASSERT(node->isHTMLElement());
     78    ASSERT(node->toInputElement());
    7879}
    7980
     
    107108void RenderTextControlSingleLine::addSearchResult()
    108109{
    109     ASSERT(node()->isHTMLElement());
    110     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     110    HTMLInputElement* input = inputElement();
    111111    if (input->maxResults() <= 0)
    112112        return;
     
    139139void RenderTextControlSingleLine::stopSearchEventTimer()
    140140{
    141     ASSERT(node()->isHTMLElement());
    142141    m_searchEventTimer.stop();
    143142}
     
    145144void RenderTextControlSingleLine::showPopup()
    146145{
    147     ASSERT(node()->isHTMLElement());
    148146    if (m_searchPopupIsVisible)
    149147        return;
     
    161159
    162160    // Trim the recent searches list if the maximum size has changed since we last saved.
    163     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     161    HTMLInputElement* input = inputElement();
    164162    if (static_cast<int>(m_recentSearches.size()) > input->maxResults()) {
    165163        do {
     
    175173void RenderTextControlSingleLine::hidePopup()
    176174{
    177     ASSERT(node()->isHTMLElement());
    178175    if (m_searchPopup)
    179176        m_searchPopup->popupMenu()->hide();
     
    189186    element->setChangedSinceLastFormControlChangeEvent(true);
    190187
    191     InputElement* input = inputElement();
     188    HTMLInputElement* input = inputElement();
    192189    // We don't need to call sanitizeUserInputValue() function here because
    193     // InputElement::handleBeforeTextInsertedEvent() has already called
     190    // HTMLInputElement::handleBeforeTextInsertedEvent() has already called
    194191    // sanitizeUserInputValue().
    195192    // sanitizeValue() is needed because IME input doesn't dispatch BeforeTextInsertedEvent.
     
    197194    if (input->isAcceptableValue(value))
    198195        input->setValueFromRenderer(input->sanitizeValue(input->convertFromVisibleValue(value)));
    199     if (node()->isHTMLElement()) {
    200         // Recalc for :invalid and hasUnacceptableValue() change.
    201         static_cast<HTMLInputElement*>(input)->setNeedsStyleRecalc();
    202     }
     196    // Recalc for :invalid and hasUnacceptableValue() change.
     197    input->setNeedsStyleRecalc();
    203198
    204199    if (m_cancelButton)
     
    711706            // flag is false. It protects an unacceptable renderer value from
    712707            // being overwritten with the DOM value.
    713             if (!static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer())
     708            if (!inputElement()->formControlValueMatchesRenderer())
    714709                setInnerTextValue(inputElement()->visibleValue());
    715710        }
     
    756751PassRefPtr<RenderStyle> RenderTextControlSingleLine::createInnerBlockStyle(const RenderStyle* startStyle) const
    757752{
    758     ASSERT(node()->isHTMLElement());
    759 
    760753    RefPtr<RenderStyle> innerBlockStyle = RenderStyle::create();
    761754    innerBlockStyle->inheritFrom(startStyle);
     
    772765PassRefPtr<RenderStyle> RenderTextControlSingleLine::createResultsButtonStyle(const RenderStyle* startStyle) const
    773766{
    774     ASSERT(node()->isHTMLElement());
    775     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     767    HTMLInputElement* input = inputElement();
    776768
    777769    RefPtr<RenderStyle> resultsBlockStyle;
     
    794786PassRefPtr<RenderStyle> RenderTextControlSingleLine::createCancelButtonStyle(const RenderStyle* startStyle) const
    795787{
    796     ASSERT(node()->isHTMLElement());
    797788    RefPtr<RenderStyle> cancelBlockStyle;
    798789   
     
    812803PassRefPtr<RenderStyle> RenderTextControlSingleLine::createInnerSpinButtonStyle() const
    813804{
    814     ASSERT(node()->isHTMLElement());
    815805    RefPtr<RenderStyle> buttonStyle = getCachedPseudoStyle(INNER_SPIN_BUTTON);
    816806    if (!buttonStyle)
     
    822812PassRefPtr<RenderStyle> RenderTextControlSingleLine::createOuterSpinButtonStyle() const
    823813{
    824     ASSERT(node()->isHTMLElement());
    825814    RefPtr<RenderStyle> buttonStyle = getCachedPseudoStyle(OUTER_SPIN_BUTTON);
    826815    if (!buttonStyle)
     
    833822PassRefPtr<RenderStyle> RenderTextControlSingleLine::createSpeechButtonStyle() const
    834823{
    835     ASSERT(node()->isHTMLElement());
    836824    RefPtr<RenderStyle> buttonStyle = getCachedPseudoStyle(INPUT_SPEECH_BUTTON);
    837825    if (!buttonStyle)
     
    859847EVisibility RenderTextControlSingleLine::visibilityForCancelButton() const
    860848{
    861     ASSERT(node()->isHTMLElement());
    862     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
    863     return input->value().isEmpty() ? HIDDEN : VISIBLE;
     849    return inputElement()->value().isEmpty() ? HIDDEN : VISIBLE;
    864850}
    865851
     
    871857void RenderTextControlSingleLine::startSearchEventTimer()
    872858{
    873     ASSERT(node()->isHTMLElement());
    874859    unsigned length = text().length();
    875860
     
    877862    if (!length) {
    878863        stopSearchEventTimer();
    879         static_cast<HTMLInputElement*>(node())->onSearch();
     864        inputElement()->onSearch();
    880865        return;
    881866    }
     
    888873void RenderTextControlSingleLine::searchEventTimerFired(Timer<RenderTextControlSingleLine>*)
    889874{
    890     ASSERT(node()->isHTMLElement());
    891     static_cast<HTMLInputElement*>(node())->onSearch();
     875    inputElement()->onSearch();
    892876}
    893877
     
    895879void RenderTextControlSingleLine::valueChanged(unsigned listIndex, bool fireEvents)
    896880{
    897     ASSERT(node()->isHTMLElement());
    898881    ASSERT(static_cast<int>(listIndex) < listSize());
    899     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     882    HTMLInputElement* input = inputElement();
    900883    if (static_cast<int>(listIndex) == (listSize() - 1)) {
    901884        if (fireEvents) {
     
    10311014void RenderTextControlSingleLine::setTextFromItem(unsigned listIndex)
    10321015{
    1033     ASSERT(node()->isHTMLElement());
    1034     static_cast<HTMLInputElement*>(node())->setValue(itemText(listIndex));
     1016    inputElement()->setValue(itemText(listIndex));
    10351017}
    10361018
     
    11191101}
    11201102
    1121 InputElement* RenderTextControlSingleLine::inputElement() const
     1103HTMLInputElement* RenderTextControlSingleLine::inputElement() const
    11221104{
    11231105    return node()->toInputElement();
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r79978 r85998  
    3131namespace WebCore {
    3232
    33 class InputElement;
     33class HTMLInputElement;
    3434class InputFieldSpeechButtonElement;
    3535class SearchFieldCancelButtonElement;
     
    143143    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
    144144
    145     InputElement* inputElement() const;
     145    HTMLInputElement* inputElement() const;
    146146
    147147    virtual int textBlockInsetLeft() const;
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r85864 r85998  
    752752        return false;
    753753
    754     InputElement* inputElement = o->node()->toInputElement();
     754    HTMLInputElement* inputElement = o->node()->toInputElement();
    755755    if (!inputElement)
    756756        return false;
     
    764764        return false;
    765765
    766     InputElement* inputElement = o->node()->toInputElement();
     766    HTMLInputElement* inputElement = o->node()->toInputElement();
    767767    if (!inputElement)
    768768        return false;
     
    966966#endif
    967967
    968 bool RenderTheme::shouldHaveSpinButton(InputElement* inputElement) const
     968bool RenderTheme::shouldHaveSpinButton(HTMLInputElement* inputElement) const
    969969{
    970970    return inputElement->isSteppable() && !inputElement->isRangeControl();
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r85423 r85998  
    3737
    3838class Element;
     39class HTMLInputElement;
    3940class PopupMenu;
    4041class RenderMenuList;
     
    202203   
    203204    virtual bool shouldShowPlaceholderWhenFocused() const { return false; }
    204     virtual bool shouldHaveSpinButton(InputElement*) const;
     205    virtual bool shouldHaveSpinButton(HTMLInputElement*) const;
    205206
    206207protected:
  • trunk/Source/WebKit/chromium/ChangeLog

    r85977 r85998  
     12011-05-06  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Eliminate WebCore/dom/InputElement.{cpp,h}
     6        https://bugs.webkit.org/show_bug.cgi?id=60262
     7
     8        * src/WebInputElement.cpp:
     9        (WebKit::WebInputElement::defaultMaxLength):
     10          Replace InputElement::s_maximumLength with HTMLInputElement::maximumLength.
     11        (WebKit::toWebInputElement):
     12          Follow the return type change of Node::toInputElement().
     13
    1142011-05-06  Justin Schuh  <jschuh@chromium.org>
    215
  • trunk/Source/WebKit/chromium/src/WebInputElement.cpp

    r81637 r85998  
    153153int WebInputElement::defaultMaxLength()
    154154{
    155     return HTMLInputElement::s_maximumLength;
     155    return HTMLInputElement::maximumLength;
    156156}
    157157
     
    174174WebInputElement* toWebInputElement(WebElement* webElement)
    175175{
    176     InputElement* inputElement = webElement->unwrap<Element>()->toInputElement();
     176    HTMLInputElement* inputElement = webElement->unwrap<Element>()->toInputElement();
    177177    if (!inputElement)
    178178        return 0;
    179 
    180     ASSERT(webElement->unwrap<Element>()->isHTMLElement());
    181179
    182180    return static_cast<WebInputElement*>(webElement);
  • trunk/Source/WebKit/gtk/ChangeLog

    r85987 r85998  
     12011-05-06  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Eliminate WebCore/dom/InputElement.{cpp,h}
     6        https://bugs.webkit.org/show_bug.cgi?id=60262
     7
     8        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     9        (DumpRenderTreeSupportGtk::setAutofilled):
     10          Follow the return type change of Node::toInputElement().
     11        (DumpRenderTreeSupportGtk::setValueForUser): ditto.
     12
    1132011-05-06  Martin Robinson  <mrobinson@igalia.com>
    214
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r85925 r85998  
    3737#include "GraphicsContext.h"
    3838#include "HTMLInputElement.h"
    39 #include "InputElement.h"
    4039#include "JSDOMWindow.h"
    4140#include "JSDocument.h"
     
    761760    if (!element)
    762761        return;
    763     InputElement* inputElement = element->toInputElement();
     762    HTMLInputElement* inputElement = element->toInputElement();
    764763    if (!inputElement)
    765764        return;
    766765
    767     static_cast<HTMLInputElement*>(inputElement)->setAutofilled(autofilled);
     766    inputElement->setAutofilled(autofilled);
    768767}
    769768
     
    774773    if (!element)
    775774        return;
    776     InputElement* inputElement = element->toInputElement();
     775    HTMLInputElement* inputElement = element->toInputElement();
    777776    if (!inputElement)
    778777        return;
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r85343 r85998  
    14471447                    }
    14481448                }
    1449                 return QVariant(InputElement::s_maximumLength);
     1449                return QVariant(HTMLInputElement::maximumLength);
    14501450            }
    14511451            return QVariant(0);
  • trunk/Source/WebKit/qt/ChangeLog

    r85925 r85998  
     12011-05-06  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Eliminate WebCore/dom/InputElement.{cpp,h}
     6        https://bugs.webkit.org/show_bug.cgi?id=60262
     7
     8        * Api/qwebpage.cpp:
     9        (QWebPage::inputMethodQuery):
     10          Replace InputElement::s_maximumLength with HTMLInputElement::maximumLength.
     11        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     12        (DumpRenderTreeSupportQt::setAutofilled):
     13          Follow the return type change of Node::toInputElement().
     14
    1152011-05-04  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r85925 r85998  
    5454#include "HistoryItem.h"
    5555#include "HTMLInputElement.h"
    56 #include "InputElement.h"
    5756#include "InspectorController.h"
    5857#include "NodeList.h"
     
    244243    if (!webElement)
    245244        return;
    246     InputElement* inputElement = webElement->toInputElement();
     245    HTMLInputElement* inputElement = webElement->toInputElement();
    247246    if (!inputElement)
    248247        return;
    249248
    250     static_cast<HTMLInputElement*>(inputElement)->setAutofilled(isAutofilled);
     249    inputElement->setAutofilled(isAutofilled);
    251250}
    252251
Note: See TracChangeset for help on using the changeset viewer.