Reviewed by Hyatt.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2006 15:26:42 +0000 (15:26 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2006 15:26:42 +0000 (15:26 +0000)
        Tweaked and landed by Darin.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=10399
        Bug 10399: RenderTextArea is unused

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        Removed RenderTextArea source files.

        * html/HTMLTextAreaElement.cpp: Removed include of RenderTextArea.h.
        * html/HTMLTextAreaElement.h: Removed forward declaration of RenderTextArea.

        * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): Updated a comment.

        * platform/TextBox.h: Removed.
        * platform/mac/TextBoxMac.mm: Removed.
        * platform/mac/WebCoreTextArea.h: Removed.
        * platform/mac/WebCoreTextArea.mm: Removed.
        * rendering/RenderTextArea.cpp: Removed.
        * rendering/RenderTextArea.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/js/kjs_dom.cpp
WebCore/bindings/js/kjs_domnode.h
WebCore/html/HTMLTextAreaElement.cpp
WebCore/html/HTMLTextAreaElement.h
WebCore/platform/TextBox.h [deleted file]
WebCore/platform/mac/TextBoxMac.mm [deleted file]
WebCore/platform/mac/WebCoreTextArea.h [deleted file]
WebCore/platform/mac/WebCoreTextArea.mm [deleted file]
WebCore/platform/mac/WidgetMac.mm
WebCore/rendering/RenderTextArea.cpp [deleted file]
WebCore/rendering/RenderTextArea.h [deleted file]

index d13ff03c648d23ea6e04583223982573fcc94734..d9af16e2136ee5878649a3d3ec27f1ad8c95c615 100644 (file)
@@ -1,3 +1,28 @@
+2006-08-15  Mark Rowe  <opendarwin.org@bdash.net.nz>
+
+        Reviewed by Hyatt.
+        Tweaked and landed by Darin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10399
+        Bug 10399: RenderTextArea is unused
+
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * WebCoreSources.bkl:
+        Removed RenderTextArea source files.
+
+        * html/HTMLTextAreaElement.cpp: Removed include of RenderTextArea.h.
+        * html/HTMLTextAreaElement.h: Removed forward declaration of RenderTextArea.
+
+        * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): Updated a comment.
+
+        * platform/TextBox.h: Removed.
+        * platform/mac/TextBoxMac.mm: Removed.
+        * platform/mac/WebCoreTextArea.h: Removed.
+        * platform/mac/WebCoreTextArea.mm: Removed.
+        * rendering/RenderTextArea.cpp: Removed.
+        * rendering/RenderTextArea.h: Removed.
+
 2006-08-15  Brady Eidson  <beidson@apple.com>
 
         Reviewed by THE OTHER Maciej...
index ab54700e4b0a3794928272b6703f3e58f6ce3989..c30e66b2ec10cff9a7cbed2f78938036bd0ee5b7 100644 (file)
                                RelativePath="..\..\rendering\RenderText.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\rendering\RenderTextArea.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\rendering\RenderTextArea.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\rendering\RenderTextControl.cpp"\r
                                >\r
index 695d09533693153cb0557861f6f0c39a8b05eb11..76894cbf8811b736e4c6b3dde0dcd8702b987a12 100644 (file)
                93F1998A08245E59001E9ABC /* RegularExpression.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B302DE3B8601EA4122 /* RegularExpression.h */; };
                93F1998C08245E59001E9ABC /* RenderTreeAsText.h in Headers */ = {isa = PBXBuildFile; fileRef = 93955A4103D72932008635CE /* RenderTreeAsText.h */; };
                93F1998D08245E59001E9ABC /* WebCoreResourceLoaderImp.h in Headers */ = {isa = PBXBuildFile; fileRef = 93386B90037045B3008635CE /* WebCoreResourceLoaderImp.h */; };
-               93F1999708245E59001E9ABC /* WebCoreTextArea.h in Headers */ = {isa = PBXBuildFile; fileRef = F587853502DE375901EA4122 /* WebCoreTextArea.h */; };
-               93F1999908245E59001E9ABC /* TextBox.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786BE02DE3B8601EA4122 /* TextBox.h */; };
                93F1999A08245E59001E9ABC /* WebCoreTextField.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851B02DE375901EA4122 /* WebCoreTextField.h */; };
                93F1999B08245E59001E9ABC /* TextStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786BF02DE3B8601EA4122 /* TextStream.h */; };
                93F1999D08245E59001E9ABC /* DeprecatedValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C202DE3B8601EA4122 /* DeprecatedValueList.h */; };
                93F19A3C08245E59001E9ABC /* DeprecatedPtrListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587851602DE375901EA4122 /* DeprecatedPtrListImpl.cpp */; };
                93F19A3F08245E59001E9ABC /* WebCoreTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851C02DE375901EA4122 /* WebCoreTextField.mm */; };
                93F19A4A08245E59001E9ABC /* RegularExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587852B02DE375901EA4122 /* RegularExpression.cpp */; };
-               93F19A5108245E59001E9ABC /* WebCoreTextArea.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587853602DE375901EA4122 /* WebCoreTextArea.mm */; };
-               93F19A5308245E59001E9ABC /* TextBoxMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587853802DE375901EA4122 /* TextBoxMac.mm */; };
                93F19A5408245E59001E9ABC /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853902DE375901EA4122 /* TextStream.cpp */; };
                93F19A5608245E59001E9ABC /* DeprecatedValueListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */; };
                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
                A8EA73C50A1900E300A8EF5F /* RenderLineEdit.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B10A1900E300A8EF5F /* RenderLineEdit.h */; };
                A8EA73C60A1900E300A8EF5F /* RenderFileButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73B20A1900E300A8EF5F /* RenderFileButton.cpp */; };
                A8EA73C70A1900E300A8EF5F /* RenderFileButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B30A1900E300A8EF5F /* RenderFileButton.h */; };
-               A8EA73C80A1900E300A8EF5F /* RenderTextArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73B40A1900E300A8EF5F /* RenderTextArea.cpp */; };
                A8EA73C90A1900E300A8EF5F /* RenderFormElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B50A1900E300A8EF5F /* RenderFormElement.h */; };
                A8EA73CA0A1900E300A8EF5F /* RenderLegend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73B60A1900E300A8EF5F /* RenderLegend.cpp */; };
                A8EA73CB0A1900E300A8EF5F /* RenderLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B70A1900E300A8EF5F /* RenderLabel.h */; };
-               A8EA73CE0A1900E300A8EF5F /* RenderTextArea.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73BA0A1900E300A8EF5F /* RenderTextArea.h */; };
                A8EA73D10A1900E300A8EF5F /* RenderLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73BD0A1900E300A8EF5F /* RenderLegend.h */; };
                A8EA73D20A1900E300A8EF5F /* RenderLineEdit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73BE0A1900E300A8EF5F /* RenderLineEdit.cpp */; };
                A8EA73D30A1900E300A8EF5F /* RenderFormElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73BF0A1900E300A8EF5F /* RenderFormElement.cpp */; };
                A8EA73B10A1900E300A8EF5F /* RenderLineEdit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderLineEdit.h; sourceTree = "<group>"; };
                A8EA73B20A1900E300A8EF5F /* RenderFileButton.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFileButton.cpp; sourceTree = "<group>"; };
                A8EA73B30A1900E300A8EF5F /* RenderFileButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderFileButton.h; sourceTree = "<group>"; };
-               A8EA73B40A1900E300A8EF5F /* RenderTextArea.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextArea.cpp; sourceTree = "<group>"; };
                A8EA73B50A1900E300A8EF5F /* RenderFormElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderFormElement.h; sourceTree = "<group>"; };
                A8EA73B60A1900E300A8EF5F /* RenderLegend.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLegend.cpp; sourceTree = "<group>"; };
                A8EA73B70A1900E300A8EF5F /* RenderLabel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderLabel.h; sourceTree = "<group>"; };
-               A8EA73BA0A1900E300A8EF5F /* RenderTextArea.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTextArea.h; sourceTree = "<group>"; };
                A8EA73BD0A1900E300A8EF5F /* RenderLegend.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderLegend.h; sourceTree = "<group>"; };
                A8EA73BE0A1900E300A8EF5F /* RenderLineEdit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLineEdit.cpp; sourceTree = "<group>"; };
                A8EA73BF0A1900E300A8EF5F /* RenderFormElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFormElement.cpp; sourceTree = "<group>"; };
                F587851B02DE375901EA4122 /* WebCoreTextField.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTextField.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587851C02DE375901EA4122 /* WebCoreTextField.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreTextField.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587852B02DE375901EA4122 /* RegularExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegularExpression.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587853502DE375901EA4122 /* WebCoreTextArea.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTextArea.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587853602DE375901EA4122 /* WebCoreTextArea.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreTextArea.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587853802DE375901EA4122 /* TextBoxMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextBoxMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853902DE375901EA4122 /* TextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextStream.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853B02DE375901EA4122 /* DeprecatedValueListImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedValueListImpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedValueListImpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587869902DE3B8601EA4122 /* DeprecatedPtrList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedPtrList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786AD02DE3B8601EA4122 /* DeprecatedPtrQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedPtrQueue.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786B302DE3B8601EA4122 /* RegularExpression.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RegularExpression.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F58786BE02DE3B8601EA4122 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TextBox.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786BF02DE3B8601EA4122 /* TextStream.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TextStream.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786C202DE3B8601EA4122 /* DeprecatedValueList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedValueList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58EF58E02DFDFB7018635CA /* WebCore.exp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.exports; path = WebCore.exp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                93B0FD890A759BED0080AD44 /* StringMac.mm */,
                                6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */,
                                9352071B09BD3BBB00F2038D /* TextBoundaries.mm */,
-                               F587853802DE375901EA4122 /* TextBoxMac.mm */,
                                F587851202DE375901EA4122 /* TextFieldMac.mm */,
                                6545F67509B830180013006F /* ResourceLoaderMac.mm */,
                                F5517DC2031AB56301A80180 /* WebCoreHistory.h */,
                                84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */,
                                93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */,
                                93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */,
-                               F587853502DE375901EA4122 /* WebCoreTextArea.h */,
-                               F587853602DE375901EA4122 /* WebCoreTextArea.mm */,
                                F587851B02DE375901EA4122 /* WebCoreTextField.h */,
                                F587851C02DE375901EA4122 /* WebCoreTextField.mm */,
                                BC066F6C09FEB2FA00C589A7 /* WebCoreTextRenderer.h */,
                                93CD4FDD0995F9EA007ECC97 /* StringImpl.h */,
                                93E62D990985F41600E1B5E3 /* SystemTime.h */,
                                9352071809BD3BA500F2038D /* TextBoundaries.h */,
-                               F58786BE02DE3B8601EA4122 /* TextBox.h */,
                                9353686A09AF78F600D35CD6 /* TextDirection.h */,
                                657BD74B09AFDC54005A2056 /* TextEncoding.cpp */,
                                657BD74C09AFDC54005A2056 /* TextEncoding.h */,
                                A8DF4AE50980C42C0052981B /* RenderTableSection.h */,
                                BCEA484C097D93020094C9E4 /* RenderText.cpp */,
                                BCEA484D097D93020094C9E4 /* RenderText.h */,
-                               A8EA73B40A1900E300A8EF5F /* RenderTextArea.cpp */,
-                               A8EA73BA0A1900E300A8EF5F /* RenderTextArea.h */,
                                AB67D1A6097F3AE300F9392E /* RenderTextControl.cpp */,
                                AB67D1A7097F3AE300F9392E /* RenderTextControl.h */,
                                BCEA484E097D93020094C9E4 /* RenderTextFragment.cpp */,
                                93F1998A08245E59001E9ABC /* RegularExpression.h in Headers */,
                                93F1998C08245E59001E9ABC /* RenderTreeAsText.h in Headers */,
                                93F1998D08245E59001E9ABC /* WebCoreResourceLoaderImp.h in Headers */,
-                               93F1999708245E59001E9ABC /* WebCoreTextArea.h in Headers */,
-                               93F1999908245E59001E9ABC /* TextBox.h in Headers */,
                                93F1999A08245E59001E9ABC /* WebCoreTextField.h in Headers */,
                                93F1999B08245E59001E9ABC /* TextStream.h in Headers */,
                                93F1999D08245E59001E9ABC /* DeprecatedValueList.h in Headers */,
                                A8EA73C70A1900E300A8EF5F /* RenderFileButton.h in Headers */,
                                A8EA73C90A1900E300A8EF5F /* RenderFormElement.h in Headers */,
                                A8EA73CB0A1900E300A8EF5F /* RenderLabel.h in Headers */,
-                               A8EA73CE0A1900E300A8EF5F /* RenderTextArea.h in Headers */,
                                A8EA73D10A1900E300A8EF5F /* RenderLegend.h in Headers */,
                                A8EA79F10A1916DF00A8EF5F /* HTMLOListElement.h in Headers */,
                                A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */,
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
                                93F19A3C08245E59001E9ABC /* DeprecatedPtrListImpl.cpp in Sources */,
                                93F19A3F08245E59001E9ABC /* WebCoreTextField.mm in Sources */,
                                93F19A4A08245E59001E9ABC /* RegularExpression.cpp in Sources */,
-                               93F19A5108245E59001E9ABC /* WebCoreTextArea.mm in Sources */,
-                               93F19A5308245E59001E9ABC /* TextBoxMac.mm in Sources */,
                                93F19A5408245E59001E9ABC /* TextStream.cpp in Sources */,
                                93F19A5608245E59001E9ABC /* DeprecatedValueListImpl.cpp in Sources */,
                                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */,
                                BC6DADFA0A19602B00E5CD14 /* WebFontCache.mm in Sources */,
                                A8EA73C30A1900E300A8EF5F /* RenderFieldset.cpp in Sources */,
                                A8EA73C60A1900E300A8EF5F /* RenderFileButton.cpp in Sources */,
-                               A8EA73C80A1900E300A8EF5F /* RenderTextArea.cpp in Sources */,
                                A8EA73CA0A1900E300A8EF5F /* RenderLegend.cpp in Sources */,
                                A8EA73D20A1900E300A8EF5F /* RenderLineEdit.cpp in Sources */,
                                A8EA73D30A1900E300A8EF5F /* RenderFormElement.cpp in Sources */,
index 797ca6665f3f5e91331a7288caac9f72ad840b6a..d098fcbc9d4a6f603721b29e82b87892b863a72a 100644 (file)
                rendering/RenderTableRow.cpp
                rendering/RenderTableSection.cpp
                rendering/RenderText.cpp
-               rendering/RenderTextArea.cpp
                rendering/RenderTextControl.cpp
                rendering/RenderTextFragment.cpp
                rendering/RenderTheme.cpp
index e504277279c3a21257531581d5914726ebbb9444..c3816c6f82d1d6d4084379a2f174b7e33275b5d3 100644 (file)
@@ -115,11 +115,6 @@ DOMNode::DOMNode(ExecState* exec, Node* n)
   setPrototype(DOMNodeProto::self(exec));
 }
 
-DOMNode::DOMNode(Node* n)
-  : m_impl(n)
-{
-}
-
 DOMNode::~DOMNode()
 {
   ScriptInterpreter::forgetDOMNodeForDocument(m_impl->document(), m_impl.get());
index ac42901882d8d5bd039a8327c3b95c8b9b6715e9..6d3da58d57e89ae1e68df8757ae6762bd5b05a5a 100644 (file)
@@ -62,9 +62,7 @@ protected:
 private:
     // Don't use this class directly -- use JSNode instead
     friend class WebCore::JSNode;
-    DOMNode();
     DOMNode(ExecState*, WebCore::Node *n);
-    DOMNode(WebCore::Node *n);
 };
 
 } // namespace KJS
index 66889537c47bef92c086732d7b4debc7dfa1ccc4..545ee11486993c38f106876b741faf1c4f54aaef 100644 (file)
@@ -33,7 +33,6 @@
 #include "FormDataList.h"
 #include "Frame.h"
 #include "HTMLNames.h"
-#include "RenderTextArea.h"
 #include "RenderTextControl.h"
 #include "Text.h"
 #include "RenderStyle.h"
@@ -259,7 +258,7 @@ String HTMLTextAreaElement::value() const
 
 void HTMLTextAreaElement::setValue(const String& value)
 {
-    // WebCoreTextArea normalizes line endings added by the user via the keyboard or pasting.
+    // Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
     // We must normalize line endings coming from JS.
     DeprecatedString valueWithNormalizedLineEndings = value.deprecatedString();
     valueWithNormalizedLineEndings.replace("\r\n", "\n");
index daa813e622d7ffd1640b579173ca16946d104dbc..13d79a819a48a66775e25480d0098d6bc0dceecf 100644 (file)
 
 namespace WebCore {
 
-class RenderTextArea;
-
 class HTMLTextAreaElement : public HTMLGenericFormElement {
-    friend class RenderTextArea;
-
 public:
     enum WrapMethod { ta_NoWrap, ta_Virtual, ta_Physical };
 
diff --git a/WebCore/platform/TextBox.h b/WebCore/platform/TextBox.h
deleted file mode 100644 (file)
index 47d6253..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef TextBox_h
-#define TextBox_h
-
-#include "GraphicsTypes.h"
-#include "ScrollView.h"
-#include "TextDirection.h"
-
-namespace WebCore {
-
-    class Color;
-    class String;
-
-class TextBox : public ScrollView {
- public:
-    typedef enum { 
-        NoWrap,
-        WidgetWidth
-    } WrapStyle;
-
-    typedef enum {
-        PlainText
-    } TextFormat;
-
-    TextBox(Widget* parent);
-    ~TextBox();
-
-    void setColors(const Color& background, const Color& foreground);
-
-    void setAlignment(HorizontalAlignment);
-    void setLineHeight(int lineHeight);
-
-    void setCursorPosition(int, int);
-    void getCursorPosition(int*, int*) const;
-
-    void setFont(const Font&);
-
-    void setReadOnly(bool);
-    bool isReadOnly() const;
-
-    void setDisabled(bool);
-    bool isDisabled() const;
-
-    bool hasSelectedText() const;
-    
-    void setText(const String&);
-    String text() const;
-    String textWithHardLineBreaks() const;
-
-    void setTextFormat(TextFormat) { }
-
-    void setWordWrap(WrapStyle);
-    WrapStyle wordWrap() const;
-
-    void setScrollBarModes(ScrollBarMode hMode, ScrollBarMode vMode);
-
-    void setWritingDirection(TextDirection);
-
-    int selectionStart();
-    int selectionEnd();
-    void setSelectionStart(int);
-    void setSelectionEnd(int);
-    
-    void selectAll();
-    void setSelectionRange(int, int);
-
-    IntSize sizeWithColumnsAndRows(int numColumns, int numRows) const;
-
-    virtual FocusPolicy focusPolicy() const;
-    virtual bool checksDescendantsForFocus() const;
-};
-
-} // namespace WebCore
-
-#endif /* TextBox_h */
diff --git a/WebCore/platform/mac/TextBoxMac.mm b/WebCore/platform/mac/TextBoxMac.mm
deleted file mode 100644 (file)
index 8dc3c86..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "config.h"
-#import "TextBox.h"
-
-#import "Font.h"
-#import "IntSize.h"
-#import "BlockExceptions.h"
-#import "TextField.h"
-#import "WebCoreTextArea.h"
-#import "WidgetClient.h"
-#import <wtf/Assertions.h>
-
-namespace WebCore {
-
-TextBox::TextBox(Widget *parent)
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    WebCoreTextArea *textView = [[WebCoreTextArea alloc] initWithWidget:this];
-    setView(textView);
-    [textView release];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-TextBox::~TextBox()
-{
-    WebCoreTextArea *textArea = (WebCoreTextArea *)getView();
-    [textArea detachWidget]; 
-}
-
-void TextBox::setText(const String& string)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView setText:string];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-String TextBox::text() const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return String([textView text]);
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return String();
-}
-
-String TextBox::textWithHardLineBreaks() const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return String([textView textWithHardLineBreaks]);
-    END_BLOCK_OBJC_EXCEPTIONS;
-    
-    return String();
-}
-
-void TextBox::getCursorPosition(int *paragraph, int *index) const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    if (index)
-        *index = 0;
-    if (paragraph)
-        *paragraph = 0;
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView getCursorPositionAsIndex:index inParagraph:paragraph];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setCursorPosition(int paragraph, int index)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView setCursorPositionToIndex:index inParagraph:paragraph];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-TextBox::WrapStyle TextBox::wordWrap() const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return [textView wordWrap] ? WidgetWidth : NoWrap;
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return NoWrap;
-}
-
-void TextBox::setWordWrap(WrapStyle style)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView setWordWrap:style == WidgetWidth];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setScrollBarModes(ScrollBarMode hMode, ScrollBarMode vMode)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
-    // this declaration must be inside the BEGIN_BLOCK_OBJC_EXCEPTIONS block or the deployment build fails
-    bool autohides = hMode == ScrollBarAuto || vMode == ScrollBarAuto;
-    
-    ASSERT(!autohides || hMode != ScrollBarAlwaysOn);
-    ASSERT(!autohides || vMode != ScrollBarAlwaysOn);
-
-    [textView setHasHorizontalScroller:hMode != ScrollBarAlwaysOff];
-    [textView setHasVerticalScroller:vMode != ScrollBarAlwaysOff];
-    [textView setAutohidesScrollers:autohides];
-
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-bool TextBox::isReadOnly() const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return ![textView isEditable];
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return false;
-}
-
-void TextBox::setReadOnly(bool flag)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView setEditable:!flag];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-bool TextBox::isDisabled() const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return ![textView isEnabled];
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return false;
-}
-
-void TextBox::setDisabled(bool flag)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView setEnabled:!flag];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-int TextBox::selectionStart()
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    NSRange range = [textView selectedRange];
-    if (range.location == NSNotFound)
-        return 0;
-    return range.location;
-    END_BLOCK_OBJC_EXCEPTIONS;
-    
-    return 0;
-}
-
-int TextBox::selectionEnd()
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    NSRange range = [textView selectedRange];
-    if (range.location == NSNotFound)
-        return 0;
-    return range.location + range.length; // Use NSMaxRange when 4213314 is fixed
-    END_BLOCK_OBJC_EXCEPTIONS;
-    
-    return 0;
-}
-
-void TextBox::setSelectionStart(int start)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    NSRange range = [textView selectedRange];
-    if (range.location == NSNotFound) {
-        range.location = 0;
-        range.length = 0;
-    }
-    
-    // coerce start to a valid value
-    int maxLength = [[textView text] length];
-    int newStart = start;
-    if (newStart < 0)
-        newStart = 0;
-    if (newStart > maxLength)
-        newStart = maxLength;
-    
-    if ((unsigned)newStart < range.location + range.length) {
-        // If we're expanding or contracting, but not collapsing the selection
-        range.length += range.location - newStart;
-        range.location = newStart;
-    } else {
-        // ok, we're collapsing the selection
-        range.location = newStart;
-        range.length = 0;
-    }
-    
-    [textView setSelectedRange:range];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setSelectionEnd(int end)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    NSRange range = [textView selectedRange];
-    if (range.location == NSNotFound) {
-        range.location = 0;
-        range.length = 0;
-    }
-    
-    // coerce end to a valid value
-    int maxLength = [[textView text] length];
-    int newEnd = end;
-    if (newEnd < 0)
-        newEnd = 0;
-    if (newEnd > maxLength)
-        newEnd = maxLength;
-    
-    if ((unsigned)newEnd >= range.location) {
-        // If we're just changing the selection length, but not location..
-        range.length = newEnd - range.location;
-    } else {
-        // ok, we've collapsed the selection and are moving it
-        range.location = newEnd;
-        range.length = 0;
-    }
-    
-    [textView setSelectedRange:range];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-bool TextBox::hasSelectedText() const
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-    
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return [textView hasSelection];
-    END_BLOCK_OBJC_EXCEPTIONS;
-    
-    return false;
-}
-
-void TextBox::selectAll()
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView selectAll];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setSelectionRange(int start, int length)
-{
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    int newStart = start;
-    int newLength = length;
-    if (newStart < 0) {
-        // truncate the length by the negative start
-        newLength = length + newStart;
-        newStart = 0;
-    }
-    if (newLength < 0) {
-        newLength = 0;
-    }
-    int maxlen = [[textView text] length];
-    if (newStart > maxlen) {
-        newStart = maxlen;
-    }
-    if (newStart + newLength > maxlen) {
-        newLength = maxlen - newStart;
-    }
-    NSRange tempRange = {newStart, newLength}; // 4213314
-    [textView setSelectedRange:tempRange];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setFont(const Font& font)
-{
-    Widget::setFont(font);
-    WebCoreTextArea *textView = (WebCoreTextArea *)getView();
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [textView setFont:font.getNSFont()];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setAlignment(HorizontalAlignment alignment)
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
-    WebCoreTextArea *textArea = static_cast<WebCoreTextArea *>(getView());
-    [textArea setAlignment:TextAlignment(alignment)];
-
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setLineHeight(int lineHeight)
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
-    WebCoreTextArea *textArea = static_cast<WebCoreTextArea *>(getView());
-    [textArea setLineHeight:lineHeight];
-
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-void TextBox::setWritingDirection(TextDirection direction)
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
-    WebCoreTextArea *textArea = static_cast<WebCoreTextArea *>(getView());
-    [textArea setBaseWritingDirection:(direction == RTL ? NSWritingDirectionRightToLeft : NSWritingDirectionLeftToRight)];
-
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-IntSize TextBox::sizeWithColumnsAndRows(int numColumns, int numRows) const
-{
-    WebCoreTextArea *textArea = static_cast<WebCoreTextArea *>(getView());
-    NSSize size = {0,0};
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    size = [textArea sizeWithColumns:numColumns rows:numRows];
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return IntSize((int)ceil(size.width), (int)ceil(size.height));
-}
-
-Widget::FocusPolicy TextBox::focusPolicy() const
-{
-    FocusPolicy policy = ScrollView::focusPolicy();
-    return policy == TabFocus ? StrongFocus : policy;
-}
-
-bool TextBox::checksDescendantsForFocus() const
-{
-    return true;
-}
-
-void TextBox::setColors(const Color& background, const Color& foreground)
-{
-    WebCoreTextArea *textArea = static_cast<WebCoreTextArea *>(getView());
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    
-    // Below is a workaround for the following AppKit bug which causes transparent backgrounds to be 
-    // drawn opaque <rdar://problem/3142730>.  Without this workaround, some textareas would be drawn with black backgrounds
-    // as described in <rdar://problem/3854383>.  We now call setDrawsBackground:NO when the background color is completely 
-    // transparent.  This does not solve the problem for translucent background colors for textareas <rdar://problem/3865161>.
-
-    [textArea setTextColor:nsColor(foreground)];
-
-    Color bg = background;
-    if (!bg.isValid())
-        bg = Color::white;
-    [textArea setBackgroundColor:nsColor(bg)];
-    [textArea setDrawsBackground:bg.alpha() != 0];
-
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-}
diff --git a/WebCore/platform/mac/WebCoreTextArea.h b/WebCore/platform/mac/WebCoreTextArea.h
deleted file mode 100644 (file)
index ed417c1..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-#import "WebCoreWidgetHolder.h"
-
-namespace WebCore {
-    class TextBox;
-}
-
-@class WebCoreTextView;
-
-@interface WebCoreTextArea : NSScrollView <WebCoreWidgetHolder>
-{
-    WebCoreTextView *textView;
-    WebCore::TextBox *widget;
-    NSFont *_font;
-    float _lineHeight;
-    BOOL wrap;
-    BOOL inNextValidKeyView;
-    BOOL inDrawingMachinery;
-    BOOL inInitWithFrame;
-    BOOL resizableByUser;
-    BOOL resizableByUserComputed;
-    BOOL normalizeLineEndings;
-}
-
-- (id)initWithWidget:(WebCore::TextBox *)w;
-- (void)detachWidget;
-
-- (void)setAlignment:(NSTextAlignment)alignment;
-- (void)setLineHeight:(float)lineHeight;
-- (void)setBaseWritingDirection:(NSWritingDirection)direction;
-
-- (void)setEditable:(BOOL)flag;
-- (BOOL)isEditable;
-
-- (void)setEnabled:(BOOL)flag;
-- (BOOL)isEnabled;
-
-- (void)setFont:(NSFont *)font;
-
-- (void)setTextColor:(NSColor *)color;
-- (void)setBackgroundColor:(NSColor *)color;
-
-- (void)setText:(NSString *)text;
-- (NSString *)text;
-- (NSString *)textWithHardLineBreaks;
-
-- (void)setWordWrap:(BOOL)wrap;
-- (BOOL)wordWrap;
-
-- (void)selectAll;
-- (void)setSelectedRange:(NSRange)aRange;
-- (NSRange)selectedRange;
-- (BOOL)hasSelection;
-
-- (NSSize)sizeWithColumns:(int)columns rows:(int)rows;
-
-// paragraph-oriented functions for the benefit of TextBox
-- (void)setCursorPositionToIndex:(int)index inParagraph:(int)paragraph;
-- (void)getCursorPositionAsIndex:(int *)index inParagraph:(int *)paragraph;
-
-@end
diff --git a/WebCore/platform/mac/WebCoreTextArea.mm b/WebCore/platform/mac/WebCoreTextArea.mm
deleted file mode 100644 (file)
index eba2af9..0000000
+++ /dev/null
@@ -1,1287 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "config.h"
-#import "WebCoreTextArea.h"
-
-#import "DOMCSS.h"
-#import "DOMHTML.h"
-#import "EventNames.h"
-#import "Element.h"
-#import "Settings.h"
-#import "TextBox.h"
-#import "FrameMac.h"
-#import "WebCoreFrameBridge.h"
-#import "RenderReplaced.h"
-#import "WidgetClient.h"
-#import <wtf/Assertions.h>
-
-using namespace std;
-using namespace WebCore;
-using namespace EventNames;
-
-@interface NSTextView (WebCoreKnowsCertainAppKitSecrets)
-- (void)setWantsNotificationForMarkedText:(BOOL)wantsNotification;
-@end
-
-/*
-    This widget is used to implement the <TEXTAREA> element.
-    
-    It has a small set of features required by the definition of the <TEXTAREA>
-    element.  
-    
-    It supports the three wierd <TEXTAREA> WRAP attributes:
-    
-              OFF - Text is not wrapped.  It is kept to single line, although if
-                    the user enters a return the line IS broken.  This emulates
-                    Mac IE 5.1.
-     SOFT|VIRTUAL - Text is wrapped, but not actually broken.  
-    HARD|PHYSICAL - Text is wrapped, and text is broken into separate lines.
-*/
-
-@interface NSView (WebCoreTextArea)
-- (void)_webcore_setKeyboardFocusRingNeedsDisplay;
-@end
-
-@interface NSTextView (WebCoreTextArea)
-- (NSParagraphStyle *)_webcore_typingParagraphStyle;
-- (void)_webcore_setTypingParagraphStyle:(NSParagraphStyle *)style;
-- (void)_webcore_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight font:(NSFont *)font;
-@end
-
-@interface NSTextStorage (WebCoreTextArea)
-- (void)_webcore_setBaseWritingDirection:(NSWritingDirection)direction;
-@end
-
-@interface WebCoreTextArea (WebCoreTextView)
-+ (NSImage *)_resizeCornerImage;
-- (BOOL)_isResizableByUser;
-- (BOOL)_textViewShouldHandleResizing;
-- (void)_trackResizeFromMouseDown:(NSEvent *)event;
-@end
-
-const int MinimumWidthWhileResizing = 100;
-const int MinimumHeightWhileResizing = 40;
-
-@interface WebCoreTextView : NSTextView <WebCoreWidgetHolder>
-{
-    TextBox *widget;
-    BOOL disabled;
-    BOOL editableIfEnabled;
-    BOOL inCut;
-    int inResponderChange;
-}
-
-- (void)setWidget:(TextBox *)widget;
-
-- (void)setEnabled:(BOOL)flag;
-- (BOOL)isEnabled;
-
-- (void)setEditableIfEnabled:(BOOL)flag;
-- (BOOL)isEditableIfEnabled;
-
-- (void)updateTextColor;
-
-- (BOOL)inResponderChange;
-
-@end
-
-@implementation WebCoreTextArea
-
-const float LargeNumberForText = 1.0e7;
-
-+ (NSImage *)_resizeCornerImage
-{
-    static NSImage *cornerImage = nil;
-    if (cornerImage == nil) {
-        cornerImage = [[NSImage alloc] initWithContentsOfFile:
-            [[NSBundle bundleForClass:[self class]]
-            pathForResource:@"textAreaResizeCorner" ofType:@"tiff"]];
-    }
-    ASSERT(cornerImage != nil);
-    return cornerImage;
-}
-
-- (void)_configureTextViewForWordWrapMode
-{
-    [textView setHorizontallyResizable:!wrap];
-    [textView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
-
-    [[textView textContainer] setWidthTracksTextView:wrap];
-    [[textView textContainer] setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
-}
-
-- (void)_createTextView
-{
-    textView = [[WebCoreTextView alloc] init];
-
-    [textView setRichText:NO];
-    [textView setAllowsUndo:YES];
-    [textView setDelegate:self];
-    [textView setWantsNotificationForMarkedText:YES];
-
-    [self setDocumentView:textView];
-
-    [self _configureTextViewForWordWrapMode];
-}
-
-- (void)_updateTextViewWidth
-{
-    if (wrap) {
-        [textView setFrameSize:NSMakeSize([self contentSize].width, [textView frame].size.height)];
-    }
-}
-
-- initWithFrame:(NSRect)frame
-{
-    [super initWithFrame:frame];
-
-    inInitWithFrame = YES;
-    wrap = YES;
-
-    [self setBorderType:NSBezelBorder];
-
-    [self _createTextView];
-    [self _updateTextViewWidth];
-
-    // Another element might overlap this one, so we have to do the slower-style scrolling.
-    [[self contentView] setCopiesOnScroll:NO];
-
-    // In WebHTMLView, we set a clip. This is not typical to do in an
-    // NSView, and while correct for any one invocation of drawRect:,
-    // it causes some bad problems if that clip is cached between calls.
-    // The cached graphics state, which clip views keep around, does
-    // cache the clip in this undesirable way. Consequently, we want to 
-    // release the GState for all clip views for all views contained in 
-    // a WebHTMLView. Here we do it for textareas used in forms.
-    // See these bugs for more information:
-    // <rdar://problem/3310943>: REGRESSION (Panther): textareas in forms sometimes draw blank (bugreporter)
-    [[self contentView] releaseGState];
-    [[self documentView] releaseGState];
-
-    inInitWithFrame = NO;
-
-    return self;
-}
-
-- initWithWidget:(TextBox *)w 
-{
-    [self init];
-
-    widget = w;
-    [textView setWidget:widget];
-
-    return self;
-}
-
-- (void)detachWidget
-{
-    widget = 0;
-    [textView setWidget:0];
-}
-
-- (void)dealloc
-{
-    [textView release];
-    [_font release];
-    
-    [super dealloc];
-}
-
-- (void)textViewDidChangeSelection:(NSNotification *)notification
-{
-    if (widget && widget->client() && ![textView inResponderChange])
-        widget->client()->selectionChanged(widget);
-}
-
-- (void)textDidChange:(NSNotification *)notification
-{
-    // Turn \r\ns into \ns so that a line ending is always a single character.
-    // Turn \rs into \ns to simplify code that finds paragraph boundaries.
-    if (normalizeLineEndings) {
-    
-        NSMutableString *string = [[textView string] mutableCopy];
-        [string replaceOccurrencesOfString:@"\r\n" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0, [string length])];
-        [string replaceOccurrencesOfString:@"\r" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0, [string length])];
-        [textView setString:string];
-        
-        normalizeLineEndings = NO;
-    }
-
-    if (widget && widget->client())
-        widget->client()->valueChanged(widget);
-    
-    WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(widget);
-    [bridge textDidChangeInTextArea:(DOMHTMLTextAreaElement *)[bridge elementForView:self]];
-}
-
-- (void)setWordWrap:(BOOL)f
-{
-    if (f != wrap) {
-        wrap = f;
-        [self _configureTextViewForWordWrapMode];
-    }
-}
-
-- (BOOL)wordWrap
-{
-    return wrap;
-}
-
-- (void)setText:(NSString *)s
-{
-    [textView setString:s];
-    [textView updateTextColor];
-}
-
-- (NSString *)text
-{
-    return [textView string];
-}
-
-- (NSString *)textWithHardLineBreaks
-{
-    NSMutableString *textWithHardLineBreaks = [NSMutableString string];
-    
-    NSString *text = [textView string];
-    NSLayoutManager *layoutManager = [textView layoutManager];
-    
-    unsigned numberOfGlyphs = [layoutManager numberOfGlyphs];
-    NSRange lineGlyphRange = NSMakeRange(0, 0);
-    while (NSMaxRange(lineGlyphRange) < numberOfGlyphs) {
-        [layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(lineGlyphRange) effectiveRange:&lineGlyphRange];
-        NSRange lineRange = [layoutManager characterRangeForGlyphRange:lineGlyphRange actualGlyphRange:NULL];
-        if ([textWithHardLineBreaks length]) {
-            unichar lastCharacter = [textWithHardLineBreaks characterAtIndex:[textWithHardLineBreaks length] - 1];
-            if (lastCharacter != '\n') {
-                [textWithHardLineBreaks appendString:@"\n"];
-            }
-        }
-        [textWithHardLineBreaks appendString:[text substringWithRange:lineRange]];
-    }
-
-    return textWithHardLineBreaks;
-}
-
-- (void)selectAll
-{
-    [textView selectAll:nil];
-}
-
-- (void)setSelectedRange:(NSRange)aRange
-{
-    [textView setSelectedRange:aRange];
-}
-
-- (NSRange)selectedRange
-{
-    return [textView selectedRange];
-}
-
-- (BOOL)hasSelection
-{
-    return [textView selectedRange].length > 0;
-}
-
-- (void)setEditable:(BOOL)flag
-{
-    [textView setEditableIfEnabled:flag];
-}
-
-- (BOOL)isEditable
-{
-    return [textView isEditableIfEnabled];
-}
-
-- (void)setEnabled:(BOOL)flag
-{
-    if (flag == [textView isEnabled])
-        return;
-        
-    [textView setEnabled:flag];
-    
-    [self setNeedsDisplay:YES];
-}
-
-- (BOOL)isEnabled
-{
-    return [textView isEnabled];
-}
-
-- (BOOL)_isResizableByUser
-{
-    // Compute the value once, then cache it. We don't react to changes in the settings, so each
-    // instance needs to keep track of its own state. We can't compute this at init time, because
-    // the part isn't reachable, hence the settings aren't reachable, until the event filter has
-    // been installed.
-    if (!resizableByUserComputed) {
-        resizableByUser = [FrameMac::bridgeForWidget(widget) impl]->settings()->textAreasAreResizable();
-        resizableByUserComputed = YES;
-    }
-    return resizableByUser;
-}
-
-- (BOOL)_textViewShouldHandleResizing
-{
-    // Only enabled textareas can be resized
-    if (![textView isEnabled]) {
-        return NO;
-    }
-    
-    // No need to handle resizing if we aren't user-resizable
-    if (![self _isResizableByUser]) {
-        return NO;
-    }
-    
-    // If either scroller is visible, the drawing and tracking for resizing are done by this class
-    // rather than by the enclosed textview.
-    NSScroller *verticalScroller = [self verticalScroller];
-    if (verticalScroller != nil && ![verticalScroller isHidden]) {
-        return NO;
-    }
-    
-    NSScroller *horizontalScroller = [self horizontalScroller];
-    if (horizontalScroller != nil && ![horizontalScroller isHidden]) {
-        return NO;
-    }
-    
-    return YES;
-}
-
-- (void)tile
-{
-    [super tile];
-    [self _updateTextViewWidth];
-    
-    // If we're still initializing, it's too early to call _isResizableByUser. -tile will be called
-    // again before we're displayed, so just skip the resizable stuff.
-    if (!inInitWithFrame && [self _isResizableByUser]) {
-        // Shrink the vertical scroller to make room for the resize corner.
-        if ([self hasVerticalScroller]) {
-            NSScroller *verticalScroller = [self verticalScroller];
-            NSRect scrollerFrame = [verticalScroller frame];
-            // The 2 pixel offset matches NSScrollView's positioning when both scrollers are present.
-            [verticalScroller setFrameSize:NSMakeSize(scrollerFrame.size.width, NSHeight([self frame]) - scrollerFrame.size.width - 2)];
-        }
-    }
-}
-
-- (void)getCursorPositionAsIndex:(int *)index inParagraph:(int *)paragraph
-{
-    assert(paragraph != NULL);
-    assert(index != NULL);
-    
-    NSString *text = [textView string];
-    NSRange selectedRange = [textView selectedRange];
-    
-    if (selectedRange.location == NSNotFound) {
-        *paragraph = 0;
-        *index = 0;
-        return;
-    }
-    
-    int paragraphSoFar = 0;
-    int paragraphStart = 0;
-    
-    NSScanner *scanner = [NSScanner scannerWithString:text];
-    [scanner setCharactersToBeSkipped:nil];
-    NSCharacterSet *newlineSet = [NSCharacterSet characterSetWithCharactersInString:@"\n"];
-
-    while (true) {
-        [scanner scanUpToCharactersFromSet:newlineSet intoString:NULL];
-        
-        if ([scanner isAtEnd] || selectedRange.location <= [scanner scanLocation]) {
-            break;
-        }
-        
-        paragraphSoFar++;
-        
-        [scanner setScanLocation:[scanner scanLocation]+1]; // skip over the found char
-        
-        paragraphStart = [scanner scanLocation];
-    }
-    
-    *paragraph = paragraphSoFar;
-    // It shouldn't happen, but it might be possible for the selection
-    // to be between the cr and lf if there's a crlf sequence
-    // that would result in a -1 index when it should be 0. Lets handle that
-    *index = MAX(selectedRange.location - paragraphStart, 0);
-}
-
-static NSRange RangeOfParagraph(NSString *text, int paragraph)
-{
-    int paragraphSoFar = 0;
-    int paragraphStart = 0;
-    
-    NSScanner *scanner = [NSScanner scannerWithString:text];
-    [scanner setCharactersToBeSkipped:nil];
-    NSCharacterSet *newlineSet = [NSCharacterSet characterSetWithCharactersInString:@"\n"];
-
-    while (true) {
-        [scanner scanUpToCharactersFromSet:newlineSet intoString:NULL];
-        
-        if ([scanner isAtEnd] || paragraphSoFar == paragraph) {
-            break;
-        }
-        
-        paragraphSoFar++;
-        
-        [scanner setScanLocation:[scanner scanLocation]+1]; // skip over the found char
-        
-        paragraphStart = [scanner scanLocation];
-    }
-    
-    if (paragraphSoFar < paragraph) {
-        return NSMakeRange(NSNotFound, 0);
-    }
-    
-    return NSMakeRange(paragraphStart, [scanner scanLocation]);
-}
-
-- (void)setCursorPositionToIndex:(int)index inParagraph:(int)paragraph
-{
-    NSString *text = [textView string];
-    NSRange range = RangeOfParagraph(text, paragraph);
-    if (range.location == NSNotFound) {
-        [textView setSelectedRange:NSMakeRange([text length], 0)];
-    } else {
-        if (index < 0) {
-            index = 0;
-        } else if ((unsigned)index > range.length) {
-            index = range.length;
-        }
-        [textView setSelectedRange:NSMakeRange(range.location + index, 0)];
-    }
-}
-
-- (void)setFont:(NSFont *)font
-{
-    [font retain];
-    [_font release];
-    _font = font;
-    [textView setFont:font];
-    
-    NSParagraphStyle *style = [textView _webcore_typingParagraphStyle];
-    if (_lineHeight) {
-        ASSERT(style);
-        [textView _webcore_updateTypingAttributes:style forLineHeight:_lineHeight font:_font];
-    }
-}
-
-- (void)setLineHeight:(float)lineHeight
-{
-    NSRange range = [textView rangeForUserParagraphAttributeChange];
-    if (range.location == NSNotFound)
-        return;
-    
-    _lineHeight = lineHeight;
-    NSTextStorage *storage = [textView textStorage];
-    NSParagraphStyle *paraStyle = nil;
-    
-    if (storage && range.length > 0) {
-        unsigned loc = range.location;
-        unsigned end = NSMaxRange(range);
-        
-        [storage beginEditing];
-        while (loc < end) {
-            NSRange effectiveRange;
-            paraStyle = [storage attribute:NSParagraphStyleAttributeName atIndex:loc longestEffectiveRange:&effectiveRange inRange:range];
-            if (!paraStyle)
-                paraStyle = [textView defaultParagraphStyle];
-            if (!paraStyle) 
-                paraStyle = [NSParagraphStyle defaultParagraphStyle];
-            if ([paraStyle minimumLineHeight] != lineHeight) {
-                NSMutableParagraphStyle *newStyle = [paraStyle mutableCopy];
-                [newStyle setMinimumLineHeight:lineHeight];
-                [storage addAttribute:NSParagraphStyleAttributeName value:newStyle range:effectiveRange];
-                [newStyle release];
-            }
-            loc = NSMaxRange(effectiveRange);
-        }
-        [storage endEditing];
-        paraStyle = [storage attribute:NSParagraphStyleAttributeName atIndex:range.location effectiveRange:NULL];
-    }
-    
-    if (!paraStyle) {
-        paraStyle = [[textView typingAttributes] objectForKey:NSParagraphStyleAttributeName];
-        if (!paraStyle) 
-            paraStyle = [textView defaultParagraphStyle];
-        if (!paraStyle) 
-            paraStyle = [NSParagraphStyle defaultParagraphStyle];
-    }
-    NSMutableParagraphStyle *newStyle = [paraStyle mutableCopy];
-    [newStyle setMinimumLineHeight:lineHeight];
-    [textView _webcore_updateTypingAttributes:newStyle forLineHeight:lineHeight font:_font];
-    [newStyle release];
-}
-
-- (void)setTextColor:(NSColor *)color
-{
-    [textView setTextColor:color];
-}
-
-- (void)setBackgroundColor:(NSColor *)color
-{
-    [textView setBackgroundColor:color];
-}
-
-- (void)setDrawsBackground:(BOOL)drawsBackground
-{
-    [super setDrawsBackground:drawsBackground];
-    [[self contentView] setDrawsBackground:drawsBackground];
-    [textView setDrawsBackground:drawsBackground];
-}
-
-- (BOOL)becomeFirstResponder
-{
-    if (widget)
-        [FrameMac::bridgeForWidget(widget) makeFirstResponder:textView];
-    return YES;
-}
-
-- (NSView *)nextKeyView
-{
-    return inNextValidKeyView && widget
-        ? FrameMac::nextKeyViewForWidget(widget, SelectingNext)
-        : [super nextKeyView];
-}
-
-- (NSView *)previousKeyView
-{
-   return inNextValidKeyView && widget
-        ? FrameMac::nextKeyViewForWidget(widget, SelectingPrevious)
-        : [super previousKeyView];
-}
-
-- (NSView *)nextValidKeyView
-{
-    inNextValidKeyView = YES;
-    NSView *view = [super nextValidKeyView];
-    inNextValidKeyView = NO;
-    return view;
-}
-
-- (NSView *)previousValidKeyView
-{
-    inNextValidKeyView = YES;
-    NSView *view = [super previousValidKeyView];
-    inNextValidKeyView = NO;
-    return view;
-}
-
-- (BOOL)needsPanelToBecomeKey
-{
-    // If we don't return YES here, tabbing backwards into this view doesn't work.
-    return YES;
-}
-
-- (NSRect)_resizeCornerRect
-{
-    NSRect bounds = [self bounds];
-    float cornerWidth = NSWidth([[self verticalScroller] frame]);
-//    NSImage *cornerImage = [WebCoreTextArea _resizeCornerImage];
-//    NSSize imageSize = [cornerImage size];
-    ASSERT([self borderType] == NSBezelBorder);
-    // Add one pixel to account for our border, and another to leave a pixel of whitespace at the right and
-    // bottom of the resize image to match normal resize corner appearance.
-//    return NSMakeRect(NSMaxX(bounds) - imageSize.width - 2, NSMaxY(bounds) - imageSize.height - 2, imageSize.width + 2, imageSize.height + 2);
-    return NSMakeRect(NSMaxX(bounds) - cornerWidth, NSMaxY(bounds) - cornerWidth, cornerWidth, cornerWidth);
-}
-
-- (void)_trackResizeFromMouseDown:(NSEvent *)event
-{
-    // If the cursor tracking worked perfectly, this next line wouldn't be necessary, but it would be harmless still.
-    [[NSCursor arrowCursor] set];
-    
-    WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(widget);
-    DOMHTMLTextAreaElement *element = (DOMHTMLTextAreaElement *)[bridge elementForView:self];
-    ASSERT([element isKindOfClass:[DOMHTMLTextAreaElement class]]);
-    
-    WebCoreTextArea *textArea = self;
-    NSPoint initialLocalPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-    NSSize initialTextAreaSize = [textArea frame].size;
-    
-    int minWidth = min((int)initialTextAreaSize.width, MinimumWidthWhileResizing);
-    int minHeight = min((int)initialTextAreaSize.height, MinimumHeightWhileResizing);
-    
-    BOOL handledIntrinsicMargins = NO;
-    DOMCSSStyleDeclaration *oldComputedStyle = [[element ownerDocument] getComputedStyle:element :@""];
-    NSString *oldMarginLeft = [oldComputedStyle marginLeft];
-    NSString *oldMarginRight = [oldComputedStyle marginRight];
-    NSString *oldMarginTop = [oldComputedStyle marginTop];
-    NSString *oldMarginBottom = [oldComputedStyle marginBottom];
-    
-    DOMCSSStyleDeclaration *inlineStyle = [element style];
-    
-    for (;;) {
-        if ([event type] == NSRightMouseDown || [event type] == NSRightMouseUp) {
-            // Ignore right mouse button events and remove them from the queue.
-        } else {
-            NSPoint localPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-            if ([event type] == NSLeftMouseUp) {
-                break;
-            }
-            
-            // FIXME Radar 4118559: This behaves very oddly for textareas that are in blocks with right-aligned text; you have
-            // to drag the bottom-right corner to make the bottom-left corner move.
-            // FIXME Radar 4118564: ideally we'd autoscroll the window as necessary to keep the point under
-            // the cursor in view.
-            int newWidth = max(minWidth, (int)(initialTextAreaSize.width + (localPoint.x - initialLocalPoint.x)));
-            int newHeight = max(minHeight, (int)(initialTextAreaSize.height + (localPoint.y - initialLocalPoint.y)));
-            [inlineStyle setWidth:[NSString stringWithFormat:@"%dpx", newWidth]];
-            [inlineStyle setHeight:[NSString stringWithFormat:@"%dpx", newHeight]];
-            
-            // render_form.cpp has a mechanism to use intrinsic margins on form elements under certain conditions.
-            // Setting the width or height explicitly suppresses the intrinsic margins. We don't want the user's
-            // manual resizing to affect the margins, so we check whether the margin was changed and, if so, compensat
-            // with an explicit margin that matches the old implicit one. We only need to do this once per element.
-            if (!handledIntrinsicMargins) {
-                DOMCSSStyleDeclaration *newComputedStyle = [[element ownerDocument] getComputedStyle:element :@""];
-                if (![oldMarginLeft isEqualToString:[newComputedStyle marginLeft]])
-                    [inlineStyle setMarginLeft:oldMarginLeft];
-                if (![oldMarginRight isEqualToString:[newComputedStyle marginRight]])
-                    [inlineStyle setMarginRight:oldMarginRight];
-                if (![oldMarginTop isEqualToString:[newComputedStyle marginTop]])
-                    [inlineStyle setMarginTop:oldMarginTop];
-                if (![oldMarginBottom isEqualToString:[newComputedStyle marginBottom]])
-                    [inlineStyle setMarginBottom:oldMarginBottom];
-                handledIntrinsicMargins = YES;
-            }
-            
-            [bridge impl]->forceLayout();
-        }
-        
-        // Go get the next event.
-        event = [[self window] nextEventMatchingMask:
-            NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseUpMask];
-    }    
-}
-
-- (void)mouseDown:(NSEvent *)event
-{
-    if ([textView isEnabled] && [self _isResizableByUser]) {
-        NSPoint localPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-       if (NSPointInRect(localPoint, [self _resizeCornerRect])) {
-            [self _trackResizeFromMouseDown:event];
-            return;
-        }
-    }
-    
-    Widget::beforeMouseDown(self);
-    [super mouseDown:event];
-    Widget::afterMouseDown(self);
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    [super drawRect:rect];
-    
-    if (![textView isEnabled]) {
-        // draw a disabled bezel border
-        [[NSColor controlColor] set];
-        NSFrameRect(rect);
-        
-        rect = NSInsetRect(rect, 1, 1);
-        [[NSColor controlShadowColor] set];
-        NSFrameRect(rect);
-    
-        rect = NSInsetRect(rect, 1, 1);
-        [[NSColor textBackgroundColor] set];
-        NSRectFill(rect);
-    } else {
-        if ([self _isResizableByUser]) {
-            NSImage *cornerImage = [WebCoreTextArea _resizeCornerImage];
-            NSRect cornerRect = [self _resizeCornerRect];
-            // one pixel to account for the border; a second to add a pixel of white space between image and border
-            NSPoint imagePoint = NSMakePoint(NSMaxX(cornerRect) - [cornerImage size].width - 2, NSMaxY(cornerRect) - 2);
-            [cornerImage compositeToPoint:imagePoint operation:NSCompositeSourceOver];            
-            // FIXME 4129417: we probably want some sort of border on the left side here, so the resize image isn't
-            // floating in space. Maybe we want to use a slightly larger resize image here that fits the scroller
-            // width better.
-        }
-        if (widget && [FrameMac::bridgeForWidget(widget) firstResponder] == textView) {
-            NSSetFocusRingStyle(NSFocusRingOnly);
-            NSRectFill([self bounds]);
-        }
-    }
-}
-
-- (void)_webcore_setKeyboardFocusRingNeedsDisplay
-{
-    [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
-}
-
-- (Widget *)widget
-{
-    return widget;
-}
-
-- (void)setAlignment:(NSTextAlignment)alignment
-{
-    [textView setAlignment:alignment];
-}
-
-- (void)setBaseWritingDirection:(NSWritingDirection)direction
-{
-    // Set the base writing direction for typing.
-    NSParagraphStyle *style = [textView _webcore_typingParagraphStyle];
-    if ([style baseWritingDirection] != direction) {
-        NSMutableParagraphStyle *mutableStyle = [style mutableCopy];
-        [mutableStyle setBaseWritingDirection:direction];
-        [textView _webcore_setTypingParagraphStyle:mutableStyle];
-        [mutableStyle release];
-    }
-
-    // Set the base writing direction for text.
-    [[textView textStorage] _webcore_setBaseWritingDirection:direction];
-    [textView setNeedsDisplay:YES];
-}
-
-// This is the only one of the display family of calls that we use, and the way we do
-// displaying in WebCore means this is called on this NSView explicitly, so this catches
-// all cases where we are inside the normal display machinery. (Used only by the insertion
-// point method below.)
-- (void)displayRectIgnoringOpacity:(NSRect)rect
-{
-    inDrawingMachinery = YES;
-    [super displayRectIgnoringOpacity:rect];
-    inDrawingMachinery = NO;
-}
-
-// Use the "needs display" mechanism to do all insertion point drawing in the web view.
-- (BOOL)textView:(NSTextView *)view shouldDrawInsertionPointInRect:(NSRect)rect color:(NSColor *)color turnedOn:(BOOL)drawInsteadOfErase
-{
-    // We only need to take control of the cases where we are being asked to draw by something
-    // outside the normal display machinery, and when we are being asked to draw the insertion
-    // point, not erase it.
-    if (inDrawingMachinery || !drawInsteadOfErase) {
-        return YES;
-    }
-
-    // NSTextView's insertion-point drawing code sets the rect width to 1.
-    // So we do the same thing, to affect exactly the same rectangle.
-    rect.size.width = 1;
-
-    // Call through to the setNeedsDisplayInRect implementation in NSView.
-    // If we call the one in NSTextView through the normal method dispatch
-    // we will reenter the caret blinking code and end up with a nasty crash
-    // (see Radar 3250608).
-    SEL selector = @selector(setNeedsDisplayInRect:);
-    typedef void (*IMPWithNSRect)(id, SEL, NSRect);
-    IMPWithNSRect implementation = (IMPWithNSRect)[NSView instanceMethodForSelector:selector];
-    implementation(view, selector, rect);
-
-    return NO;
-}
-
-- (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString
-{
-    if ([replacementString rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"\r"]].location != NSNotFound)
-        normalizeLineEndings = YES;
-    
-    return YES;
-}
-
-- (NSSize)sizeWithColumns:(int)numColumns rows:(int)numRows
-{
-    // Must use font from _font field rather than from the text view's font method,
-    // because the text view will return a substituted font if the first character in
-    // the text view requires font substitution, and we don't want the size to depend on
-    // the text in the text view.
-
-    float columnWidth = [@"0" sizeWithAttributes:[NSDictionary dictionaryWithObject:_font forKey:NSFontAttributeName]].width;
-    NSSize textSize = NSMakeSize(ceil(numColumns * columnWidth), numRows * [[textView layoutManager] defaultLineHeightForFont:_font]);
-    NSSize textContainerSize = NSMakeSize(textSize.width + [[textView textContainer] lineFragmentPadding] * 2, textSize.height);
-    NSSize textContainerInset = [textView textContainerInset];
-    NSSize textViewSize = NSMakeSize(textContainerSize.width + textContainerInset.width, textContainerSize.height + textContainerInset.height); 
-    return [[self class] frameSizeForContentSize:textViewSize
-        hasHorizontalScroller:[self hasHorizontalScroller]
-        hasVerticalScroller:[self hasVerticalScroller]
-        borderType:[self borderType]];
-}
-
-- (void)viewWillMoveToWindow:(NSWindow *)window
-{
-    if ([self window] != window) {
-        [[textView undoManager] removeAllActionsWithTarget:[textView textStorage]];
-    }
-    [super viewWillMoveToWindow:window];
-}
-
-- (BOOL)autoforwardsScrollWheelEvents
-{
-    return YES;
-}
-
-@end
-
-@implementation WebCoreTextView
-
-static BOOL _spellCheckingInitiallyEnabled = NO;
-static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckingEnabled";
-
-+ (void)_setContinuousSpellCheckingEnabledForNewTextAreas:(BOOL)flag
-{
-    _spellCheckingInitiallyEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebContinuousSpellCheckingEnabled];
-}
-
-+ (BOOL)_isContinuousSpellCheckingEnabledForNewTextAreas
-{
-    static BOOL _checkedUserDefault = NO;
-    if (!_checkedUserDefault) {
-        _spellCheckingInitiallyEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled];
-        _checkedUserDefault = YES;
-    }
-
-    return _spellCheckingInitiallyEnabled;
-}
-
-- (id)initWithFrame:(NSRect)frame textContainer:(NSTextContainer *)aTextContainer
-{
-    self = [super initWithFrame:frame textContainer:aTextContainer];
-    [super setContinuousSpellCheckingEnabled:
-        [[self class] _isContinuousSpellCheckingEnabledForNewTextAreas]];
-
-    editableIfEnabled = YES;
-
-    return self;
-}
-
-- (void)setContinuousSpellCheckingEnabled:(BOOL)flag
-{
-    [[self class] _setContinuousSpellCheckingEnabledForNewTextAreas:flag];
-    [super setContinuousSpellCheckingEnabled:flag];
-}
-
-
-- (void)setWidget:(TextBox *)w
-{
-    widget = w;
-}
-
-- (void)insertTab:(id)sender
-{
-    NSView *view = [[self delegate] nextValidKeyView];
-    if (view && view != self && view != [self delegate] && widget) {
-        [FrameMac::bridgeForWidget(widget) makeFirstResponder:view];
-    }
-}
-
-- (void)insertBacktab:(id)sender
-{
-    NSView *view = [[self delegate] previousValidKeyView];
-    if (view && view != self && view != [self delegate] && widget) {
-        [FrameMac::bridgeForWidget(widget) makeFirstResponder:view];
-    }
-}
-
-- (BOOL)becomeFirstResponder
-{
-    if (disabled)
-        return NO;
-
-    ++inResponderChange;
-
-    BOOL become = [super becomeFirstResponder];
-    
-    if (become) {
-        // Select all the text if we are tabbing in, but otherwise preserve/remember
-        // the selection from last time we had focus (to match WinIE).
-        if ([[self window] keyViewSelectionDirection] != NSDirectSelection) {
-            [self selectAll:nil];
-        }
-    }
-
-    --inResponderChange;
-
-    if (become) {
-        if (widget && widget->client() && !FrameMac::currentEventIsMouseDownInWidget(widget))
-            widget->client()->scrollToVisible(widget);
-        [self _webcore_setKeyboardFocusRingNeedsDisplay];
-        if (widget && widget->client()) {
-            widget->client()->focusIn(widget);
-            [FrameMac::bridgeForWidget(widget) formControlIsBecomingFirstResponder:self];
-        }
-    }
-
-    return become;
-}
-
-- (BOOL)resignFirstResponder
-{
-    ++inResponderChange;
-
-    BOOL resign = [super resignFirstResponder];
-
-    --inResponderChange;
-
-    if (resign) {
-        [self _webcore_setKeyboardFocusRingNeedsDisplay];
-
-        if (widget && widget->client()) {
-            widget->client()->focusOut(widget);
-            [FrameMac::bridgeForWidget(widget) formControlIsResigningFirstResponder:self];
-        }
-    }
-
-    return resign;
-}
-
-- (BOOL)shouldDrawInsertionPoint
-{
-    return widget && self == [FrameMac::bridgeForWidget(widget) firstResponder] && [super shouldDrawInsertionPoint];
-}
-
-- (NSDictionary *)selectedTextAttributes
-{
-    if (widget && self != [FrameMac::bridgeForWidget(widget) firstResponder])
-        return nil;
-    return [super selectedTextAttributes];
-}
-
-- (void)scrollPageUp:(id)sender
-{
-    // After hitting the top, tell our parent to scroll
-    float oldY = [[[self enclosingScrollView] contentView] bounds].origin.y;
-    [super scrollPageUp:sender];
-    if (oldY == [[[self enclosingScrollView] contentView] bounds].origin.y) {
-        [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:nil];
-    }
-}
-
-- (void)scrollPageDown:(id)sender
-{
-    // After hitting the bottom, tell our parent to scroll
-    float oldY = [[[self enclosingScrollView] contentView] bounds].origin.y;
-    [super scrollPageDown:sender];
-    if (oldY == [[[self enclosingScrollView] contentView] bounds].origin.y) {
-        [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:nil];
-    }
-}
-
-- (Widget *)widget
-{
-    return widget;
-}
-
-- (WebCoreTextArea *)_enclosingTextArea
-{
-    WebCoreTextArea *textArea = (WebCoreTextArea *)[[self superview] superview];
-    ASSERT([textArea isKindOfClass:[WebCoreTextArea class]]);
-    return textArea;
-}
-
-- (NSRect)_resizeCornerRect
-{
-    NSClipView *clipView = (NSClipView *)[self superview];
-    NSRect visibleRect = [clipView documentVisibleRect];
-    NSImage *cornerImage = [WebCoreTextArea _resizeCornerImage];
-    NSSize imageSize = [cornerImage size];
-    // Add one pixel of whitespace at right and bottom of image to match normal resize corner appearance.
-    // This could be built into the image, alternatively.
-    return NSMakeRect(NSMaxX(visibleRect) - imageSize.width - 1, NSMaxY(visibleRect) - imageSize.height - 1, imageSize.width + 1, imageSize.height + 1);
-}
-
-- (void)resetCursorRects
-{
-    [super resetCursorRects];
-    
-    // FIXME Radar 4118575: This is intended to change the cursor to the arrow cursor whenever it is
-    // over the resize corner. However, it currently only works when the cursor had
-    // been inside the textarea, presumably due to interactions with the way NSTextView
-    // sets the cursor via [NSClipView setDocumentCursor:]. Also, it stops working once
-    // the textview has been resized, for reasons not yet understood.
-    // FIXME: need to test that the cursor rect we add here is removed when the return value of _textViewShouldHandleResizing
-    // changes for any reason
-    if (!NSIsEmptyRect([self visibleRect]) && [[self _enclosingTextArea] _textViewShouldHandleResizing]) {
-        [self addCursorRect:[self _resizeCornerRect] cursor:[NSCursor arrowCursor]];
-    }
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    [super drawRect:rect];
-    
-    if ([[self _enclosingTextArea] _textViewShouldHandleResizing]) {
-        NSImage *cornerImage = [WebCoreTextArea _resizeCornerImage];
-        NSPoint imagePoint = [self _resizeCornerRect].origin;
-        imagePoint.y += [cornerImage size].height;
-        [cornerImage compositeToPoint:imagePoint operation:NSCompositeSourceOver];
-    }
-}
-
-- (void)mouseDown:(NSEvent *)event
-{
-    if (disabled)
-        return;
-    
-    WebCoreTextArea *enclosingTextArea = [self _enclosingTextArea];
-    if ([enclosingTextArea _textViewShouldHandleResizing]) {
-        NSPoint localPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-        // FIXME Radar 4118599: With this "bottom right corner" design, we might want to distinguish between a click in text
-        // and a drag-to-resize. This code currently always does the drag-to-resize behavior.
-        if (NSPointInRect(localPoint, [self _resizeCornerRect])) {
-            [[self _enclosingTextArea] _trackResizeFromMouseDown:event];
-            return;
-        }
-    }
-    
-    Widget::beforeMouseDown(enclosingTextArea);
-    [super mouseDown:event];
-    Widget::afterMouseDown(enclosingTextArea);
-    
-    if (widget)
-        widget->sendConsumedMouseUp();
-    if (widget && widget->client())
-        widget->client()->clicked(widget);
-}
-
-- (void)keyDown:(NSEvent *)event
-{
-    if (disabled || !widget) {
-        return;
-    }
-    
-    // Don't mess with text marked by an input method
-    if ([[NSInputManager currentInputManager] hasMarkedText]) {
-        [super keyDown:event];
-        return;
-    }
-
-    WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(widget);
-    if ([bridge interceptKeyEvent:event toView:self]) {
-        return;
-    }
-    
-    // Don't let option-tab insert a character since we use it for
-    // tabbing between links
-    if (FrameMac::handleKeyboardOptionTabInView(self)) {
-        return;
-    }
-    
-    [super keyDown:event];
-}
-
-- (void)keyUp:(NSEvent *)event
-{
-    if (disabled || !widget)
-        return;
-
-    WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(widget);
-    if (![[NSInputManager currentInputManager] hasMarkedText]) {
-        [bridge interceptKeyEvent:event toView:self];
-    }
-    // Don't call super because NSTextView will simply pass the
-    // event along the responder chain. This is arguably a bug in
-    // NSTextView; see Radar 3507083.
-}
-
-- (void)setEnabled:(BOOL)flag
-{
-    if (disabled == !flag) {
-        return;
-    }
-
-    disabled = !flag;
-    if (editableIfEnabled) {
-        [self setEditable:!disabled];
-    }
-    [self updateTextColor];
-}
-
-- (BOOL)isEnabled
-{
-    return !disabled;
-}
-
-- (void)setEditableIfEnabled:(BOOL)flag
-{
-    editableIfEnabled = flag;
-    if (!disabled) {
-        [self setEditable:editableIfEnabled];
-    }
-}
-
-- (BOOL)isEditableIfEnabled
-{
-    return editableIfEnabled;
-}
-
-- (void)updateTextColor
-{
-    // Make the text look disabled by changing its color.
-    NSColor *color = disabled ? [NSColor disabledControlTextColor] : [NSColor controlTextColor];
-    [[self textStorage] setForegroundColor:color];
-}
-
-// Could get fancy and send this to TextBox, then RenderTextArea, but there's really no harm
-// in doing this directly right here. Could refactor some day if you disagree.
-
-// FIXME: This does not yet implement the feature of canceling the operation, or the necessary
-// support to implement the clipboard operations entirely in JavaScript.
-- (void)dispatchHTMLEvent:(const AtomicString &)eventType
-{
-    if (widget)
-        if (WidgetClient* c = widget->client())
-            if (EventTargetNode* node = c->element(widget))
-                node->dispatchHTMLEvent(eventType, false, false);
-}
-
-- (void)cut:(id)sender
-{
-    inCut = YES;
-    [self dispatchHTMLEvent:beforecutEvent];
-    [super cut:sender];
-    [self dispatchHTMLEvent:cutEvent];
-    inCut = NO;
-}
-
-- (void)copy:(id)sender
-{
-    if (!inCut)
-        [self dispatchHTMLEvent:beforecopyEvent];
-    [super copy:sender];
-    if (!inCut)
-        [self dispatchHTMLEvent:copyEvent];
-}
-
-- (void)paste:(id)sender
-{
-    [self dispatchHTMLEvent:beforepasteEvent];
-    [super paste:sender];
-    [self dispatchHTMLEvent:pasteEvent];
-}
-
-- (void)pasteAsPlainText:(id)sender
-{
-    [self dispatchHTMLEvent:beforepasteEvent];
-    [super pasteAsPlainText:sender];
-    [self dispatchHTMLEvent:pasteEvent];
-}
-
-- (void)pasteAsRichText:(id)sender
-{
-    [self dispatchHTMLEvent:beforepasteEvent];
-    [super pasteAsRichText:sender];
-    [self dispatchHTMLEvent:pasteEvent];
-}
-
-- (BOOL)inResponderChange
-{
-    return inResponderChange != 0;
-}
-
-@end
-
-@implementation NSView (WebCoreTextArea)
-
-- (void)_webcore_setKeyboardFocusRingNeedsDisplay
-{
-    [[self superview] _webcore_setKeyboardFocusRingNeedsDisplay];
-}
-
-@end
-
-@implementation NSTextView (WebCoreTextArea)
-
-- (NSParagraphStyle *)_webcore_typingParagraphStyle
-{
-    NSParagraphStyle *style = [[self typingAttributes] objectForKey:NSParagraphStyleAttributeName];
-    if (style != nil) {
-        return style;
-    }
-    style = [self defaultParagraphStyle];
-    if (style != nil) {
-        return style;
-    }
-    return [NSParagraphStyle defaultParagraphStyle];
-}
-
-- (void)_webcore_setTypingParagraphStyle:(NSParagraphStyle *)style
-{
-    NSParagraphStyle *immutableStyle = [style copy];
-    NSDictionary *attributes = [self typingAttributes];
-    if (attributes != nil) {
-        NSMutableDictionary *mutableAttributes = [attributes mutableCopy];
-        [mutableAttributes setObject:immutableStyle forKey:NSParagraphStyleAttributeName];
-        attributes = mutableAttributes;
-    } else {
-        attributes = [[NSDictionary alloc] initWithObjectsAndKeys:immutableStyle, NSParagraphStyleAttributeName, nil];
-    }
-    [immutableStyle release];
-    [self setTypingAttributes:attributes];
-    [attributes release];
-}
-
-- (void)_webcore_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight font:(NSFont *)font
-{
-    NSDictionary *typingAttrs = [self typingAttributes];
-    NSMutableDictionary *dict;
-    float fontHeight = [[self layoutManager] defaultLineHeightForFont:font];
-    float h = (lineHeight / 2.0f) - (fontHeight / 2.0f);
-    h = (h >= 0.0) ? floorf(h) : -floorf(-h);
-    
-    if (typingAttrs)
-        dict = [typingAttrs mutableCopy];
-    else
-        dict = [[NSMutableDictionary alloc] init];
-            
-    [dict setObject:style forKey:NSParagraphStyleAttributeName];
-    [dict setObject:[NSNumber numberWithFloat:h] forKey:NSBaselineOffsetAttributeName];
-    
-    [self setTypingAttributes:dict];
-    [dict release];
-}
-
-@end
-
-@implementation NSTextStorage (WebCoreTextArea)
-
-- (void)_webcore_setBaseWritingDirection:(NSWritingDirection)direction
-{
-    unsigned end = [self length];
-    NSRange range = NSMakeRange(0, end);
-    if (end != 0) {
-        [self beginEditing];
-        for (unsigned i = 0; i < end; ) {
-            NSRange effectiveRange;
-            NSParagraphStyle *style = [self attribute:NSParagraphStyleAttributeName atIndex:i longestEffectiveRange:&effectiveRange inRange:range];
-            if (style == nil) {
-                style = [NSParagraphStyle defaultParagraphStyle];
-            }
-            if ([style baseWritingDirection] != direction) {
-                NSMutableParagraphStyle *mutableStyle = [style mutableCopy];
-                [mutableStyle setBaseWritingDirection:direction];
-                [self addAttribute:NSParagraphStyleAttributeName value:mutableStyle range:effectiveRange];
-                [mutableStyle release];
-            }
-            i = NSMaxRange(effectiveRange);
-        }
-        [self endEditing];
-    }
-}
-
-@end
index b548f7f4ddf40f259612e841f38a200ad6e8710c..2deca8e9eeb21ba0bc24284a00bbdc863149d010 100644 (file)
@@ -360,7 +360,7 @@ void Widget::paint(GraphicsContext* p, const IntRect& r)
     if (p->paintingDisabled())
         return;
     NSView *view = getOuterView();
-    // WebCoreTextArea and WebCoreTextField both rely on the fact that we use this particular
+    // WebCoreTextField relies on the fact that we use this particular
     // NSView display method. If you change this, be sure to update them as well.
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     [view displayRectIgnoringOpacity:[view convertRect:r fromView:[view superview]]];
diff --git a/WebCore/rendering/RenderTextArea.cpp b/WebCore/rendering/RenderTextArea.cpp
deleted file mode 100644 (file)
index 9f64494..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * This file is part of the DOM implementation for KDE.
- *
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- *           (C) 1999 Antti Koivisto (koivisto@kde.org)
- *           (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "config.h"
-#include "RenderTextArea.h"
-
-#include "TextBox.h"
-#include "HTMLTextAreaElement.h"
-#include "FrameView.h"
-
-namespace WebCore {
-
-RenderTextArea::RenderTextArea(HTMLTextAreaElement* element)
-    : RenderFormElement(element)
-    , m_dirty(false)
-    , m_updating(false)
-{
-    TextBox* edit = new TextBox(m_view);
-
-    if (element->wrap() != HTMLTextAreaElement::ta_NoWrap)
-        edit->setWordWrap(TextBox::WidgetWidth);
-    else
-        edit->setWordWrap(TextBox::NoWrap);
-
-    setWidget(edit);
-}
-
-void RenderTextArea::destroy()
-{
-    static_cast<HTMLTextAreaElement*>(node())->rendererWillBeDestroyed();
-    RenderFormElement::destroy();
-}
-
-void RenderTextArea::calcMinMaxWidth()
-{
-    ASSERT(!minMaxKnown());
-
-    TextBox* w = static_cast<TextBox*>(m_widget);
-    IntSize size(w->sizeWithColumnsAndRows(
-        max(static_cast<HTMLTextAreaElement*>(node())->cols(), 1),
-        max(static_cast<HTMLTextAreaElement*>(node())->rows(), 1)));
-
-    setIntrinsicWidth(size.width());
-    setIntrinsicHeight(size.height());
-
-    RenderFormElement::calcMinMaxWidth();
-}
-
-void RenderTextArea::setStyle(RenderStyle* s)
-{
-    RenderFormElement::setStyle(s);
-
-    TextBox* w = static_cast<TextBox*>(m_widget);
-    w->setAlignment(textAlignment());
-    w->setLineHeight(RenderObject::lineHeight(true));
-
-    w->setWritingDirection(style()->direction() == RTL ? RTL : LTR);
-
-    ScrollBarMode verticalScrollMode = ScrollBarAuto;
-    switch (style()->overflowY()) {
-        case OAUTO:
-        case OMARQUEE: // makes no sense, map to auto
-        case OOVERLAY: // not implemented for text, map to auto
-        case OVISIBLE:
-            break;
-        case OHIDDEN:
-            verticalScrollMode = ScrollBarAlwaysOff;
-            break;
-        case OSCROLL:
-            verticalScrollMode = ScrollBarAlwaysOn;
-            break;
-    }
-    ScrollBarMode horizontalScrollMode = ScrollBarAuto;
-    switch (style()->overflowX()) {
-        case OAUTO:
-        case OMARQUEE: // makes no sense, map to auto
-        case OOVERLAY: // not implemented for text, map to auto
-        case OVISIBLE:
-            break;
-        case OHIDDEN:
-            horizontalScrollMode = ScrollBarAlwaysOff;
-            break;
-        case OSCROLL:
-            horizontalScrollMode = ScrollBarAlwaysOn;
-            break;
-    }
-
-    if (static_cast<HTMLTextAreaElement*>(node())->wrap() != HTMLTextAreaElement::ta_NoWrap)
-        horizontalScrollMode = ScrollBarAlwaysOff;
-
-    w->setScrollBarModes(horizontalScrollMode, verticalScrollMode);
-}
-
-void RenderTextArea::setEdited(bool x)
-{
-    m_dirty = x;
-}
-
-void RenderTextArea::updateFromElement()
-{
-    HTMLTextAreaElement* e = static_cast<HTMLTextAreaElement*>(node());
-    TextBox* w = static_cast<TextBox*>(m_widget);
-
-    w->setReadOnly(e->isReadOnlyControl());
-    w->setDisabled(e->disabled());
-
-    String widgetText = text();
-    String text = e->value();
-    text.replace('\\', backslashAsCurrencySymbol());
-    if (widgetText != text) {
-        int line, col;
-        w->getCursorPosition(&line, &col);
-        m_updating = true;
-        w->setText(text);
-        m_updating = false;
-        w->setCursorPosition(line, col);
-    }
-    m_dirty = false;
-
-    w->setColors(style()->backgroundColor(), style()->color());
-
-    RenderFormElement::updateFromElement();
-}
-
-String RenderTextArea::text()
-{
-    String txt = static_cast<TextBox*>(m_widget)->text();
-    return txt.replace(backslashAsCurrencySymbol(), '\\');
-}
-
-String RenderTextArea::textWithHardLineBreaks()
-{
-    String txt = static_cast<TextBox*>(m_widget)->textWithHardLineBreaks();
-    return txt.replace(backslashAsCurrencySymbol(), '\\');
-}
-
-void RenderTextArea::valueChanged(Widget*)
-{
-    if (m_updating)
-        return;
-    static_cast<HTMLTextAreaElement*>(node())->setValueMatchesRenderer(false);
-    m_dirty = true;
-}
-
-int RenderTextArea::selectionStart()
-{
-    return static_cast<TextBox*>(m_widget)->selectionStart();
-}
-
-int RenderTextArea::selectionEnd()
-{
-    return static_cast<TextBox*>(m_widget)->selectionEnd();
-}
-
-void RenderTextArea::setSelectionStart(int start)
-{
-    static_cast<TextBox*>(m_widget)->setSelectionStart(start);
-}
-
-void RenderTextArea::setSelectionEnd(int end)
-{
-    static_cast<TextBox*>(m_widget)->setSelectionEnd(end);
-}
-
-void RenderTextArea::select()
-{
-    static_cast<TextBox*>(m_widget)->selectAll();
-}
-
-void RenderTextArea::setSelectionRange(int start, int end)
-{
-    TextBox* textEdit = static_cast<TextBox*>(m_widget);
-    textEdit->setSelectionRange(start, end-start);
-}
-
-void RenderTextArea::selectionChanged(Widget*)
-{
-    TextBox* w = static_cast<TextBox*>(m_widget);
-
-    // We only want to call onselect if there actually is a selection
-    if (!w->hasSelectedText())
-        return;
-    
-    static_cast<HTMLTextAreaElement*>(node())->onSelect();
-}
-
-} // namespace WebCore
diff --git a/WebCore/rendering/RenderTextArea.h b/WebCore/rendering/RenderTextArea.h
deleted file mode 100644 (file)
index 6e59d16..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * This file is part of the DOM implementation for KDE.
- *
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- *           (C) 1999 Antti Koivisto (koivisto@kde.org)
- *           (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef RenderTextArea_h
-#define RenderTextArea_h
-
-#include "RenderFormElement.h"
-
-namespace WebCore {
-
-    class HTMLTextAreaElement;
-
-    class RenderTextArea : public RenderFormElement {
-    public:
-        RenderTextArea(HTMLTextAreaElement*);
-
-        virtual const char* renderName() const { return "RenderTextArea"; }
-
-        virtual void destroy();
-
-        virtual void calcMinMaxWidth();
-        virtual void updateFromElement();
-        virtual void setStyle(RenderStyle*);
-
-        bool isTextArea() const { return true; }
-        bool isEdited() const { return m_dirty; }
-        void setEdited(bool);
-        
-        String text();
-        String textWithHardLineBreaks();
-
-        int selectionStart();
-        int selectionEnd();
-        void setSelectionStart(int);
-        void setSelectionEnd(int);
-        
-        void select();
-        void setSelectionRange(int, int);
-        
-        virtual bool canHaveIntrinsicMargins() const { return true; }
-
-    private:
-        virtual void valueChanged(Widget*);
-        virtual void selectionChanged(Widget*);
-        
-    protected:
-        virtual bool isEditable() const { return true; }
-
-        bool m_dirty;
-        bool m_updating;
-    };
-
-
-} // namespace WebCore
-
-#endif // RenderTextArea_h