Changeset 79978 in webkit


Ignore:
Timestamp:
Mar 1, 2011 12:48:46 AM (13 years ago)
Author:
rolandsteiner@chromium.org
Message:

2011-03-01 Roland Steiner <rolandsteiner@chromium.org>

Reviewed by Kent Tamura.

Bug 54853 - Move TextControlInnerElements from WebCore/rendering to WebCore/html/shadow
https://bugs.webkit.org/show_bug.cgi?id=54853


Moving the files from rendering to html/shadow, with the exception of
the class RenderTextControlInnerBlock, which I moved to RenderTextControlSingleLine
(this place is not ideal, but only a temporary state during the larger refactoring
for <input>).

No new tests. (refactoring)

  • Android.mk:
  • CMakeLists.txt:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • html/shadow/TextControlInnerElements.cpp: Copied from Source/WebCore/rendering/TextControlInnerElements.cpp.
  • html/shadow/TextControlInnerElements.h: Copied from Source/WebCore/rendering/TextControlInnerElements.h.
  • rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlInnerBlock::positionForPoint):
  • rendering/RenderTextControlSingleLine.h: (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock): (WebCore::RenderTextControlInnerBlock::hasLineIfEmpty):
  • rendering/TextControlInnerElements.cpp: Removed.
  • rendering/TextControlInnerElements.h: Removed.
Location:
trunk/Source/WebCore
Files:
9 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/Android.mk

    r79825 r79978  
    352352        html/shadow/MediaControls.cpp \
    353353        html/shadow/SliderThumbElement.cpp \
     354        html/shadow/TextControlInnerElements.cpp \
    354355        \
    355356        loader/cache/CachedCSSStyleSheet.cpp \
     
    783784LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
    784785        rendering/ScrollBehavior.cpp \
    785         rendering/TextControlInnerElements.cpp \
    786786        rendering/TransformState.cpp \
    787787        rendering/break_lines.cpp \
  • trunk/Source/WebCore/CMakeLists.txt

    r79861 r79978  
    10351035    html/shadow/MediaControls.cpp
    10361036    html/shadow/SliderThumbElement.cpp
     1037    html/shadow/TextControlInnerElements.cpp
    10371038
    10381039    inspector/ConsoleMessage.cpp
     
    14061407    rendering/ScrollBehavior.cpp
    14071408    rendering/ShadowElement.cpp
    1408     rendering/TextControlInnerElements.cpp
    14091409    rendering/TransformState.cpp
    14101410    rendering/break_lines.cpp
  • trunk/Source/WebCore/ChangeLog

    r79976 r79978  
     12011-03-01  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        Bug 54853 - Move TextControlInnerElements from WebCore/rendering to WebCore/html/shadow
     6        https://bugs.webkit.org/show_bug.cgi?id=54853
     7       
     8        Moving the files from rendering to html/shadow, with the exception of
     9        the class RenderTextControlInnerBlock, which I moved to RenderTextControlSingleLine
     10        (this place is not ideal, but only a temporary state during the larger refactoring
     11        for <input>).
     12
     13        No new tests. (refactoring)
     14
     15        * Android.mk:
     16        * CMakeLists.txt:
     17        * WebCore.gypi:
     18        * WebCore.pro:
     19        * WebCore.vcproj/WebCore.vcproj:
     20        * WebCore.xcodeproj/project.pbxproj:
     21        * html/shadow/TextControlInnerElements.cpp: Copied from Source/WebCore/rendering/TextControlInnerElements.cpp.
     22        * html/shadow/TextControlInnerElements.h: Copied from Source/WebCore/rendering/TextControlInnerElements.h.
     23        * rendering/RenderTextControlSingleLine.cpp:
     24        (WebCore::RenderTextControlInnerBlock::positionForPoint):
     25        * rendering/RenderTextControlSingleLine.h:
     26        (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
     27        (WebCore::RenderTextControlInnerBlock::hasLineIfEmpty):
     28        * rendering/TextControlInnerElements.cpp: Removed.
     29        * rendering/TextControlInnerElements.h: Removed.
     30
    1312011-03-01  Ryosuke Niwa  <rniwa@webkit.org>
    232
  • trunk/Source/WebCore/WebCore.gypi

    r79882 r79978  
    20212021            'html/shadow/SliderThumbElement.cpp',
    20222022            'html/shadow/SliderThumbElement.h',
     2023            'html/shadow/TextControlInnerElements.cpp',
     2024            'html/shadow/TextControlInnerElements.h',
    20232025            'inspector/ConsoleMessage.cpp',
    20242026            'inspector/ConsoleMessage.h',
     
    40244026            'rendering/ShadowElement.h',
    40254027            'rendering/TableLayout.h',
    4026             'rendering/TextControlInnerElements.cpp',
    4027             'rendering/TextControlInnerElements.h',
    40284028            'rendering/TransformState.cpp',
    40294029            'rendering/TransformState.h',
  • trunk/Source/WebCore/WebCore.pro

    r79825 r79978  
    789789    html/shadow/MediaControls.cpp \
    790790    html/shadow/SliderThumbElement.cpp \
     791    html/shadow/TextControlInnerElements.cpp \
    791792    inspector/ConsoleMessage.cpp \
    792793    inspector/InjectedScript.cpp \
     
    11171118    rendering/ScrollBehavior.cpp \
    11181119    rendering/ShadowElement.cpp \
    1119     rendering/TextControlInnerElements.cpp \
    11201120    rendering/TransformState.cpp \
    11211121    rendering/style/ContentData.cpp \
     
    21822182    rendering/svg/SVGTextMetrics.h \
    21832183    rendering/svg/SVGTextQuery.h \
    2184     rendering/TextControlInnerElements.h \
    21852184    rendering/TransformState.h \
    21862185    svg/animation/SMILTimeContainer.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r79861 r79978  
    3848138481                        </File>
    3848238482                        <File
    38483                                 RelativePath="..\rendering\TextControlInnerElements.cpp"
    38484                                 >
    38485                                 <FileConfiguration
    38486                                         Name="Debug|Win32"
    38487                                         ExcludedFromBuild="true"
    38488                                         >
    38489                                         <Tool
    38490                                                 Name="VCCLCompilerTool"
    38491                                         />
    38492                                 </FileConfiguration>
    38493                                 <FileConfiguration
    38494                                         Name="Release|Win32"
    38495                                         ExcludedFromBuild="true"
    38496                                         >
    38497                                         <Tool
    38498                                                 Name="VCCLCompilerTool"
    38499                                         />
    38500                                 </FileConfiguration>
    38501                                 <FileConfiguration
    38502                                         Name="Debug_Cairo_CFLite|Win32"
    38503                                         ExcludedFromBuild="true"
    38504                                         >
    38505                                         <Tool
    38506                                                 Name="VCCLCompilerTool"
    38507                                         />
    38508                                 </FileConfiguration>
    38509                                 <FileConfiguration
    38510                                         Name="Release_Cairo_CFLite|Win32"
    38511                                         ExcludedFromBuild="true"
    38512                                         >
    38513                                         <Tool
    38514                                                 Name="VCCLCompilerTool"
    38515                                         />
    38516                                 </FileConfiguration>
    38517                                 <FileConfiguration
    38518                                         Name="Debug_All|Win32"
    38519                                         ExcludedFromBuild="true"
    38520                                         >
    38521                                         <Tool
    38522                                                 Name="VCCLCompilerTool"
    38523                                         />
    38524                                 </FileConfiguration>
    38525                                 <FileConfiguration
    38526                                         Name="Release_LTCG|Win32"
    38527                                         ExcludedFromBuild="true"
    38528                                         >
    38529                                         <Tool
    38530                                                 Name="VCCLCompilerTool"
    38531                                         />
    38532                                 </FileConfiguration>
    38533                         </File>
    38534                         <File
    38535                                 RelativePath="..\rendering\TextControlInnerElements.h"
    38536                                 >
    38537                         </File>
    38538                         <File
    3853938483                                RelativePath="..\rendering\TrailingFloatsRootInlineBox.h"
    3854038484                                >
     
    5580555749                                        >
    5580655750                                </File>
     55751                <File
     55752                    RelativePath="..\html\shadow\TextControlInnerElements.cpp"
     55753                    >
     55754                </File>
     55755                <File
     55756                    RelativePath="..\html\shadow\TextControlInnerElements.h"
     55757                    >
     55758                </File>
    5580755759                        </Filter>
    5580855760                </Filter>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r79947 r79978  
    284284                142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */; };
    285285                142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
     286                142B97C913138943008BEF4B /* TextControlInnerElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142B97C713138943008BEF4B /* TextControlInnerElements.cpp */; };
     287                142B97CA13138943008BEF4B /* TextControlInnerElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 142B97C813138943008BEF4B /* TextControlInnerElements.h */; };
    286288                1432E8470C51493800B1500F /* GCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1432E8460C51493800B1500F /* GCController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    287289                1432E8490C51493F00B1500F /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1432E8480C51493F00B1500F /* GCController.cpp */; };
     
    40094011                AA4C3A760B2B1679002334A2 /* StyleElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA4C3A740B2B1679002334A2 /* StyleElement.cpp */; };
    40104012                AA4C3A770B2B1679002334A2 /* StyleElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AA4C3A750B2B1679002334A2 /* StyleElement.h */; };
    4011                 AB014DE30E689A4300E10445 /* TextControlInnerElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB014DE10E689A4300E10445 /* TextControlInnerElements.cpp */; };
    4012                 AB014DE40E689A4300E10445 /* TextControlInnerElements.h in Headers */ = {isa = PBXBuildFile; fileRef = AB014DE20E689A4300E10445 /* TextControlInnerElements.h */; };
    40134013                AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */; };
    40144014                AB23A32809BBA7D00067CC53 /* BeforeTextInsertedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */; };
     
    65816581                142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleDeclaration.cpp; sourceTree = "<group>"; };
    65826582                142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleDeclaration.h; sourceTree = "<group>"; };
     6583                142B97C713138943008BEF4B /* TextControlInnerElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextControlInnerElements.cpp; sourceTree = "<group>"; };
     6584                142B97C813138943008BEF4B /* TextControlInnerElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextControlInnerElements.h; sourceTree = "<group>"; };
    65836585                1432E8460C51493800B1500F /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; };
    65846586                1432E8480C51493F00B1500F /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; };
     
    1018910191                AA4C3A740B2B1679002334A2 /* StyleElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleElement.cpp; sourceTree = "<group>"; };
    1019010192                AA4C3A750B2B1679002334A2 /* StyleElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleElement.h; sourceTree = "<group>"; };
    10191                 AB014DE10E689A4300E10445 /* TextControlInnerElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextControlInnerElements.cpp; sourceTree = "<group>"; };
    10192                 AB014DE20E689A4300E10445 /* TextControlInnerElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextControlInnerElements.h; sourceTree = "<group>"; };
    1019310193                AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeTextInsertedEvent.cpp; sourceTree = "<group>"; };
    1019410194                AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BeforeTextInsertedEvent.h; sourceTree = "<group>"; };
     
    1322213222                                4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */,
    1322313223                                4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */,
     13224                                142B97C713138943008BEF4B /* TextControlInnerElements.cpp */,
     13225                                142B97C813138943008BEF4B /* TextControlInnerElements.h */,
    1322413226                        );
    1322513227                        path = shadow;
     
    1889818900                                A7F338A211C0EFCA00A320A7 /* ShadowElement.h */,
    1889918901                                A8CFF04C0A154F09000A4234 /* TableLayout.h */,
    18900                                 AB014DE10E689A4300E10445 /* TextControlInnerElements.cpp */,
    18901                                 AB014DE20E689A4300E10445 /* TextControlInnerElements.h */,
    1890218902                                37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */,
    1890318903                                0F500AB00F54DB3100EEF928 /* TransformState.cpp */,
     
    2225722257                                B2C3DA420D006C1D00EF6F26 /* TextCodecUTF16.h in Headers */,
    2225822258                                9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */,
    22259                                 AB014DE40E689A4300E10445 /* TextControlInnerElements.h in Headers */,
     22259                                142B97CA13138943008BEF4B /* TextControlInnerElements.h in Headers */,
    2226022260                                B2C3DA450D006C1D00EF6F26 /* TextDirection.h in Headers */,
    2226122261                                97BC84B412371180000C6161 /* TextDocument.h in Headers */,
     
    2493924939                                B2C3DA410D006C1D00EF6F26 /* TextCodecUTF16.cpp in Sources */,
    2494024940                                9343CB8112F25E510033C5EE /* TextCodecUTF8.cpp in Sources */,
    24941                                 AB014DE30E689A4300E10445 /* TextControlInnerElements.cpp in Sources */,
     24941                                142B97C913138943008BEF4B /* TextControlInnerElements.cpp in Sources */,
    2494224942                                97BC84B312371180000C6161 /* TextDocument.cpp in Sources */,
    2494324943                                97BC84831236FD93000C6161 /* TextDocumentParser.cpp in Sources */,
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r79287 r79978  
    4848using namespace HTMLNames;
    4949
    50 class RenderTextControlInnerBlock : public RenderBlock {
    51 public:
    52     RenderTextControlInnerBlock(Node* node, bool isMultiLine) : RenderBlock(node), m_multiLine(isMultiLine) { }
    53 
    54 private:
    55     virtual bool hasLineIfEmpty() const { return true; }
    56     virtual VisiblePosition positionForPoint(const IntPoint&);
    57 
    58     bool m_multiLine;
    59 };
    60 
    61 VisiblePosition RenderTextControlInnerBlock::positionForPoint(const IntPoint& point)
    62 {
    63     IntPoint contentsPoint(point);
    64 
    65     // Multiline text controls have the scroll on shadowAncestorNode, so we need to take that
    66     // into account here.
    67     if (m_multiLine) {
    68         RenderTextControl* renderer = toRenderTextControl(node()->shadowAncestorNode()->renderer());
    69         if (renderer->hasOverflowClip())
    70             contentsPoint += renderer->layer()->scrolledContentOffset();
    71     }
    72 
    73     return RenderBlock::positionForPoint(contentsPoint);
    74 }
    75 
    76 // ----------------------------
    77 
    7850TextControlInnerElement::TextControlInnerElement(Document* document, HTMLElement* shadowParent)
    7951    : HTMLDivElement(divTag, document)
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r79284 r79978  
    5252using namespace HTMLNames;
    5353
     54VisiblePosition RenderTextControlInnerBlock::positionForPoint(const IntPoint& point)
     55{
     56    IntPoint contentsPoint(point);
     57
     58    // Multiline text controls have the scroll on shadowAncestorNode, so we need to take that
     59    // into account here.
     60    if (m_multiLine) {
     61        RenderTextControl* renderer = toRenderTextControl(node()->shadowAncestorNode()->renderer());
     62        if (renderer->hasOverflowClip())
     63            contentsPoint += renderer->layer()->scrolledContentOffset();
     64    }
     65
     66    return RenderBlock::positionForPoint(contentsPoint);
     67}
     68
     69// ----------------------------
     70
    5471RenderTextControlSingleLine::RenderTextControlSingleLine(Node* node, bool placeholderVisible)
    5572    : RenderTextControl(node, placeholderVisible)
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r76378 r79978  
    175175void toRenderTextControlSingleLine(const RenderTextControlSingleLine*);
    176176
     177// ----------------------------
     178
     179class RenderTextControlInnerBlock : public RenderBlock {
     180public:
     181    RenderTextControlInnerBlock(Node* node, bool isMultiLine) : RenderBlock(node), m_multiLine(isMultiLine) { }
     182
     183private:
     184    virtual bool hasLineIfEmpty() const { return true; }
     185    virtual VisiblePosition positionForPoint(const IntPoint&);
     186
     187    bool m_multiLine;
     188};
     189
    177190}
    178191
Note: See TracChangeset for help on using the changeset viewer.