Changeset 24289 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jul 14, 2007, 3:25:31 PM (18 years ago)
Author:
beidson
Message:

JavaScriptCore:

Reviewed by Sam Weinig

Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser

  • wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the proper network-layer support

WebCore:

Reviewed by Sam Weinig

Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser

Development has taken place on both Leopard and Windows (windows enabling patch will follow shortly)
Support will only exist on platforms whose network layers (ie, ResourceHandle) support piping the raw
FTP Directory data into the engine.

This is known to include Leopard, Windows, and CURL based platforms - probably others
Known incompatible platforms include Tiger.

The FTP listing page is built in HTML. An external HTML document can be provided as a template for the
directory listing. This document is parsed, and expected to have a <table> with a certain class in it.
As FTP directory listings come in, each entry is added to this table as a row.

If no HTML template is provided to work with, a very basic empty document is hard coded that contains only
this special table.

Upgrades to the look and feel of the directory listings can take place largely in this HTML template which,
admittedly, is conspicuously absent in this initial checkin

  • WebCore.exp: New Settings symbols for WebKit
  • WebCore.xcodeproj/project.pbxproj:
  • config.h: If BUILDING_ON_TIGER, disable FTP directory listing support
  • dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): Create an FTPDirectoryDocument if the mime type is "application/x-ftp-directory"
  • loader/FTPDirectoryDocument.cpp: Added. (WebCore::FTPDirectoryTokenizer::isWaitingForScripts): (WebCore::FTPDirectoryTokenizer::checkBuffer): (WebCore::FTPDirectoryTokenizer::FTPDirectoryTokenizer): Building on HTML tokenizer, this facilitates parsing FTP Directory listings in the engine (WebCore::FTPDirectoryTokenizer::appendEntry): Add a table row for a directory listing to the document (WebCore::FTPDirectoryTokenizer::createTDForFilename): Create the TD for the filename with the anchor in it

(WebCore::processFilesizeString): Prettify the filesize
(WebCore::wasLastDayOfMonth):
(WebCore::processFileDateString): Prettify the date
(WebCore::FTPDirectoryTokenizer::parseAndAppendOneLine):
(WebCore::FTPDirectoryTokenizer::loadDocumentTemplate): Loads the HTML template that FTP directory listings

can build on top of

(WebCore::FTPDirectoryTokenizer::createBasicDocument): Creates a most basic document (body and one table) to

append the rows to in case the document template is not loaded and parsed

(WebCore::FTPDirectoryTokenizer::write): Add the FTP listing to the buffer and parse entries out of it
(WebCore::FTPDirectoryTokenizer::finish):

(WebCore::FTPDirectoryDocument::FTPDirectoryDocument): Special document-type for FTP directory listings
(WebCore::FTPDirectoryDocument::createTokenizer):

  • loader/FTPDirectoryDocument.h: Added. (WebCore::FTPDirectoryDocument::isImageDocument):


  • loader/FTPDirectoryParser.cpp: Added. (WebCore::parseOneFTPLine): Adapted from ParseFTPList.cpp from Firefox - parses most known FTP directory listing styles into discrete FTP directory entries
  • loader/FTPDirectoryParser.h: Added. (WebCore::ListState::ListState): Maintains FTP Parser state (WebCore::ListResult::ListResult): Represents one FTP directory listing (WebCore::ListResult::clear):
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::checkContentPolicy): If the Settings say to bypass the policy check for "application/x-ftp-directory", skip it. This will allow people to test this feature even if their browser/WebKit app would otherwise not allow it
  • page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setFTPDirectoryTemplatePath): Set the path to the FTP listing document template (WebCore::Settings::setForceFTPDirectoryListings): Set to bypass the policy delegate check for mime type "application/x-ftp-directory"
  • page/Settings.h: (WebCore::Settings::ftpDirectoryTemplatePath): (WebCore::Settings::forceFTPDirectoryListings):
  • platform/Logging.cpp: Add an "LogFTP" logging channel
  • platform/Logging.h:
  • platform/mac/LoggingMac.mm: (WebCore::InitializeLoggingChannelsIfNecessary):
  • platform/MimeTypeRegistry.cpp: (WebCore::initialiseSupportedNonImageMimeTypes): Add "application/x-ftp-directory"
  • platform/SharedBuffer.cpp: (WebCore::SharedBuffer::createWithContentsOfFile): Stub for now
  • platform/SharedBuffer.h:
  • platform/mac/SharedBufferMac.mm: (WebCore::SharedBuffer::createWithContentsOfFile): Load contents of the file into an NSData, then wrap that NSData

WebKit:

Reviewed by Sam Weinig

Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser

  • WebView/WebPreferenceKeysPrivate.h: Added preference keys for the FTP template location, as well as to force FTP directory listings, bypassing the policy delegate. This is necessary to test the new feature until browser policy delegate support is added.
  • WebView/WebPreferences.m: (-[WebPreferences _setFTPDirectoryTemplatePath:]): (-[WebPreferences _ftpDirectoryTemplatePath]): (-[WebPreferences _setForceFTPDirectoryListings:]): (-[WebPreferences _forceFTPDirectoryListings]):
  • WebView/WebPreferencesPrivate.h:
  • WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r24287 r24289  
     12007-07-14  Brady Eidson  <[email protected]>
     2
     3        Reviewed by Sam Weinig
     4
     5        Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
     6
     7        * wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the
     8          proper network-layer support
     9
    1102007-07-14  Cameron Zwarich  <[email protected]>
    211
  • trunk/JavaScriptCore/wtf/Platform.h

    r24042 r24289  
    206206#endif
    207207
     208#if !defined(FTPDIR)
     209#define ENABLE_FTPDIR 1
     210#endif
     211
    208212#endif /* WTF_Platform_h */
Note: See TracChangeset for help on using the changeset viewer.