Changeset 14258 in webkit
- Timestamp:
- May 9, 2006 12:03:20 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r14257 r14258 1 2006-05-09 Anders Carlsson <acarlsson@apple.com> 2 3 Reviewed by Darin. 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=8808 6 WebCore should handle text files 7 8 * WebCore.xcodeproj/project.pbxproj: 9 Add TextDocument.cpp and TextDocument.h 10 11 * bridge/mac/WebCoreFrameBridge.mm: 12 (+[WebCoreFrameBridge supportedMIMETypes]): 13 Add text types here. 14 15 * dom/DOMImplementation.cpp: 16 (WebCore::DOMImplementation::createTextDocument): 17 (WebCore::DOMImplementation::isTextMIMEType): 18 * dom/DOMImplementation.h: 19 New functions for creating a TextDocument and determining if a 20 mime type is a text MIME type. 21 22 * loader/TextDocument.cpp: Added. 23 (WebCore::TextTokenizer::TextTokenizer): 24 (WebCore::TextTokenizer::write): 25 (WebCore::TextTokenizer::finish): 26 (WebCore::TextTokenizer::isWaitingForScripts): 27 Special tokenizer which will put text inside a <pre> tag 28 in a document. 29 30 (WebCore::TextDocument::TextDocument): 31 (WebCore::TextDocument::createTokenizer): 32 Create a TextTokenizer. 33 34 * loader/TextDocument.h: Added. 35 36 * page/Frame.cpp: 37 (WebCore::Frame::begin): 38 Create a TextDocument if the MIME type is of type text. 39 1 40 2006-05-09 Maciej Stachowiak <mjs@apple.com> 2 41 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r14234 r14258 56 56 1A6931760A0CD4FA00C127FE /* XPathValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6931740A0CD4FA00C127FE /* XPathValue.h */; }; 57 57 1A6931770A0CD4FA00C127FE /* XPathValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6931750A0CD4FA00C127FE /* XPathValue.cpp */; }; 58 1A6938010A11100A00C127FE /* TextDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6937FF0A11100A00C127FE /* TextDocument.cpp */; }; 59 1A6938020A11100A00C127FE /* TextDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6938000A11100A00C127FE /* TextDocument.h */; }; 58 60 1A7629830A0740A000989F5B /* XPathExpressionNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7629590A0740A000989F5B /* XPathExpressionNode.cpp */; }; 59 61 1A7629840A0740A000989F5B /* XPathExpressionNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A76295A0A0740A000989F5B /* XPathExpressionNode.h */; }; … … 1298 1300 1A6931740A0CD4FA00C127FE /* XPathValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPathValue.h; sourceTree = "<group>"; }; 1299 1301 1A6931750A0CD4FA00C127FE /* XPathValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPathValue.cpp; sourceTree = "<group>"; }; 1302 1A6937FF0A11100A00C127FE /* TextDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextDocument.cpp; sourceTree = "<group>"; }; 1303 1A6938000A11100A00C127FE /* TextDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextDocument.h; sourceTree = "<group>"; }; 1300 1304 1A7629590A0740A000989F5B /* XPathExpressionNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XPathExpressionNode.cpp; sourceTree = "<group>"; }; 1301 1305 1A76295A0A0740A000989F5B /* XPathExpressionNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XPathExpressionNode.h; sourceTree = "<group>"; }; … … 3980 3984 BCB16C150979C3BD00467741 /* Request.cpp */, 3981 3985 BCB16C160979C3BD00467741 /* Request.h */, 3986 1A6937FF0A11100A00C127FE /* TextDocument.cpp */, 3987 1A6938000A11100A00C127FE /* TextDocument.h */, 3982 3988 ); 3983 3989 path = loader; … … 5004 5010 1A5D938F0A0B9ACC00B1121F /* XPathParser.h in Headers */, 5005 5011 1A6931760A0CD4FA00C127FE /* XPathValue.h in Headers */, 5012 1A6938020A11100A00C127FE /* TextDocument.h in Headers */, 5006 5013 ); 5007 5014 runOnlyForDeploymentPostprocessing = 0; … … 5741 5748 BCCD13200A0C0030001AFA8B /* FontData.mm in Sources */, 5742 5749 1A6931770A0CD4FA00C127FE /* XPathValue.cpp in Sources */, 5750 1A6938010A11100A00C127FE /* TextDocument.cpp in Sources */, 5743 5751 ); 5744 5752 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bridge/mac/WebCoreFrameBridge.mm
r14251 r14258 366 366 @"text/xml", 367 367 @"text/xsl", 368 @"text/", 369 @"application/x-javascript", 368 370 @"application/xml", 369 371 @"application/xhtml+xml", -
trunk/WebCore/dom/DOMImplementation.cpp
r14234 r14258 32 32 #include "HTMLDocument.h" 33 33 #include "RegularExpression.h" 34 #include "TextDocument.h" 34 35 35 36 namespace WebCore { … … 175 176 } 176 177 178 PassRefPtr<TextDocument> DOMImplementation::createTextDocument(FrameView *v) 179 { 180 return new TextDocument(this, v); 181 } 182 177 183 DOMImplementation* DOMImplementation::instance() 178 184 { … … 192 198 } 193 199 200 bool DOMImplementation::isTextMIMEType(const String& mimeType) 201 { 202 if (mimeType == "application/x-javascript" || 203 (mimeType.startsWith("text/") && mimeType != "text/html" && 204 mimeType != "text/xml" && mimeType != "text/xsl")) 205 return true; 206 207 return false; 208 } 209 194 210 PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title) 195 211 { -
trunk/WebCore/dom/DOMImplementation.h
r14256 r14258 38 38 class HTMLDocument; 39 39 class String; 40 class TextDocument; 40 41 41 42 typedef int ExceptionCode; … … 59 60 PassRefPtr<Document> createDocument(FrameView* = 0); 60 61 PassRefPtr<HTMLDocument> createHTMLDocument(FrameView* = 0); 62 PassRefPtr<TextDocument> createTextDocument(FrameView* v = 0); 61 63 62 64 // Returns the static instance of this class - only one instance of this class should … … 65 67 66 68 static bool isXMLMIMEType(const String& mimeType); 69 static bool isTextMIMEType(const String& mimeType); 67 70 }; 68 71 -
trunk/WebCore/page/Frame.cpp
r14211 r14258 54 54 #include "RenderTheme.h" 55 55 #include "SegmentedString.h" 56 #include "TextDocument.h" 56 57 #include "TextIterator.h" 57 58 #include "TransferJob.h" … … 590 591 if (DOMImplementation::isXMLMIMEType(d->m_request.m_responseMIMEType)) 591 592 d->m_doc = DOMImplementation::instance()->createDocument(d->m_view.get()); 593 else if (DOMImplementation::isTextMIMEType(d->m_request.m_responseMIMEType)) 594 d->m_doc = DOMImplementation::instance()->createTextDocument(d->m_view.get()); 592 595 else 593 596 d->m_doc = DOMImplementation::instance()->createHTMLDocument(d->m_view.get()); -
trunk/WebKit/ChangeLog
r14257 r14258 1 2006-05-09 Anders Carlsson <acarlsson@apple.com> 2 3 Reviewed by Darin. 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=8808 6 WebCore should handle text files 7 8 * WebKit.exp: 9 Remove WebTextView. 10 11 * WebKit.xcodeproj/project.pbxproj: 12 Get rid of WebTextView and WebTextRepresentation. 13 14 * WebView/WebDataSource.m: 15 (+[WebDataSource _repTypesAllowImageTypeOmission:]): 16 * WebView/WebFrameView.m: 17 (+[WebFrameView _viewTypesAllowImageTypeOmission:]): 18 * WebView/WebHTMLView.m: 19 The text MIME types are now handled by WebHTMLView. 20 21 (+[WebHTMLView unsupportedTextMIMETypes]): 22 New function, moved here from WebTextView. 23 24 * WebView/WebHTMLViewPrivate.h: 25 * WebView/WebTextRepresentation.h: Removed. 26 * WebView/WebTextRepresentation.m: Removed. 27 * WebView/WebTextView.h: Removed. 28 * WebView/WebTextView.m: Removed. 29 30 * WebView/WebView.m: 31 (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): 32 Now special-case WebHTMLView instead of WebTextView for MIME types 33 that shouldn't be shown. 34 1 35 2006-05-09 Maciej Stachowiak <mjs@apple.com> 2 36 -
trunk/WebKit/WebKit.exp
r14185 r14258 24 24 .objc_class_name_WebResource 25 25 .objc_class_name_WebStringTruncator 26 .objc_class_name_WebTextView27 26 .objc_class_name_WebURLsWithTitles 28 27 .objc_class_name_WebView -
trunk/WebKit/WebKit.xcodeproj/project.pbxproj
r14113 r14258 119 119 9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F81C3902B67C26018635CA /* WebRenderNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 120 120 939810600824BF01008DF038 /* WebResourceLoadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 121 939810610824BF01008DF038 /* WebTextRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081DA602B6D4E40ACA2ACA /* WebTextRepresentation.h */; };122 939810620824BF01008DF038 /* WebTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081DA802B6D4E40ACA2ACA /* WebTextView.h */; settings = {ATTRIBUTES = (); }; };123 121 939810630824BF01008DF038 /* WebHistoryItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 516F296F03A6C45A00CA2D3A /* WebHistoryItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 124 122 939810640824BF01008DF038 /* WebFormDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */; }; … … 240 238 939810F80824BF01008DF038 /* WebPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = F5AEBB3D024A527601C1A526 /* WebPreferences.m */; }; 241 239 939810F90824BF01008DF038 /* WebRenderNode.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F81C3A02B67C26018635CA /* WebRenderNode.m */; }; 242 939810FA0824BF01008DF038 /* WebTextRepresentation.m in Sources */ = {isa = PBXBuildFile; fileRef = 35081DA702B6D4E40ACA2ACA /* WebTextRepresentation.m */; };243 939810FB0824BF01008DF038 /* WebTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 35081DA902B6D4E40ACA2ACA /* WebTextView.m */; };244 240 939810FC0824BF01008DF038 /* WebFormDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */; }; 245 241 939810FD0824BF01008DF038 /* CarbonWindowAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.m */; }; … … 371 367 35081D9A02B6D4D80ACA2ACA /* WebImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebImageView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 372 368 35081D9B02B6D4D80ACA2ACA /* WebImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 373 35081DA602B6D4E40ACA2ACA /* WebTextRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebTextRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };374 35081DA702B6D4E40ACA2ACA /* WebTextRepresentation.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebTextRepresentation.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };375 35081DA802B6D4E40ACA2ACA /* WebTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebTextView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };376 35081DA902B6D4E40ACA2ACA /* WebTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebTextView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };377 369 35081DAE02B6D4F50ACA2ACA /* WebDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 378 370 35F3577F0198AAB80ACA1520 /* English */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 912 904 F52CA6BE02DF9D49018635CA /* Image */, 913 905 51E94C0706C02CA300A9B09E /* PDF */, 914 F52CA6BF02DF9D4D018635CA /* Text */,915 906 8373435A0624EE0D00F3B289 /* WebArchive.h */, 916 907 8373435B0624EE0D00F3B289 /* WebArchive.m */, … … 993 984 ); 994 985 name = Image; 995 sourceTree = "<group>";996 };997 F52CA6BF02DF9D4D018635CA /* Text */ = {998 isa = PBXGroup;999 children = (1000 35081DA602B6D4E40ACA2ACA /* WebTextRepresentation.h */,1001 35081DA702B6D4E40ACA2ACA /* WebTextRepresentation.m */,1002 35081DA802B6D4E40ACA2ACA /* WebTextView.h */,1003 35081DA902B6D4E40ACA2ACA /* WebTextView.m */,1004 );1005 name = Text;1006 986 sourceTree = "<group>"; 1007 987 }; … … 1214 1194 9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */, 1215 1195 939810600824BF01008DF038 /* WebResourceLoadDelegate.h in Headers */, 1216 939810610824BF01008DF038 /* WebTextRepresentation.h in Headers */,1217 939810620824BF01008DF038 /* WebTextView.h in Headers */,1218 1196 939810630824BF01008DF038 /* WebHistoryItemPrivate.h in Headers */, 1219 1197 939810640824BF01008DF038 /* WebFormDelegatePrivate.h in Headers */, … … 1785 1763 939810F80824BF01008DF038 /* WebPreferences.m in Sources */, 1786 1764 939810F90824BF01008DF038 /* WebRenderNode.m in Sources */, 1787 939810FA0824BF01008DF038 /* WebTextRepresentation.m in Sources */,1788 939810FB0824BF01008DF038 /* WebTextView.m in Sources */,1789 1765 939810FC0824BF01008DF038 /* WebFormDelegate.m in Sources */, 1790 1766 939810FD0824BF01008DF038 /* CarbonWindowAdapter.m in Sources */, -
trunk/WebKit/WebView/WebDataSource.m
r14251 r14258 60 60 #import <WebKit/WebResourceLoadDelegate.h> 61 61 #import <WebKit/WebResourcePrivate.h> 62 #import <WebKit/WebTextRepresentation.h>63 62 #import <WebKit/WebUnarchivingState.h> 64 63 #import <WebKit/WebViewInternal.h> … … 569 568 repTypes = [[NSMutableDictionary alloc] init]; 570 569 addTypesFromClass(repTypes, [WebHTMLRepresentation class], [WebHTMLRepresentation supportedMIMETypes]); 571 addTypesFromClass(repTypes, [WebTextRepresentation class], [WebTextRepresentation supportedMIMETypes]);572 570 573 571 // Since this is a "secret default" we don't both registering it. -
trunk/WebKit/WebView/WebFrameView.m
r14196 r14258 50 50 #import "WebPDFView.h" 51 51 #import "WebSystemInterface.h" 52 #import "WebTextView.h"53 52 #import "WebViewFactory.h" 54 53 #import "WebViewInternal.h" … … 259 258 viewTypes = [[NSMutableDictionary alloc] init]; 260 259 addTypesFromClass(viewTypes, [WebHTMLView class], [WebHTMLView supportedMIMETypes]); 261 addTypesFromClass(viewTypes, [WebTextView class], [WebTextView supportedMIMETypes]);262 260 263 261 // Since this is a "secret default" we don't both registering it. -
trunk/WebKit/WebView/WebHTMLView.m
r14251 r14258 689 689 { 690 690 return [WebHTMLRepresentation supportedMIMETypes]; 691 } 692 693 + (NSArray *)unsupportedTextMIMETypes 694 { 695 return [NSArray arrayWithObjects: 696 @"text/calendar", // iCal 697 @"text/x-calendar", 698 @"text/x-vcalendar", 699 @"text/vcalendar", 700 @"text/vcard", // vCard 701 @"text/x-vcard", 702 @"text/directory", 703 @"text/ldif", // Netscape Address Book 704 @"text/qif", // Quicken 705 @"text/x-qif", 706 @"text/x-csv", // CSV (for Address Book and Microsoft Outlook) 707 @"text/x-vcf", // vCard type used in Sun affinity app 708 nil]; 691 709 } 692 710 -
trunk/WebKit/WebView/WebHTMLViewPrivate.h
r13581 r14258 41 41 - (void)_reset; 42 42 + (NSArray *)supportedMIMETypes; 43 + (NSArray *)unsupportedTextMIMETypes; 43 44 44 45 // Modifier (flagsChanged) tracking SPI -
trunk/WebKit/WebView/WebView.m
r14166 r14258 80 80 #import "WebResourceLoadDelegate.h" 81 81 #import "WebScriptDebugDelegatePrivate.h" 82 #import "WebTextRepresentation.h"83 #import "WebTextView.h"84 82 #import "WebUIDelegate.h" 85 83 #import "WebUIDelegatePrivate.h" … … 513 511 514 512 if (viewClass && repClass) { 515 // Special-case Web TextView for text types that shouldn't be shown.516 if (viewClass == [Web TextView class] &&517 repClass == [Web TextRepresentation class] &&518 [[Web TextView unsupportedTextMIMETypes] containsObject:MIMEType]) {513 // Special-case WebHTMLView for text types that shouldn't be shown. 514 if (viewClass == [WebHTMLView class] && 515 repClass == [WebHTMLRepresentation class] && 516 [[WebHTMLView unsupportedTextMIMETypes] containsObject:MIMEType]) { 519 517 return NO; 520 518 }
Note: See TracChangeset
for help on using the changeset viewer.