Changeset 90849 in webkit


Ignore:
Timestamp:
Jul 12, 2011 2:20:35 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

Isolate HTMLTextFormControlElement into a separate file
https://bugs.webkit.org/show_bug.cgi?id=64381

Reviewed by Dimitri Glazkov.

Extracted HTMLTextFormControlElement.h and HTMLTextFormControlElement.cpp out of
HTMLFormControlElement.h and HTMLFormControlElement.cpp.

Also moved defaultEventHandler from HTMLFormControlElementWithState to HTMLTextFormControlElement
because it was specific to HTMLTextFormControlElement, and replaced all references to
HTMLFormControlElementWithState in HTMLInputElement and HTMLTextAreaElement by ones to
HTMLTextFormControlElement.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • editing/TextIterator.cpp:
  • editing/htmlediting.cpp:
  • html/HTMLElementsAllInOne.cpp:
  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::isFocusable):

  • html/HTMLFormControlElement.h:
  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::isKeyboardFocusable):
(WebCore::HTMLInputElement::isMouseFocusable):
(WebCore::HTMLInputElement::updateFocusAppearance):
(WebCore::HTMLInputElement::canStartSelection):
(WebCore::HTMLInputElement::parseMappedAttribute):
(WebCore::HTMLInputElement::finishParsingChildren):
(WebCore::HTMLInputElement::rendererIsNeeded):
(WebCore::HTMLInputElement::attach):
(WebCore::HTMLInputElement::detach):
(WebCore::HTMLInputElement::copyNonAttributeProperties):
(WebCore::HTMLInputElement::defaultEventHandler):
(WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
(WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
(WebCore::HTMLInputElement::addSubresourceAttributeURLs):
(WebCore::HTMLInputElement::recalcWillValidate):

  • html/HTMLInputElement.h:
  • html/HTMLTextAreaElement.cpp:

(WebCore::HTMLTextAreaElement::defaultEventHandler):

  • html/HTMLTextAreaElement.h:
  • html/HTMLTextFormControlElement.cpp: Copied from Source/WebCore/html/HTMLFormControlElement.cpp.

(WebCore::HTMLTextFormControlElement::defaultEventHandler):

  • html/HTMLTextFormControlElement.h: Copied from Source/WebCore/html/HTMLFormControlElement.h.
Location:
trunk/Source/WebCore
Files:
16 edited
2 copied

Legend:

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

    r90832 r90849  
    775775    html/HTMLTableSectionElement.cpp
    776776    html/HTMLTextAreaElement.cpp
     777    html/HTMLTextFormControlElement.cpp
    777778    html/HTMLTitleElement.cpp
    778779    html/HTMLUListElement.cpp
  • trunk/Source/WebCore/ChangeLog

    r90847 r90849  
     12011-07-12  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Isolate HTMLTextFormControlElement into a separate file
     4        https://bugs.webkit.org/show_bug.cgi?id=64381
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Extracted HTMLTextFormControlElement.h and HTMLTextFormControlElement.cpp out of
     9        HTMLFormControlElement.h and HTMLFormControlElement.cpp.
     10
     11        Also moved defaultEventHandler from HTMLFormControlElementWithState to HTMLTextFormControlElement
     12        because it was specific to HTMLTextFormControlElement, and replaced all references to
     13        HTMLFormControlElementWithState in HTMLInputElement and HTMLTextAreaElement by ones to
     14        HTMLTextFormControlElement.
     15
     16        * CMakeLists.txt:
     17        * GNUmakefile.list.am:
     18        * WebCore.gypi:
     19        * WebCore.pro:
     20        * WebCore.vcproj/WebCore.vcproj:
     21        * WebCore.xcodeproj/project.pbxproj:
     22        * editing/TextIterator.cpp:
     23        * editing/htmlediting.cpp:
     24        * html/HTMLElementsAllInOne.cpp:
     25        * html/HTMLFormControlElement.cpp:
     26        (WebCore::HTMLFormControlElement::isFocusable):
     27        * html/HTMLFormControlElement.h:
     28        * html/HTMLInputElement.cpp:
     29        (WebCore::HTMLInputElement::isKeyboardFocusable):
     30        (WebCore::HTMLInputElement::isMouseFocusable):
     31        (WebCore::HTMLInputElement::updateFocusAppearance):
     32        (WebCore::HTMLInputElement::canStartSelection):
     33        (WebCore::HTMLInputElement::parseMappedAttribute):
     34        (WebCore::HTMLInputElement::finishParsingChildren):
     35        (WebCore::HTMLInputElement::rendererIsNeeded):
     36        (WebCore::HTMLInputElement::attach):
     37        (WebCore::HTMLInputElement::detach):
     38        (WebCore::HTMLInputElement::copyNonAttributeProperties):
     39        (WebCore::HTMLInputElement::defaultEventHandler):
     40        (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
     41        (WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
     42        (WebCore::HTMLInputElement::addSubresourceAttributeURLs):
     43        (WebCore::HTMLInputElement::recalcWillValidate):
     44        * html/HTMLInputElement.h:
     45        * html/HTMLTextAreaElement.cpp:
     46        (WebCore::HTMLTextAreaElement::defaultEventHandler):
     47        * html/HTMLTextAreaElement.h:
     48        * html/HTMLTextFormControlElement.cpp: Copied from Source/WebCore/html/HTMLFormControlElement.cpp.
     49        (WebCore::HTMLTextFormControlElement::defaultEventHandler):
     50        * html/HTMLTextFormControlElement.h: Copied from Source/WebCore/html/HTMLFormControlElement.h.
     51
    1522011-07-12  Sheriff Bot  <webkit.review.bot@gmail.com>
    253
  • trunk/Source/WebCore/GNUmakefile.list.am

    r90832 r90849  
    17771777        Source/WebCore/html/HTMLTextAreaElement.cpp \
    17781778        Source/WebCore/html/HTMLTextAreaElement.h \
     1779        Source/WebCore/html/HTMLTextFormControlElement.cpp \
     1780        Source/WebCore/html/HTMLTextFormControlElement.h \
    17791781        Source/WebCore/html/HTMLTitleElement.cpp \
    17801782        Source/WebCore/html/HTMLTitleElement.h \
  • trunk/Source/WebCore/WebCore.gypi

    r90842 r90849  
    620620            'html/HTMLTablePartElement.h',
    621621            'html/HTMLTextAreaElement.h',
     622            'html/HTMLTextFormControlElement.h',
    622623            'html/InputType.h',
    623624            'html/VoidCallback.h',
     
    30213022            'html/HTMLTableSectionElement.h',
    30223023            'html/HTMLTextAreaElement.cpp',
     3024            'html/HTMLTextFormControlElement.cpp',
    30233025            'html/HTMLTitleElement.cpp',
    30243026            'html/HTMLTitleElement.h',
  • trunk/Source/WebCore/WebCore.pro

    r90832 r90849  
    733733    html/HTMLTableSectionElement.cpp \
    734734    html/HTMLTextAreaElement.cpp \
     735    html/HTMLTextFormControlElement.cpp \
    735736    html/HTMLTitleElement.cpp \
    736737    html/HTMLUListElement.cpp \
     
    17261727    html/HTMLTableSectionElement.h \
    17271728    html/HTMLTextAreaElement.h \
     1729    html/HTMLTextFormControlElement.h \
    17281730    html/HTMLTitleElement.h \
    17291731    html/HTMLTrackElement.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r90832 r90849  
    5691956919                        </File>
    5692056920                        <File
     56921                                RelativePath="..\html\HTMLTextFormControlElement.cpp"
     56922                                >
     56923                                <FileConfiguration
     56924                                        Name="Debug|Win32"
     56925                                        ExcludedFromBuild="true"
     56926                                        >
     56927                                        <Tool
     56928                                                Name="VCCLCompilerTool"
     56929                                        />
     56930                                </FileConfiguration>
     56931                                <FileConfiguration
     56932                                        Name="Release|Win32"
     56933                                        ExcludedFromBuild="true"
     56934                                        >
     56935                                        <Tool
     56936                                                Name="VCCLCompilerTool"
     56937                                        />
     56938                                </FileConfiguration>
     56939                                <FileConfiguration
     56940                                        Name="Debug_Cairo_CFLite|Win32"
     56941                                        ExcludedFromBuild="true"
     56942                                        >
     56943                                        <Tool
     56944                                                Name="VCCLCompilerTool"
     56945                                        />
     56946                                </FileConfiguration>
     56947                                <FileConfiguration
     56948                                        Name="Release_Cairo_CFLite|Win32"
     56949                                        ExcludedFromBuild="true"
     56950                                        >
     56951                                        <Tool
     56952                                                Name="VCCLCompilerTool"
     56953                                        />
     56954                                </FileConfiguration>
     56955                                <FileConfiguration
     56956                                        Name="Debug_All|Win32"
     56957                                        ExcludedFromBuild="true"
     56958                                        >
     56959                                        <Tool
     56960                                                Name="VCCLCompilerTool"
     56961                                        />
     56962                                </FileConfiguration>
     56963                                <FileConfiguration
     56964                                        Name="Production|Win32"
     56965                                        ExcludedFromBuild="true"
     56966                                        >
     56967                                        <Tool
     56968                                                Name="VCCLCompilerTool"
     56969                                        />
     56970                                </FileConfiguration>
     56971                        </File>
     56972                        <File
     56973                                RelativePath="..\html\HTMLTextFormControlElement.h"
     56974                                >
     56975                        </File>
     56976                        <File
    5692156977                                RelativePath="..\html\HTMLTitleElement.cpp"
    5692256978                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r90832 r90849  
    32183218                9BAB6C6D12550631001626D4 /* EditingStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BAB6C6B12550631001626D4 /* EditingStyle.cpp */; };
    32193219                9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAF3B2312C1A39800014BF1 /* WritingDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3220                9BC6C21B13CCC97B008E0337 /* HTMLTextFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BC6C21913CCC97B008E0337 /* HTMLTextFormControlElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3221                9BC6C21C13CCC97B008E0337 /* HTMLTextFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC6C21A13CCC97B008E0337 /* HTMLTextFormControlElement.cpp */; };
    32203222                9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */; };
    32213223                9BD0BF9412A42BF50072FD43 /* ScopedEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BD0BF9212A42BF50072FD43 /* ScopedEventQueue.cpp */; };
     
    97419743                9BAB6C6B12550631001626D4 /* EditingStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditingStyle.cpp; sourceTree = "<group>"; };
    97429744                9BAF3B2312C1A39800014BF1 /* WritingDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritingDirection.h; sourceTree = "<group>"; };
     9745                9BC6C21913CCC97B008E0337 /* HTMLTextFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTextFormControlElement.h; sourceTree = "<group>"; };
     9746                9BC6C21A13CCC97B008E0337 /* HTMLTextFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTextFormControlElement.cpp; sourceTree = "<group>"; };
    97439747                9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopedEventQueue.h; sourceTree = "<group>"; };
    97449748                9BD0BF9212A42BF50072FD43 /* ScopedEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScopedEventQueue.cpp; sourceTree = "<group>"; };
     
    1271612720                        isa = PBXGroup;
    1271712721                        children = (
     12722                                00CA93B413C6697C00F7FE95 /* NewXMLDocumentParser.cpp */,
     12723                                00CA93B113C6691600F7FE95 /* NewXMLDocumentParser.h */,
    1271812724                                00B9318113BA867F0035A948 /* XMLDocumentParser.cpp */,
    1271912725                                00B9318213BA867F0035A948 /* XMLDocumentParser.h */,
     
    1272112727                                00B9318513BA867F0035A948 /* XMLDocumentParserScope.cpp */,
    1272212728                                00B9318613BA867F0035A948 /* XMLDocumentParserScope.h */,
    12723                                 00CA93B113C6691600F7FE95 /* NewXMLDocumentParser.h */,
    12724                                 00CA93B413C6697C00F7FE95 /* NewXMLDocumentParser.cpp */,
    1272512729                        );
    1272612730                        path = parser;
     
    1368713691                        isa = PBXGroup;
    1368813692                        children = (
     13693                                41815C1B138319630057AAA4 /* js */,
    1368913694                                B1AD4E7713A12A7200846B27 /* track */,
     13695                                B1AD4E4B13A12A0B00846B27 /* CueIndex.cpp */,
     13696                                B1AD4E4C13A12A0B00846B27 /* CueIndex.h */,
    1369013697                                B1AD4E7113A12A4600846B27 /* CueLoader.cpp */,
    1369113698                                B1AD4E7213A12A4600846B27 /* CueLoader.h */,
    13692                                 B1AD4E4B13A12A0B00846B27 /* CueIndex.cpp */,
    13693                                 B1AD4E4C13A12A0B00846B27 /* CueIndex.h */,
     13699                                417DA4CF13734326007C57FB /* Internals.cpp */,
     13700                                417DA4CE13734326007C57FB /* Internals.h */,
     13701                                41813F9113818AD60057AAA4 /* Internals.idl */,
    1369413702                                B1AD4E4D13A12A0B00846B27 /* LoadableTextTrack.cpp */,
    1369513703                                B1AD4E4E13A12A0B00846B27 /* LoadableTextTrack.h */,
     
    1370213710                                B1AD4E5913A12A0B00846B27 /* TextTrackCueList.cpp */,
    1370313711                                B1AD4E5A13A12A0B00846B27 /* TextTrackCueList.h */,
    13704                                 41815C1B138319630057AAA4 /* js */,
    13705                                 417DA4CF13734326007C57FB /* Internals.cpp */,
    13706                                 417DA4CE13734326007C57FB /* Internals.h */,
    13707                                 41813F9113818AD60057AAA4 /* Internals.idl */,
    1370813712                        );
    1370913713                        path = testing;
     
    1431614320                        isa = PBXGroup;
    1431714321                        children = (
    14318                                 CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */,
    14319                                 CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */,
    14320                                 CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */,
    14321                                 CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */,
    14322                                 CD8203081395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h */,
    14323                                 CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */,
    1432414322                                51E1ECAD0C91C54600DC255B /* AutodrainedPool.mm */,
    1432514323                                65A640F00533BB1F0085E777 /* BlockExceptions.h */,
     
    1438614384                                E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */,
    1438714385                                E1A3162C134BC32D007C9A4F /* WebNSAttributedStringExtras.mm */,
     14386                                CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */,
     14387                                CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */,
     14388                                CD8203081395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h */,
     14389                                CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */,
     14390                                CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */,
     14391                                CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */,
    1438814392                                935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */,
    1438914393                                9380F47709A11ACC001FDB34 /* WidgetMac.mm */,
     
    1622416228                                A81369BA097374F500D74463 /* HTMLTextAreaElement.h */,
    1622516229                                A80E7E160A1A7CCB007FB8C5 /* HTMLTextAreaElement.idl */,
     16230                                9BC6C21A13CCC97B008E0337 /* HTMLTextFormControlElement.cpp */,
     16231                                9BC6C21913CCC97B008E0337 /* HTMLTextFormControlElement.h */,
    1622616232                                A871DC1D0A15205700B12A68 /* HTMLTitleElement.cpp */,
    1622716233                                A871DC1C0A15205700B12A68 /* HTMLTitleElement.h */,
     
    1745317459                                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */,
    1745417460                                B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */,
     17461                                431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */,
    1745517462                                431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */,
    17456                                 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */,
    1745717463                                0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */,
    1745817464                                0863951413B5FE5700BB344D /* SVGAnimatedPath.h */,
     17465                                43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */,
    1745917466                                43B9336713B261B1004584BF /* SVGAnimatedPointList.h */,
    17460                                 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */,
    1746117467                                431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */,
    1746217468                                08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */,
     
    1810118107                                087E0AF513606D0B00FA4BA8 /* SVGGlyph.h */,
    1810218108                                930FC6891072B9280045293E /* TextRenderingMode.h */,
     18109                                376DCCE013B4F966002EBEFC /* TextRun.cpp */,
    1810318110                                A824B4640E2EF2EA0081A7B7 /* TextRun.h */,
    18104                                 376DCCE013B4F966002EBEFC /* TextRun.cpp */,
    1810518111                                37C28A6710F659CC008C7813 /* TypesettingFeatures.h */,
    1810618112                                E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */,
     
    1873418740                                089582530E857A7E00F82C83 /* ImageLoader.cpp */,
    1873518741                                089582540E857A7E00F82C83 /* ImageLoader.h */,
    18736                                 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */,
    1873718742                                98CE4325129E00BD005821DC /* LinkLoader.cpp */,
    1873818743                                98CE4329129E00E5005821DC /* LinkLoader.h */,
     18744                                984264EF12D5280A000D88A4 /* LinkLoaderClient.h */,
    1873918745                                93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */,
    1874018746                                656D37290ADBA5DE00A4554D /* MainResourceLoader.h */,
     
    2018420190                                49EECDE310503C2400099FAB /* ArrayBuffer.h in Headers */,
    2018520191                                49EECDE010503C2400099FAB /* ArrayBufferView.h in Headers */,
     20192                                FD5686CA13AC180200B69C68 /* AsyncAudioDecoder.h in Headers */,
    2018620193                                2EF1BFF7121CB0BD00C27627 /* AsyncFileStream.h in Headers */,
    2018720194                                89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */,
     
    2019520202                                FD315FF712B0267600C1A359 /* AudioBasicProcessorNode.h in Headers */,
    2019620203                                FD315FF912B0267600C1A359 /* AudioBuffer.h in Headers */,
     20204                                FD5686CC13AC181400B69C68 /* AudioBufferCallback.h in Headers */,
    2019720205                                FD315FFC12B0267600C1A359 /* AudioBufferSourceNode.h in Headers */,
    2019820206                                FD31607C12B026F700C1A359 /* AudioBus.h in Headers */,
     
    2042820436                                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */,
    2042920437                                A80E6CE90A1989CA007FB8C5 /* CSSValueList.h in Headers */,
     20438                                B1AD4E5D13A12A0B00846B27 /* CueIndex.h in Headers */,
     20439                                B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */,
     20440                                B1AD4E7C13A12A7200846B27 /* CueParser.h in Headers */,
     20441                                B1AD4E7D13A12A7200846B27 /* CueParserPrivate.h in Headers */,
    2043020442                                93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
    2043120443                                BC2272A20E82E87C00E7F975 /* CursorData.h in Headers */,
     
    2140621418                                A871DB250A150BD600B12A68 /* HTMLTableSectionElement.h in Headers */,
    2140721419                                A81369D6097374F600D74463 /* HTMLTextAreaElement.h in Headers */,
     21420                                9BC6C21B13CCC97B008E0337 /* HTMLTextFormControlElement.h in Headers */,
    2140821421                                A871DC280A15205700B12A68 /* HTMLTitleElement.h in Headers */,
    2140921422                                977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */,
     
    2150921522                                4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
    2151021523                                82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
     21524                                82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
    2151121525                                754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
    2151221526                                4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */,
     
    2154721561                                65DF31DB09D1C123000BE325 /* JSAttr.h in Headers */,
    2154821562                                FDA15E9E12B03EE1003A583A /* JSAudioBuffer.h in Headers */,
     21563                                FDF7E9C413AC21DB00A51EAC /* JSAudioBufferCallback.h in Headers */,
    2154921564                                FDA15EA012B03EE1003A583A /* JSAudioBufferSourceNode.h in Headers */,
    2155021565                                FDA15EA212B03EE1003A583A /* JSAudioChannelMerger.h in Headers */,
     
    2206022075                                85EC9AFB0A71A2C600EEEAED /* Language.h in Headers */,
    2206122076                                2D9066070BE141D400956998 /* LayoutState.h in Headers */,
     22077                                BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */,
    2206222078                                512DD8F50D91E6AF000F89EE /* LegacyWebArchive.h in Headers */,
    2206322079                                BCE65BEB0EACDF16007E4533 /* Length.h in Headers */,
     
    2207222088                                84730D911248F0B300D3A9C9 /* LightSource.h in Headers */,
    2207322089                                B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */,
     22090                                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */,
    2207422091                                AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
    2207522092                                89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */,
     
    2207722094                                98CE432A129E00E5005821DC /* LinkLoader.h in Headers */,
    2207822095                                984264F112D5280A000D88A4 /* LinkLoaderClient.h in Headers */,
     22096                                985BB96E13A94058007A0B69 /* LinkRelAttribute.h in Headers */,
     22097                                B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */,
    2207922098                                656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */,
    2208022099                                7EE6846912D26E3800E79415 /* LoaderRunLoopCF.h in Headers */,
     
    2215522174                                93309DFC099E64920056E581 /* MoveSelectionCommand.h in Headers */,
    2215622175                                B12D234213560282002A28D4 /* MultipleTrackList.h in Headers */,
     22176                                B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */,
    2215722177                                85031B4A0A44EFC700F992E0 /* MutationEvent.h in Headers */,
    2215822178                                A81872230977D3C0005826D9 /* NamedNodeMap.h in Headers */,
     
    2253422554                                B2AFFC940D00A5DF0030074D /* ShapeArabic.h in Headers */,
    2253522555                                1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */,
     22556                                97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */,
    2253622557                                498770EB1242C535002226BA /* SharedGraphicsContext3D.h in Headers */,
    2253722558                                93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
     
    2262422645                                BC5EB67F0E81D4A700B25965 /* StyleDashboardRegion.h in Headers */,
    2262522646                                A8C4A7FD09D563270003AC8D /* StyledElement.h in Headers */,
     22647                                BC5EB8B90E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.h in Headers */,
    2262622648                                AA4C3A770B2B1679002334A2 /* StyleElement.h in Headers */,
    22627                                 BC5EB8B90E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.h in Headers */,
    2262822649                                BCEF444A0E6745E0001C1287 /* StyleGeneratedImage.h in Headers */,
    2262922650                                BCEF43CF0E673DA1001C1287 /* StyleImage.h in Headers */,
     
    2264922670                                93B2D8160F9920D2006AE6B2 /* SuddenTermination.h in Headers */,
    2265022671                                97C078501165D5BE003A32EF /* SuffixTree.h in Headers */,
     22672                                087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */,
    2265122673                                62C1217D11AB9E77003C462C /* SuspendableTimer.h in Headers */,
    2265222674                                B22279740D00BF220071B782 /* SVGAElement.h in Headers */,
     
    2265622678                                087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */,
    2265722679                                085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */,
     22680                                43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */,
    2265822681                                08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */,
    2265922682                                71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */,
     
    2266422687                                08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */,
    2266522688                                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */,
     22689                                431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,
     22690                                0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
    2266622691                                089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */,
     22692                                43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,
    2266722693                                08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */,
    2266822694                                088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */,
     
    2268322709                                B22279980D00BF220071B782 /* SVGAnimationElement.h in Headers */,
    2268422710                                439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */,
     22711                                08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */,
    2268522712                                B222799C0D00BF220071B782 /* SVGCircleElement.h in Headers */,
    2268622713                                B222799F0D00BF220071B782 /* SVGClipPathElement.h in Headers */,
     
    2280722834                                B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
    2280822835                                088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */,
     22836                                081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */,
    2280922837                                088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */,
    2281022838                                088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
     
    2291022938                                A824B4650E2EF2EA0081A7B7 /* TextRun.h in Headers */,
    2291122939                                B2C3DA4B0D006C1D00EF6F26 /* TextStream.h in Headers */,
     22940                                B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */,
     22941                                B1AD4E6913A12A0B00846B27 /* TextTrackCue.h in Headers */,
     22942                                B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */,
    2291222943                                498770F11242C535002226BA /* Texture.h in Headers */,
    2291322944                                97BC84A512370DC8000C6161 /* TextViewSourceParser.h in Headers */,
     
    2309323124                                977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
    2309423125                                FD537353137B651800008DCE /* ZeroPole.h in Headers */,
    23095                                 985BB96E13A94058007A0B69 /* LinkRelAttribute.h in Headers */,
    23096                                 FD5686CA13AC180200B69C68 /* AsyncAudioDecoder.h in Headers */,
    23097                                 FD5686CC13AC181400B69C68 /* AudioBufferCallback.h in Headers */,
    23098                                 FDF7E9C413AC21DB00A51EAC /* JSAudioBufferCallback.h in Headers */,
    23099                                 B1AD4E5D13A12A0B00846B27 /* CueIndex.h in Headers */,
    23100                                 B1AD4E5F13A12A0B00846B27 /* LoadableTextTrack.h in Headers */,
    23101                                 B1AD4E6313A12A0B00846B27 /* MutableTextTrack.h in Headers */,
    23102                                 B1AD4E6713A12A0B00846B27 /* TextTrack.h in Headers */,
    23103                                 B1AD4E6913A12A0B00846B27 /* TextTrackCue.h in Headers */,
    23104                                 B1AD4E6B13A12A0B00846B27 /* TextTrackCueList.h in Headers */,
    23105                                 B1AD4E7413A12A4600846B27 /* CueLoader.h in Headers */,
    23106                                 B1AD4E7C13A12A7200846B27 /* CueParser.h in Headers */,
    23107                                 B1AD4E7D13A12A7200846B27 /* CueParserPrivate.h in Headers */,
    23108                                 97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */,
    23109                                 BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */,
    23110                                 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,
    23111                                 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */,
    23112                                 087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */,
    23113                                 0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
    23114                                 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,
    23115                                 A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */,
    23116                                 081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */,
    23117                                 08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */,
    23118                                 82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
    2311923126                        );
    2312023127                        runOnlyForDeploymentPostprocessing = 0;
     
    2347823485                                49EECDE210503C2400099FAB /* ArrayBuffer.cpp in Sources */,
    2347923486                                49EECDDF10503C2400099FAB /* ArrayBufferView.cpp in Sources */,
     23487                                FD5686C913AC180200B69C68 /* AsyncAudioDecoder.cpp in Sources */,
    2348023488                                89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */,
    2348123489                                A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */,
     
    2367323681                                1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
    2367423682                                A80E6CE40A1989CA007FB8C5 /* CSSValueList.cpp in Sources */,
     23683                                B1AD4E5C13A12A0B00846B27 /* CueIndex.cpp in Sources */,
     23684                                B1AD4E7313A12A4600846B27 /* CueLoader.cpp in Sources */,
     23685                                B1AD4E7B13A12A7200846B27 /* CueParser.cpp in Sources */,
    2367523686                                E11AF15111B9A1A300805103 /* Cursor.cpp in Sources */,
    2367623687                                93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
     
    2430624317                                A871DB260A150BD600B12A68 /* HTMLTableSectionElement.cpp in Sources */,
    2430724318                                A81369D7097374F600D74463 /* HTMLTextAreaElement.cpp in Sources */,
     24319                                9BC6C21C13CCC97B008E0337 /* HTMLTextFormControlElement.cpp in Sources */,
    2430824320                                A871DC290A15205700B12A68 /* HTMLTitleElement.cpp in Sources */,
    2430924321                                977B3877122883E900B81FF8 /* HTMLTokenizer.cpp in Sources */,
     
    2434324355                                1A71D57B0F33819000F9CE4E /* IdentifierRep.cpp in Sources */,
    2434424356                                B275356F0B053814002CE64F /* Image.cpp in Sources */,
     24357                                43D2597713C816F400608559 /* ImageBuffer.cpp in Sources */,
    2434524358                                B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */,
    2434624359                                2292B27C1356669400CF11EF /* ImageBufferDataCG.cpp in Sources */,
     
    2439324406                                4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
    2439424407                                82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
     24408                                82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */,
    2439524409                                754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
    2439624410                                4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */,
     
    2442724441                                BC2ED6BC0C6BD2F000920BFF /* JSAttrCustom.cpp in Sources */,
    2442824442                                FDA15E9D12B03EE1003A583A /* JSAudioBuffer.cpp in Sources */,
     24443                                FDF7E9C313AC21DB00A51EAC /* JSAudioBufferCallback.cpp in Sources */,
    2442924444                                FDA15E9F12B03EE1003A583A /* JSAudioBufferSourceNode.cpp in Sources */,
    2443024445                                FDEAAAF312B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp in Sources */,
     
    2506725082                                A7AD2F870EC89D07008AB002 /* LinkHash.cpp in Sources */,
    2506825083                                98CE4326129E00BD005821DC /* LinkLoader.cpp in Sources */,
     25084                                985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */,
     25085                                B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */,
    2506925086                                656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
    2507025087                                7EE6846812D26E3800E79415 /* LoaderRunLoopCF.cpp in Sources */,
     
    2513925156                                93309DFB099E64920056E581 /* MoveSelectionCommand.cpp in Sources */,
    2514025157                                B12D234113560282002A28D4 /* MultipleTrackList.cpp in Sources */,
     25158                                B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */,
    2514125159                                85031B490A44EFC700F992E0 /* MutationEvent.cpp in Sources */,
    2514225160                                BCF34A3711A231CD00C71804 /* NamedNodeMap.cpp in Sources */,
     
    2543125449                                1A4A954D0B4EDCCB002D8C3C /* SharedBuffer.cpp in Sources */,
    2543225450                                512DD8E30D91E2B4000F89EE /* SharedBufferCF.cpp in Sources */,
     25451                                97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */,
    2543325452                                1A4A95520B4EDCFF002D8C3C /* SharedBufferMac.mm in Sources */,
    2543425453                                498770EA1242C535002226BA /* SharedGraphicsContext3D.cpp in Sources */,
     
    2551125530                                BCEF447A0E6747D0001C1287 /* StyleCachedImage.cpp in Sources */,
    2551225531                                A8C4A7FE09D563270003AC8D /* StyledElement.cpp in Sources */,
     25532                                BC5EB8B80E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.cpp in Sources */,
    2551325533                                AA4C3A760B2B1679002334A2 /* StyleElement.cpp in Sources */,
    25514                                 BC5EB8B80E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.cpp in Sources */,
    2551525534                                BCEF447D0E674806001C1287 /* StyleGeneratedImage.cpp in Sources */,
    2551625535                                BC2273030E82F1E600E7F975 /* StyleInheritedData.cpp in Sources */,
     
    2553125550                                7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */,
    2553225551                                93B2D8180F9920EE006AE6B2 /* SuddenTermination.mm in Sources */,
     25552                                087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */,
    2553325553                                62C1217C11AB9E77003C462C /* SuspendableTimer.cpp in Sources */,
    2553425554                                B22279730D00BF220071B782 /* SVGAElement.cpp in Sources */,
     
    2553625556                                B22279760D00BF220071B782 /* SVGAngle.cpp in Sources */,
    2553725557                                B22279790D00BF220071B782 /* SVGAnimateColorElement.cpp in Sources */,
     25558                                4362C7B913AC6F1A00344BEB /* SVGAnimatedAngle.cpp in Sources */,
     25559                                431A308813B8F978007791E4 /* SVGAnimatedBoolean.cpp in Sources */,
     25560                                43A625F913B3304000AC94B8 /* SVGAnimatedColor.cpp in Sources */,
     25561                                43F6FD9613BCD0B100224052 /* SVGAnimatedInteger.cpp in Sources */,
    2553825562                                4381763B13A697D4007D1187 /* SVGAnimatedLength.cpp in Sources */,
     25563                                431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */,
     25564                                43A0F0B113AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp in Sources */,
     25565                                4331AC7813B6870000A9E5AE /* SVGAnimatedNumberList.cpp in Sources */,
     25566                                431A2F9D13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp in Sources */,
     25567                                08B5F25513B5FFF2002959EC /* SVGAnimatedPath.cpp in Sources */,
     25568                                43B9336A13B261B1004584BF /* SVGAnimatedPointList.cpp in Sources */,
     25569                                431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */,
     25570                                43142E7A13B1E97700F1C871 /* SVGAnimatedRect.cpp in Sources */,
     25571                                43A6266713B3D11000AC94B8 /* SVGAnimatedString.cpp in Sources */,
     25572                                43A0F0B613ACCCFF00A5F0A7 /* SVGAnimatedType.cpp in Sources */,
    2553925573                                B222798F0D00BF220071B782 /* SVGAnimateElement.cpp in Sources */,
    2554025574                                B22279920D00BF220071B782 /* SVGAnimateMotionElement.cpp in Sources */,
    2554125575                                B22279940D00BF220071B782 /* SVGAnimateTransformElement.cpp in Sources */,
    2554225576                                B22279970D00BF220071B782 /* SVGAnimationElement.cpp in Sources */,
     25577                                08FB17C113BC7E9100040086 /* SVGAttributeToPropertyMap.cpp in Sources */,
    2554325578                                B222799B0D00BF220071B782 /* SVGCircleElement.cpp in Sources */,
    2554425579                                B222799E0D00BF220071B782 /* SVGClipPathElement.cpp in Sources */,
     
    2570625741                                93309E1B099E64920056E581 /* TextIterator.cpp in Sources */,
    2570725742                                93F19A9D08245E59001E9ABC /* TextResourceDecoder.cpp in Sources */,
     25743                                376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */,
    2570825744                                B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
     25745                                B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */,
     25746                                B1AD4E6813A12A0B00846B27 /* TextTrackCue.cpp in Sources */,
     25747                                B1AD4E6A13A12A0B00846B27 /* TextTrackCueList.cpp in Sources */,
    2570925748                                498770F01242C535002226BA /* Texture.cpp in Sources */,
    2571025749                                97BC84A412370DC8000C6161 /* TextViewSourceParser.cpp in Sources */,
     
    2585725896                                977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
    2585825897                                FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
    25859                                 985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */,
    25860                                 FD5686C913AC180200B69C68 /* AsyncAudioDecoder.cpp in Sources */,
    25861                                 FDF7E9C313AC21DB00A51EAC /* JSAudioBufferCallback.cpp in Sources */,
    25862                                 B1AD4E5C13A12A0B00846B27 /* CueIndex.cpp in Sources */,
    25863                                 B1AD4E5E13A12A0B00846B27 /* LoadableTextTrack.cpp in Sources */,
    25864                                 B1AD4E6213A12A0B00846B27 /* MutableTextTrack.cpp in Sources */,
    25865                                 B1AD4E6613A12A0B00846B27 /* TextTrack.cpp in Sources */,
    25866                                 B1AD4E6813A12A0B00846B27 /* TextTrackCue.cpp in Sources */,
    25867                                 B1AD4E6A13A12A0B00846B27 /* TextTrackCueList.cpp in Sources */,
    25868                                 B1AD4E7313A12A4600846B27 /* CueLoader.cpp in Sources */,
    25869                                 B1AD4E7B13A12A7200846B27 /* CueParser.cpp in Sources */,
    25870                                 4362C7B913AC6F1A00344BEB /* SVGAnimatedAngle.cpp in Sources */,
    25871                                 43A0F0B113AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp in Sources */,
    25872                                 43A0F0B613ACCCFF00A5F0A7 /* SVGAnimatedType.cpp in Sources */,
    25873                                 97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */,
    25874                                 43142E7A13B1E97700F1C871 /* SVGAnimatedRect.cpp in Sources */,
    25875                                 43B9336A13B261B1004584BF /* SVGAnimatedPointList.cpp in Sources */,
    25876                                 43A625F913B3304000AC94B8 /* SVGAnimatedColor.cpp in Sources */,
    25877                                 43A6266713B3D11000AC94B8 /* SVGAnimatedString.cpp in Sources */,
    25878                                 087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */,
    25879                                 08B5F25513B5FFF2002959EC /* SVGAnimatedPath.cpp in Sources */,
    25880                                 376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */,
    25881                                 4331AC7813B6870000A9E5AE /* SVGAnimatedNumberList.cpp in Sources */,
    25882                                 431A2F9D13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp in Sources */,
    25883                                 431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */,
    25884                                 431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */,
    25885                                 431A308813B8F978007791E4 /* SVGAnimatedBoolean.cpp in Sources */,
    25886                                 08FB17C113BC7E9100040086 /* SVGAttributeToPropertyMap.cpp in Sources */,
    25887                                 43F6FD9613BCD0B100224052 /* SVGAnimatedInteger.cpp in Sources */,
    25888                                 82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */,
    25889                                 43D2597713C816F400608559 /* ImageBuffer.cpp in Sources */,
    2589025898                        );
    2589125899                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r90775 r90849  
    3131#include "Frame.h"
    3232#include "HTMLElement.h"
    33 #include "HTMLFormControlElement.h"
     33#include "HTMLTextFormControlElement.h"
    3434#include "HTMLNames.h"
    3535#include "htmlediting.h"
  • trunk/Source/WebCore/editing/htmlediting.cpp

    r90098 r90849  
    3232#include "HTMLDivElement.h"
    3333#include "HTMLElementFactory.h"
    34 #include "HTMLFormControlElement.h"
     34#include "HTMLTextFormControlElement.h"
    3535#include "HTMLInterchange.h"
    3636#include "HTMLLIElement.h"
  • trunk/Source/WebCore/html/HTMLElementsAllInOne.cpp

    r84991 r90849  
    103103#include "HTMLTableSectionElement.cpp"
    104104#include "HTMLTextAreaElement.cpp"
     105#include "HTMLTextFormControlElement.cpp"
    105106#include "HTMLTitleElement.cpp"
    106107#include "HTMLUListElement.cpp"
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r90775 r90849  
    2727
    2828#include "Attribute.h"
    29 #include "Chrome.h"
    30 #include "ChromeClient.h"
    3129#include "Document.h"
    32 #include "DocumentParser.h"
    3330#include "ElementRareData.h"
    3431#include "Event.h"
     
    4037#include "HTMLNames.h"
    4138#include "LabelsNodeList.h"
    42 #include "Page.h"
    4339#include "RenderBox.h"
    44 #include "RenderTextControl.h"
    4540#include "RenderTheme.h"
    4641#include "ScriptEventListener.h"
    4742#include "ValidationMessage.h"
    4843#include "ValidityState.h"
    49 #include <limits>
    5044#include <wtf/Vector.h>
    51 #include <wtf/unicode/CharacterNames.h>
    5245
    5346namespace WebCore {
     
    283276bool HTMLFormControlElement::isFocusable() const
    284277{
    285     if (!renderer() ||
    286         !renderer()->isBox() || toRenderBox(renderer())->size().isEmpty())
     278    if (!renderer() || !renderer()->isBox() || toRenderBox(renderer())->size().isEmpty())
    287279        return false;
    288280    // HTMLElement::isFocusable handles visibility and calls suportsFocus which
     
    553545}
    554546
    555 void HTMLFormControlElementWithState::defaultEventHandler(Event* event)
    556 {
    557     if (event->type() == eventNames().webkitEditableContentChangedEvent && renderer() && renderer()->isTextControl()) {
    558         toRenderTextControl(renderer())->subtreeHasChanged();
    559         return;
    560     }
    561 
    562     HTMLFormControlElement::defaultEventHandler(event);
    563 }
    564 
    565 HTMLTextFormControlElement::HTMLTextFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* form)
    566     : HTMLFormControlElementWithState(tagName, doc, form)
    567     , m_cachedSelectionStart(-1)
    568     , m_cachedSelectionEnd(-1)
    569 {
    570 }
    571 
    572 HTMLTextFormControlElement::~HTMLTextFormControlElement()
    573 {
    574 }
    575 
    576 void HTMLTextFormControlElement::insertedIntoDocument()
    577 {
    578     HTMLFormControlElement::insertedIntoDocument();
    579     String initialValue = value();
    580     setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString() : initialValue);
    581 }
    582 
    583 void HTMLTextFormControlElement::dispatchFocusEvent()
    584 {
    585     if (supportsPlaceholder())
    586         updatePlaceholderVisibility(false);
    587     handleFocusEvent();
    588     HTMLFormControlElementWithState::dispatchFocusEvent();
    589 }
    590 
    591 void HTMLTextFormControlElement::dispatchBlurEvent()
    592 {
    593     if (supportsPlaceholder())
    594         updatePlaceholderVisibility(false);
    595     handleBlurEvent();
    596     HTMLFormControlElementWithState::dispatchBlurEvent();
    597 }
    598 
    599 String HTMLTextFormControlElement::strippedPlaceholder() const
    600 {
    601     // According to the HTML5 specification, we need to remove CR and LF from
    602     // the attribute value.
    603     const AtomicString& attributeValue = getAttribute(placeholderAttr);
    604     if (!attributeValue.contains(newlineCharacter) && !attributeValue.contains(carriageReturn))
    605         return attributeValue;
    606 
    607     Vector<UChar> stripped;
    608     unsigned length = attributeValue.length();
    609     stripped.reserveCapacity(length);
    610     for (unsigned i = 0; i < length; ++i) {
    611         UChar character = attributeValue[i];
    612         if (character == newlineCharacter || character == carriageReturn)
    613             continue;
    614         stripped.append(character);
    615     }
    616     return String::adopt(stripped);
    617 }
    618 
    619 static bool isNotLineBreak(UChar ch) { return ch != newlineCharacter && ch != carriageReturn; }
    620 
    621 bool HTMLTextFormControlElement::isPlaceholderEmpty() const
    622 {
    623     const AtomicString& attributeValue = getAttribute(placeholderAttr);
    624     return attributeValue.string().find(isNotLineBreak) == notFound;
    625 }
    626 
    627 bool HTMLTextFormControlElement::placeholderShouldBeVisible() const
    628 {
    629     return supportsPlaceholder()
    630         && isEmptyValue()
    631         && isEmptySuggestedValue()
    632         && !isPlaceholderEmpty()
    633         && (document()->focusedNode() != this || (renderer() && renderer()->theme()->shouldShowPlaceholderWhenFocused()));
    634 }
    635 
    636 void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderValueChanged)
    637 {
    638     if (supportsPlaceholder() && renderer())
    639         toRenderTextControl(renderer())->updatePlaceholderVisibility(placeholderShouldBeVisible(), placeholderValueChanged);
    640 }
    641 
    642 RenderTextControl* HTMLTextFormControlElement::textRendererAfterUpdateLayout()
    643 {
    644     if (!isTextFormControl())
    645         return 0;
    646     document()->updateLayoutIgnorePendingStylesheets();
    647     return toRenderTextControl(renderer());
    648 }
    649 
    650 void HTMLTextFormControlElement::setSelectionStart(int start)
    651 {
    652     setSelectionRange(start, max(start, selectionEnd()));
    653 }
    654 
    655 void HTMLTextFormControlElement::setSelectionEnd(int end)
    656 {
    657     setSelectionRange(min(end, selectionStart()), end);
    658 }
    659 
    660 void HTMLTextFormControlElement::select()
    661 {
    662     setSelectionRange(0, numeric_limits<int>::max());
    663 }
    664 
    665 String HTMLTextFormControlElement::selectedText() const
    666 {
    667     // FIXME: We should be able to extract selected contents even if there were no renderer.
    668     if (!renderer() || renderer()->isTextControl())
    669         return String();
    670 
    671     RenderTextControl* textControl = toRenderTextControl(renderer());
    672     return textControl->text().substring(selectionStart(), selectionEnd() - selectionStart());
    673 }
    674 
    675 void HTMLTextFormControlElement::dispatchFormControlChangeEvent()
    676 {
    677     if (m_textAsOfLastFormControlChangeEvent != value()) {
    678         HTMLElement::dispatchChangeEvent();
    679         setTextAsOfLastFormControlChangeEvent(value());
    680     }
    681     setChangedSinceLastFormControlChangeEvent(false);
    682 }
    683 
    684 static inline bool hasVisibleTextArea(RenderTextControl* textControl, HTMLElement* innerText)
    685 {
    686     ASSERT(textControl);
    687     return textControl->style()->visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height();
    688 }
    689 
    690 void HTMLTextFormControlElement::setSelectionRange(int start, int end)
    691 {
    692     document()->updateLayoutIgnorePendingStylesheets();
    693 
    694     if (!renderer() || !renderer()->isTextControl())
    695         return;
    696 
    697     end = max(end, 0);
    698     start = min(max(start, 0), end);
    699 
    700     RenderTextControl* control = toRenderTextControl(renderer());
    701     if (!hasVisibleTextArea(control, innerTextElement())) {
    702         cacheSelection(start, end);
    703         return;
    704     }
    705     VisiblePosition startPosition = control->visiblePositionForIndex(start);
    706     VisiblePosition endPosition;
    707     if (start == end)
    708         endPosition = startPosition;
    709     else
    710         endPosition = control->visiblePositionForIndex(end);
    711 
    712     // startPosition and endPosition can be null position for example when
    713     // "-webkit-user-select: none" style attribute is specified.
    714     if (startPosition.isNotNull() && endPosition.isNotNull()) {
    715         ASSERT(startPosition.deepEquivalent().deprecatedNode()->shadowAncestorNode() == this
    716             && endPosition.deepEquivalent().deprecatedNode()->shadowAncestorNode() == this);
    717     }
    718     VisibleSelection newSelection = VisibleSelection(startPosition, endPosition);
    719 
    720     if (Frame* frame = document()->frame())
    721         frame->selection()->setSelection(newSelection);
    722 }
    723 
    724 int HTMLTextFormControlElement::selectionStart() const
    725 {
    726     if (!isTextFormControl())
    727         return 0;
    728     if (document()->focusedNode() != this && hasCachedSelectionStart())
    729         return m_cachedSelectionStart;
    730 
    731     return computeSelectionStart();
    732 }
    733 
    734 int HTMLTextFormControlElement::computeSelectionStart() const
    735 {
    736     Frame* frame = document()->frame();
    737     if (!frame)
    738         return 0;
    739 
    740     return RenderTextControl::indexForVisiblePosition(innerTextElement(), frame->selection()->start());
    741 }
    742 
    743 int HTMLTextFormControlElement::selectionEnd() const
    744 {
    745     if (!isTextFormControl())
    746         return 0;
    747     if (document()->focusedNode() != this && hasCachedSelectionEnd())
    748         return m_cachedSelectionEnd;
    749     return computeSelectionEnd();
    750 }
    751 
    752 int HTMLTextFormControlElement::computeSelectionEnd() const
    753 {
    754     Frame* frame = document()->frame();
    755     if (!frame)
    756         return 0;
    757 
    758     return RenderTextControl::indexForVisiblePosition(innerTextElement(), frame->selection()->end());
    759 }
    760 
    761 static inline void setContainerAndOffsetForRange(Node* node, int offset, Node*& containerNode, int& offsetInContainer)
    762 {
    763     if (node->isTextNode()) {
    764         containerNode = node;
    765         offsetInContainer = offset;
    766     } else {
    767         containerNode = node->parentNode();
    768         offsetInContainer = node->nodeIndex() + offset;
    769     }
    770 }
    771 
    772 PassRefPtr<Range> HTMLTextFormControlElement::selection() const
    773 {
    774     if (!renderer() || !isTextFormControl() || !hasCachedSelectionStart() || !hasCachedSelectionEnd())
    775         return 0;
    776 
    777     int start = m_cachedSelectionStart;
    778     int end = m_cachedSelectionEnd;
    779 
    780     ASSERT(start <= end);
    781     HTMLElement* innerText = innerTextElement();
    782     if (!innerText)
    783         return 0;
    784 
    785     if (!innerText->firstChild())
    786         return Range::create(document(), innerText, 0, innerText, 0);
    787 
    788     int offset = 0;
    789     Node* startNode = 0;
    790     Node* endNode = 0;
    791     for (Node* node = innerText->firstChild(); node; node = node->traverseNextNode(innerText)) {
    792         ASSERT(!node->firstChild());
    793         ASSERT(node->isTextNode() || node->hasTagName(brTag));
    794         int length = node->isTextNode() ? lastOffsetInNode(node) : 1;
    795 
    796         if (offset <= start && start <= offset + length)
    797             setContainerAndOffsetForRange(node, start - offset, startNode, start);
    798 
    799         if (offset <= end && end <= offset + length) {
    800             setContainerAndOffsetForRange(node, end - offset, endNode, end);
    801             break;
    802         }
    803 
    804         offset += length;
    805     }
    806 
    807     if (!startNode || !endNode)
    808         return 0;
    809 
    810     return Range::create(document(), startNode, start, endNode, end);
    811 }
    812 
    813 void HTMLTextFormControlElement::restoreCachedSelection()
    814 {
    815     setSelectionRange(m_cachedSelectionStart, m_cachedSelectionEnd);
    816 }
    817 
    818 void HTMLTextFormControlElement::selectionChanged(bool userTriggered)
    819 {
    820     if (!renderer() || !isTextFormControl())
    821         return;
    822 
    823     // selectionStart() or selectionEnd() will return cached selection when this node doesn't have focus
    824     cacheSelection(computeSelectionStart(), computeSelectionEnd());
    825 
    826     if (Frame* frame = document()->frame()) {
    827         if (frame->selection()->isRange() && userTriggered)
    828             dispatchEvent(Event::create(eventNames().selectEvent, true, false));
    829     }
    830 }
    831 
    832 void HTMLTextFormControlElement::parseMappedAttribute(Attribute* attr)
    833 {
    834     if (attr->name() == placeholderAttr)
    835         updatePlaceholderVisibility(true);
    836     else if (attr->name() == onselectAttr)
    837         setAttributeEventListener(eventNames().selectEvent, createAttributeEventListener(this, attr));
    838     else if (attr->name() == onchangeAttr)
    839         setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, attr));
    840     else
    841         HTMLFormControlElementWithState::parseMappedAttribute(attr);
    842 }
    843 
    844547} // namespace Webcore
  • trunk/Source/WebCore/html/HTMLFormControlElement.h

    r90775 r90849  
    3232class FormDataList;
    3333class HTMLFormElement;
    34 class RenderTextControl;
    3534class ValidationMessage;
    3635class ValidityState;
    37 class VisibleSelection;
    3836
    3937// HTMLFormControlElement is the default implementation of FormAssociatedElement,
     
    180178    virtual void willMoveToNewOwnerDocument();
    181179    virtual void didMoveToNewOwnerDocument();
    182     virtual void defaultEventHandler(Event*);
    183180
    184181private:
     
    186183};
    187184
    188 // FIXME: Give this class its own header file.
    189 class HTMLTextFormControlElement : public HTMLFormControlElementWithState {
    190 public:
    191     // Common flag for HTMLInputElement::tooLong() and HTMLTextAreaElement::tooLong().
    192     enum NeedsToCheckDirtyFlag {CheckDirtyFlag, IgnoreDirtyFlag};
    193 
    194     virtual ~HTMLTextFormControlElement();
    195 
    196     virtual void insertedIntoDocument();
    197 
    198     // The derived class should return true if placeholder processing is needed.
    199     virtual bool supportsPlaceholder() const = 0;
    200     String strippedPlaceholder() const;
    201     bool placeholderShouldBeVisible() const;
    202 
    203     int selectionStart() const;
    204     int selectionEnd() const;
    205     void setSelectionStart(int);
    206     void setSelectionEnd(int);
    207     void select();
    208     void setSelectionRange(int start, int end);
    209     PassRefPtr<Range> selection() const;
    210     String selectedText() const;
    211 
    212     virtual void dispatchFormControlChangeEvent();
    213 
    214     virtual int maxLength() const = 0;
    215     virtual String value() const = 0;
    216 
    217     virtual HTMLElement* innerTextElement() const = 0;
    218 
    219     void cacheSelection(int start, int end)
    220     {
    221         m_cachedSelectionStart = start;
    222         m_cachedSelectionEnd = end;
    223     }
    224 
    225     void selectionChanged(bool userTriggered);
    226 
    227 protected:
    228     HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*);
    229 
    230     void updatePlaceholderVisibility(bool);
    231 
    232     virtual void parseMappedAttribute(Attribute*);
    233 
    234     void setTextAsOfLastFormControlChangeEvent(const String& text) { m_textAsOfLastFormControlChangeEvent = text; }
    235 
    236     void restoreCachedSelection();
    237     bool hasCachedSelectionStart() const { return m_cachedSelectionStart >= 0; }
    238     bool hasCachedSelectionEnd() const { return m_cachedSelectionEnd >= 0; }
    239 
    240 private:
    241     int computeSelectionStart() const;
    242     int computeSelectionEnd() const;
    243 
    244     virtual void dispatchFocusEvent();
    245     virtual void dispatchBlurEvent();
    246 
    247     bool isPlaceholderEmpty() const;
    248 
    249     // Returns true if user-editable value is empty. Used to check placeholder visibility.
    250     virtual bool isEmptyValue() const = 0;
    251     // Returns true if suggested value is empty. Used to check placeholder visibility.
    252     virtual bool isEmptySuggestedValue() const { return true; }
    253     // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent().
    254     virtual void handleFocusEvent() { }
    255     // Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent().
    256     virtual void handleBlurEvent() { }
    257 
    258     RenderTextControl* textRendererAfterUpdateLayout();
    259 
    260     String m_textAsOfLastFormControlChangeEvent;
    261    
    262     int m_cachedSelectionStart;
    263     int m_cachedSelectionEnd;
    264 };
    265 
    266 // This function returns 0 when node is an input element and not a text field.
    267 inline HTMLTextFormControlElement* toTextFormControl(Node* node)
    268 {
    269     return (node && node->isElementNode() && static_cast<Element*>(node)->isTextFormControl()) ? static_cast<HTMLTextFormControlElement*>(node) : 0;
    270 }
    271 
    272185} // namespace
    273186
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r90809 r90849  
    457457{
    458458    if (isTextField())
    459         return HTMLFormControlElementWithState::isFocusable();
    460     return HTMLFormControlElementWithState::isKeyboardFocusable(event) && m_inputType->isKeyboardFocusable();
     459        return HTMLTextFormControlElement::isFocusable();
     460    return HTMLTextFormControlElement::isKeyboardFocusable(event) && m_inputType->isKeyboardFocusable();
    461461}
    462462
     
    464464{
    465465    if (isTextField())
    466         return HTMLFormControlElementWithState::isFocusable();
    467     return HTMLFormControlElementWithState::isMouseFocusable();
     466        return HTMLTextFormControlElement::isFocusable();
     467    return HTMLTextFormControlElement::isMouseFocusable();
    468468}
    469469
     
    478478            document()->frame()->selection()->revealSelection();
    479479    } else
    480         HTMLFormControlElementWithState::updateFocusAppearance(restorePreviousSelection);
     480        HTMLTextFormControlElement::updateFocusAppearance(restorePreviousSelection);
    481481}
    482482
     
    630630    if (!isTextField())
    631631        return false;
    632     return HTMLFormControlElementWithState::canStartSelection();
     632    return HTMLTextFormControlElement::canStartSelection();
    633633}
    634634
     
    667667        m_name = attr->value();
    668668        checkedRadioButtons().addButton(this);
    669         HTMLFormControlElementWithState::parseMappedAttribute(attr);
     669        HTMLTextFormControlElement::parseMappedAttribute(attr);
    670670    } else if (attr->name() == autocompleteAttr) {
    671671        if (equalIgnoringCase(attr->value(), "off")) {
     
    778778{
    779779    m_parsingInProgress = false;
    780     HTMLFormControlElementWithState::finishParsingChildren();
     780    HTMLTextFormControlElement::finishParsingChildren();
    781781    if (!m_stateRestored) {
    782782        bool checked = hasAttribute(checkedAttr);
     
    789789bool HTMLInputElement::rendererIsNeeded(const NodeRenderingContext& context)
    790790{
    791     return m_inputType->rendererIsNeeded() && HTMLFormControlElementWithState::rendererIsNeeded(context);
     791    return m_inputType->rendererIsNeeded() && HTMLTextFormControlElement::rendererIsNeeded(context);
    792792}
    793793
     
    804804        updateType();
    805805
    806     HTMLFormControlElementWithState::attach();
     806    HTMLTextFormControlElement::attach();
    807807
    808808    m_inputType->attach();
     
    816816void HTMLInputElement::detach()
    817817{
    818     HTMLFormControlElementWithState::detach();
     818    HTMLTextFormControlElement::detach();
    819819    setFormControlValueMatchesRenderer(false);
    820820}
     
    937937    m_isIndeterminate = sourceElement->m_isIndeterminate;
    938938
    939     HTMLFormControlElementWithState::copyNonAttributeProperties(source);
     939    HTMLTextFormControlElement::copyNonAttributeProperties(source);
    940940}
    941941
     
    11511151    bool callBaseClassEarly = isTextField() && (evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent);
    11521152    if (callBaseClassEarly) {
    1153         HTMLFormControlElementWithState::defaultEventHandler(evt);
     1153        HTMLTextFormControlElement::defaultEventHandler(evt);
    11541154        if (evt->defaultHandled())
    11551155            return;
     
    12171217
    12181218    if (!callBaseClassEarly && !evt->defaultHandled())
    1219         HTMLFormControlElementWithState::defaultEventHandler(evt);
     1219        HTMLTextFormControlElement::defaultEventHandler(evt);
    12201220}
    12211221
     
    13901390    document()->checkedRadioButtons().removeButton(this);
    13911391
    1392     HTMLFormControlElementWithState::willMoveToNewOwnerDocument();
     1392    HTMLTextFormControlElement::willMoveToNewOwnerDocument();
    13931393}
    13941394
     
    13971397    registerForActivationCallbackIfNeeded();
    13981398
    1399     HTMLFormControlElementWithState::didMoveToNewOwnerDocument();
     1399    HTMLTextFormControlElement::didMoveToNewOwnerDocument();
    14001400}
    14011401
    14021402void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
    14031403{
    1404     HTMLFormControlElementWithState::addSubresourceAttributeURLs(urls);
     1404    HTMLTextFormControlElement::addSubresourceAttributeURLs(urls);
    14051405
    14061406    addSubresourceURL(urls, src());
     
    14091409bool HTMLInputElement::recalcWillValidate() const
    14101410{
    1411     return m_inputType->supportsValidation() && HTMLFormControlElementWithState::recalcWillValidate();
     1411    return m_inputType->supportsValidation() && HTMLTextFormControlElement::recalcWillValidate();
    14121412}
    14131413
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r90591 r90849  
    2525#define HTMLInputElement_h
    2626
    27 #include "HTMLFormControlElement.h"
     27#include "HTMLTextFormControlElement.h"
    2828
    2929namespace WebCore {
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r90775 r90849  
    240240        handleBeforeTextInsertedEvent(static_cast<BeforeTextInsertedEvent*>(event));
    241241
    242     HTMLFormControlElementWithState::defaultEventHandler(event);
     242    HTMLTextFormControlElement::defaultEventHandler(event);
    243243}
    244244
  • trunk/Source/WebCore/html/HTMLTextAreaElement.h

    r90775 r90849  
    2525#define HTMLTextAreaElement_h
    2626
    27 #include "HTMLFormControlElement.h"
     27#include "HTMLTextFormControlElement.h"
    2828
    2929namespace WebCore {
  • trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp

    r90802 r90849  
    2424
    2525#include "config.h"
    26 #include "HTMLFormControlElement.h"
     26#include "HTMLTextFormControlElement.h"
    2727
    2828#include "Attribute.h"
    29 #include "Chrome.h"
    30 #include "ChromeClient.h"
    3129#include "Document.h"
    32 #include "DocumentParser.h"
    33 #include "ElementRareData.h"
    3430#include "Event.h"
    35 #include "EventHandler.h"
    3631#include "EventNames.h"
    3732#include "Frame.h"
     
    3934#include "HTMLInputElement.h"
    4035#include "HTMLNames.h"
    41 #include "LabelsNodeList.h"
    42 #include "Page.h"
    4336#include "RenderBox.h"
    4437#include "RenderTextControl.h"
    4538#include "RenderTheme.h"
    4639#include "ScriptEventListener.h"
    47 #include "ValidationMessage.h"
    48 #include "ValidityState.h"
    49 #include <limits>
    5040#include <wtf/Vector.h>
    51 #include <wtf/unicode/CharacterNames.h>
    5241
    5342namespace WebCore {
     
    5544using namespace HTMLNames;
    5645using namespace std;
    57 
    58 HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
    59     : HTMLElement(tagName, document)
    60     , FormAssociatedElement(form)
    61     , m_disabled(false)
    62     , m_readOnly(false)
    63     , m_required(false)
    64     , m_valueMatchesRenderer(false)
    65     , m_willValidateInitialized(false)
    66     , m_willValidate(true)
    67     , m_isValid(true)
    68     , m_wasChangedSinceLastFormControlChangeEvent(false)
    69 {
    70     if (!this->form())
    71         setForm(findFormAncestor());
    72     if (this->form())
    73         this->form()->registerFormElement(this);
    74 }
    75 
    76 HTMLFormControlElement::~HTMLFormControlElement()
    77 {
    78     if (form())
    79         form()->removeFormElement(this);
    80 }
    81 
    82 void HTMLFormControlElement::detach()
    83 {
    84     m_validationMessage = nullptr;
    85     HTMLElement::detach();
    86 }
    87 
    88 bool HTMLFormControlElement::formNoValidate() const
    89 {
    90     return fastHasAttribute(formnovalidateAttr);
    91 }
    92 
    93 void HTMLFormControlElement::parseMappedAttribute(Attribute* attr)
    94 {
    95     if (attr->name() == disabledAttr) {
    96         bool oldDisabled = m_disabled;
    97         m_disabled = !attr->isNull();
    98         if (oldDisabled != m_disabled) {
    99             setNeedsStyleRecalc();
    100             if (renderer() && renderer()->style()->hasAppearance())
    101                 renderer()->theme()->stateChanged(renderer(), EnabledState);
    102         }
    103     } else if (attr->name() == readonlyAttr) {
    104         bool oldReadOnly = m_readOnly;
    105         m_readOnly = !attr->isNull();
    106         if (oldReadOnly != m_readOnly) {
    107             setNeedsStyleRecalc();
    108             if (renderer() && renderer()->style()->hasAppearance())
    109                 renderer()->theme()->stateChanged(renderer(), ReadOnlyState);
    110         }
    111     } else if (attr->name() == requiredAttr) {
    112         bool oldRequired = m_required;
    113         m_required = !attr->isNull();
    114         if (oldRequired != m_required) {
    115             setNeedsValidityCheck();
    116             setNeedsStyleRecalc(); // Updates for :required :optional classes.
    117         }
    118     } else
    119         HTMLElement::parseMappedAttribute(attr);
    120     setNeedsWillValidateCheck();
    121 }
    122 
    123 static bool shouldAutofocus(HTMLFormControlElement* element)
    124 {
    125     if (!element->autofocus())
    126         return false;
    127     if (!element->renderer())
    128         return false;
    129     if (element->document()->ignoreAutofocus())
    130         return false;
    131     if (element->isReadOnlyFormControl())
    132         return false;
    133 
    134     // FIXME: Should this set of hasTagName checks be replaced by a
    135     // virtual member function?
    136     if (element->hasTagName(inputTag))
    137         return !static_cast<HTMLInputElement*>(element)->isInputTypeHidden();
    138     if (element->hasTagName(selectTag))
    139         return true;
    140     if (element->hasTagName(keygenTag))
    141         return true;
    142     if (element->hasTagName(buttonTag))
    143         return true;
    144     if (element->hasTagName(textareaTag))
    145         return true;
    146 
    147     return false;
    148 }
    149 
    150 static void focusPostAttach(Node* element, unsigned)
    151 {
    152     static_cast<Element*>(element)->focus();
    153     element->deref();
    154 }
    155 
    156 void HTMLFormControlElement::attach()
    157 {
    158     ASSERT(!attached());
    159 
    160     suspendPostAttachCallbacks();
    161 
    162     HTMLElement::attach();
    163 
    164     // The call to updateFromElement() needs to go after the call through
    165     // to the base class's attach() because that can sometimes do a close
    166     // on the renderer.
    167     if (renderer())
    168         renderer()->updateFromElement();
    169 
    170     if (shouldAutofocus(this)) {
    171         ref();
    172         queuePostAttachCallback(focusPostAttach, this);
    173     }
    174 
    175     resumePostAttachCallbacks();
    176 }
    177 
    178 void HTMLFormControlElement::willMoveToNewOwnerDocument()
    179 {
    180     FormAssociatedElement::willMoveToNewOwnerDocument();
    181     HTMLElement::willMoveToNewOwnerDocument();
    182 }
    183 
    184 void HTMLFormControlElement::insertedIntoTree(bool deep)
    185 {
    186     FormAssociatedElement::insertedIntoTree();
    187     if (!form())
    188         document()->checkedRadioButtons().addButton(this);
    189 
    190     HTMLElement::insertedIntoTree(deep);
    191 }
    192 
    193 void HTMLFormControlElement::removedFromTree(bool deep)
    194 {
    195     FormAssociatedElement::removedFromTree();
    196     HTMLElement::removedFromTree(deep);
    197 }
    198 
    199 void HTMLFormControlElement::insertedIntoDocument()
    200 {
    201     HTMLElement::insertedIntoDocument();
    202     FormAssociatedElement::insertedIntoDocument();
    203 }
    204 
    205 void HTMLFormControlElement::removedFromDocument()
    206 {
    207     HTMLElement::removedFromDocument();
    208     FormAssociatedElement::removedFromDocument();
    209 }
    210 
    211 const AtomicString& HTMLFormControlElement::formControlName() const
    212 {
    213     const AtomicString& name = fastGetAttribute(nameAttr);
    214     return name.isNull() ? emptyAtom : name;
    215 }
    216 
    217 void HTMLFormControlElement::setName(const AtomicString& value)
    218 {
    219     setAttribute(nameAttr, value);
    220 }
    221 
    222 bool HTMLFormControlElement::wasChangedSinceLastFormControlChangeEvent() const
    223 {
    224     return m_wasChangedSinceLastFormControlChangeEvent;
    225 }
    226 
    227 void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool changed)
    228 {
    229     m_wasChangedSinceLastFormControlChangeEvent = changed;
    230 }
    231 
    232 void HTMLFormControlElement::dispatchFormControlChangeEvent()
    233 {
    234     HTMLElement::dispatchChangeEvent();
    235     setChangedSinceLastFormControlChangeEvent(false);
    236 }
    237 
    238 void HTMLFormControlElement::dispatchFormControlInputEvent()
    239 {
    240     setChangedSinceLastFormControlChangeEvent(true);
    241     HTMLElement::dispatchInputEvent();
    242 }
    243 
    244 void HTMLFormControlElement::setDisabled(bool b)
    245 {
    246     setAttribute(disabledAttr, b ? "" : 0);
    247 }
    248 
    249 bool HTMLFormControlElement::autofocus() const
    250 {
    251     return hasAttribute(autofocusAttr);
    252 }
    253 
    254 bool HTMLFormControlElement::required() const
    255 {
    256     return m_required;
    257 }
    258 
    259 static void updateFromElementCallback(Node* node, unsigned)
    260 {
    261     ASSERT_ARG(node, node->isElementNode());
    262     ASSERT_ARG(node, static_cast<Element*>(node)->isFormControlElement());
    263     ASSERT(node->renderer());
    264     if (RenderObject* renderer = node->renderer())
    265         renderer->updateFromElement();
    266 }
    267 
    268 void HTMLFormControlElement::recalcStyle(StyleChange change)
    269 {
    270     HTMLElement::recalcStyle(change);
    271 
    272     // updateFromElement() can cause the selection to change, and in turn
    273     // trigger synchronous layout, so it must not be called during style recalc.
    274     if (renderer())
    275         queuePostAttachCallback(updateFromElementCallback, this);
    276 }
    277 
    278 bool HTMLFormControlElement::supportsFocus() const
    279 {
    280     return !m_disabled;
    281 }
    282 
    283 bool HTMLFormControlElement::isFocusable() const
    284 {
    285     if (!renderer() ||
    286         !renderer()->isBox() || toRenderBox(renderer())->size().isEmpty())
    287         return false;
    288     // HTMLElement::isFocusable handles visibility and calls suportsFocus which
    289     // will cover the disabled case.
    290     return HTMLElement::isFocusable();
    291 }
    292 
    293 bool HTMLFormControlElement::isKeyboardFocusable(KeyboardEvent* event) const
    294 {
    295     if (isFocusable())
    296         if (document()->frame())
    297             return document()->frame()->eventHandler()->tabsToAllFormControls(event);
    298     return false;
    299 }
    300 
    301 bool HTMLFormControlElement::isMouseFocusable() const
    302 {
    303 #if PLATFORM(GTK) || PLATFORM(QT)
    304     return HTMLElement::isMouseFocusable();
    305 #else
    306     return false;
    307 #endif
    308 }
    309 
    310 short HTMLFormControlElement::tabIndex() const
    311 {
    312     // Skip the supportsFocus check in HTMLElement.
    313     return Element::tabIndex();
    314 }
    315 
    316 bool HTMLFormControlElement::recalcWillValidate() const
    317 {
    318     // FIXME: Should return false if this element has a datalist element as an
    319     // ancestor. See HTML5 4.10.10 'The datalist element.'
    320     return !m_disabled && !m_readOnly;
    321 }
    322 
    323 bool HTMLFormControlElement::willValidate() const
    324 {
    325     if (!m_willValidateInitialized) {
    326         m_willValidateInitialized = true;
    327         m_willValidate = recalcWillValidate();
    328     } else {
    329         // If the following assertion fails, setNeedsWillValidateCheck() is not
    330         // called correctly when something which changes recalcWillValidate() result
    331         // is updated.
    332         ASSERT(m_willValidate == recalcWillValidate());
    333     }
    334     return m_willValidate;
    335 }
    336 
    337 void HTMLFormControlElement::setNeedsWillValidateCheck()
    338 {
    339     // We need to recalculate willValidte immediately because willValidate
    340     // change can causes style change.
    341     bool newWillValidate = recalcWillValidate();
    342     if (m_willValidateInitialized && m_willValidate == newWillValidate)
    343         return;
    344     m_willValidateInitialized = true;
    345     m_willValidate = newWillValidate;
    346     setNeedsStyleRecalc();
    347     if (!m_willValidate)
    348         hideVisibleValidationMessage();
    349 }
    350 
    351 String HTMLFormControlElement::validationMessage()
    352 {
    353     return validity()->validationMessage();
    354 }
    355 
    356 void HTMLFormControlElement::updateVisibleValidationMessage()
    357 {
    358     Page* page = document()->page();
    359     if (!page)
    360         return;
    361     String message;
    362     if (renderer() && willValidate()) {
    363         message = validationMessage().stripWhiteSpace();
    364         // HTML5 specification doesn't ask UA to show the title attribute value
    365         // with the validationMessage.  However, this behavior is same as Opera
    366         // and the specification describes such behavior as an example.
    367         const AtomicString& title = getAttribute(titleAttr);
    368         if (!message.isEmpty() && !title.isEmpty()) {
    369             message.append('\n');
    370             message.append(title);
    371         }
    372     }
    373     if (message.isEmpty()) {
    374         hideVisibleValidationMessage();
    375         return;
    376     }
    377     if (!m_validationMessage) {
    378         m_validationMessage = ValidationMessage::create(this);
    379         m_validationMessage->setMessage(message);
    380     } else {
    381         // Call setMessage() even if m_validationMesage->message() == message
    382         // because the existing message might be to be hidden.
    383         m_validationMessage->setMessage(message);
    384     }
    385 }
    386 
    387 void HTMLFormControlElement::hideVisibleValidationMessage()
    388 {
    389     if (m_validationMessage)
    390         m_validationMessage->requestToHideMessage();
    391 }
    392 
    393 String HTMLFormControlElement::visibleValidationMessage() const
    394 {
    395     return m_validationMessage ? m_validationMessage->message() : String();
    396 }
    397 
    398 bool HTMLFormControlElement::checkValidity(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidControls)
    399 {
    400     if (!willValidate() || isValidFormControlElement())
    401         return true;
    402     // An event handler can deref this object.
    403     RefPtr<HTMLFormControlElement> protector(this);
    404     RefPtr<Document> originalDocument(document());
    405     bool needsDefaultAction = dispatchEvent(Event::create(eventNames().invalidEvent, false, true));
    406     if (needsDefaultAction && unhandledInvalidControls && inDocument() && originalDocument == document())
    407         unhandledInvalidControls->append(this);
    408     return false;
    409 }
    410 
    411 bool HTMLFormControlElement::isValidFormControlElement()
    412 {
    413     // If the following assertion fails, setNeedsValidityCheck() is not called
    414     // correctly when something which changes validity is updated.
    415     ASSERT(m_isValid == validity()->valid());
    416     return m_isValid;
    417 }
    418 
    419 void HTMLFormControlElement::setNeedsValidityCheck()
    420 {
    421     bool newIsValid = validity()->valid();
    422     if (willValidate() && newIsValid != m_isValid) {
    423         // Update style for pseudo classes such as :valid :invalid.
    424         setNeedsStyleRecalc();
    425     }
    426     m_isValid = newIsValid;
    427 
    428     // Updates only if this control already has a validtion message.
    429     if (!visibleValidationMessage().isEmpty()) {
    430         // Calls updateVisibleValidationMessage() even if m_isValid is not
    431         // changed because a validation message can be chagned.
    432         updateVisibleValidationMessage();
    433     }
    434 }
    435 
    436 void HTMLFormControlElement::setCustomValidity(const String& error)
    437 {
    438     validity()->setCustomErrorMessage(error);
    439 }
    440 
    441 void HTMLFormControlElement::dispatchBlurEvent()
    442 {
    443     HTMLElement::dispatchBlurEvent();
    444     hideVisibleValidationMessage();
    445 }
    446 
    447 HTMLFormElement* HTMLFormControlElement::virtualForm() const
    448 {
    449     return FormAssociatedElement::form();
    450 }
    451 
    452 bool HTMLFormControlElement::isDefaultButtonForForm() const
    453 {
    454     return isSuccessfulSubmitButton() && form() && form()->defaultButton() == this;
    455 }
    456 
    457 void HTMLFormControlElement::attributeChanged(Attribute* attr, bool preserveDecls)
    458 {
    459     if (attr->name() == formAttr) {
    460         formAttributeChanged();
    461         if (!form())
    462             document()->checkedRadioButtons().addButton(this);
    463     } else
    464         HTMLElement::attributeChanged(attr, preserveDecls);
    465 }
    466 
    467 bool HTMLFormControlElement::isLabelable() const
    468 {
    469     // FIXME: Add meterTag and outputTag to the list once we support them.
    470     return hasTagName(buttonTag) || hasTagName(inputTag) || hasTagName(keygenTag)
    471 #if ENABLE(METER_TAG)
    472         || hasTagName(meterTag)
    473 #endif
    474 #if ENABLE(PROGRESS_TAG)
    475         || hasTagName(progressTag)
    476 #endif
    477         || hasTagName(selectTag) || hasTagName(textareaTag);
    478 }
    479 
    480 PassRefPtr<NodeList> HTMLFormControlElement::labels()
    481 {
    482     if (!isLabelable())
    483         return 0;
    484     if (!document())
    485         return 0;
    486 
    487     NodeRareData* data = Node::ensureRareData();
    488     if (!data->nodeLists()) {
    489         data->setNodeLists(NodeListsNodeData::create());
    490         treeScope()->addNodeListCache();
    491     }
    492 
    493     if (data->nodeLists()->m_labelsNodeListCache)
    494         return data->nodeLists()->m_labelsNodeListCache;
    495 
    496     RefPtr<LabelsNodeList> list = LabelsNodeList::create(this);
    497     data->nodeLists()->m_labelsNodeListCache = list.get();
    498     return list.release();
    499 }
    500 
    501 HTMLFormControlElementWithState::HTMLFormControlElementWithState(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
    502     : HTMLFormControlElement(tagName, doc, f)
    503 {
    504     document()->registerFormElementWithState(this);
    505 }
    506 
    507 HTMLFormControlElementWithState::~HTMLFormControlElementWithState()
    508 {
    509     document()->unregisterFormElementWithState(this);
    510 }
    511 
    512 void HTMLFormControlElementWithState::willMoveToNewOwnerDocument()
    513 {
    514     document()->unregisterFormElementWithState(this);
    515     HTMLFormControlElement::willMoveToNewOwnerDocument();
    516 }
    517 
    518 void HTMLFormControlElementWithState::didMoveToNewOwnerDocument()
    519 {
    520     document()->registerFormElementWithState(this);
    521     HTMLFormControlElement::didMoveToNewOwnerDocument();
    522 }
    523 
    524 bool HTMLFormControlElementWithState::shouldAutocomplete() const
    525 {
    526     if (!form())
    527         return true;
    528     return form()->shouldAutocomplete();
    529 }
    530 
    531 bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
    532 {
    533     // We don't save/restore control state in a form with autocomplete=off.
    534     return attached() && shouldAutocomplete();
    535 }
    536 
    537 void HTMLFormControlElementWithState::finishParsingChildren()
    538 {
    539     HTMLFormControlElement::finishParsingChildren();
    540 
    541     // We don't save state of a control with shouldSaveAndRestoreFormControlState()=false.
    542     // But we need to skip restoring process too because a control in another
    543     // form might have the same pair of name and type and saved its state.
    544     if (!shouldSaveAndRestoreFormControlState())
    545         return;
    546 
    547     Document* doc = document();
    548     if (doc->hasStateForNewFormElements()) {
    549         String state;
    550         if (doc->takeStateForFormElement(name().impl(), type().impl(), state))
    551             restoreFormControlState(state);
    552     }
    553 }
    554 
    555 void HTMLFormControlElementWithState::defaultEventHandler(Event* event)
    556 {
    557     if (event->type() == eventNames().webkitEditableContentChangedEvent && renderer() && renderer()->isTextControl()) {
    558         toRenderTextControl(renderer())->subtreeHasChanged();
    559         return;
    560     }
    561 
    562     HTMLFormControlElement::defaultEventHandler(event);
    563 }
    56446
    56547HTMLTextFormControlElement::HTMLTextFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* form)
     
    59577    handleBlurEvent();
    59678    HTMLFormControlElementWithState::dispatchBlurEvent();
     79}
     80
     81void HTMLTextFormControlElement::defaultEventHandler(Event* event)
     82{
     83    if (event->type() == eventNames().webkitEditableContentChangedEvent && renderer() && renderer()->isTextControl()) {
     84        toRenderTextControl(renderer())->subtreeHasChanged();
     85        return;
     86    }
     87
     88    HTMLFormControlElementWithState::defaultEventHandler(event);
    59789}
    59890
  • trunk/Source/WebCore/html/HTMLTextFormControlElement.h

    r90802 r90849  
    2222 */
    2323
    24 #ifndef HTMLFormControlElement_h
    25 #define HTMLFormControlElement_h
     24#ifndef HTMLTextFormControlElement_h
     25#define HTMLTextFormControlElement_h
    2626
    27 #include "FormAssociatedElement.h"
    28 #include "HTMLElement.h"
     27#include "HTMLFormControlElement.h"
    2928
    3029namespace WebCore {
    3130
    32 class FormDataList;
    33 class HTMLFormElement;
    3431class RenderTextControl;
    35 class ValidationMessage;
    36 class ValidityState;
    37 class VisibleSelection;
    3832
    39 // HTMLFormControlElement is the default implementation of FormAssociatedElement,
    40 // and form-associated element implementations should use HTMLFormControlElement
    41 // unless there is a special reason.
    42 class HTMLFormControlElement : public HTMLElement, public FormAssociatedElement {
    43 public:
    44     virtual ~HTMLFormControlElement();
    45 
    46     HTMLFormElement* form() const { return FormAssociatedElement::form(); }
    47 
    48     bool formNoValidate() const;
    49 
    50     virtual void reset() { }
    51 
    52     virtual bool formControlValueMatchesRenderer() const { return m_valueMatchesRenderer; }
    53     virtual void setFormControlValueMatchesRenderer(bool b) { m_valueMatchesRenderer = b; }
    54 
    55     virtual bool wasChangedSinceLastFormControlChangeEvent() const;
    56     virtual void setChangedSinceLastFormControlChangeEvent(bool);
    57 
    58     virtual void dispatchFormControlChangeEvent();
    59     virtual void dispatchFormControlInputEvent();
    60 
    61     virtual bool disabled() const { return m_disabled; }
    62     void setDisabled(bool);
    63 
    64     virtual bool isFocusable() const;
    65     virtual bool isEnumeratable() const { return false; }
    66 
    67     // Determines whether or not a control will be automatically focused.
    68     virtual bool autofocus() const;
    69 
    70     bool required() const;
    71 
    72     const AtomicString& type() const { return formControlType(); }
    73 
    74     void setName(const AtomicString& name);
    75 
    76     virtual bool isEnabledFormControl() const { return !disabled(); }
    77     virtual bool isReadOnlyFormControl() const { return readOnly(); }
    78 
    79     virtual bool isRadioButton() const { return false; }
    80     virtual bool canTriggerImplicitSubmission() const { return false; }
    81 
    82     // Override in derived classes to get the encoded name=value pair for submitting.
    83     // Return true for a successful control (see HTML4-17.13.2).
    84     virtual bool appendFormData(FormDataList&, bool) { return false; }
    85 
    86     virtual bool isSuccessfulSubmitButton() const { return false; }
    87     virtual bool isActivatedSubmit() const { return false; }
    88     virtual void setActivatedSubmit(bool) { }
    89 
    90     virtual bool willValidate() const;
    91     String validationMessage();
    92     void updateVisibleValidationMessage();
    93     void hideVisibleValidationMessage();
    94     bool checkValidity(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidControls = 0);
    95     // This must be called when a validation constraint or control value is changed.
    96     void setNeedsValidityCheck();
    97     void setCustomValidity(const String&);
    98 
    99     bool isLabelable() const;
    100     PassRefPtr<NodeList> labels();
    101 
    102     bool readOnly() const { return m_readOnly; }
    103 
    104     virtual void attributeChanged(Attribute*, bool preserveDecls = false);
    105 
    106     using TreeShared<ContainerNode>::ref;
    107     using TreeShared<ContainerNode>::deref;
    108 
    109 protected:
    110     HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
    111 
    112     virtual void parseMappedAttribute(Attribute*);
    113     virtual void attach();
    114     virtual void insertedIntoTree(bool deep);
    115     virtual void removedFromTree(bool deep);
    116     virtual void insertedIntoDocument();
    117     virtual void removedFromDocument();
    118     virtual void willMoveToNewOwnerDocument();
    119 
    120     virtual bool supportsFocus() const;
    121     virtual bool isKeyboardFocusable(KeyboardEvent*) const;
    122     virtual bool isMouseFocusable() const;
    123 
    124     virtual void recalcStyle(StyleChange);
    125 
    126     virtual void dispatchBlurEvent();
    127     virtual void detach();
    128 
    129     // This must be called any time the result of willValidate() has changed.
    130     void setNeedsWillValidateCheck();
    131     virtual bool recalcWillValidate() const;
    132 
    133 private:
    134     virtual const AtomicString& formControlName() const;
    135     virtual const AtomicString& formControlType() const = 0;
    136 
    137     virtual void refFormAssociatedElement() { ref(); }
    138     virtual void derefFormAssociatedElement() { deref(); }
    139 
    140     virtual bool isFormControlElement() const { return true; }
    141 
    142     virtual short tabIndex() const;
    143 
    144     virtual HTMLFormElement* virtualForm() const;
    145     virtual bool isDefaultButtonForForm() const;
    146     virtual bool isValidFormControlElement();
    147     String visibleValidationMessage() const;
    148 
    149     OwnPtr<ValidationMessage> m_validationMessage;
    150     bool m_disabled : 1;
    151     bool m_readOnly : 1;
    152     bool m_required : 1;
    153     bool m_valueMatchesRenderer : 1;
    154 
    155     // The initial value of m_willValidate depends on the derived class. We can't
    156     // initialize it with a virtual function in the constructor. m_willValidate
    157     // is not deterministic as long as m_willValidateInitialized is false.
    158     mutable bool m_willValidateInitialized: 1;
    159     mutable bool m_willValidate : 1;
    160 
    161     // Cache of validity()->valid().
    162     // But "candidate for constraint validation" doesn't affect m_isValid.
    163     bool m_isValid : 1;
    164 
    165     bool m_wasChangedSinceLastFormControlChangeEvent : 1;
    166 };
    167 
    168 // FIXME: Give this class its own header file.
    169 class HTMLFormControlElementWithState : public HTMLFormControlElement {
    170 public:
    171     virtual ~HTMLFormControlElementWithState();
    172 
    173     virtual bool canContainRangeEndPoint() const { return false; }
    174 
    175 protected:
    176     HTMLFormControlElementWithState(const QualifiedName& tagName, Document*, HTMLFormElement*);
    177 
    178     virtual bool shouldAutocomplete() const;
    179     virtual void finishParsingChildren();
    180     virtual void willMoveToNewOwnerDocument();
    181     virtual void didMoveToNewOwnerDocument();
    182     virtual void defaultEventHandler(Event*);
    183 
    184 private:
    185     virtual bool shouldSaveAndRestoreFormControlState() const;
    186 };
    187 
    188 // FIXME: Give this class its own header file.
    18933class HTMLTextFormControlElement : public HTMLFormControlElementWithState {
    19034public:
     
    23882    bool hasCachedSelectionEnd() const { return m_cachedSelectionEnd >= 0; }
    23983
     84    virtual void defaultEventHandler(Event*);
     85
    24086private:
    24187    int computeSelectionStart() const;
Note: See TracChangeset for help on using the changeset viewer.